diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-15 12:52:03 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-15 12:52:03 +0000 |
| commit | d8d159ccd86183649771b5b20ef154504540b1ab (patch) | |
| tree | c32e4a8b838fced1337b406a81d56cd1f80d3712 /src/HttpResponseCommand.cc | |
| parent | 6a1fe669751801b55affa0aeaff4646ac2ac6a00 (diff) | |
2010-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced HttpHeader::responseStatus_ with HttpHeader::statusCode_.
statusCode_ is of type int.
* src/AbstractProxyResponseCommand.cc
* src/FtpNegotiationCommand.cc
* src/HttpHeader.cc
* src/HttpHeader.h
* src/HttpHeaderProcessor.cc
* src/HttpResponse.cc
* src/HttpResponse.h
* src/HttpResponseCommand.cc
* src/HttpSkipResponseCommand.cc
* src/util.cc
* src/util.h
* test/HttpHeaderProcessorTest.cc
* test/HttpHeaderTest.cc
* test/HttpResponseTest.cc
* test/UtilTest.cc
Diffstat (limited to 'src/HttpResponseCommand.cc')
| -rw-r--r-- | src/HttpResponseCommand.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index 04036a40..01628a3f 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -167,8 +167,9 @@ bool HttpResponseCommand::executeInternal() (getOption()->getAsInt(PREF_MAX_HTTP_PIPELINING)); } + int statusCode = httpResponse->getStatusCode(); if(!httpResponse->getHttpRequest()->getIfModifiedSinceHeader().empty()) { - if(httpResponse->getResponseStatus() == HttpHeader::S304) { + if(statusCode == 304) { uint64_t totalLength = httpResponse->getEntityLength(); getFileEntry()->setLength(totalLength); getRequestGroup()->initPieceStorage(); @@ -181,15 +182,13 @@ bool HttpResponseCommand::executeInternal() poolConnection(); getFileEntry()->poolRequest(getRequest()); return true; - } else if(httpResponse->getResponseStatus() == HttpHeader::S200 || - httpResponse->getResponseStatus() == HttpHeader::S206) { + } else if(statusCode == 200 || statusCode == 206) { // Remote file is newer than local file. We allow overwrite. getOption()->put(PREF_ALLOW_OVERWRITE, A2_V_TRUE); } } - if(httpResponse->getResponseStatus() >= HttpHeader::S300 && - httpResponse->getResponseStatus() != HttpHeader::S304) { - if(httpResponse->getResponseStatus() == HttpHeader::S404) { + if(statusCode != 304 && statusCode >= 300) { + if(statusCode == 404) { getRequestGroup()->increaseAndValidateFileNotFoundCount(); } return skipResponseBody(httpResponse); |
