Set Connection: close in outgoing HTTP headers.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 18 Apr 2013 23:38:36 +0000 (01:38 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 18 Apr 2013 23:38:36 +0000 (01:38 +0200)
httpinput.cpp
udpinput.cpp

index 457c216..da672ed 100644 (file)
@@ -200,6 +200,11 @@ bool HTTPInput::parse_response(const std::string &request)
                }
        }
 
                }
        }
 
+       // Set “Connection: close”.
+       // TODO: Make case-insensitive.
+       parameters.erase("Connection");
+       parameters.insert(make_pair("Connection", "close"));
+
        // Construct the new HTTP header.
        http_header = "HTTP/1.0 200 OK\r\n";
        for (multimap<string, string>::iterator it = parameters.begin();
        // Construct the new HTTP header.
        http_header = "HTTP/1.0 200 OK\r\n";
        for (multimap<string, string>::iterator it = parameters.begin();
index 8659141..4222515 100644 (file)
@@ -70,7 +70,8 @@ void UDPInput::construct_header()
                "HTTP/1.0 200 OK\r\n"
                "Content-type: application/octet-stream\r\n"
                "Cache-control: no-cache\r\n"
                "HTTP/1.0 200 OK\r\n"
                "Content-type: application/octet-stream\r\n"
                "Cache-control: no-cache\r\n"
-               "Server: " SERVER_IDENTIFICATION "\r\n";
+               "Server: " SERVER_IDENTIFICATION "\r\n"
+               "Connection: close\r\n";
 }
        
 void UDPInput::add_destination(const string &stream_id)
 }
        
 void UDPInput::add_destination(const string &stream_id)