mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
parent
b864abfe23
commit
c8c183eb62
5 changed files with 54 additions and 2 deletions
4
NEWS
4
NEWS
|
@ -2,6 +2,10 @@ PHP NEWS
|
||||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||
?? ??? 2019, PHP 7.2.22
|
?? ??? 2019, PHP 7.2.22
|
||||||
|
|
||||||
|
- Curl:
|
||||||
|
. Fixed bug #77946 (Bad cURL resources returned by curl_multi_info_read()).
|
||||||
|
(Abyr Valg)
|
||||||
|
|
||||||
- Standard:
|
- Standard:
|
||||||
. Fixed bug #69100 (Bus error from stream_copy_to_stream (file -> SSL stream)
|
. Fixed bug #69100 (Bus error from stream_copy_to_stream (file -> SSL stream)
|
||||||
with invalid length). (Nikita)
|
with invalid length). (Nikita)
|
||||||
|
|
|
@ -152,8 +152,6 @@ static void _php_curl_close_ex(php_curl *ch);
|
||||||
static void _php_curl_close(zend_resource *rsrc);
|
static void _php_curl_close(zend_resource *rsrc);
|
||||||
|
|
||||||
|
|
||||||
#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err;
|
|
||||||
|
|
||||||
#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s) - 1, (zend_long) v);
|
#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s) - 1, (zend_long) v);
|
||||||
#define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s) - 1, (double) v);
|
#define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s) - 1, (double) v);
|
||||||
#define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s) - 1, (char *) (v ? v : ""));
|
#define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s) - 1, (char *) (v ? v : ""));
|
||||||
|
|
|
@ -339,6 +339,7 @@ PHP_FUNCTION(curl_multi_info_read)
|
||||||
CURLMsg *tmp_msg;
|
CURLMsg *tmp_msg;
|
||||||
int queued_msgs;
|
int queued_msgs;
|
||||||
zval *zmsgs_in_queue = NULL;
|
zval *zmsgs_in_queue = NULL;
|
||||||
|
php_curl *ch;
|
||||||
|
|
||||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||||
Z_PARAM_RESOURCE(z_mh)
|
Z_PARAM_RESOURCE(z_mh)
|
||||||
|
@ -376,6 +377,10 @@ PHP_FUNCTION(curl_multi_info_read)
|
||||||
being done in add_assoc_resource */
|
being done in add_assoc_resource */
|
||||||
Z_ADDREF_P(pz_ch);
|
Z_ADDREF_P(pz_ch);
|
||||||
|
|
||||||
|
/* we must save result to be able to read error message */
|
||||||
|
ch = (php_curl*)zend_fetch_resource(Z_RES_P(pz_ch), le_curl_name, le_curl);
|
||||||
|
SAVE_CURL_ERROR(ch, tmp_msg->data.result);
|
||||||
|
|
||||||
/* add_assoc_resource automatically creates a new zval to
|
/* add_assoc_resource automatically creates a new zval to
|
||||||
wrap the "resource" represented by the current pz_ch */
|
wrap the "resource" represented by the current pz_ch */
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,8 @@ extern zend_module_entry curl_module_entry;
|
||||||
#define PHP_CURL_RETURN 4
|
#define PHP_CURL_RETURN 4
|
||||||
#define PHP_CURL_IGNORE 7
|
#define PHP_CURL_IGNORE 7
|
||||||
|
|
||||||
|
#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err;
|
||||||
|
|
||||||
extern int le_curl;
|
extern int le_curl;
|
||||||
#define le_curl_name "cURL handle"
|
#define le_curl_name "cURL handle"
|
||||||
extern int le_curl_multi_handle;
|
extern int le_curl_multi_handle;
|
||||||
|
|
43
ext/curl/tests/bug77946.phpt
Normal file
43
ext/curl/tests/bug77946.phpt
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #77946 (Errored cURL resources returned by curl_multi_info_read() must be compatible with curl_errno() and curl_error())
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if (!extension_loaded('curl')) {
|
||||||
|
exit('skip curl extension not loaded');
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$urls = array(
|
||||||
|
'unknown://scheme.tld',
|
||||||
|
);
|
||||||
|
|
||||||
|
$mh = curl_multi_init();
|
||||||
|
|
||||||
|
foreach ($urls as $i => $url) {
|
||||||
|
$conn[$i] = curl_init($url);
|
||||||
|
curl_multi_add_handle($mh, $conn[$i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
$status = curl_multi_exec($mh, $active);
|
||||||
|
$info = curl_multi_info_read($mh);
|
||||||
|
if (false !== $info) {
|
||||||
|
var_dump($info['result']);
|
||||||
|
var_dump(curl_errno($info['handle']));
|
||||||
|
var_dump(curl_error($info['handle']));
|
||||||
|
}
|
||||||
|
} while ($status === CURLM_CALL_MULTI_PERFORM || $active);
|
||||||
|
|
||||||
|
foreach ($urls as $i => $url) {
|
||||||
|
curl_close($conn[$i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
curl_multi_close($mh);
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
int(1)
|
||||||
|
int(1)
|
||||||
|
string(%d) "Protocol %Sunknown%S not supported or disabled in libcurl"
|
Loading…
Add table
Add a link
Reference in a new issue