From b9f87872a42f32818805f3c2520555f2d6e2928d Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 19 Apr 2013 01:38:36 +0200 Subject: [PATCH 1/1] Set Connection: close in outgoing HTTP headers. --- httpinput.cpp | 5 +++++ udpinput.cpp | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/httpinput.cpp b/httpinput.cpp index 457c216..da672ed 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -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::iterator it = parameters.begin(); diff --git a/udpinput.cpp b/udpinput.cpp index 8659141..4222515 100644 --- a/udpinput.cpp +++ b/udpinput.cpp @@ -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" - "Server: " SERVER_IDENTIFICATION "\r\n"; + "Server: " SERVER_IDENTIFICATION "\r\n" + "Connection: close\r\n"; } void UDPInput::add_destination(const string &stream_id) -- 2.39.2