summaryrefslogtreecommitdiff
path: root/src/StreamCheckIntegrityEntry.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-11-09 18:01:12 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-11-09 18:01:12 +0000
commitb5ad00980918777cb701420b151e9c4c81e43757 (patch)
tree5b4d9c234c21c4468ad409c76df41da85e4b9877 /src/StreamCheckIntegrityEntry.cc
parent76b9093d09d76b399823e36c83f1289b37ca2624 (diff)
2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Don't connect server before checking file integrity at startup, if filesize and output file path are known. * src/AbstractCommand.cc * src/StreamFileAllocationEntry.cc * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc Added DownloadFailureException. If it is thrown, RequestGroup should halt. * src/AbstractCommand.cc * src/DownloadFailureException.h * src/RequestGroup.cc Catch RecoverableException, instead of DlAbortEx. * src/RequestGroupMan.cc * src/FillRequestGroupCommand.cc * src/MetaFileUtil.cc * src/IteratableChunkChecksumValidator.cc Now first parameter of MSG_DOWNLOAD_ABORTED is gid(RequestGroup:: getGID()) * src/CheckIntegrityCommand.cc * src/message.h Print gid instead of idx. * src/RequestGroupMan.cc Removed exception throwers declaration. * src/DirectDiskAdaptor.{h, cc} * src/SocketCore.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpConnection.{h, cc} * src/HttpResponse.{h, cc} * src/DiskAdaptor.{h, cc} * src/CopyDiskAdaptor.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpHeaderProcessor.{h, cc} * src/AbstractSingleDiskAdaptor.{h, cc} * src/Util.{h, cc} * test/UtilTest.cc * src/DefaultDiskWriter.{h, cc} * src/FtpConnection.{h, cc} * src/AbstractDiskWriter.{h, cc} Removed duplicate code. * src/StreamCheckIntegrityEntry.cc Removed unnecessary include. * src/DiskWriter.h Included Exception.h * src/option_processing.cc Included 2 files and added doc * src/TrackerWatcherCommand.cc * src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
Diffstat (limited to 'src/StreamCheckIntegrityEntry.cc')
-rw-r--r--src/StreamCheckIntegrityEntry.cc17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/StreamCheckIntegrityEntry.cc b/src/StreamCheckIntegrityEntry.cc
index 9cd8dfb4..b745d8e7 100644
--- a/src/StreamCheckIntegrityEntry.cc
+++ b/src/StreamCheckIntegrityEntry.cc
@@ -54,22 +54,13 @@ StreamCheckIntegrityEntry::~StreamCheckIntegrityEntry() {}
Commands StreamCheckIntegrityEntry::onDownloadIncomplete(DownloadEngine* e)
{
Commands commands;
+ FileAllocationEntryHandle entry =
+ new StreamFileAllocationEntry(_currentRequest, _requestGroup,
+ popNextCommand());
if(_requestGroup->needsFileAllocation()) {
- FileAllocationEntryHandle entry =
- new StreamFileAllocationEntry(_currentRequest, _requestGroup,
- popNextCommand());
e->_fileAllocationMan->pushFileAllocationEntry(entry);
} else {
- if(_nextCommand) {
- commands.push_back(popNextCommand());
- } else {
- Commands streamCommands = _requestGroup->createNextCommandWithAdj(e, -1);
- Command* command = InitiateConnectionCommandFactory::createInitiateConnectionCommand(CUIDCounterSingletonHolder::instance()->newID(),
- _currentRequest, _requestGroup, e);
-
- commands.push_front(command);
- copy(streamCommands.begin(), streamCommands.end(), back_inserter(commands));
- }
+ commands = entry->prepareForNextAction(e);
}
return commands;
}