1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-30 03:56:45 +02:00

Ignore bootstrap nodes that use a domain instead of IP address

Domains cause toxcore to do blocking DNS requests which creates noticable lag
and might (??) leak IP addresses when using a proxy
This commit is contained in:
Jfreegman
2016-09-21 00:28:16 -04:00
parent 151f5f0c51
commit 221d761ff4
3 changed files with 17 additions and 1 deletions

View File

@ -77,7 +77,6 @@ static struct DHT_Nodes {
char keys[MAXNODES][TOX_PUBLIC_KEY_SIZE];
} Nodes;
/* Return true if nodeslist pointed to by fp needs to be updated.
* This will be the case if the file is empty, has an invalid format,
* or if the file is older than the given timeout.
@ -297,6 +296,11 @@ int load_DHT_nodeslist(void)
memcpy(ipv4_string, ip_start, ip_len);
ipv4_string[ip_len] = 0;
/* ignore domains because we don't want toxcore doing DNS requests during bootstrap. */
if (!is_ip4_address(ipv4_string)) {
continue;
}
/* Extract port */
const char *port_start = strstr(ip_start, PORT_JSON_VALUE);