aboutsummaryrefslogtreecommitdiff
path: root/lib/getinfo.c
diff options
context:
space:
mode:
authorFrank Meier <frank.meier@ergon.ch>2010-06-05 00:29:09 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-06-05 00:31:36 +0200
commit8098d9417c649272b9d6d2ad76abbde7dfbfcad1 (patch)
treee1a81f1d49804a97d60c2dc78678f3a5c64925fd /lib/getinfo.c
parent605207a3a60f515c77216922870e086dc8cc7f1b (diff)
getinfo: added *_PRIMARY_PORT, *_LOCAL_IP and *_LOCAL_PORT
Diffstat (limited to 'lib/getinfo.c')
-rw-r--r--lib/getinfo.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c
index 7a0ed71ac..d5517e489 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -66,6 +66,12 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
info->header_size = 0;
info->request_size = 0;
info->numconnects = 0;
+
+ info->ip[0] = 0;
+ info->port = 0;
+ info->localip[0] = 0;
+ info->localport = 0;
+
return CURLE_OK;
}
@@ -224,6 +230,19 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
/* Return the ip address of the most recent (primary) connection */
*param_charp = data->info.ip;
break;
+ case CURLINFO_PRIMARY_PORT:
+ /* Return the (remote) port of the most recent (primary) connection */
+ *param_longp = data->info.port;
+ break;
+ case CURLINFO_LOCAL_IP:
+ /* Return the source/local ip address of the most recent (primary)
+ connection */
+ *param_charp = data->info.localip;
+ break;
+ case CURLINFO_LOCAL_PORT:
+ /* Return the local port of the most recent (primary) connection */
+ *param_longp = data->info.localport;
+ break;
case CURLINFO_CERTINFO:
/* Return the a pointer to the certinfo struct. Not really an slist
pointer but we can pretend it is here */