diff options
author | dec05eba <0xdec05eba@gmail.com> | 2018-10-28 02:17:09 +0200 |
---|---|---|
committer | dec05eba <0xdec05eba@gmail.com> | 2018-10-28 02:17:09 +0200 |
commit | c1322a271104d037684fb21e2cdced47c566a3c8 (patch) | |
tree | 933dfface84fb1c8b0b4cc7ad1fa226d11c59a0c /src | |
parent | e268dbeb982d92188c6515b9571b17d864d40ef6 (diff) | |
parent | 027ac0cba7ed1c55d95a4a4f36dc6c221134c4a4 (diff) |
Merge branch 'master' of https://gitlab.com/DEC05EBA/sibs-pubsub into HEAD
Diffstat (limited to 'src')
-rw-r--r-- | src/BootstrapConnection.cpp | 3 | ||||
-rw-r--r-- | src/DirectConnection.cpp | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/BootstrapConnection.cpp b/src/BootstrapConnection.cpp index d0731b9..4ace97c 100644 --- a/src/BootstrapConnection.cpp +++ b/src/BootstrapConnection.cpp @@ -240,7 +240,10 @@ namespace sibs bool BootstrapConnection::put(const PubsubKey &pubsubKey, const void *data, const usize size) { if(size > 819200) // 800kb + { + Log::error("No data was sent because you are trying to send more than 800kb"); return false; + } { std::lock_guard<std::recursive_mutex> lock(subscribeDataMutex); 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)? |