mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
network engine: handle unexpected node id
This commit is contained in:
1 parent
db6c301084
commit
bd72c6468f
2 files changed
+16
-6
No files matched your search
@@ -28,6 +28,8 @@ NodeCache::getNode(const InfoHash& id, sa_family_t family) {
|
||||
|
||||
std::shared_ptr<Node>
|
||||
NodeCache::getNode(const InfoHash& id, const sockaddr* sa, socklen_t sa_len, time_point now, int confirm) {
|
||||
if (id == zeroes)
|
||||
return std::make_shared<Node>(id, sa, sa_len);
|
||||
return (sa->sa_family == AF_INET ? cache_4 : cache_6).getNode(id, sa, sa_len, now, confirm);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user