1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-11 12:05:06 -05:00

Markus Koetter provided a patch to avoid getnameinfo() usage which broke a couple of both IPv4 and IPv6 autobuilds.

This commit is contained in:
Gunter Knauf 2009-07-04 01:04:23 +00:00
parent 3050f10676
commit 83fb285d40
2 changed files with 15 additions and 10 deletions

View File

@ -6,6 +6,10 @@
Changelog
Guenter Knauf (4 Jul 2009)
- Markus Koetter provided a patch to avoid getnameinfo() usage which broke a
couple of both IPv4 and IPv6 autobuilds.
Daniel Stenberg (29 Jun 2009)
- Markus Koetter made CURLOPT_FTPPORT (and curl's -P/--ftpport) support a port
range if given colon-separated after the host name/address part. Like

View File

@ -1000,22 +1000,23 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
the IP from the control connection */
sslen = sizeof(ss);
if(getsockname(conn->sock[FIRSTSOCKET], (struct sockaddr *)&ss, &sslen)) {
if(getsockname(conn->sock[FIRSTSOCKET], sa, &sslen)) {
failf(data, "getsockname() failed: %s",
Curl_strerror(conn, SOCKERRNO) );
if (addr)
free(addr);
return CURLE_FTP_PORT_FAILED;
}
sslen = sizeof(ss);
rc = getnameinfo((struct sockaddr *)&ss, sslen, hbuf, sizeof(hbuf), NULL,
0, NIFLAGS);
if(rc) {
failf(data, "getnameinfo() returned %d", rc);
if (addr)
free(addr);
return CURLE_FTP_PORT_FAILED;
switch(sa->sa_family)
{
#ifdef ENABLE_IPV6
case AF_INET6:
Curl_inet_ntop(sa->sa_family, &sa6->sin6_addr, hbuf, sizeof(hbuf));
break;
#endif
default:
Curl_inet_ntop(sa->sa_family, &sa4->sin_addr, hbuf, sizeof(hbuf));
break;
}
host = hbuf; /* use this host name */
}