| 926 | } |
| 927 | |
| 928 | static int |
| 929 | setup_socks_servers(ParentRecord *rec_arr, int len) |
| 930 | { |
| 931 | /* This changes hostnames into ip addresses and sets go_direct to false */ |
| 932 | for (int j = 0; j < len; j++) { |
| 933 | rec_arr[j].go_direct = false; |
| 934 | |
| 935 | pRecord *pr = rec_arr[j].parents; |
| 936 | int n_parents = rec_arr[j].num_parents; |
| 937 | |
| 938 | for (int i = 0; i < n_parents; i++) { |
| 939 | IpEndpoint ip4, ip6; |
| 940 | if (0 == ats_ip_getbestaddrinfo(pr[i].hostname, &ip4, &ip6)) { |
| 941 | IpEndpoint *ip = ats_is_ip6(&ip6) ? &ip6 : &ip4; |
| 942 | ats_ip_ntop(ip, pr[i].hostname, MAXDNAME + 1); |
| 943 | } else { |
| 944 | Warning("Could not resolve socks server name \"%s\". " |
| 945 | "Please correct it", |
| 946 | pr[i].hostname); |
| 947 | snprintf(pr[i].hostname, MAXDNAME + 1, "255.255.255.255"); |
| 948 | } |
| 949 | } |
| 950 | } |
| 951 | |
| 952 | return 0; |
| 953 | } |
| 954 | |
| 955 | void |
| 956 | SocksServerConfig::reconfigure() |
no test coverage detected