Debian Codegraph @

doc/docstrings/curl_duphandle.rst

raw
1 duphandle() -> Curl
2
3 Clone a curl handle. This function will return a new curl handle,
4 a duplicate, using all the options previously set in the input curl handle.
5 Both handles can subsequently be used independently.
6
7 The new handle will not inherit any state information, no connections,
8 no SSL sessions and no cookies. It also will not inherit any share object
9 states or options (it will be made as if SHARE was unset).
10
11 When ``MIMEPOST`` includes parts configured with ``CurlMimePart.data_cb()``,
12 libcurl duplicates callback userdata pointers into the duplicated handle.
13 Design callback state (especially any ``free`` hook side effects) so that
14 multiple handle instances can release it safely.
15 See also `curl_mime_data_cb`_ in libcurl.
16
17 Corresponds to `curl_easy_duphandle`_ in libcurl.
18
19 Example usage::
20
21 import pycurl
22 curl = pycurl.Curl()
23 curl.setopt(pycurl.URL, "https://python.org")
24 dup = curl.duphandle()
25 curl.perform()
26 dup.perform()
27
28 .. _curl_easy_duphandle:
29 https://curl.se/libcurl/c/curl_easy_duphandle.html
30
31 .. _curl_mime_data_cb:
32 https://curl.se/libcurl/c/curl_mime_data_cb.html