aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/BootstrapConnection.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/BootstrapConnection.cpp b/src/BootstrapConnection.cpp
index f83b21c..55e49df 100644
--- a/src/BootstrapConnection.cpp
+++ b/src/BootstrapConnection.cpp
@@ -252,17 +252,18 @@ namespace sibs
{
Log::warn("BootstrapConnection::put with no subscribers on same key '%s'", pubsubKey.toString().c_str());
std::this_thread::sleep_for(std::chrono::milliseconds(200));
- continue;
+ goto checkPutAttemptDuration;
}
listenStartTimeMs = subscribeIt->second.listenStartTimeMs;
for(auto &peer : subscribeIt->second.peers)
{
- if(peersMessaged.find(peer->socket->udtSocket) != peersMessaged.end())
- continue;
- peersToMessage.push_back(peer);
- peersMessaged.insert(peer->socket->udtSocket);
+ if(peersMessaged.find(peer->socket->udtSocket) == peersMessaged.end())
+ {
+ peersToMessage.push_back(peer);
+ peersMessaged.insert(peer->socket->udtSocket);
+ }
}
}
@@ -275,6 +276,7 @@ namespace sibs
peersToMessage.clear();
}
+ checkPutAttemptDuration:
const i64 half_min_ms = 1000 * 30;
i64 now = chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now().time_since_epoch()).count();
if(now - listenStartTimeMs > half_min_ms)