fix for systems without gethostbyname_r()

This commit is contained in:
Daniel Stenberg 2004-06-24 11:58:43 +00:00
Родитель feb2dd2835
Коммит e49a6feabb
1 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -355,13 +355,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
infof(data, "gethostbyname(2) failed for %s\n", hostname); infof(data, "gethostbyname(2) failed for %s\n", hostname);
else { else {
/* /*
* Copy the hostent struct right here, as the static one we got a * Translate the hostent to Curl_addrinfo and return the allocated
* pointer to might get removed when we don't want/expect that. Windows * data.
* (other platforms?) also doesn't allow passing of the returned data
* between threads, which thus the copying here them allows the app to
* do.
*/ */
return Curl_addrinfo_copy(h); return Curl_addrinfo_copy(h, port);
} }
#endif /*HAVE_GETHOSTBYNAME_R */ #endif /*HAVE_GETHOSTBYNAME_R */
} }