Lines Matching refs:ai
121 const struct addrinfo *ai; in Curl_getaddrinfo_ex() local
137 for(ai = aihead; ai != NULL; ai = ai->ai_next) { in Curl_getaddrinfo_ex()
141 if(ai->ai_family == AF_INET) in Curl_getaddrinfo_ex()
144 else if(ai->ai_family == AF_INET6) in Curl_getaddrinfo_ex()
151 if((ai->ai_addr == NULL) || !(ai->ai_addrlen > 0)) in Curl_getaddrinfo_ex()
155 if((size_t)ai->ai_addrlen < ss_size) in Curl_getaddrinfo_ex()
167 ca->ai_flags = ai->ai_flags; in Curl_getaddrinfo_ex()
168 ca->ai_family = ai->ai_family; in Curl_getaddrinfo_ex()
169 ca->ai_socktype = ai->ai_socktype; in Curl_getaddrinfo_ex()
170 ca->ai_protocol = ai->ai_protocol; in Curl_getaddrinfo_ex()
182 memcpy(ca->ai_addr, ai->ai_addr, ss_size); in Curl_getaddrinfo_ex()
184 if(ai->ai_canonname != NULL) { in Curl_getaddrinfo_ex()
185 ca->ai_canonname = strdup(ai->ai_canonname); in Curl_getaddrinfo_ex()
279 Curl_addrinfo *ai; in Curl_he2ai() local
306 ai = calloc(1, sizeof(Curl_addrinfo)); in Curl_he2ai()
307 if(!ai) { in Curl_he2ai()
311 ai->ai_canonname = strdup(he->h_name); in Curl_he2ai()
312 if(!ai->ai_canonname) { in Curl_he2ai()
314 free(ai); in Curl_he2ai()
317 ai->ai_addr = calloc(1, ss_size); in Curl_he2ai()
318 if(!ai->ai_addr) { in Curl_he2ai()
320 free(ai->ai_canonname); in Curl_he2ai()
321 free(ai); in Curl_he2ai()
327 firstai = ai; in Curl_he2ai()
331 prevai->ai_next = ai; in Curl_he2ai()
333 ai->ai_family = he->h_addrtype; in Curl_he2ai()
337 ai->ai_socktype = SOCK_STREAM; in Curl_he2ai()
339 ai->ai_addrlen = (curl_socklen_t)ss_size; in Curl_he2ai()
343 switch(ai->ai_family) { in Curl_he2ai()
345 addr = (void *)ai->ai_addr; /* storage area for this info */ in Curl_he2ai()
354 addr6 = (void *)ai->ai_addr; /* storage area for this info */ in Curl_he2ai()
363 prevai = ai; in Curl_he2ai()
399 Curl_addrinfo *ai; in Curl_ip2addr() local
460 ai = Curl_he2ai(h, port); in Curl_ip2addr()
465 return ai; in Curl_ip2addr()
497 Curl_addrinfo *ai; in Curl_unix2addr() local
503 ai = calloc(1, sizeof(Curl_addrinfo)); in Curl_unix2addr()
504 if(!ai) in Curl_unix2addr()
506 ai->ai_addr = calloc(1, sizeof(struct sockaddr_un)); in Curl_unix2addr()
507 if(!ai->ai_addr) { in Curl_unix2addr()
508 free(ai); in Curl_unix2addr()
512 sa_un = (void *) ai->ai_addr; in Curl_unix2addr()
518 free(ai->ai_addr); in Curl_unix2addr()
519 free(ai); in Curl_unix2addr()
524 ai->ai_family = AF_UNIX; in Curl_unix2addr()
525 ai->ai_socktype = SOCK_STREAM; /* assume reliable transport for HTTP */ in Curl_unix2addr()
526 ai->ai_addrlen = (curl_socklen_t) in Curl_unix2addr()
535 return ai; in Curl_unix2addr()