From ab807bf3e87863ef97412faf83dc2cac697d6a23 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 9 Aug 2014 17:57:16 +0000 Subject: use more nodes git-svn-id: http://svn.miranda-ng.org/main/trunk@10138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_proto.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'protocols/Tox/src/tox_proto.cpp') diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index e2cc4f0407..b5bd446cb5 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -157,34 +157,27 @@ int __cdecl CToxProto::SetStatus(int iNewStatus) char *name = "my_nickname"; int res = tox_set_name(tox, (uint8_t*)name, strlen(name)); - char *pub_key = HexToBinString(BOOTSTRAP_KEY); - res = tox_bootstrap_from_address(tox, BOOTSTRAP_ADDRESS, 1, htons(BOOTSTRAP_PORT), (uint8_t *)pub_key); - //mir_free(pub_key); - if (!res) - { - SetStatus(ID_STATUS_OFFLINE); - } + do_bootstrap(tox); time_t timestamp0 = time(NULL); int on = 0; while (1) { + tox_do(tox); + if (on == 0) { if (tox_isconnected(tox)) { - //new_lines("[i] connected to DHT"); on = 1; - mir_free(pub_key); } else { time_t timestamp1 = time(NULL); if (timestamp0 + 10 < timestamp1) { timestamp0 = timestamp1; - tox_bootstrap_from_address(tox, BOOTSTRAP_ADDRESS, 1, htons(BOOTSTRAP_PORT), (uint8_t *)pub_key); + do_bootstrap(tox); } } } - tox_do(tox); } res = tox_isconnected(tox); -- cgit v1.2.3