summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-05-08 12:41:21 -0400
committerAndrew Opalach <andrew@akon.city> 2025-05-08 12:41:21 -0400
commitef86574ec5d859727695da65f683f0774a3b4460 (patch)
treee0736a2f57fd3ed18286e148dad91a340736ff61
parent23ec05f871f53b724dc6eb5e1c62d0245109c69d (diff)
downloadlibnaunet-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>
-rw-r--r--meson.build4
-rw-r--r--src/curl/http.c2
-rw-r--r--src/util/file/file_linux.c2
-rw-r--r--src/util/file/file_stdio.c2
-rw-r--r--subprojects/libalabaster.wrap2
5 files changed, 7 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index 94ae0c0..74d106d 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,7 @@
project('libnaunet', 'c', version: '0.01',
- default_options: ['warning_level=2', 'c_std=c99'])
+ meson_version: '>=0.63.0',
+ default_options: ['warning_level=2', 'c_std=c99'],
+ license: 'GPL-3.0-only')
compiler = meson.get_compiler('c')
cmake = import('cmake')
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);
diff --git a/src/util/file/file_linux.c b/src/util/file/file_linux.c
index 9693d4b..6537d26 100644
--- a/src/util/file/file_linux.c
+++ b/src/util/file/file_linux.c
@@ -1,4 +1,4 @@
-#define AL_LOG_SECTION "file_linux"
+#define AL_LOG_SECTION "file"
#include <al/log.h>
#include <sys/mman.h>
diff --git a/src/util/file/file_stdio.c b/src/util/file/file_stdio.c
index 48dd545..ae07908 100644
--- a/src/util/file/file_stdio.c
+++ b/src/util/file/file_stdio.c
@@ -1,4 +1,4 @@
-#define AL_LOG_SECTION "file_stdio"
+#define AL_LOG_SECTION "file"
#include <al/log.h>
#include <al/lib.h>
diff --git a/subprojects/libalabaster.wrap b/subprojects/libalabaster.wrap
index fe96079..6ab8612 100644
--- a/subprojects/libalabaster.wrap
+++ b/subprojects/libalabaster.wrap
@@ -1,4 +1,4 @@
[wrap-git]
url = https://git.akon.city/libalabaster
-revision = a5516233d66eb1552cf7fdfe03779b2bf896c82d
+revision = 34a5e136b6c79092eee73857bbad25892fe8047a
depth = 1