/* */ #ifndef _D_DHT_ENTRY_POINT_NAME_RESOVE_COMMAND_H_ #define _D_DHT_ENTRY_POINT_NAME_RESOVE_COMMAND_H_ #include "Command.h" #include "SharedHandle.h" #include #include namespace aria2 { class DHTTaskQueue; class DHTTaskFactory; class DHTRoutingTable; class DHTNode; class DownloadEngine; #ifdef ENABLE_ASYNC_DNS class AsyncNameResolver; #endif // ENABLE_ASYNC_DNS class DHTEntryPointNameResolveCommand:public Command { protected: DownloadEngine* _e; private: #ifdef ENABLE_ASYNC_DNS SharedHandle _resolver; #endif // ENABLE_ASYNC_DNS SharedHandle _taskQueue; SharedHandle _taskFactory; SharedHandle _routingTable; SharedHandle _localNode; std::deque > _entryPoints; std::deque > _resolvedEntryPoints; bool _bootstrapEnabled; void addPingTask(const std::pair& addr); #ifdef ENABLE_ASYNC_DNS bool resolveHostname(const std::string& hostname, const SharedHandle& resolver); void setNameResolverCheck(const SharedHandle& resolver); void disableNameResolverCheck(const SharedHandle& resolver); #endif // ENABLE_ASYNC_DNS public: DHTEntryPointNameResolveCommand(int32_t cuid, DownloadEngine* e, const std::deque >& entryPoints); virtual ~DHTEntryPointNameResolveCommand(); virtual bool execute(); void setBootstrapEnabled(bool f); void setTaskQueue(const SharedHandle& taskQueue); void setTaskFactory(const SharedHandle& taskFactory); void setRoutingTable(const SharedHandle& routingTable); void setLocalNode(const SharedHandle& localNode); }; } // namespace aria2 #endif // _D_DHT_ENTRY_POINT_NAME_RESOVE_COMMAND_H_