diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-02-02 18:22:20 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-02-02 18:22:23 +0100 |
| commit | 42035701c02d15d586e762afa1db5c8b5c9eac39 (patch) | |
| tree | 0089266b8df6ecdcc5d1abc33e92e133f44760fb /src | |
| parent | 31e85df2679b123d2e4451463baa0b1d15474c28 (diff) | |
| download | PROJ-42035701c02d15d586e762afa1db5c8b5c9eac39.tar.gz PROJ-42035701c02d15d586e762afa1db5c8b5c9eac39.zip | |
proj_download_file(): relax test for the situation where a file < 1 MB is updated to be slightly larger
CloudFront could return a Range: bytes=0-X/Y with X < Y and X being the previous file size and Y the new one
Diffstat (limited to 'src')
| -rw-r--r-- | src/networkfilemanager.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/networkfilemanager.cpp b/src/networkfilemanager.cpp index 5b64eba1..c4cb41d9 100644 --- a/src/networkfilemanager.cpp +++ b/src/networkfilemanager.cpp @@ -2377,8 +2377,7 @@ int proj_download_file(PJ_CONTEXT *ctx, const char *url_or_filename, return false; } - if (size_read < - std::min(static_cast<unsigned long long>(buffer.size()), props.size)) { + if (size_read == 0) { pj_log(ctx, PJ_LOG_ERROR, "Did not get as many bytes as expected"); ctx->networking.close(ctx, handle, ctx->networking.user_data); f.reset(); |
