]> Nishi Git Mirror - libw3.git/commitdiff
fixed header parsing bug
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Wed, 24 Jan 2024 14:02:25 +0000 (14:02 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Wed, 24 Jan 2024 14:02:25 +0000 (14:02 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@60 d27a3e52-49c5-7645-884c-6793ebffc270

Library/HTTP.c
W3Version.h.p

index 336bcf0191fee0925d149996bf4e24b9f01dd86f..9bf2995cf03474783840b66a61313c0d94c00276 100644 (file)
@@ -127,9 +127,9 @@ void __W3_HTTP_Request(struct W3* w3) {
                                                int j;
                                                int incr = 0;
                                                int start = 0;
-                                               for(j = 1; headerbuf[j] != 0; j++) {
+                                               for(j = 1;; j++) {
                                                        char c = headerbuf[j];
-                                                       if(c == '\r') {
+                                                       if(c == '\r' || c == 0) {
                                                                headers[incr] = 0;
                                                                headers[incr + 1] = 0;
                                                                char* data = __W3_Strdup(headers + start);
@@ -156,6 +156,7 @@ void __W3_HTTP_Request(struct W3* w3) {
                                                                start = incr + 1;
                                                                incr++;
                                                                j++;
+                                                               if(c == 0) break;
                                                        } else {
                                                                headers[incr] = c;
                                                                headers[incr + 1] = 0;
index 180169a4ee3569a48c5c98a977d0d5c2ef6c7331..3244913e278eca52ff8920a2768fa69e08d79cb5 100644 (file)
@@ -6,7 +6,7 @@
 extern "C" {
 #endif
 
-#define LIBW3_VERSION "1.3A" \
+#define LIBW3_VERSION "1.3B" \
 SUFFIX
 
 #ifdef __cplusplus