diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-10-27 00:24:13 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 22:56:48 +0200 |
commit | 0b8f250676a3eec8f9ed8e46f56962ba1324c7f9 (patch) | |
tree | bf8a9d49ded14dfdb0513d1804e5beaf8d98dafd /src/DirectConnection.cpp | |
parent | 314b92c0e37c6896ecabc391a4e1594fc86c2fdb (diff) |
Add debug when send fails
Diffstat (limited to 'src/DirectConnection.cpp')
-rw-r--r-- | src/DirectConnection.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/DirectConnection.cpp b/src/DirectConnection.cpp index 8243b50..b548a02 100644 --- a/src/DirectConnection.cpp +++ b/src/DirectConnection.cpp @@ -185,10 +185,16 @@ namespace sibs bool DirectConnections::send(const std::shared_ptr<DirectConnectionPeer> peer, std::shared_ptr<Message> data, PubSubSendDataCallback sendDataCallbackFunc) { if(data->getDataSize() == 0) + { + Log::warn("No data sent because you are trying to send 0 bytes"); return true; + } if(data->getDataSize() > 819200) // 800kb + { + Log::error("Data not sent, data was over 800kb"); return false; + } Log::debug("DirectConnections::send: sending %d bytes to %s:%d", data->getRawSize(), peer->address.getAddress().c_str(), peer->address.getPort()); // TODO: Replace this with light-weight threads (fibers)? |