php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54022 Add support for curl_easy_reset
Submitted: 2011-02-15 04:57 UTC Modified: 2011-12-04 01:44 UTC
Votes:6
Avg. Score:4.7 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:4 (66.7%)
Same OS:1 (16.7%)
From: mtdowling at gmail dot com Assigned: pierrick (profile)
Status: Closed Package: cURL related
PHP Version: 5.3.5 OS: Mac OS X
Private report: No CVE-ID: None
 [2011-02-15 04:57 UTC] mtdowling at gmail dot com
Description:
------------
It's difficult to use the same curl handle for multiple requests to the same host and port when many unknown options could have been applied to the handle after its creation.  Many of the curl_setopt options can be removed from a handle using some careful option setting, but some options cannot.  Adding a curl_easy_reset method to the PHP bindings would allow PHP developers to more easily implement connection pooling and utilize keep-alive sessions 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.


Patches

curl_reset (last revision 2011-04-05 00:48 UTC by mtdowling at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-15 11:30 UTC] kalle@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: kalle
 [2011-08-19 20:17 UTC] mtdowling at gmail dot com
Any news on this?  I submitted a patch and announced it on the mailing list.  Please let me know if you need anything further from me.
 [2011-11-22 08:40 UTC] pierrick@php.net
-Assigned To: kalle +Assigned To: pierrick
 [2011-11-23 07:55 UTC] pierrick@php.net
The provided patch is not valid. All the handlers of the php_curl_handlers 
structure also need to be reseted.
 [2011-12-04 01:44 UTC] pierrick@php.net
-Status: Assigned +Status: Closed
 [2011-12-04 01:44 UTC] pierrick@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Committed to trunk :)
 [2012-01-31 16:25 UTC] jacob dot bare at gmail dot com
I was wondering if this fix was added to any active PHP 5 releases. I looked at the change log and wasn't able to find this Bug # referenced anywhere. The latest build is newer than when this bug was addressed. If it is available in 5.3.9 is there any available documentation on usage? Thanks!
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Nov 26 13:05:53 2022 UTC