Set the socket buffer to the size of a HTTP response.
This gives us a better chance of the response fitting in a single write() call (if it doesn't, it's going to get truncated, because the internal webserver is really simple)
This commit is contained in:
parent
22c90415be
commit
da437b3295
3
net_io.c
3
net_io.c
|
@ -1453,6 +1453,9 @@ static int handleHTTPRequest(struct client *c, char *p) {
|
||||||
printf("HTTP Reply header:\n%s", hdr);
|
printf("HTTP Reply header:\n%s", hdr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* hack hack hack. try to deal with large content */
|
||||||
|
anetSetSendBuffer(Modes.aneterr, c->fd, clen + hdrlen);
|
||||||
|
|
||||||
// Send header and content.
|
// Send header and content.
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
if ( (write(c->fd, hdr, hdrlen) != hdrlen)
|
if ( (write(c->fd, hdr, hdrlen) != hdrlen)
|
||||||
|
|
Loading…
Reference in a new issue