From 4410f0e56c4940d5ddee815329805897c9a338af Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 4 May 2013 22:44:08 +0900 Subject: [PATCH] Treat response is completed if EOF is received before streamFilter completes --- src/HttpSkipResponseCommand.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/HttpSkipResponseCommand.cc b/src/HttpSkipResponseCommand.cc index b236a01b..75d65637 100644 --- a/src/HttpSkipResponseCommand.cc +++ b/src/HttpSkipResponseCommand.cc @@ -148,13 +148,17 @@ bool HttpSkipResponseCommand::executeInternal() return processResponse(); } + if(eof) { + // we may get EOF before non-sink streamFilter reports its + // completion. There are some broken servers to prevent + // streamFilter from completion. Since we just discard the + // response body anyway, so we assume that the response is + // completed. + return processResponse(); + } bool finished = false; if(sinkFilterOnly_) { - if(eof) { - return processResponse(); - } else { - finished = (totalLength_ == receivedBytes_); - } + finished = (totalLength_ == receivedBytes_); } else { finished = streamFilter_->finished(); }