diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-02-20 23:41:39 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-02-20 23:41:39 +0000 |
commit | 858a7a599391c064481a630933f37c5ecd7c3fe5 (patch) | |
tree | a418743fdd9b44ac150bd5c6d78337349db748c7 /protocols/Tox/src/tox_network.cpp | |
parent | 1468a7f080de048e7c301af58d890d530c5ee685 (diff) |
Tox: reworked node list
git-svn-id: http://svn.miranda-ng.org/main/trunk@12226 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_network.cpp')
-rw-r--r-- | protocols/Tox/src/tox_network.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index dcc7f39153..8fa5d85aa5 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -8,23 +8,25 @@ bool CToxProto::IsOnline() int CToxProto::BootstrapNodesFromDb(bool isIPv6)
{
int nodesLoaded = 0;
- int nodeCount = db_get_w(NULL, MODULE, TOX_SETTINGS_NODE_COUNT, 0);
+ char module[MAX_PATH];
+ mir_snprintf(module, SIZEOF(module), "%s_NODES", m_szModuleName);
+ int nodeCount = db_get_w(NULL, module, TOX_SETTINGS_NODE_COUNT, 0);
if (nodeCount > 0)
{
char setting[MAX_PATH];
for (int i = 0; i < nodeCount; i++)
{
mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, i);
- ptrA address(db_get_sa(NULL, MODULE, setting));
+ ptrA address(db_get_sa(NULL, module, setting));
mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, i);
- int port = db_get_w(NULL, MODULE, setting, 33445);
+ int port = db_get_w(NULL, module, setting, 33445);
mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, i);
- ptrA pubKey(db_get_sa(NULL, MODULE, setting));
+ ptrA pubKey(db_get_sa(NULL, module, setting));
nodesLoaded += tox_bootstrap_from_address(tox, address, port, ToxBinAddress(pubKey));
if (isIPv6)
{
mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, i);
- address = db_get_sa(NULL, MODULE, setting);
+ address = db_get_sa(NULL, module, setting);
nodesLoaded += tox_bootstrap_from_address(tox, address, port, ToxBinAddress(pubKey));
}
}
@@ -125,7 +127,7 @@ void CToxProto::CheckConnection(int &retriesCount) }
else
{
- if (retriesCount == TOX_MAX_DISCONNECT_RETRIES - 10)
+ if (retriesCount == TOX_MAX_DISCONNECT_RETRIES - 20)
{
debugLogA("CToxProto::CheckConnection: lost connection with DHT");
retriesCount--;
|