summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/RequestGroup.cc8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b3d7cb8c..a79c6bd8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
+ Throw exception if same infohash torrent is now downloading.
+ * src/RequestGroup.cc
+
+2009-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
+
Added --dry-run option. In this mode, aria2 just checks whether
the remote file is available and doesn't download data. This
option has effect on HTTP/FTP downloads and BitTorrent downloads
diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc
index adc50835..d12d1b3f 100644
--- a/src/RequestGroup.cc
+++ b/src/RequestGroup.cc
@@ -209,6 +209,12 @@ void RequestGroup::createInitialCommand(std::deque<Command*>& commands,
throw DownloadFailureException
("Cancel BitTorrent download in dry-run context.");
}
+ SharedHandle<BtRegistry> btRegistry = e->getBtRegistry();
+ if(!btRegistry->getBtContext(btContext->getInfoHashAsString()).isNull()) {
+ throw DownloadFailureException
+ (StringFormat("InfoHash %s is already registered.",
+ btContext->getInfoHashAsString().c_str()).str());
+ }
if(e->_requestGroupMan->isSameFileBeingDownloaded(this)) {
throw DownloadFailureException
@@ -231,8 +237,6 @@ void RequestGroup::createInitialCommand(std::deque<Command*>& commands,
_pieceStorage,
_option));
- SharedHandle<BtRegistry> btRegistry = e->getBtRegistry();
-
btRegistry->registerBtContext(btContext->getInfoHashAsString(),
btContext);
btRegistry->registerPieceStorage(btContext->getInfoHashAsString(),