Merge branch 'PHP-8.4'

This commit is contained in:
David Carlier 2024-10-12 14:54:02 +01:00
commit 2e263d26a2
No known key found for this signature in database
GPG key ID: 8486F847B4B94EF1
2 changed files with 25 additions and 4 deletions

View file

@ -1629,12 +1629,17 @@ static bool php_curl_set_callable_handler(zend_fcall_info_cache *const handler_f
}
#define HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(curl_ptr, constant_no_function, handler_type) \
#define HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(curl_ptr, constant_no_function, handler_type, default_method) \
case constant_no_function##FUNCTION: { \
bool result = php_curl_set_callable_handler(&curl_ptr->handlers.handler_type->fcc, zvalue, is_array_config, #constant_no_function "FUNCTION"); \
if (!result) { \
curl_ptr->handlers.handler_type->method = default_method; \
return FAILURE; \
} \
if (!ZEND_FCC_INITIALIZED(curl_ptr->handlers.handler_type->fcc)) { \
curl_ptr->handlers.handler_type->method = default_method; \
return SUCCESS; \
} \
curl_ptr->handlers.handler_type->method = PHP_CURL_USER; \
break; \
}
@ -1657,9 +1662,9 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
switch (option) {
/* Callable options */
HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(ch, CURLOPT_WRITE, write);
HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(ch, CURLOPT_HEADER, write_header);
HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(ch, CURLOPT_READ, read);
HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(ch, CURLOPT_WRITE, write, PHP_CURL_STDOUT);
HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(ch, CURLOPT_HEADER, write_header, PHP_CURL_IGNORE);
HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(ch, CURLOPT_READ, read, PHP_CURL_DIRECT);
HANDLE_CURL_OPTION_CALLABLE(ch, CURLOPT_PROGRESS, handlers.progress, curl_progress);
HANDLE_CURL_OPTION_CALLABLE(ch, CURLOPT_XFERINFO, handlers.xferinfo, curl_xferinfo);