mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:53:34 +03:00
- Added CURLINFO_PRIMARY_IP as a new information retrievable with
curl_easy_getinfo. It returns a pointer to a string with the most recently used IP address. Modified test case 500 to also verify this feature. The implementing of this feature was sponsored by Lenny Rachitsky at NeuStar.
This commit is contained in:
parent
afc66554d7
commit
930a45e7a9
9 changed files with 48 additions and 7 deletions
|
|
@ -775,9 +775,12 @@ singleipconnect(struct connectdata *conn,
|
|||
/* FIXME: do we have Curl_printable_address-like with struct sockaddr* as
|
||||
argument? */
|
||||
#if defined(HAVE_SYS_UN_H) && defined(AF_UNIX)
|
||||
if(addr->family==AF_UNIX)
|
||||
if(addr->family==AF_UNIX) {
|
||||
infof(data, " Trying %s... ",
|
||||
((const struct sockaddr_un*)(&addr->addr))->sun_path);
|
||||
snprintf(data->info.ip, MAX_IPADR_LEN, "%s",
|
||||
((const struct sockaddr_un*)(&addr->addr))->sun_path);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
|
|
@ -789,8 +792,10 @@ singleipconnect(struct connectdata *conn,
|
|||
iptoprint = &((const struct sockaddr_in*)(&addr->addr))->sin_addr;
|
||||
|
||||
if(Curl_inet_ntop(addr->family, iptoprint, addr_buf,
|
||||
sizeof(addr_buf)) != NULL)
|
||||
sizeof(addr_buf)) != NULL) {
|
||||
infof(data, " Trying %s... ", addr_buf);
|
||||
snprintf(data->info.ip, MAX_IPADR_LEN, "%s", addr_buf);
|
||||
}
|
||||
}
|
||||
|
||||
if(data->set.tcp_nodelay)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue