mirror of
https://github.com/curl/curl.git
synced 2026-08-24 14:33:33 +03:00
- Fixed CURLINFO_PRIMARY_IP: When libcurl created a connection to host A then
the app re-used the handle to do a connection to host B and then again re-used the handle to host A, it would not update the info with host A's IP address (due to the connection being re-used) but it would instead report the info from host B.
This commit is contained in:
parent
feeabd08ab
commit
61cfbecc74
3 changed files with 14 additions and 0 deletions
|
|
@ -4238,6 +4238,12 @@ static CURLcode create_conn(struct SessionHandle *data,
|
|||
infof(data, "Re-using existing connection! (#%ld) with host %s\n",
|
||||
conn->connectindex,
|
||||
conn->proxy.name?conn->proxy.dispname:conn->host.dispname);
|
||||
/* copy this IP address to the common buffer for the easy handle so that
|
||||
the address can actually survice the removal of this connection. strcpy
|
||||
is safe since the target buffer is big enough to hold the largest
|
||||
possible IP address */
|
||||
strcpy(data->info.ip, conn->ip_addr_str);
|
||||
|
||||
}
|
||||
else {
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue