summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2015-07-31 06:40:22 +0000
committerChris Wilson <chris+github@qwirx.com>2015-07-31 06:40:22 +0000
commit8231689bc61f8fadb94e92fe35529cf8b378ab1d (patch)
treecc9499aa5b70d88d04f04e0c6308fc7b349d7e5e
parentd72425de59db7d94dd51cca7988c3d025426925b (diff)
Fix S3Client handling of "Connection: close" responses.
We can't continue to use the same connection after receiving such a response, so close it immediately.
-rw-r--r--lib/httpserver/S3Client.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/httpserver/S3Client.cpp b/lib/httpserver/S3Client.cpp
index cd5988d5..59044573 100644
--- a/lib/httpserver/S3Client.cpp
+++ b/lib/httpserver/S3Client.cpp
@@ -224,9 +224,9 @@ HTTPResponse S3Client::FinishAndSendRequest(HTTPRequest::Method Method,
HTTPResponse S3Client::SendRequest(HTTPRequest& rRequest,
IOStream* pStreamToSend, const char* pStreamContentType)
-{
+{
HTTPResponse response;
-
+
if (pStreamToSend)
{
rRequest.SendWithStream(*mapClientSocket,
@@ -238,6 +238,11 @@ HTTPResponse S3Client::SendRequest(HTTPRequest& rRequest,
rRequest.Send(*mapClientSocket, 30000 /* milliseconds */);
response.Receive(*mapClientSocket, 30000 /* milliseconds */);
}
-
+
+ if(!response.IsKeepAlive())
+ {
+ mapClientSocket.reset();
+ }
+
return response;
}