# [PATCH] curl_reset

- Thread: https://externals.io/message/52446
- Original archive: https://news-web.php.net/php.internals/52446
- Started by Michael Dowling on 2011-05-18T18:08:21+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #52446 — Michael Dowling — 2011-05-18T18:08:21+00:00

URL: https://externals.io/message/52446#52446

I submitted a patch to add a curl_reset function to the cURL extension. 
  It would be great if this patch could find its way into the PHP 5.4 
release.  This is my first attempt at a patch, so a review and feedback 
would be greatly appreciated.

Feature request: http://bugs.php.net/bug.php?id=54022

Patch: 
http://bugs.php.net/patch-display.php?bug_id=54022&patch=curl_reset&revision=latest

Motivation:

Many of the curl_setopt options can be removed from a handle using some 
careful option setting that removes a related option as a side effect, 
but some options cannot be removed directly or indirectly (e.g. 
CURLOPT_RANGE, CURLOPT_TIMEOUT, CURLOPT_RESUME_FROM, CURLOPT_HTTPAUTH, etc).

Adding support for the curl_easy_reset method to the PHP bindings would 
allow PHP developers to more easily implement connection pooling and 
utilize persistent connections over HTTP/1.1.

curl_easy_reset has been available since version 7.12.1 
(http://curl.haxx.se/libcurl/c/curl_easy_reset.html):

 > Re-initializes all options previously set on a specified CURL handle 
to the default values. This puts back the handle to the same state as it 
was in when it was just created with curl_easy_init(3).  It does not 
change the following information kept in the handle: live connections, 
the Session ID cache, the DNS cache, the cookies and shares.

Thanks,
Michael Dowling
