curl_easy_reset(3)

πŸ’… curl_easy_reset(3) β€” your fave libcurl glow-up reset button ✨

okay so bestie, this little gem lives in the Library Functions Manual (very official, very demure) and honestly it's giving "factory reset but make it cute" πŸŽ€


✨ NAME ✨

curl_easy_reset β€” resets, like, every single option on a libcurl session handle. yes. all of them. 🧹


🌸 SYNOPSIS 🌸

#include <curl/curl.h>

void curl_easy_reset(CURL *handle);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea β˜• β€” curl_easy_reset re-initializes all the options you previously set on a specified curl handle back to their default values. It literally puts the handle back into the exact same state it was in when it was freshly created with curl_easy_init(3). brand new. no cap. πŸ’«

But wait β€” it does NOT change the following info that's still vibing inside the handle:

  • live connections πŸ”Œ
  • the Session ID cache
  • the DNS cache
  • the cookies πŸͺ
  • the shares
  • the alt-svc cache

so like, it's a reset but it's not a reset reset, yk? the handle keeps its whole social life, it just forgets its preferences πŸ™ˆ


🌈 PROTOCOLS 🌈

This functionality affects all supported protocols β€” every single one, no gatekeeping, periodt πŸ‘‘


πŸŽ€ EXAMPLE πŸŽ€

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {

    /* ... the handle is used and options are set ... */
    curl_easy_reset(curl);
  }
}

look at that little main character handle getting its options set and then getting reset 😌 iconic behavior honestly


⭐ AVAILABILITY ⭐

Added in curl 7.12.1 β€” so it's been serving looks since way back 🫢


πŸ’œ RETURN VALUE πŸ’œ

Nothing. it returns void, it does not return a value, it is unbothered, it is at peace πŸ§˜β€β™€οΈ

fr fr do not try to assign its return value to anything, there is literally nothing there πŸ’€

πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page bestie!! ✨

this masterpiece was brought to you by libcurl, dated 2026-10-12, in the curl_easy_reset(3) era β€” mwah, love u, go reset something πŸ’‹πŸ’…
πŸ“¦ where this page comes from