diff options
-rw-r--r-- | doc/docstrings/curl_duphandle.rst | 23 | ||||
-rw-r--r-- | src/easy.c | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/doc/docstrings/curl_duphandle.rst b/doc/docstrings/curl_duphandle.rst new file mode 100644 index 0000000..ca6e7a8 --- /dev/null +++ b/doc/docstrings/curl_duphandle.rst @@ -0,0 +1,23 @@ +duphandle() -> Curl + +Clone a curl handle. 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. + +The new handle will not inherit any state information, no connections, +no SSL sessions and no cookies. It also will not inherit any share object +states or options (it will be made as if SHARE was unset). + +Corresponds to `curl_easy_duphandle`_ in libcurl. + +Example usage:: + + import pycurl + curl = pycurl.Curl() + curl.setopt(pycurl.URL, "https://python.org") + dup = curl.duphandle() + curl.perform() + dup.perform() + +.. _curl_easy_duphandle: + https://curl.se/libcurl/c/curl_easy_duphandle.html @@ -728,7 +728,7 @@ PYCURL_INTERNAL PyMethodDef curlobject_methods[] = { {"setopt_string", (PyCFunction)do_curl_setopt_string, METH_VARARGS, curl_setopt_string_doc}, {"unsetopt", (PyCFunction)do_curl_unsetopt, METH_VARARGS, curl_unsetopt_doc}, {"reset", (PyCFunction)do_curl_reset, METH_NOARGS, curl_reset_doc}, - {"duphandle", (PyCFunction)do_curl_duphandle, METH_NOARGS, NULL}, + {"duphandle", (PyCFunction)do_curl_duphandle, METH_NOARGS, curl_duphandle_doc}, #if defined(HAVE_CURL_OPENSSL) {"set_ca_certs", (PyCFunction)do_curl_set_ca_certs, METH_VARARGS, curl_set_ca_certs_doc}, #endif |