MCPcopy Create free account
hub / github.com/apache/trafficserver / setup_socks_servers

Function setup_socks_servers

src/proxy/ParentSelection.cc:928–953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

926}
927
928static int
929setup_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
955void
956SocksServerConfig::reconfigure()

Callers 1

reconfigureMethod · 0.85

Calls 3

ats_ip_getbestaddrinfoFunction · 0.85
ats_is_ip6Function · 0.85
ats_ip_ntopFunction · 0.50

Tested by

no test coverage detected