diff options
Diffstat (limited to 'src/HttpResponseCommand.cc')
| -rw-r--r-- | src/HttpResponseCommand.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index 997b17fc..97ab2a79 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -145,7 +145,13 @@ bool HttpResponseCommand::handleDefaultEncoding(const HttpResponseHandle& httpRe File file(_requestGroup->getFilePath()); SegmentHandle segment = _requestGroup->getSegmentMan()->getSegment(cuid, 0); - if(!segment.isNull() && segment->getPositionToWrite() == 0) { + // pipelining requires implicit range specified. But the request for + // this response most likely dones't contains range header. This means + // we can't continue to use this socket because server sends all entity + // body instead of a segment. + // Therefore, we shutdown the socket here if pipelining is enabled. + if(!segment.isNull() && segment->getPositionToWrite() == 0 && + !req->isPipeliningEnabled()) { command = createHttpDownloadCommand(httpResponse); } else { _requestGroup->getSegmentMan()->cancelSegment(cuid); |
