From f34dfca5e6c8b04d7c3ce7501bf508a8a7f2a815 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 23 Feb 2018 14:41:08 +0800 Subject: [PATCH] Enable Http/1.1 persistence connection This enables reusing existing TCP connection instead of opening a new connection for every request --- src/base/http/connection.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/base/http/connection.cpp b/src/base/http/connection.cpp index fe74e7974..4ade26155 100644 --- a/src/base/http/connection.cpp +++ b/src/base/http/connection.cpp @@ -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;