Lines Matching refs:addrs
220 http_alloc(const struct source *addrs, size_t addrsz, in http_alloc() argument
239 if (addrs[cur].family == 4) { in http_alloc()
243 c = inet_pton(AF_INET, addrs[cur].ip, in http_alloc()
246 } else if (addrs[cur].family == 6) { in http_alloc()
250 c = inet_pton(AF_INET6, addrs[cur].ip, in http_alloc()
254 warnx("%s: unknown family", addrs[cur].ip); in http_alloc()
259 warn("%s: inet_ntop", addrs[cur].ip); in http_alloc()
262 warnx("%s: inet_ntop", addrs[cur].ip); in http_alloc()
270 warn("%s: socket", addrs[cur].ip); in http_alloc()
273 warn("%s: connect", addrs[cur].ip); in http_alloc()
288 http->src.family = addrs[cur].family; in http_alloc()
289 http->src.ip = strdup(addrs[cur].ip); in http_alloc()
674 http_get(const struct source *addrs, size_t addrsz, const char *domain, in http_get() argument
685 h = http_alloc(addrs, addrsz, domain, port, path); in http_get()
740 struct source addrs[2];
744 addrs[0].ip = "127.0.0.1";
745 addrs[0].family = 4;
748 addrs[0].ip = "2a00:1450:400a:806::2004";
749 addrs[0].family = 6;
750 addrs[1].ip = "193.135.3.123";
751 addrs[1].family = 4;
759 g = http_get(addrs, addrsz, "localhost", 80, "/index.html");
761 g = http_get(addrs, addrsz, "www.google.ch", 80, "/index.html",