version 1.29, 2000/05/02 00:54:53 |
version 1.30, 2000/05/03 19:50:41 |
|
|
hints.ai_socktype = SOCK_STREAM; |
hints.ai_socktype = SOCK_STREAM; |
port = portnum ? portnum : httpport; |
port = portnum ? portnum : httpport; |
error = getaddrinfo(host, port, &hints, &res0); |
error = getaddrinfo(host, port, &hints, &res0); |
|
if (error == EAI_SERVICE && port == httpport) { |
|
/* |
|
* If the services file is corrupt/missing, fall back |
|
* on our hard-coded defines. |
|
*/ |
|
char pbuf[NI_MAXSERV]; |
|
|
|
snprintf(pbuf, sizeof(pbuf), "%d", HTTP_PORT); |
|
error = getaddrinfo(host, pbuf, &hints, &res0); |
|
} |
if (error) { |
if (error) { |
warnx("%s: %s", gai_strerror(error), host); |
warnx("%s: %s", gai_strerror(error), host); |
goto cleanup_url_get; |
goto cleanup_url_get; |