summaryrefslogtreecommitdiff
path: root/src/StreamFileAllocationEntry.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/StreamFileAllocationEntry.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/StreamFileAllocationEntry.cc')
-rw-r--r--src/StreamFileAllocationEntry.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/StreamFileAllocationEntry.cc b/src/StreamFileAllocationEntry.cc
index b229a0a2..cfa34a83 100644
--- a/src/StreamFileAllocationEntry.cc
+++ b/src/StreamFileAllocationEntry.cc
@@ -58,12 +58,16 @@ Commands StreamFileAllocationEntry::prepareForNextAction(DownloadEngine* e)
_nextCommand) {
commands.push_back(popNextCommand());
} else {
- Commands streamCommands = _requestGroup->createNextCommandWithAdj(e, -1);
- Command* command = InitiateConnectionCommandFactory::createInitiateConnectionCommand(CUIDCounterSingletonHolder::instance()->newID(),
- _currentRequest, _requestGroup, e);
-
- commands.push_back(command);
- copy(streamCommands.begin(), streamCommands.end(), back_inserter(commands));
+ if(_currentRequest.isNull()) {
+ commands = _requestGroup->createNextCommandWithAdj(e, 0);
+ } else {
+ Commands streamCommands = _requestGroup->createNextCommandWithAdj(e, -1);
+ Command* command = InitiateConnectionCommandFactory::createInitiateConnectionCommand(CUIDCounterSingletonHolder::instance()->newID(),
+ _currentRequest, _requestGroup, e);
+
+ commands.push_back(command);
+ copy(streamCommands.begin(), streamCommands.end(), back_inserter(commands));
+ }
}
return commands;
}