xref: /curl/docs/libcurl/curl_easy_reset.md (revision e3fe0200)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: curl_easy_reset
5Section: 3
6Source: libcurl
7See-also:
8  - curl_easy_cleanup (3)
9  - curl_easy_duphandle (3)
10  - curl_easy_init (3)
11  - curl_easy_setopt (3)
12Protocol:
13  - All
14---
15
16# NAME
17
18curl_easy_reset - reset all options of a libcurl session handle
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25void curl_easy_reset(CURL *handle);
26~~~
27
28# DESCRIPTION
29
30Re-initializes all options previously set on a specified CURL handle to the
31default values. This puts back the handle to the same state as it was in when
32it was just created with curl_easy_init(3).
33
34It does not change the following information kept in the handle: live
35connections, the Session ID cache, the DNS cache, the cookies, the shares or
36the alt-svc cache.
37
38# EXAMPLE
39
40~~~c
41int main(void)
42{
43  CURL *curl = curl_easy_init();
44  if(curl) {
45
46    /* ... the handle is used and options are set ... */
47    curl_easy_reset(curl);
48  }
49}
50~~~
51
52# AVAILABILITY
53
54This function was added in libcurl 7.12.1
55
56# RETURN VALUE
57
58Nothing
59