$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
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
-
char buf[256];
int a, b;
int ContentLength = 0;
+ int BytesRead;
char ContentType[512];
char *content;
struct httprequest *hptr;
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)) {