aboutsummaryrefslogtreecommitdiff
path: root/lib/getinfo.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-02-11 22:35:16 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-02-11 22:35:16 +0000
commit87bcb6f3775a437579c7526d0972c714c2e5d31d (patch)
treee3b1729ce92ff0ab994b7e904f0bca5bd018a060 /lib/getinfo.c
parentb0bc2f00d2ef005b6322123799af78528f66b713 (diff)
Karl M added the CURLOPT_CONNECT_ONLY and CURLINFO_LASTSOCKET options that
an app can use to let libcurl only connect to a remote host and then extract the socket from libcurl. libcurl will then not attempt to do any transfer at all after the connect is done.
Diffstat (limited to 'lib/getinfo.c')
-rw-r--r--lib/getinfo.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c
index 47828212b..2a4c3aac4 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -187,6 +187,14 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
case CURLINFO_COOKIELIST:
*param_slistp = Curl_cookie_list(data);
break;
+ case CURLINFO_LASTSOCKET:
+ if((data->state.lastconnect != -1) &&
+ (data->state.connects[data->state.lastconnect] != NULL))
+ *param_longp = data->state.connects[data->state.lastconnect]->
+ sock[FIRSTSOCKET];
+ else
+ *param_longp = -1;
+ break;
default:
return CURLE_BAD_FUNCTION_ARGUMENT;
}