summaryrefslogtreecommitdiff
path: root/src/HttpResponseCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-09-30 15:54:50 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-09-30 15:54:50 +0000
commitc682371a582386b022fe3cfc0d72782356aa1841 (patch)
treed6a441d01c065371456740c0bf0280de0d721156 /src/HttpResponseCommand.cc
parent91e4a887c627b10ccbc080b43b9a4d10cb26b9e2 (diff)
2008-10-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Don't set Request::supportsPersistentConnection() in HttpConnection since this code is also used in AbstractProxyResponseCommand. Moved those code to HttpResponse. * src/HttpResponse.cc * src/HttpResponse.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpResponseCommand.cc * test/HttpResponseTest.cc
Diffstat (limited to 'src/HttpResponseCommand.cc')
-rw-r--r--src/HttpResponseCommand.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc
index b5025b52..e8cedc95 100644
--- a/src/HttpResponseCommand.cc
+++ b/src/HttpResponseCommand.cc
@@ -93,6 +93,13 @@ bool HttpResponseCommand::executeInternal()
httpResponse->validateResponse();
httpResponse->retrieveCookie();
+ SharedHandle<HttpHeader> httpHeader = httpResponse->getHttpHeader();
+ // Disable persistent connection if:
+ // Connection: close is received or the remote server is not HTTP/1.1.
+ // We don't care whether non-HTTP/1.1 server returns Connection: keep-alive.
+ req->supportsPersistentConnection
+ (httpResponse->supportsPersistentConnection());
+
if(httpResponse->getResponseStatus() >= HttpHeader::S300) {
if(httpResponse->getResponseStatus() == HttpHeader::S404) {
_requestGroup->increaseAndValidateFileNotFoundCount();