From 0554e4bfdf2e24419c2b9facceaecc6e9d4764ec Mon Sep 17 00:00:00 2001 From: dec05eba <0xdec05eba@gmail.com> Date: Fri, 19 Oct 2018 23:10:36 +0200 Subject: Add put retry --- depends/sibs-pubsub | 2 +- src/Database.cpp | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/depends/sibs-pubsub b/depends/sibs-pubsub index 3565289..5425446 160000 --- a/depends/sibs-pubsub +++ b/depends/sibs-pubsub @@ -1 +1 @@ -Subproject commit 3565289c19974ca874f87429cc74a87558249c8e +Subproject commit 54254462e432dcc6ef2bb306a9ee773d21314d19 diff --git a/src/Database.cpp b/src/Database.cpp index 50b5044..4422e1c 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -647,9 +647,6 @@ namespace odhtdb { InfoHash responseKey = receiveMessageKey; ++responseKey[0]; - - if(!bootstrapConnection.areWeListeningOnKey(responseKey.getKey())) - bootstrapConnection.listen(responseKey.getKey(), nullptr); return bootstrapConnection.listen(receiveMessageKey.getKey(), [callbackFunc, this, responseKey](const sibs::DirectConnectionPeer *peer, const void *data, const usize size) { @@ -664,11 +661,6 @@ namespace odhtdb void Database::sendCustomMessage(const InfoHash &requestKey, const void *data, const usize size) { - if(!bootstrapConnection.areWeListeningOnKey(requestKey.getKey())) - { - bootstrapConnection.listen(requestKey.getKey(), nullptr); - std::this_thread::sleep_for(std::chrono::seconds(3)); - } bootstrapConnection.put(requestKey.getKey(), data, size); } -- cgit v1.2.3