Previous implementation was using its own refcounting (uses field of
the php_curl struct). zend_list_add/remove already implements its own
refcount, so we don't need to use an other one.
Bug #43177: If an eval() has a parse error, the overall exit status and return code should not be affected.
Without this fix, a webpage using eval() may return code 500. That might display
fine and the 500 go unnoticed, but using AJAX or wget, the 500 will cause problems.
Pierrick Charron [Thu, 27 Dec 2012 18:31:55 +0000 (13:31 -0500)]
Fixed #63859 Memory leak when reusing curl-handle
When CURLOPT_POSTFIELDS is called more than once on the same
curl handle, php/curl did not free the memory of the previous
post data. This commit will fix the problem unless the curl
handle was previously duplicated using the curl_copy_handle()
function in which case we can not know if the post data is
still in use or not by any curl handle
Nikita Popov [Mon, 17 Dec 2012 21:02:32 +0000 (22:02 +0100)]
Implement Generator::throw() method
Generator::throw($exception) throws an exception into the generator. The
exception is thrown at the current point of suspension within the generator.
It basically behaves as if the current yield statement were replaced with
a throw statement and the generator subsequently resumed.
Pierrick Charron [Sun, 23 Dec 2012 22:13:49 +0000 (17:13 -0500)]
New curl_pause() function
Add the curl_pause function (binding of curl_easy_pause).
Using this function, you can explicitly mark a running connection
to get paused, and you can unpause a connection that was
previously paused.
Pierrick Charron [Sun, 23 Dec 2012 20:45:39 +0000 (15:45 -0500)]
Support for curl_strerror and curl_multi_strerror
Add the support for both curl_strerror and curl_multi_strerror.
Those function will return a string describing the error code
passed in the argument errornum
Pierrick Charron [Sun, 23 Dec 2012 00:03:24 +0000 (19:03 -0500)]
Fixed segfault due to libcurl connection caching
Libcurl is doing connection caching. When easy handle is cleaned up,
if the handle was previously used by the curl_multi_api, the connection
remains open un the curl multi handle is cleaned up. Some protocols are
sending content like the FTP one, and libcurl try to use the
WRITEFUNCTION or the HEADERFUNCTION. Since structures used in those
callback are freed, we need to use an other callback to which avoid
segfaults.
Libcurl commit d021f2e8a00 fix this issue and should be part of 7.28.2
Pierrick Charron [Sat, 22 Dec 2012 00:27:51 +0000 (19:27 -0500)]
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
Update NEWS file
Fixed bug #63352 (Can't enable hostname validation when using curl stream wrappers)
CURL >= 7.28.0 no longer support value 1 for CURLOPT_SSL_VERIFYHOST)
Pierrick Charron [Sat, 22 Dec 2012 00:24:28 +0000 (19:24 -0500)]
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
Update NEWS file
Fixed bug #63352 (Can't enable hostname validation when using curl stream wrappers)
CURL >= 7.28.0 no longer support value 1 for CURLOPT_SSL_VERIFYHOST)
Nikita Popov [Fri, 21 Dec 2012 16:28:20 +0000 (17:28 +0100)]
Fix crash when last yielded value is a closure
If zend_generator_close is called from within zend_generator_resume (e.g.
due to a return statement) then all the EGs will still be using the values
from the generator. That's why the stack frame has to be the last thing
that is dtored, otherwise some other dtor that is using
EG(current_execute_data) might access the already freed memory segment.
This was the case with the closure dtor.
The fix is to move the dtors for key and value to the start of the handler.
This way the stack frame is the last thing that is freed.
Pierrick Charron [Thu, 20 Dec 2012 00:40:29 +0000 (19:40 -0500)]
Fixed bug #55438 (Curlwapper is not sending http header randomly)
Since curl multi is used, it sometime happen that the resource is freed before
the curl multi really execute the query. The patch will store the headers
slist in the curlstream handle and free it only when the stream will be closed