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 itwas 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