aboutsummaryrefslogtreecommitdiff
path: root/lib/getinfo.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-11-30 22:14:37 +0100
committerYang Tse <yangsita@gmail.com>2010-11-30 22:14:37 +0100
commit11cddb68e0ff73c8297b85e51bebaf6f968a8d62 (patch)
tree92c287a27561496b0be9f35faba35ef9c6bcc580 /lib/getinfo.c
parent1b2b93e0746ed09daf62ffc55cff1dcaaa3dff09 (diff)
fix getinfo CURLINFO_LOCAL* for reused connections (take 2)
Diffstat (limited to 'lib/getinfo.c')
-rw-r--r--lib/getinfo.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c
index 5412c0ffc..946686281 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -67,6 +67,11 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
info->request_size = 0;
info->numconnects = 0;
+ info->conn_primary_ip[0] = '\0';
+ info->conn_local_ip[0] = '\0';
+ info->conn_primary_port = 0;
+ info->conn_local_port = 0;
+
return CURLE_OK;
}
@@ -233,20 +238,20 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
break;
case CURLINFO_PRIMARY_IP:
/* Return the ip address of the most recent (primary) connection */
- *param_charp = data->info.primary_ip;
+ *param_charp = data->info.conn_primary_ip;
break;
case CURLINFO_PRIMARY_PORT:
/* Return the (remote) port of the most recent (primary) connection */
- *param_longp = data->info.primary_port;
+ *param_longp = data->info.conn_primary_port;
break;
case CURLINFO_LOCAL_IP:
/* Return the source/local ip address of the most recent (primary)
connection */
- *param_charp = data->info.local_ip;
+ *param_charp = data->info.conn_local_ip;
break;
case CURLINFO_LOCAL_PORT:
/* Return the local port of the most recent (primary) connection */
- *param_longp = data->info.local_port;
+ *param_longp = data->info.conn_local_port;
break;
case CURLINFO_CERTINFO:
/* Return the a pointer to the certinfo struct. Not really an slist