pull/1/head
Tatsuhiro Tsujikawa 2007-06-09 10:37:17 +00:00
parent 2d522cf6b7
commit aa7cbf60ba
2 changed files with 2 additions and 2 deletions

View File

@ -129,6 +129,7 @@ bool DownloadCommand::prepareForNextSegment() {
if(!_requestGroup->getChecksum().isNull() &&
!_requestGroup->getChecksum()->isEmpty()) {
ChecksumCommand* command = new ChecksumCommand(cuid, _requestGroup, e);
command->initValidator();
e->commands.push_back(command);
}
return true;

View File

@ -99,6 +99,7 @@ bool HttpResponseCommand::executeInternal()
_requestGroup->validateFilenameByHint(httpResponse->determinFilename());
_requestGroup->validateTotalLengthByHint(httpResponse->getEntityLength());
_requestGroup->getSegmentMan()->filename = httpResponse->determinFilename();
if(e->_requestGroupMan->isSameFileBeingDownloaded(_requestGroup)) {
throw new FatalException(EX_DUPLICATE_FILE_DOWNLOAD, _requestGroup->getFilePath().c_str());
}
@ -123,7 +124,6 @@ bool HttpResponseCommand::handleDefaultEncoding(const HttpResponseHandle& httpRe
throw new DlAbortEx(EX_TOO_LARGE_FILE, size);
}
_requestGroup->getSegmentMan()->isSplittable = !(size == 0);
_requestGroup->getSegmentMan()->filename = httpResponse->determinFilename();
_requestGroup->getSegmentMan()->downloadStarted = true;
_requestGroup->getSegmentMan()->totalSize = size;
@ -157,7 +157,6 @@ bool HttpResponseCommand::handleOtherEncoding(const HttpResponseHandle& httpResp
// we ignore content-length when transfer-encoding is set
_requestGroup->getSegmentMan()->downloadStarted = true;
_requestGroup->getSegmentMan()->isSplittable = false;
_requestGroup->getSegmentMan()->filename = httpResponse->determinFilename();
_requestGroup->getSegmentMan()->totalSize = 0;
// quick hack for method 'head'
if(httpRequest->getMethod() == Request::METHOD_HEAD) {