vsprintf(wbuf, format, arg_ptr);
va_end(arg_ptr);
- write(WC->http_sock, wbuf, strlen(wbuf));
+ client_write(wbuf, strlen(wbuf));
}
(long) length,
SERVER
);
- write(WC->http_sock, thing, (size_t)length);
+ client_write(thing, (size_t)length);
}
char buf[SIZ];
int a, b;
int ContentLength = 0;
- int BytesRead;
+ int BytesRead = 0;
char ContentType[512];
char *content;
char *content_end;
ContentType, ContentLength);
body_start = strlen(content);
+/***** old version
BytesRead = 0;
while (BytesRead < ContentLength) {
a=read(WC->http_sock, &content[BytesRead+body_start],
if (a <= 0) BytesRead = ContentLength;
else BytesRead += a;
}
+*******/
+
+ /* Now we're daring and read it all at once. */
+ client_read(WC->http_sock, &content[BytesRead+body_start], ContentLength);
if (!strncasecmp(ContentType,
"application/x-www-form-urlencoded", 33)) {