]> granicus.if.org Git - icinga2/commitdiff
Add a code comment for connection: close handling 6814/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Mon, 3 Dec 2018 13:40:50 +0000 (14:40 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 3 Dec 2018 13:40:50 +0000 (14:40 +0100)
lib/remote/httpresponse.cpp

index ef0df7e81a2dad143bd733bfcd4c3f5f7a2d6661..de029b701a67cee64433bfbd0dffbff6cdc927a2 100644 (file)
@@ -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();
 }