From 5f25eb6b2dda2737a98b429def496bb1bdd950cf Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Mon, 3 Dec 2018 14:40:50 +0100 Subject: [PATCH] Add a code comment for connection: close handling --- lib/remote/httpresponse.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/remote/httpresponse.cpp b/lib/remote/httpresponse.cpp index ef0df7e81..de029b701 100644 --- a/lib/remote/httpresponse.cpp +++ b/lib/remote/httpresponse.cpp @@ -112,6 +112,12 @@ void HttpResponse::Finish() m_State = HttpResponseEnd; + /* Close the connection on + * a) HTTP/1.0 + * b) Connection: close in the sent header. + * + * Do this here and not in DataAvailableHandler - there might still be incoming data in there. + */ if (m_Request->ProtocolVersion == HttpVersion10 || m_Request->Headers->Get("connection") == "close") m_Stream->Shutdown(); } -- 2.40.0