From 2e6595fe6183fc9e388449abf3a105d43f96f7fa Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 25 Nov 2018 02:46:02 +0100 Subject: Route data --- src/BootstrapConnection.cpp | 9 +++++++-- 1 file 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 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; } -- cgit v1.2.3