aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksi Lindeman <dec05eba@protonmail.com>2018-11-25 02:46:02 +0100
committerAleksi Lindeman <dec05eba@protonmail.com>2018-11-25 02:46:02 +0100
commitdffdc71ce5a110fefb2f7d6c49e65069b8c7bc99 (patch)
treebca10179520f2e08ec7e37355894e3c9814d3730
parent3f6c75b1ee660b9fceefa1a021bae59b581637b7 (diff)
Route data
-rw-r--r--src/BootstrapConnection.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/BootstrapConnection.cpp b/src/BootstrapConnection.cpp
index f09547e..1e1ac43 100644
--- a/src/BootstrapConnection.cpp
+++ b/src/BootstrapConnection.cpp
@@ -85,9 +85,14 @@ namespace sibs
// TODO: This is vulnerable against MitM attack, replace with asymmetric cryptography, get data signed with server private key and verify against known server public key
void BootstrapConnection::receiveDataFromServer(std::shared_ptr<DirectConnectionPeer> peer, MessageType messageType, const void *data, const usize size)
{
- if(messageType != MessageType::SUBSCRIBE)
+ if(messageType == MessageType::DATA)
+ {
+ receiveDataFromPeer(peer, messageType, data, size);
+ return;
+ }
+ else if(messageType != MessageType::SUBSCRIBE)
{
- Log::warn("BootstrapConnection::receiveDataFromServer: received message from server that was not subscribe");
+ Log::warn("BootstrapConnection::receiveDataFromServer: received message from server that was not subscribe or data");
return;
}