summaryrefslogtreecommitdiff
path: root/src/DHTEntryPointNameResolveCommand.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-13 15:17:08 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-13 15:17:08 +0000
commit13021233680e3fb3650075e2a71c1f234acb1803 (patch)
treee79c0138e86071486e18a0814df377b47050a0d0 /src/DHTEntryPointNameResolveCommand.h
parentbfcc3006703924fade80cbf41b4d682481618690 (diff)
2008-02-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to load nodes from torrent file. These nodes are added to the routing table when downloading that torrent. * src/BtContext.h * src/DefaultBtContext.{h, cc} * src/DHTSetup.cc * src/DHTEntryPointNameResolveCommand.{h, cc}: Now accepts list of hostname and port pair, and resolves all of them. * src/NameResolver.{h, cc}: Added reset(). * src/RequestGroup.cc * test/DefaultBtContextTest.cc * test/MockBtContext.h Removed assert() from DefaultBtContext and throw exception instead. * src/DefaultBtContext.cc
Diffstat (limited to 'src/DHTEntryPointNameResolveCommand.h')
-rw-r--r--src/DHTEntryPointNameResolveCommand.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/DHTEntryPointNameResolveCommand.h b/src/DHTEntryPointNameResolveCommand.h
index 3e72c872..ad4ca2c2 100644
--- a/src/DHTEntryPointNameResolveCommand.h
+++ b/src/DHTEntryPointNameResolveCommand.h
@@ -37,11 +37,14 @@
#include "Command.h"
#include "SharedHandle.h"
+#include <utility>
+#include <deque>
namespace aria2 {
class DHTTaskQueue;
class DHTTaskFactory;
+class DHTRoutingTable;
class DHTNode;
class DownloadEngine;
class NameResolver;
@@ -56,8 +59,18 @@ private:
SharedHandle<DHTTaskFactory> _taskFactory;
+ SharedHandle<DHTRoutingTable> _routingTable;
+
SharedHandle<DHTNode> _localNode;
+ std::deque<std::pair<std::string, uint16_t> > _entryPoints;
+
+ std::deque<std::pair<std::string, uint16_t> > _resolvedEntryPoints;
+
+ bool _bootstrapEnabled;
+
+ void addPingTask(const std::pair<std::string, uint16_t>& addr);
+
bool resolveHostname(const std::string& hostname,
const SharedHandle<NameResolver>& resolver);
@@ -66,16 +79,21 @@ private:
void disableNameResolverCheck(const SharedHandle<NameResolver>& resolver);
public:
- DHTEntryPointNameResolveCommand(int32_t cuid, DownloadEngine* e);
+ DHTEntryPointNameResolveCommand(int32_t cuid, DownloadEngine* e,
+ const std::deque<std::pair<std:: string, uint16_t> >& entryPoints);
virtual ~DHTEntryPointNameResolveCommand();
virtual bool execute();
+ void setBootstrapEnabled(bool f);
+
void setTaskQueue(const SharedHandle<DHTTaskQueue>& taskQueue);
void setTaskFactory(const SharedHandle<DHTTaskFactory>& taskFactory);
+ void setRoutingTable(const SharedHandle<DHTRoutingTable>& routingTable);
+
void setLocalNode(const SharedHandle<DHTNode>& localNode);
};