mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
dht: remove processMessage
This commit is contained in:
1 parent
98ec789526
commit
024dd42e5a
2 files changed
+7
-24
No files matched your search
@@ -553,8 +553,6 @@ private:
|
||||
|
||||
bool neighbourhoodMaintenance(RoutingTable&);
|
||||
|
||||
void processMessage(const uint8_t *buf, size_t buflen, const SockAddr&);
|
||||
|
||||
void onError(Sp<net::Request> node, net::DhtProtocolException e);
|
||||
/* when our address is reported by a distant peer. */
|
||||
void onReportedAddr(const InfoHash& id, const SockAddr&);
|
||||
|
||||
+7
-22
@@ -1863,32 +1863,17 @@ Dht::maintainStorage(decltype(store)::value_type& storage, bool force, DoneCallb
|
||||
return announce_per_af;
|
||||
}
|
||||
|
||||
void
|
||||
Dht::processMessage(const uint8_t *buf, size_t buflen, const SockAddr& from)
|
||||
{
|
||||
if (buflen == 0)
|
||||
return;
|
||||
|
||||
try {
|
||||
network_engine.processMessage(buf, buflen, from);
|
||||
} catch (const std::exception& e) {
|
||||
DHT_LOG.e("Can't parse message from %s: %s", from.toString().c_str(), e.what());
|
||||
//auto code = e.getCode();
|
||||
//if (code == net::DhtProtocolException::INVALID_TID_SIZE or code == net::DhtProtocolException::WRONG_NODE_INFO_BUF_LEN) {
|
||||
/* This is really annoying, as it means that we will
|
||||
time-out all our searches that go through this node.
|
||||
Kill it. */
|
||||
//const auto& id = e.getNodeId();
|
||||
//blacklistNode(&id, from, fromlen);
|
||||
///}
|
||||
}
|
||||
}
|
||||
|
||||
time_point
|
||||
Dht::periodic(const uint8_t *buf, size_t buflen, const SockAddr& from)
|
||||
{
|
||||
scheduler.syncTime();
|
||||
processMessage(buf, buflen, from);
|
||||
if (buflen) {
|
||||
try {
|
||||
network_engine.processMessage(buf, buflen, from);
|
||||
} catch (const std::exception& e) {
|
||||
DHT_LOG.e("Can't parse message from %s: %s", from.toString().c_str(), e.what());
|
||||
}
|
||||
}
|
||||
return scheduler.run();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user