Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lihuiba committed Jan 17, 2024
1 parent bbef794 commit e6bf45b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fs/httpfs/httpfs_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,19 @@ class HttpFile_v2 : public fs::VirtualReadOnlyFile {
m_stat.st_size = len;
return 0;
}
void send_read_request(net::http::Client::Operation &op, off_t offset, size_t length, const Timeout &tmo) {
again:
void send_read_request(net::http::Client::Operation &op, off_t offset, size_t length, Timeout tmo) {
estring url;
url.appends(m_url, "?", m_url_param);
again:
op.req.reset(net::http::Verb::GET, url);
op.set_enable_proxy(m_fs->get_client()->has_proxy());
op.req.headers.merge(m_common_header);
op.req.headers.range(offset, offset + length - 1);
op.req.headers.content_length(0);
op.timeout = tmo.timeout();
op.timeout = tmo;
m_fs->get_client()->call(&op);
if (op.status_code < 0) {
if (tmo.timeout() == 0) {
if (!tmo) {
m_etimeout = true;
LOG_ERROR_RETURN(ENOENT, , "http timedout");
}
Expand Down Expand Up @@ -254,7 +254,7 @@ class HttpFile_v2 : public fs::VirtualReadOnlyFile {
}
};

IFile* HttpFs_v2::open(const char* pathname, int flags) {
inline IFile* HttpFs_v2::open(const char* pathname, int flags) {
if (!pathname) LOG_ERROR_RETURN(EINVAL, nullptr, "NULL is not allowed");
if (flags != O_RDONLY) return nullptr;

Expand Down

0 comments on commit e6bf45b

Please sign in to comment.