diff options
author | Coren[m] <Break@Ocean> | 2013-09-10 22:59:33 +0200 |
---|---|---|
committer | Coren[m] <Break@Ocean> | 2013-09-10 22:59:33 +0200 |
commit | 64ca4b5db23dbb68d1b01e307837c9fb89283256 (patch) | |
tree | b8544dbb4146415dc48caa37946e6651c37ce519 /toxcore/DHT.c | |
parent | e89dda5cea04f217d7981d567de963cc8f2e76c7 (diff) |
tox.*, DHT.*:
- return to the caller if the string could be resolved into an IP
other/DHT_bootstrap.c, testing/*_test.c, testing/nTox.c:
- parse cmdline for --ipv4/--ipv6 switch to allow user a choice
util.h:
- proper old-style C-comment
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r-- | toxcore/DHT.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 7663b1cc..1798ea1a 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c | |||
@@ -978,14 +978,17 @@ void DHT_bootstrap(DHT *dht, IP_Port ip_port, uint8_t *public_key) | |||
978 | getnodes(dht, ip_port, public_key, dht->c->self_public_key); | 978 | getnodes(dht, ip_port, public_key, dht->c->self_public_key); |
979 | send_ping_request(dht->ping, dht->c, ip_port, public_key); | 979 | send_ping_request(dht->ping, dht->c, ip_port, public_key); |
980 | } | 980 | } |
981 | void DHT_bootstrap_ex(DHT *dht, const char *address, uint8_t ipv6enabled, uint16_t port, uint8_t *public_key) | 981 | int DHT_bootstrap_ex(DHT *dht, const char *address, uint8_t ipv6enabled, uint16_t port, uint8_t *public_key) |
982 | { | 982 | { |
983 | IP_Port ip_port; | 983 | IP_Port ip_port; |
984 | ip_init(&ip_port.ip, ipv6enabled); | 984 | ip_init(&ip_port.ip, ipv6enabled); |
985 | if (addr_resolve_or_parse_ip(address, &ip_port.ip)) { | 985 | if (addr_resolve_or_parse_ip(address, &ip_port.ip)) { |
986 | ip_port.port = port; | 986 | ip_port.port = port; |
987 | DHT_bootstrap(dht, ip_port, public_key); | 987 | DHT_bootstrap(dht, ip_port, public_key); |
988 | return 1; | ||
988 | } | 989 | } |
990 | else | ||
991 | return 0; | ||
989 | } | 992 | } |
990 | 993 | ||
991 | /* Send the given packet to node with client_id | 994 | /* Send the given packet to node with client_id |