mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 21:47:37 +03:00
2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added handling of dynamic cast failure. * src/DHTNodeLookupTask.cc * src/DHTPeerLookupTask.cc
This commit is contained in:
parent
9c277148b9
commit
34e6a1dc9a
3 changed files with 19 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Added handling of dynamic cast failure.
|
||||
* src/DHTNodeLookupTask.cc
|
||||
* src/DHTPeerLookupTask.cc
|
||||
|
||||
2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Added the ability to stop aria2 itself when given time has passed
|
||||
|
|
|
@ -50,7 +50,11 @@ std::deque<SharedHandle<DHTNode> >
|
|||
DHTNodeLookupTask::getNodesFromMessage(const SharedHandle<DHTMessage>& message)
|
||||
{
|
||||
SharedHandle<DHTFindNodeReplyMessage> m = message;
|
||||
return m->getClosestKNodes();
|
||||
if(m.isNull()) {
|
||||
return std::deque<SharedHandle<DHTNode> >();
|
||||
} else {
|
||||
return m->getClosestKNodes();
|
||||
}
|
||||
}
|
||||
|
||||
SharedHandle<DHTMessage>
|
||||
|
|
|
@ -59,13 +59,19 @@ DHTPeerLookupTask::DHTPeerLookupTask(const SharedHandle<BtContext>& btContext):
|
|||
std::deque<SharedHandle<DHTNode> > DHTPeerLookupTask::getNodesFromMessage(const SharedHandle<DHTMessage>& message)
|
||||
{
|
||||
SharedHandle<DHTGetPeersReplyMessage> m = message;
|
||||
return m->getClosestKNodes();
|
||||
if(m.isNull()) {
|
||||
return std::deque<SharedHandle<DHTNode> >();
|
||||
} else {
|
||||
return m->getClosestKNodes();
|
||||
}
|
||||
}
|
||||
|
||||
void DHTPeerLookupTask::onReceivedInternal(const SharedHandle<DHTMessage>& message)
|
||||
{
|
||||
SharedHandle<DHTGetPeersReplyMessage> m = message;
|
||||
|
||||
if(m.isNull()) {
|
||||
return;
|
||||
}
|
||||
SharedHandle<DHTNode> remoteNode = m->getRemoteNode();
|
||||
_tokenStorage[Util::toHex(remoteNode->getID(), DHT_ID_LENGTH)] = m->getToken();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue