mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
allow to cancel request without network engine
This commit is contained in:
1 parent
040e3770ad
commit
91bf5bb41b
3 files changed
+16
-11
No files matched your search
@@ -273,13 +273,14 @@ NetworkEngine::processMessage(const uint8_t *buf, size_t buflen, const sockaddr*
|
||||
} else
|
||||
node->update(from, fromlen);
|
||||
|
||||
if (req->cancelled()) {
|
||||
DHT_LOG.ERROR("Request is cancelled: %d", msg.tid);
|
||||
onNewNode(node, 2);
|
||||
onReportedAddr(msg.id, (sockaddr*)&msg.addr.first, msg.addr.second);
|
||||
|
||||
if (req->cancelled() or req->expired() or (req->completed() and not req->persistent)) {
|
||||
requests.erase(reqp);
|
||||
return;
|
||||
}
|
||||
|
||||
onNewNode(node, 2);
|
||||
onReportedAddr(msg.id, (sockaddr*)&msg.addr.first, msg.addr.second);
|
||||
switch (msg.type) {
|
||||
case MessageType::Error: {
|
||||
if (msg.error_code == DhtProtocolException::UNAUTHORIZED
|
||||
|
||||
Reference in new issue
Block a user