Imported Upstream version 7.59.0
[platform/upstream/curl.git] / docs / libcurl / curl_easy_duphandle.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .TH curl_easy_duphandle 3 "February 03, 2016" "libcurl 7.59.0" "libcurl Manual"
23
24 .SH NAME
25 curl_easy_duphandle - Clone a libcurl session handle
26 .SH SYNOPSIS
27 .B #include <curl/curl.h>
28
29 .BI "CURL *curl_easy_duphandle(CURL *"handle ");"
30
31 .SH DESCRIPTION
32 This function will return a new curl handle, a duplicate, using all the
33 options previously set in the input curl \fIhandle\fP. Both handles can
34 subsequently be used independently and they must both be freed with
35 \fIcurl_easy_cleanup(3)\fP.
36
37 All strings that the input handle has been told to point to (as opposed to
38 copy) with previous calls to \fIcurl_easy_setopt(3)\fP using char * inputs,
39 will be pointed to by the new handle as well. You must therefore make sure to
40 keep the data around until both handles have been cleaned up.
41
42 The new handle will \fBnot\fP inherit any state information, no connections,
43 no SSL sessions and no cookies.
44
45 \fBNote\fP that even in multi-threaded programs, this function must be called
46 in a synchronous way, the input handle may not be in use when cloned.
47 .SH RETURN VALUE
48 If this function returns NULL, something went wrong and no valid handle was
49 returned.
50 .SH "SEE ALSO"
51 .BR curl_easy_init "(3)," curl_easy_cleanup "(3)," curl_easy_reset "(3),"
52 .BR curl_global_init "(3)"
53