diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-11-25 02:46:02 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 22:56:48 +0200 |
commit | 2e6595fe6183fc9e388449abf3a105d43f96f7fa (patch) | |
tree | 734dab354ed4aba3f31e867d379bcb97281e17f8 /src | |
parent | 168fa4889c230de9016e1371e65da49a8d36e16c (diff) |
Route data
Diffstat (limited to 'src')
-rw-r--r-- | src/BootstrapConnection.cpp | 9 |
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; } |