mirror of
https://github.com/curl/curl.git
synced 2026-08-12 05:40:53 +03:00
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.
This commit is contained in:
parent
b0bc2f00d2
commit
87bcb6f377
13 changed files with 119 additions and 48 deletions
|
|
@ -2159,6 +2159,12 @@ CURLcode Curl_perform(struct SessionHandle *data)
|
|||
|
||||
if(res == CURLE_OK) {
|
||||
bool do_done;
|
||||
if(data->set.connect_only) {
|
||||
/* keep connection open for application to use the socket */
|
||||
conn->bits.close = FALSE;
|
||||
res = Curl_done(&conn, CURLE_OK);
|
||||
break;
|
||||
}
|
||||
res = Curl_do(&conn, &do_done);
|
||||
|
||||
/* for non 3rd party transfer only */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue