From 64ca4b5db23dbb68d1b01e307837c9fb89283256 Mon Sep 17 00:00:00 2001 From: "Coren[m]" Date: Tue, 10 Sep 2013 22:59:33 +0200 Subject: 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 --- toxcore/DHT.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'toxcore/DHT.c') 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) getnodes(dht, ip_port, public_key, dht->c->self_public_key); send_ping_request(dht->ping, dht->c, ip_port, public_key); } -void DHT_bootstrap_ex(DHT *dht, const char *address, uint8_t ipv6enabled, uint16_t port, uint8_t *public_key) +int DHT_bootstrap_ex(DHT *dht, const char *address, uint8_t ipv6enabled, uint16_t port, uint8_t *public_key) { IP_Port ip_port; ip_init(&ip_port.ip, ipv6enabled); if (addr_resolve_or_parse_ip(address, &ip_port.ip)) { ip_port.port = port; DHT_bootstrap(dht, ip_port, public_key); + return 1; } + else + return 0; } /* Send the given packet to node with client_id -- cgit v1.2.3