summaryrefslogtreecommitdiff
path: root/other/DHT_bootstrap.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-09-14 12:42:17 -0400
committerirungentoo <irungentoo@gmail.com>2013-09-14 12:42:17 -0400
commit12d1c5199bd2feecd93424ff57f44fab4bbb02ad (patch)
treecd5a20e0c995199a383efd0a77ca0efb0033cfb6 /other/DHT_bootstrap.c
parent64d000cdfaed710d3e22fa5444b8c2883b9f09d6 (diff)
astyled everything.
Diffstat (limited to 'other/DHT_bootstrap.c')
-rw-r--r--other/DHT_bootstrap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/other/DHT_bootstrap.c b/other/DHT_bootstrap.c
index 246ae818..484a511c 100644
--- a/other/DHT_bootstrap.c
+++ b/other/DHT_bootstrap.c
@@ -94,6 +94,7 @@ int main(int argc, char *argv[])
94 /* let user override default by cmdline */ 94 /* let user override default by cmdline */
95 uint8_t ipv6enabled = TOX_ENABLE_IPV6_DEFAULT; /* x */ 95 uint8_t ipv6enabled = TOX_ENABLE_IPV6_DEFAULT; /* x */
96 int argvoffset = cmdline_parsefor_ipv46(argc, argv, &ipv6enabled); 96 int argvoffset = cmdline_parsefor_ipv46(argc, argv, &ipv6enabled);
97
97 if (argvoffset < 0) 98 if (argvoffset < 0)
98 exit(1); 99 exit(1);
99 100
@@ -130,7 +131,7 @@ int main(int argc, char *argv[])
130 uint16_t port = htons(atoi(argv[argvoffset + 2])); 131 uint16_t port = htons(atoi(argv[argvoffset + 2]));
131 uint8_t *bootstrap_key = hex_string_to_bin(argv[argvoffset + 3]); 132 uint8_t *bootstrap_key = hex_string_to_bin(argv[argvoffset + 3]);
132 int res = DHT_bootstrap_from_address(dht, argv[argvoffset + 1], 133 int res = DHT_bootstrap_from_address(dht, argv[argvoffset + 1],
133 ipv6enabled, port, bootstrap_key); 134 ipv6enabled, port, bootstrap_key);
134 free(bootstrap_key); 135 free(bootstrap_key);
135 136
136 if (!res) { 137 if (!res) {
@@ -151,6 +152,7 @@ int main(int argc, char *argv[])
151 } 152 }
152 153
153 do_DHT(dht); 154 do_DHT(dht);
155
154 if (last_LANdiscovery + (is_waiting_for_dht_connection ? 5 : LAN_DISCOVERY_INTERVAL) < unix_time()) { 156 if (last_LANdiscovery + (is_waiting_for_dht_connection ? 5 : LAN_DISCOVERY_INTERVAL) < unix_time()) {
155 send_LANdiscovery(htons(PORT), dht->c); 157 send_LANdiscovery(htons(PORT), dht->c);
156 last_LANdiscovery = unix_time(); 158 last_LANdiscovery = unix_time();