fix case where proxy was using a DNS name or non-dotted ipv4

it is generally invalid to use a DNS name since DNS subsystem
is only available once connected to the proxy; because
DNS is done server-side.

closes #19
This commit is contained in:
rofl0r 2013-05-02 13:40:56 +02:00
parent 9f6ed6ed90
commit 64a7cd26dc

View File

@ -192,7 +192,12 @@ static void get_chain_data(proxy_data * pd, unsigned int *proxy_count, chain_typ
sscanf(buff, "%s %s %d %s %s", type, host, &port_n, pd[count].user, pd[count].pass); sscanf(buff, "%s %s %d %s %s", type, host, &port_n, pd[count].user, pd[count].pass);
pd[count].ip.as_int = (uint32_t) inet_addr(host); in_addr_t host_ip = inet_addr(host);
if(host_ip == INADDR_NONE) {
fprintf(stderr, "proxy %s has invalid value or is not numeric\n", host);
exit(1);
}
pd[count].ip.as_int = (uint32_t) host_ip;
pd[count].port = htons((unsigned short) port_n); pd[count].port = htons((unsigned short) port_n);
if(!strcmp(type, "http")) { if(!strcmp(type, "http")) {