From 40a3008318a72464daf57b5eccee0b0b00fb7952 Mon Sep 17 00:00:00 2001 From: Mathias Gug Date: Mon, 25 Jan 2016 15:03:37 -0800 Subject: [PATCH] Send the Connection: close response header so that proxy server don't try to reuse the connection. Given that osrm-routed does *not* support keepalive the Connection: close response header should be set. --- src/server/http/reply.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server/http/reply.cpp b/src/server/http/reply.cpp index 87faa1ba1..efea8f628 100644 --- a/src/server/http/reply.cpp +++ b/src/server/http/reply.cpp @@ -103,7 +103,11 @@ boost::asio::const_buffer reply::status_to_buffer(const reply::status_type statu return boost::asio::buffer(http_bad_request_string); } -reply::reply() : status(ok) {} +reply::reply() : status(ok) +{ + // We do not currently support keep alive. Always set 'Connection: close'. + headers.emplace_back("Connection", "close"); +} } } }