diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-12-04 11:38:06 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-12-04 11:38:06 +0000 |
| commit | ed3ebb7c22db5422328a69e600d2bb2aba6bbd86 (patch) | |
| tree | 568291aec94fd39b8c3cac8518ba42551d1912fd /src/HttpResponse.cc | |
| parent | 936ce09b8339e2827e949385a0701a6f53a321a9 (diff) | |
2007-12-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Forced download abort when received negative response from
http/ftp
server.
* src/HttpResponseCommand.cc
* src/FtpNegotiationCommand.cc
* src/HttpResponse.cc
* src/FtpConnection.cc
Diffstat (limited to 'src/HttpResponse.cc')
| -rw-r--r-- | src/HttpResponse.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/HttpResponse.cc b/src/HttpResponse.cc index c186dbd3..1f62ce96 100644 --- a/src/HttpResponse.cc +++ b/src/HttpResponse.cc @@ -37,7 +37,6 @@ #include "Util.h" #include "message.h" #include "DlAbortEx.h" -#include "DlRetryEx.h" void HttpResponse::validateResponse() const { @@ -48,11 +47,11 @@ void HttpResponse::validateResponse() const throw new DlAbortEx(MSG_RESOURCE_NOT_FOUND); } if(status >= 400) { - throw new DlRetryEx(EX_BAD_STATUS, status); + throw new DlAbortEx(EX_BAD_STATUS, status); } if(status >= 300) { if(!httpHeader->defined("Location")) { - throw new DlRetryEx(EX_LOCATION_HEADER_REQUIRED, + throw new DlAbortEx(EX_LOCATION_HEADER_REQUIRED, status); } } else { @@ -60,7 +59,7 @@ void HttpResponse::validateResponse() const // compare the received range against the requested range RangeHandle responseRange = httpHeader->getRange(); if(!httpRequest->isRangeSatisfied(responseRange)) { - throw new DlRetryEx(EX_INVALID_RANGE_HEADER, + throw new DlAbortEx(EX_INVALID_RANGE_HEADER, Util::llitos(httpRequest->getStartByte(), true).c_str(), Util::llitos(httpRequest->getEndByte(), true).c_str(), Util::llitos(httpRequest->getEntityLength(), true).c_str(), |
