summaryrefslogtreecommitdiff
path: root/other/DHT_bootstrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'other/DHT_bootstrap.c')
-rw-r--r--other/DHT_bootstrap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c
index 4a5d937d..af5fae01 100644
--- a/other/DHT_bootstrap.c
+++ b/other/DHT_bootstrap.c
@@ -1,3 +1,4 @@
1
1/* DHT boostrap 2/* DHT boostrap
2 * 3 *
3 * A simple DHT boostrap server for tox. 4 * A simple DHT boostrap server for tox.
@@ -20,6 +21,7 @@
20 * along with Tox. If not, see <http://www.gnu.org/licenses/>. 21 * along with Tox. If not, see <http://www.gnu.org/licenses/>.
21 * 22 *
22 */ 23 */
24
23#ifdef HAVE_CONFIG_H 25#ifdef HAVE_CONFIG_H
24#include "config.h" 26#include "config.h"
25#endif 27#endif
@@ -27,6 +29,8 @@
27#include "../toxcore/DHT.h" 29#include "../toxcore/DHT.h"
28#include "../toxcore/LAN_discovery.h" 30#include "../toxcore/LAN_discovery.h"
29#include "../toxcore/friend_requests.h" 31#include "../toxcore/friend_requests.h"
32#include "../toxcore/util.h"
33
30#include "../testing/misc_tools.c" 34#include "../testing/misc_tools.c"
31 35
32/* Sleep function (x = milliseconds) */ 36/* Sleep function (x = milliseconds) */
@@ -147,7 +151,7 @@ int main(int argc, char *argv[])
147 151
148 do_DHT(dht); 152 do_DHT(dht);
149 153
150 if (last_LANdiscovery + (is_waiting_for_dht_connection ? 5 : LAN_DISCOVERY_INTERVAL) < unix_time()) { 154 if (is_timeout(last_LANdiscovery, is_waiting_for_dht_connection ? 5 : LAN_DISCOVERY_INTERVAL)) {
151 send_LANdiscovery(htons(PORT), dht->c); 155 send_LANdiscovery(htons(PORT), dht->c);
152 last_LANdiscovery = unix_time(); 156 last_LANdiscovery = unix_time();
153 } 157 }