Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libfetch/common.c
Show First 20 Lines • Show All 489 Lines • ▼ Show 20 Lines | fetch_ssl_get_numeric_addrinfo(const char *hostname, size_t len) | ||||
memcpy(host, hostname, len); | memcpy(host, hostname, len); | ||||
host[len] = '\0'; | host[len] = '\0'; | ||||
memset(&hints, 0, sizeof(hints)); | memset(&hints, 0, sizeof(hints)); | ||||
hints.ai_family = PF_UNSPEC; | hints.ai_family = PF_UNSPEC; | ||||
hints.ai_socktype = SOCK_STREAM; | hints.ai_socktype = SOCK_STREAM; | ||||
hints.ai_protocol = 0; | hints.ai_protocol = 0; | ||||
hints.ai_flags = AI_NUMERICHOST; | hints.ai_flags = AI_NUMERICHOST; | ||||
/* port is not relevant for this purpose */ | /* port is not relevant for this purpose */ | ||||
getaddrinfo(host, "443", &hints, &res); | if (getaddrinfo(host, "443", &hints, &res) != 0) | ||||
res = NULL; | |||||
free(host); | free(host); | ||||
return res; | return res; | ||||
} | } | ||||
/* | /* | ||||
* Compare ip address in addrinfo with address passes. | * Compare ip address in addrinfo with address passes. | ||||
*/ | */ | ||||
static int | static int | ||||
▲ Show 20 Lines • Show All 879 Lines • Show Last 20 Lines |