Lines Matching refs:ai
23 bool IsAllLocalhostOfOneFamily(const struct addrinfo* ai) {
26 for (; ai != NULL; ai = ai->ai_next) {
27 switch (ai->ai_family) {
30 reinterpret_cast<struct sockaddr_in*>(ai->ai_addr);
39 reinterpret_cast<struct sockaddr_in6*>(ai->ai_addr);
141 struct addrinfo* ai = NULL;
199 int err = getaddrinfo(host.c_str(), NULL, &hints, &ai);
219 err == 0 && IsAllLocalhostOfOneFamily(ai)) {
230 if (ai != NULL) {
231 freeaddrinfo(ai);
232 ai = NULL;
234 err = getaddrinfo(host.c_str(), NULL, &hints, &ai);
238 if (err || ai == NULL) {
263 addrlist->Adopt(ai);