blob: cc5990e21c93e2ed2d5fe09b61b72ca24b33e128 [file] [log] [blame]
Lucas Eckels9bd90e62012-08-06 15:07:02 -07001.\" **************************************************************************
2.\" * _ _ ____ _
3.\" * Project ___| | | | _ \| |
4.\" * / __| | | | |_) | |
5.\" * | (__| |_| | _ <| |___
6.\" * \___|\___/|_| \_\_____|
7.\" *
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -07008.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
Lucas Eckels9bd90e62012-08-06 15:07:02 -07009.\" *
10.\" * This software is licensed as described in the file COPYING, which
11.\" * you should have received as part of this distribution. The terms
Alex Deymo8f1a2142016-06-28 14:49:26 -070012.\" * are also available at https://curl.haxx.se/docs/copyright.html.
Lucas Eckels9bd90e62012-08-06 15:07:02 -070013.\" *
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.\"
23.TH curl_easy_cleanup 3 "22 aug 2007" "libcurl 7.17.0" "libcurl Manual"
24.SH NAME
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070025curl_easy_cleanup - End a libcurl easy handle
Lucas Eckels9bd90e62012-08-06 15:07:02 -070026.SH SYNOPSIS
27.B #include <curl/curl.h>
28
29.BI "void curl_easy_cleanup(CURL *" handle ");"
Lucas Eckels9bd90e62012-08-06 15:07:02 -070030.SH DESCRIPTION
31This function must be the last function to call for an easy session. It is the
32opposite of the \fIcurl_easy_init(3)\fP function and must be called with the
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070033same \fIhandle\fP as input that a \fIcurl_easy_init(3)\fP call returned.
Lucas Eckels9bd90e62012-08-06 15:07:02 -070034
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070035This might close all connections this handle has used and possibly has kept
36open until now - unless it was attached to a multi handle while doing the
37transfers. Don't call this function if you intend to transfer more files,
38re-using handles is a key to good performance with libcurl.
Lucas Eckels9bd90e62012-08-06 15:07:02 -070039
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070040Occasionally you may get your progress callback or header callback called from
41within \fIcurl_easy_cleanup(3)\fP (if previously set for the handle using
42\fIcurl_easy_setopt(3)\fP). Like if libcurl decides to shut down the
43connection and the protocol is of a kind that requires a command/response
44sequence before disconnect. Examples of such protocols are FTP, POP3 and IMAP.
Lucas Eckels9bd90e62012-08-06 15:07:02 -070045
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070046Any use of the \fBhandle\fP after this function has been called and have
47returned, is illegal. \fIcurl_easy_cleanup(3)\fP kills the handle and all
48memory associated with it!
49
50For libcurl versions before 7.17,: after you've called this function, you can
51safely remove all the strings you've previously told libcurl to use, as it
52won't use them anymore now.
Lucas Eckels9bd90e62012-08-06 15:07:02 -070053.SH RETURN VALUE
54None
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070055.SH EXAMPLE
56.nf
57CURL *curl = curl_easy_init();
58if(curl) {
59 CURLcode res;
60 curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
61 res = curl_easy_perform(curl);
62 curl_easy_cleanup(curl);
63}
64.fi
Lucas Eckels9bd90e62012-08-06 15:07:02 -070065.SH "SEE ALSO"
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070066.BR curl_easy_init "(3), " curl_easy_duphandle "(3), "
67.BR curl_easy_reset "(3), "
68.BR curl_multi_cleanup "(3), " curl_multi_remove_handle "(3) "