diff --git a/.github/workflows/ci.linux.arm.yml b/.github/workflows/ci.linux.arm.yml index cc6b00ab..68b3656c 100644 --- a/.github/workflows/ci.linux.arm.yml +++ b/.github/workflows/ci.linux.arm.yml @@ -83,4 +83,4 @@ jobs: - name: Test run: | cd build - ctest --timeout 3600 -V \ No newline at end of file + ctest --timeout 3600 -V diff --git a/fs/httpfs/httpfs.cpp b/fs/httpfs/httpfs.cpp index 5a6ff0d7..4ef3e207 100644 --- a/fs/httpfs/httpfs.cpp +++ b/fs/httpfs/httpfs.cpp @@ -229,8 +229,7 @@ class HttpFile : public fs::VirtualReadOnlyFile { VALUE(url), VALUE(offset), VALUE(ret)); } authorized = true; - headers.try_get("content-length", ret); - return ret; + return writer.written; } int fstat(struct stat* buf) override { diff --git a/net/curl.h b/net/curl.h index 65dee2f2..37fee819 100644 --- a/net/curl.h +++ b/net/curl.h @@ -145,9 +145,11 @@ class StringWriter { struct IOVWriter : public IOVector { using IOVector::IOVector; size_t drop = 0; + size_t written = 0; size_t write(const void* buf, size_t size) { auto actual_count = memcpy_from( buf, size); // copy from (buf, size) to iovec[] in *this, + written += actual_count; extract_front(actual_count); // and extract the portion just copied if (actual_count < size) // means full {