summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-11-24 11:32:22 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-11-24 11:32:22 +0000
commit355a91cdec6941cf42e527e5d51ef2506814e644 (patch)
treeabd470e49902b1d0f372396976461fe6b8369e5c
parent6d544c58276a90420e8df2092c2c3f1a7c242b6c (diff)
2007-11-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed: compilation fails without c-ares/ares * src/DownloadEngine.cc (addCommand): Moved outside #ifdef Generate http/ftp commands only when download is incomplete. * src/BtFileAllocationEntry.cc (prepareForNextAction)
-rw-r--r--ChangeLog8
-rw-r--r--src/BtFileAllocationEntry.cc7
-rw-r--r--src/DownloadEngine.cc11
3 files changed, 17 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index a69dace8..eac533da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-11-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
+
+ Fixed: compilation fails without c-ares/ares
+ * src/DownloadEngine.cc (addCommand): Moved outside #ifdef
+
+ Generate http/ftp commands only when download is incomplete.
+ * src/BtFileAllocationEntry.cc (prepareForNextAction)
+
2007-11-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Corrected typo. Examples are removed since they are available in man
diff --git a/src/BtFileAllocationEntry.cc b/src/BtFileAllocationEntry.cc
index b3c72525..3a5e9b9c 100644
--- a/src/BtFileAllocationEntry.cc
+++ b/src/BtFileAllocationEntry.cc
@@ -46,8 +46,9 @@ BtFileAllocationEntry::~BtFileAllocationEntry() {}
Commands BtFileAllocationEntry::prepareForNextAction(DownloadEngine* e)
{
Commands commands = BtSetup().setup(_requestGroup, e, e->option);
- // TODO don't integerate http/ftp when multi-file torrent
- Commands streamCommands = _requestGroup->createNextCommandWithAdj(e, 0);
- copy(streamCommands.begin(), streamCommands.end(), back_inserter(commands));
+ if(!_requestGroup->downloadFinished()) {
+ Commands streamCommands = _requestGroup->createNextCommandWithAdj(e, 0);
+ copy(streamCommands.begin(), streamCommands.end(), back_inserter(commands));
+ }
return commands;
}
diff --git a/src/DownloadEngine.cc b/src/DownloadEngine.cc
index c2e2e860..2210d17e 100644
--- a/src/DownloadEngine.cc
+++ b/src/DownloadEngine.cc
@@ -292,6 +292,11 @@ void DownloadEngine::setStatCalc(const StatCalcHandle& statCalc)
_statCalc = statCalc;
}
+void DownloadEngine::addCommand(const Commands& commands)
+{
+ this->commands.insert(this->commands.end(), commands.begin(), commands.end());
+}
+
#ifdef ENABLE_ASYNC_DNS
bool DownloadEngine::addNameResolverCheck(const NameResolverHandle& resolver,
Command* command) {
@@ -322,10 +327,4 @@ bool DownloadEngine::deleteNameResolverCheck(const NameResolverHandle& resolver,
return true;
}
}
-
-void DownloadEngine::addCommand(const Commands& commands)
-{
- this->commands.insert(this->commands.end(), commands.begin(), commands.end());
-}
-
#endif // ENABLE_ASYNC_DNS