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/HttpSkipResponseCommand.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/HttpSkipResponseCommand.cc')
| -rw-r--r-- | src/HttpSkipResponseCommand.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/HttpSkipResponseCommand.cc b/src/HttpSkipResponseCommand.cc index 7edbde63..b38ea7d0 100644 --- a/src/HttpSkipResponseCommand.cc +++ b/src/HttpSkipResponseCommand.cc @@ -171,6 +171,7 @@ void HttpSkipResponseCommand::poolConnection() const bool HttpSkipResponseCommand::processResponse() { + int statusCode; if(httpResponse_->isRedirect()) { unsigned int rnum = httpResponse_->getHttpRequest()->getRequest()->getRedirectCount(); @@ -180,8 +181,8 @@ bool HttpSkipResponseCommand::processResponse() } httpResponse_->processRedirect(); return prepareForRetry(0); - } else if(httpResponse_->getResponseStatus() >= HttpHeader::S400) { - if(httpResponse_->getResponseStatus() == HttpHeader::S401) { + } else if((statusCode = httpResponse_->getStatusCode()) >= 400) { + if(statusCode == 401) { if(getOption()->getAsBool(PREF_HTTP_AUTH_CHALLENGE) && !httpResponse_->getHttpRequest()->authenticationUsed() && getDownloadEngine()->getAuthConfigFactory()->activateBasicCred @@ -190,14 +191,11 @@ bool HttpSkipResponseCommand::processResponse() } else { throw DL_ABORT_EX(EX_AUTH_FAILED); } - }else if(httpResponse_->getResponseStatus() == HttpHeader::S404) { + } else if(statusCode == 404) { throw DL_ABORT_EX2(MSG_RESOURCE_NOT_FOUND, downloadresultcode::RESOURCE_NOT_FOUND); } else { - throw DL_ABORT_EX - (StringFormat - (EX_BAD_STATUS, - util::parseUInt(httpResponse_->getResponseStatus())).str()); + throw DL_ABORT_EX(StringFormat(EX_BAD_STATUS, statusCode).str()); } } else { return prepareForRetry(0); |
