mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
network engine: print error if send fails
for now just print an error
This commit is contained in:
1 parent
3b2e5a13bf
commit
696ac1bbd5
2 files changed
+6
-5
No files matched your search
@@ -605,11 +605,11 @@ insertAddr(msgpack::packer<msgpack::sbuffer>& pk, const SockAddr& addr)
|
||||
pk.pack_bin_body((char*)addr_ptr, addr_len);
|
||||
}
|
||||
|
||||
int
|
||||
void
|
||||
NetworkEngine::send(const char *buf, size_t len, int flags, const SockAddr& addr)
|
||||
{
|
||||
if (addr.second == 0)
|
||||
return -1;
|
||||
return;
|
||||
|
||||
int s;
|
||||
if (addr.getFamily() == AF_INET)
|
||||
@@ -620,8 +620,9 @@ NetworkEngine::send(const char *buf, size_t len, int flags, const SockAddr& addr
|
||||
s = -1;
|
||||
|
||||
if (s < 0)
|
||||
return -1;
|
||||
return sendto(s, buf, len, flags, (const sockaddr*)&addr.first, addr.second);
|
||||
return;
|
||||
if (sendto(s, buf, len, flags, (const sockaddr*)&addr.first, addr.second) == -1)
|
||||
DHT_LOG.e("Can't send message to %s: %s", addr.toString().c_str(), strerror(errno));
|
||||
}
|
||||
|
||||
Sp<Request>
|
||||
|
||||
Reference in new issue
Block a user