diff options
| author | 2025-05-08 12:41:21 -0400 | |
|---|---|---|
| committer | 2025-05-08 12:41:21 -0400 | |
| commit | ef86574ec5d859727695da65f683f0774a3b4460 (patch) | |
| tree | e0736a2f57fd3ed18286e148dad91a340736ff61 /src/curl | |
| parent | 23ec05f871f53b724dc6eb5e1c62d0245109c69d (diff) | |
| download | libnaunet-ef86574ec5d859727695da65f683f0774a3b4460.tar.gz libnaunet-ef86574ec5d859727695da65f683f0774a3b4460.tar.bz2 libnaunet-ef86574ec5d859727695da65f683f0774a3b4460.zip | |
Ignore Content-Length on non-200 status code
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/curl')
| -rw-r--r-- | src/curl/http.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/curl/http.c b/src/curl/http.c index 154e0c7..cfb8a18 100644 --- a/src/curl/http.c +++ b/src/curl/http.c @@ -12,7 +12,7 @@ static void check_status_codes(struct nn_curl *curl) http->callback(http->userdata, NNWT_HTTP_RESPONSE_CODE, NULL, &http->status_code); } } - if (http->content_length < 0) { + if (http->content_length < 0 && http->status_code / 100 == 2) { curl_easy_getinfo(curl->handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &http->content_length); if (http->content_length >= 0) { http->callback(http->userdata, NNWT_HTTP_CONTENT_LENGTH, NULL, &http->content_length); |