diff options
author | Yang Tse <yangsita@gmail.com> | 2010-11-30 06:20:54 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-11-30 06:20:54 +0100 |
commit | f6f5d7874f6a890f2626195f169abcbfc785b220 (patch) | |
tree | 94039bb2a957ead238095ddb5a67bec225373e67 /lib/getinfo.c | |
parent | 5db0a412ff6972e51ccddaf1e8d6a27c8de4990f (diff) |
fix getinfo CURLINFO_LOCAL* for reused connections
Diffstat (limited to 'lib/getinfo.c')
-rw-r--r-- | lib/getinfo.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c index c00e675eb..5412c0ffc 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -67,11 +67,6 @@ CURLcode Curl_initinfo(struct SessionHandle *data) info->request_size = 0; info->numconnects = 0; - info->ip[0] = 0; - info->port = 0; - info->localip[0] = 0; - info->localport = 0; - return CURLE_OK; } @@ -238,20 +233,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.ip; + *param_charp = data->info.primary_ip; break; case CURLINFO_PRIMARY_PORT: /* Return the (remote) port of the most recent (primary) connection */ - *param_longp = data->info.port; + *param_longp = data->info.primary_port; break; case CURLINFO_LOCAL_IP: /* Return the source/local ip address of the most recent (primary) connection */ - *param_charp = data->info.localip; + *param_charp = data->info.local_ip; break; case CURLINFO_LOCAL_PORT: /* Return the local port of the most recent (primary) connection */ - *param_longp = data->info.localport; + *param_longp = data->info.local_port; break; case CURLINFO_CERTINFO: /* Return the a pointer to the certinfo struct. Not really an slist |