]> code.citadel.org Git - citadel.git/commitdiff
* Worked around HTTP bugs in Internet Explorer 5. Die, Bill, Die.
authorArt Cancro <ajc@citadel.org>
Tue, 4 Jan 2000 15:24:18 +0000 (15:24 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 4 Jan 2000 15:24:18 +0000 (15:24 +0000)
* This will be released as v2.11; tagged everything as such.

webcit/ChangeLog
webcit/webcit.c

index 4dc97912b1e6351d0462d9570c54c4089448c096..c5d34f8bd5804495307d99f679886774929ae563 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 211.0  2000/01/04 15:24:16  ajc
+* Worked around HTTP bugs in Internet Explorer 5.  Die, Bill, Die.
+* This will be released as v2.11; tagged everything as such.
+
 Revision 210.0  1999/12/24 04:57:18  ajc
 * 2.10 release
 
@@ -368,4 +372,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index bbf986c3de7c4d27b40ee1462c8d349fc794e92a..ed9da2253b93002636a914e136ae80e6a09b90a2 100644 (file)
@@ -567,6 +567,7 @@ void session_loop(struct httprequest *req)
        char buf[256];
        int a, b;
        int ContentLength = 0;
+       int BytesRead;
        char ContentType[512];
        char *content;
        struct httprequest *hptr;
@@ -622,9 +623,17 @@ void session_loop(struct httprequest *req)
        if (ContentLength > 0) {
                fprintf(stderr, "Content length: %d\n", ContentLength);
                content = malloc(ContentLength + 1);
-               read(WC->http_sock, content, ContentLength);
-
-               content[ContentLength] = 0;
+               memset(content, 0, ContentLength+1);
+               BytesRead = 0;
+
+               while (BytesRead < ContentLength) {
+                       a=read(WC->http_sock, &content[BytesRead],
+                               ContentLength - BytesRead);
+                       if (a <= 0) BytesRead = ContentLength;
+                       else BytesRead += a;
+                       fprintf(stderr, "Block: %-5d  Read: %-5d  Need: %-5d\n",
+                               a, BytesRead, ContentLength);
+               }
 
                if (!strncasecmp(ContentType,
                              "application/x-www-form-urlencoded", 33)) {