mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -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:
parent
3050f10676
commit
83fb285d40
4
CHANGES
4
CHANGES
@ -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
|
||||
|
21
lib/ftp.c
21
lib/ftp.c
@ -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 */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user