From e6bf45b30a56cf467fc9b1a7fc5062f95d0ba542 Mon Sep 17 00:00:00 2001 From: lihuiba Date: Wed, 17 Jan 2024 17:28:24 +0800 Subject: [PATCH] fix --- fs/httpfs/httpfs_v2.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/httpfs/httpfs_v2.cpp b/fs/httpfs/httpfs_v2.cpp index 3aa3d881..61177f88 100644 --- a/fs/httpfs/httpfs_v2.cpp +++ b/fs/httpfs/httpfs_v2.cpp @@ -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"); } @@ -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;