mirror of https://github.com/aria2/aria2
2008-06-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
If FTP server returns negative response with REST raw command and requested range is not 0, throw exception. If requested range is 0, continue download a file from 0 byte. * src/FtpNegotiationCommand.cc * src/FtpNegotiationCommand.hpull/1/head
parent
3e12ebf78f
commit
68b5ae7d86
|
@ -1,3 +1,11 @@
|
|||
2008-06-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
If FTP server returns negative response with REST raw command and
|
||||
requested range is not 0, throw exception. If requested range is 0,
|
||||
continue download a file from 0 byte.
|
||||
* src/FtpNegotiationCommand.cc
|
||||
* src/FtpNegotiationCommand.h
|
||||
|
||||
2008-06-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Supported FTP server which don't recognize SIZE raw command.
|
||||
|
|
|
@ -383,14 +383,17 @@ bool FtpNegotiationCommand::sendRest(const SegmentHandle& segment) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool FtpNegotiationCommand::recvRest() {
|
||||
bool FtpNegotiationCommand::recvRest(const SharedHandle<Segment>& segment) {
|
||||
unsigned int status = ftp->receiveResponse();
|
||||
if(status == 0) {
|
||||
return false;
|
||||
}
|
||||
// TODO if we recieve negative response, then we set _requestGroup->getSegmentMan()->splittable = false, and continue.
|
||||
// If we recieve negative response and requested file position is not 0,
|
||||
// then throw exception here.
|
||||
if(status != 350) {
|
||||
throw DlAbortEx(StringFormat(EX_BAD_STATUS, status).str());
|
||||
if(!segment.isNull() && segment->getPositionToWrite() != 0) {
|
||||
throw DlAbortEx("FTP server doesn't support resuming.");
|
||||
}
|
||||
}
|
||||
sequence = SEQ_SEND_RETR;
|
||||
return true;
|
||||
|
@ -480,7 +483,7 @@ bool FtpNegotiationCommand::processSequence(const SegmentHandle& segment) {
|
|||
case SEQ_SEND_REST:
|
||||
return sendRest(segment);
|
||||
case SEQ_RECV_REST:
|
||||
return recvRest();
|
||||
return recvRest(segment);
|
||||
case SEQ_SEND_RETR:
|
||||
return sendRetr();
|
||||
case SEQ_RECV_RETR:
|
||||
|
|
|
@ -92,7 +92,7 @@ private:
|
|||
bool recvPasv();
|
||||
bool sendRest(const SharedHandle<Segment>& segment);
|
||||
bool sendRestPasv(const SharedHandle<Segment>& segment);
|
||||
bool recvRest();
|
||||
bool recvRest(const SharedHandle<Segment>& segment);
|
||||
bool sendRetr();
|
||||
bool recvRetr();
|
||||
bool waitConnection();
|
||||
|
|
Loading…
Reference in New Issue