mirror of https://github.com/aria2/aria2
2009-04-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Avoid dynamic_pointer_cast. * src/DHTGetPeersCommand.cc * src/DHTGetPeersCommand.hpull/1/head
parent
afdd61f9d1
commit
0414c71956
|
@ -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<DHTPeerLookupTask>
|
||||
(_taskFactory->createPeerLookupTask(_btContext, _btRuntime,
|
||||
_peerStorage));
|
||||
_task = _taskFactory->createPeerLookupTask(_btContext, _btRuntime,
|
||||
_peerStorage);
|
||||
_taskQueue->addPeriodicTask2(_task);
|
||||
} else if(!_task.isNull() && _task->finished()) {
|
||||
_lastGetPeerTime.reset();
|
||||
|
|
|
@ -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<DHTTaskFactory> _taskFactory;
|
||||
|
||||
SharedHandle<DHTPeerLookupTask> _task;
|
||||
SharedHandle<DHTTask> _task;
|
||||
|
||||
size_t _numRetry;
|
||||
|
||||
|
|
Loading…
Reference in New Issue