summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-02-22 08:39:35 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-02-22 08:39:35 +0000
commit128e7c57a2fc7f6d158b2d3d0d55cf396059d46d (patch)
tree1b72b92caca95dd34d6c9847e8da17557c0a4a3c
parent808957a884ac8195484c2a7a662b99cc7a163b86 (diff)
Tox: tuned disconnecting algorithm
git-svn-id: http://svn.miranda-ng.org/main/trunk@12238 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/Tox/src/tox_network.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp
index 8fa5d85aa5..694d966753 100644
--- a/protocols/Tox/src/tox_network.cpp
+++ b/protocols/Tox/src/tox_network.cpp
@@ -127,9 +127,13 @@ void CToxProto::CheckConnection(int &retriesCount)
}
else
{
- if (retriesCount == TOX_MAX_DISCONNECT_RETRIES - 20)
+ if (retriesCount == TOX_MAX_DISCONNECT_RETRIES)
{
+ retriesCount--;
debugLogA("CToxProto::CheckConnection: lost connection with DHT");
+ }
+ else if (retriesCount % 50 == 0)
+ {
retriesCount--;
BootstrapNodes();
}