summaryrefslogtreecommitdiff
path: root/src/AbstractCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-01-16 18:12:14 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-01-16 18:12:14 +0900
commit63fe7874daa45ad32475b2e9f04087ecb7621347 (patch)
treeee81dabe89c6de9c7cfcb46fa0d5d6c8be0ee1d7 /src/AbstractCommand.cc
parentb2f27e6548ec5f13a0f5776612cb512cb0d30d4e (diff)
Handle the situation when remote server returns Connection: close
after several pipelined requests. We call Request::setMaxPipelinedRequest(1) if Connection: close is received. Also call Request::supportsPersistentConnection(true) and Request::setMaxPipelinedRequest(1) when closing the connection.
Diffstat (limited to 'src/AbstractCommand.cc')
-rw-r--r--src/AbstractCommand.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc
index 5a15e86a..b4e5ee2f 100644
--- a/src/AbstractCommand.cc
+++ b/src/AbstractCommand.cc
@@ -347,6 +347,12 @@ bool AbstractCommand::prepareForRetry(time_t wait) {
getSegmentMan()->cancelSegment(getCuid());
}
if(req_) {
+ // Reset persistentConnection and maxPipelinedRequest to handle
+ // the situation where remote server returns Connection: close
+ // after several pipelined requests.
+ req_->supportsPersistentConnection(true);
+ req_->setMaxPipelinedRequest(1);
+
fileEntry_->poolRequest(req_);
A2_LOG_DEBUG(fmt("CUID#%lld - Pooling request URI=%s",
getCuid(), req_->getUri().c_str()));