aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-10-07 21:56:56 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-10-07 21:56:56 +0000
commit61cfbecc7458edd4cc2d538d0a361648131a2c93 (patch)
treecc802447e615446506bcb252bfe74cd7fb6d2891 /lib/url.c
parentfeeabd08ab66207771825bf0616fb08acb460c37 (diff)
- 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.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index bb09d2fd3..17b34c68e 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -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 {
/*