Enable Http/1.1 persistence connection

This enables reusing existing TCP connection instead of opening a new connection
for every request
This commit is contained in:
Chocobo1 2018-02-23 14:41:08 +08:00
parent cec68c3fd7
commit f34dfca5e6
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -101,12 +101,10 @@ void Connection::read()
if (acceptsGzipEncoding(result.request.headers["accept-encoding"]))
resp.headers[HEADER_CONTENT_ENCODING] = "gzip";
resp.headers[HEADER_CONNECTION] = "close";
resp.headers[HEADER_CONNECTION] = "keep-alive";
sendResponse(resp);
m_receivedData = m_receivedData.mid(result.frameSize);
m_socket->close();
}
break;