mirror of https://github.com/aria2/aria2
2010-07-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Check status values: 200 and 206. * src/HttpResponse.ccpull/1/head
parent
332a5bd4a1
commit
036abeee11
|
@ -1,3 +1,8 @@
|
||||||
|
2010-07-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Check status values: 200 and 206.
|
||||||
|
* src/HttpResponse.cc
|
||||||
|
|
||||||
2010-07-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2010-07-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Reverted previous change and fixed it in a right way.
|
Reverted previous change and fixed it in a right way.
|
||||||
|
|
|
@ -69,11 +69,11 @@ void HttpResponse::validateResponse() const
|
||||||
if(status >= HttpHeader::S400) {
|
if(status >= HttpHeader::S400) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(status == HttpHeader::S304 &&
|
if(status == HttpHeader::S304) {
|
||||||
httpRequest_->getIfModifiedSinceHeader().empty()) {
|
if(httpRequest_->getIfModifiedSinceHeader().empty()) {
|
||||||
throw DL_ABORT_EX("Got 304 without If-Modified-Since");
|
throw DL_ABORT_EX("Got 304 without If-Modified-Since");
|
||||||
}
|
}
|
||||||
if(status == HttpHeader::S301 ||
|
} else if(status == HttpHeader::S301 ||
|
||||||
status == HttpHeader::S302 ||
|
status == HttpHeader::S302 ||
|
||||||
status == HttpHeader::S303 ||
|
status == HttpHeader::S303 ||
|
||||||
status == HttpHeader::S307) {
|
status == HttpHeader::S307) {
|
||||||
|
@ -82,7 +82,10 @@ void HttpResponse::validateResponse() const
|
||||||
(StringFormat(EX_LOCATION_HEADER_REQUIRED,
|
(StringFormat(EX_LOCATION_HEADER_REQUIRED,
|
||||||
util::parseUInt(status)).str());
|
util::parseUInt(status)).str());
|
||||||
}
|
}
|
||||||
} else if(!httpHeader_->defined(HttpHeader::TRANSFER_ENCODING)) {
|
return;
|
||||||
|
} else if(status == HttpHeader::S200 ||
|
||||||
|
status == HttpHeader::S206) {
|
||||||
|
if(!httpHeader_->defined(HttpHeader::TRANSFER_ENCODING)) {
|
||||||
// compare the received range against the requested range
|
// compare the received range against the requested range
|
||||||
RangeHandle responseRange = httpHeader_->getRange();
|
RangeHandle responseRange = httpHeader_->getRange();
|
||||||
if(!httpRequest_->isRangeSatisfied(responseRange)) {
|
if(!httpRequest_->isRangeSatisfied(responseRange)) {
|
||||||
|
@ -98,6 +101,10 @@ void HttpResponse::validateResponse() const
|
||||||
downloadresultcode::CANNOT_RESUME);
|
downloadresultcode::CANNOT_RESUME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
throw DL_ABORT_EX
|
||||||
|
(StringFormat("Unexpected status %s", status.c_str()).str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string HttpResponse::determinFilename() const
|
std::string HttpResponse::determinFilename() const
|
||||||
|
|
Loading…
Reference in New Issue