From da437b32958d5d0c275d97a8e4f2bdb2bb404fe9 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sat, 2 Jul 2016 10:51:23 +0100 Subject: [PATCH] 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) --- net_io.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net_io.c b/net_io.c index 6ecedee..d2b0a89 100644 --- a/net_io.c +++ b/net_io.c @@ -1453,6 +1453,9 @@ static int handleHTTPRequest(struct client *c, char *p) { 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. #ifndef _WIN32 if ( (write(c->fd, hdr, hdrlen) != hdrlen)