diff options
author | irungentoo <irungentoo@gmail.com> | 2013-09-20 17:28:46 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-09-20 17:28:46 -0700 |
commit | 892c7aa2668b075e694df83cd00544101569ede0 (patch) | |
tree | 627b0e828d4b9c25faf0bfe04c8fc71fc8e240e3 /testing | |
parent | 01ec9d6e7bd9be9328d13aa30009b1f7559d1471 (diff) | |
parent | 330c1bee5ce3ccbca77f62336bfa84a0752a58ff (diff) |
Merge pull request #594 from FullName/nTox.KeepBootstrappingUntilConnected
nTox: keep bootstrap()ping every 10 seconds, until we get a connection...
Diffstat (limited to 'testing')
-rw-r--r-- | testing/nTox.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/testing/nTox.c b/testing/nTox.c index 33c8ab85..a9af5239 100644 --- a/testing/nTox.c +++ b/testing/nTox.c | |||
@@ -667,10 +667,19 @@ int main(int argc, char *argv[]) | |||
667 | new_lines(whoami); | 667 | new_lines(whoami); |
668 | } | 668 | } |
669 | 669 | ||
670 | time_t timestamp0 = time(NULL); | ||
670 | while (1) { | 671 | while (1) { |
671 | if (on == 0 && tox_isconnected(m)) { | 672 | if (on == 0) { |
672 | new_lines("[i] connected to DHT"); | 673 | if (tox_isconnected(m)) { |
673 | on = 1; | 674 | new_lines("[i] connected to DHT"); |
675 | on = 1; | ||
676 | } else { | ||
677 | time_t timestamp1 = time(NULL); | ||
678 | if (timestamp0 + 10 < timestamp1) { | ||
679 | timestamp0 = timestamp1; | ||
680 | tox_bootstrap_from_address(m, argv[argvoffset + 1], ipv6enabled, port, binary_string); | ||
681 | } | ||
682 | } | ||
674 | } | 683 | } |
675 | 684 | ||
676 | tox_do(m); | 685 | tox_do(m); |