Browse Source

2009-12-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Fixed the bug that DHT is always enabled when BitTorrent Magnet
	URI is supplied. Notify user that they should consider enabling
	DHT if they use Magnet URI.
	* src/RequestGroup.cc
Tatsuhiro Tsujikawa 16 years ago
parent
commit
7bc6fc54a1
2 changed files with 15 additions and 3 deletions
  1. 7 0
      ChangeLog
  2. 8 3
      src/RequestGroup.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2009-12-05  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Fixed the bug that DHT is always enabled when BitTorrent Magnet
+	URI is supplied. Notify user that they should consider enabling
+	DHT if they use Magnet URI.
+	* src/RequestGroup.cc
+
 2009-12-05  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Added --disable-ipv6 option to disable IPv6.

+ 8 - 3
src/RequestGroup.cc

@@ -277,9 +277,14 @@ void RequestGroup::createInitialCommand
 				SharedHandle<BtProgressInfoFile>
 				(progressInfoFile))));
       if(metadataGetMode) {
-	std::deque<Command*> dhtCommands;
-	DHTSetup().setup(dhtCommands, e, _option.get());
-	e->addCommand(dhtCommands);
+	if(_option->getAsBool(PREF_ENABLE_DHT)) {
+	  std::deque<Command*> dhtCommands;
+	  DHTSetup().setup(dhtCommands, e, _option.get());
+	  e->addCommand(dhtCommands);
+	} else {
+	  _logger->notice("For BitTorrent Magnet URI, enabling DHT is strongly"
+			  " recommended. See --enable-dht option.");
+	}
 
 	SharedHandle<CheckIntegrityEntry> entry
 	  (new BtCheckIntegrityEntry(this));