curl_easy_duphandle

Syntax

#include <curl/curl.h>

CURL *curl_easy_duphandle(CURL *handle);

Parameters

handle Handle to a curl session.

Return Values

Returns a new CURL handle. If NULL is returned, an unexpected issue occurred and no valid handle was returned.

Description

This function will return a new CURL handle, a duplicate, using all the options previously set in the input CURL handle. Both handles can subsequently be used independently and they must both be freed with curl_easy_cleanup.

All strings that the input handle has been instructed to point to (as opposed to copy) with previous calls to curl_easy_setopt using char * inputs, will also be pointed to by the new handle. Keep the data available until both handles have been cleaned up.

The new handle will not inherit any state information, connections, SSL sessions, or cookies.

NOTE:
Even in multithreaded programs, this function must be called in a synchronous way. The input handle may not be in use when cloned.

Do Not Call From

None.

See Also

HTTP Client Library (libcurl)
libcurl API Functions
curl_easy_cleanup
curl_easy_setopt

Revision History

2013/09/18 Conversion
2013/05/08 Automated cleanup pass.
2012/05/04 Initial version.


CONFIDENTIAL