From 0414c719565a5362e6aebb79680f382ac6d689f3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 21 Apr 2009 15:15:10 +0000 Subject: [PATCH] 2009-04-22 Tatsuhiro Tsujikawa Avoid dynamic_pointer_cast. * src/DHTGetPeersCommand.cc * src/DHTGetPeersCommand.h --- src/DHTGetPeersCommand.cc | 6 ++---- src/DHTGetPeersCommand.h | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/DHTGetPeersCommand.cc b/src/DHTGetPeersCommand.cc index 7981e1c9..f3ffbd10 100644 --- a/src/DHTGetPeersCommand.cc +++ b/src/DHTGetPeersCommand.cc @@ -38,7 +38,6 @@ #include "DHTTask.h" #include "DownloadEngine.h" #include "RequestGroup.h" -#include "DHTPeerLookupTask.h" #include "DHTNode.h" #include "DHTNodeLookupEntry.h" #include "BtContext.h" @@ -73,9 +72,8 @@ bool DHTGetPeersCommand::execute() _lastGetPeerTime.elapsed(GET_PEER_INTERVAL))) { logger->debug("Issuing PeerLookup for infoHash=%s", _btContext->getInfoHashAsString().c_str()); - _task = dynamic_pointer_cast - (_taskFactory->createPeerLookupTask(_btContext, _btRuntime, - _peerStorage)); + _task = _taskFactory->createPeerLookupTask(_btContext, _btRuntime, + _peerStorage); _taskQueue->addPeriodicTask2(_task); } else if(!_task.isNull() && _task->finished()) { _lastGetPeerTime.reset(); diff --git a/src/DHTGetPeersCommand.h b/src/DHTGetPeersCommand.h index fc44f48d..27548d10 100644 --- a/src/DHTGetPeersCommand.h +++ b/src/DHTGetPeersCommand.h @@ -44,7 +44,7 @@ namespace aria2 { class DHTTaskQueue; class DHTTaskFactory; -class DHTPeerLookupTask; +class DHTTask; class DownloadEngine; class RequestGroup; class BtContext; @@ -73,7 +73,7 @@ private: SharedHandle _taskFactory; - SharedHandle _task; + SharedHandle _task; size_t _numRetry;