diff options
author | Remi Collet <remi@remirepo.net> | 2025-10-10 08:36:49 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2025-10-10 08:36:49 +0200 |
commit | c9c87abe9a0bf7b045e989ce9e9fc16ac1cc97dc (patch) | |
tree | 1e046907478593a46bd1775feee2d959d4977852 | |
parent | 9ccd57189357a54ccbd12a01734f933357620790 (diff) |
open https://github.com/m6w6/ext-http/issues/151
test suite hangs with old libcurl (EL-8)
fix build with libcurl 7.61 (EL-8) using patch from
https://github.com/m6w6/ext-http/pull/152
-rw-r--r-- | 0001-fix-incompatible-pointer-type.patch | 39 | ||||
-rw-r--r-- | 0001-re-add-curl-7.61-specific-code.patch | 94 | ||||
-rw-r--r-- | 0001-return-string-in-output-handler.patch | 31 | ||||
-rw-r--r-- | PHPINFO | 6 | ||||
-rw-r--r-- | REFLECTION | 14 | ||||
-rw-r--r-- | php-pecl-http.spec | 24 |
6 files changed, 118 insertions, 90 deletions
diff --git a/0001-fix-incompatible-pointer-type.patch b/0001-fix-incompatible-pointer-type.patch deleted file mode 100644 index f10cbb2..0000000 --- a/0001-fix-incompatible-pointer-type.patch +++ /dev/null @@ -1,39 +0,0 @@ -From aa9b18e49f2c4e9033e6f32bc6af9cb11c44d332 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Thu, 23 Jan 2025 07:41:55 +0100 -Subject: [PATCH] fix incompatible pointer type - ---- - src/php_http_client_curl.h | 2 +- - src/php_http_client_curl_event.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/php_http_client_curl.h b/src/php_http_client_curl.h -index 61723b9..42feff7 100644 ---- a/src/php_http_client_curl.h -+++ b/src/php_http_client_curl.h -@@ -25,7 +25,7 @@ typedef struct php_http_client_curl_handle { - } php_http_client_curl_handle_t; - - typedef struct php_http_client_curl_ops { -- void *(*init)(); -+ void *(*init)(php_http_client_t *client, void *user_data); - void (*dtor)(void **ctx_ptr); - ZEND_RESULT_CODE (*once)(void *ctx); - ZEND_RESULT_CODE (*wait)(void *ctx, struct timeval *custom_timeout); -diff --git a/src/php_http_client_curl_event.c b/src/php_http_client_curl_event.c -index 2e663ed..b532e11 100644 ---- a/src/php_http_client_curl_event.c -+++ b/src/php_http_client_curl_event.c -@@ -242,7 +242,7 @@ static ZEND_RESULT_CODE php_http_client_curl_event_exec(void *context) - return SUCCESS; - } - --static void *php_http_client_curl_event_init(php_http_client_t *client) -+static void *php_http_client_curl_event_init(php_http_client_t *client, void *user_data) - { - php_http_client_curl_t *curl = client->ctx; - php_http_client_curl_event_context_t *ctx; --- -2.48.1 - diff --git a/0001-re-add-curl-7.61-specific-code.patch b/0001-re-add-curl-7.61-specific-code.patch new file mode 100644 index 0000000..d357279 --- /dev/null +++ b/0001-re-add-curl-7.61-specific-code.patch @@ -0,0 +1,94 @@ +From fea4a62212dd9a33f572894e47af5e00ce2f0b35 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 10 Oct 2025 08:22:16 +0200 +Subject: [PATCH] re-add curl 7.61 specific code + +--- + src/php_http_client_curl.c | 64 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 64 insertions(+) + +diff --git a/src/php_http_client_curl.c b/src/php_http_client_curl.c +index d5262f6..a02a87e 100644 +--- a/src/php_http_client_curl.c ++++ b/src/php_http_client_curl.c +@@ -1880,6 +1880,50 @@ static ZEND_RESULT_CODE php_http_curle_set_option(php_http_option_t *opt, zval * + return rv; + } + ++#if !PHP_HTTP_CURL_VERSION(7,62,0) ++static ZEND_RESULT_CODE php_http_curlm_option_set_pipelining_bl(php_http_option_t *opt, zval *value, void *userdata) ++{ ++ php_http_client_t *client = userdata; ++ php_http_client_curl_t *curl = client->ctx; ++ CURLM *ch = curl->handle->multi; ++ HashTable tmp_ht; ++ char **bl = NULL; ++ ++ /* array of char *, ending with a NULL */ ++ if (value && Z_TYPE_P(value) != IS_NULL) { ++ zval *entry; ++ HashTable *ht = HASH_OF(value); ++ int c = zend_hash_num_elements(ht); ++ char **ptr = ecalloc(c + 1, sizeof(char *)); ++ ++ bl = ptr; ++ ++ zend_hash_init(&tmp_ht, c, NULL, ZVAL_PTR_DTOR, 0); ++ array_join(ht, &tmp_ht, 0, ARRAY_JOIN_STRINGIFY); ++ ++ ZEND_HASH_FOREACH_VAL(&tmp_ht, entry) ++ { ++ *ptr++ = Z_STRVAL_P(entry); ++ } ++ ZEND_HASH_FOREACH_END(); ++ } ++ ++ if (CURLM_OK != curl_multi_setopt(ch, opt->option, bl)) { ++ if (bl) { ++ efree(bl); ++ zend_hash_destroy(&tmp_ht); ++ } ++ return FAILURE; ++ } ++ ++ if (bl) { ++ efree(bl); ++ zend_hash_destroy(&tmp_ht); ++ } ++ return SUCCESS; ++} ++#endif ++ + static inline ZEND_RESULT_CODE php_http_curlm_use_eventloop(php_http_client_t *h, php_http_client_curl_ops_t *ev_ops, zval *init_data) + { + php_http_client_curl_t *curl = h->ctx; +@@ -1978,6 +2022,26 @@ static void php_http_curlm_options_init(php_http_options_t *registry) + } + #endif + ++#if !PHP_HTTP_CURL_VERSION(7,62,0) ++ /* enable/disable HTTP pipelining */ ++ php_http_option_register(registry, ZEND_STRL("pipelining"), CURLMOPT_PIPELINING, _IS_BOOL); ++ /* maximum number of requests in a pipeline */ ++ if ((opt = php_http_option_register(registry, ZEND_STRL("max_pipeline_length"), CURLMOPT_MAX_PIPELINE_LENGTH, IS_LONG))) { ++ ZVAL_LONG(&opt->defval, 5); ++ } ++ /* chunk length threshold for pipelining */ ++ php_http_option_register(registry, ZEND_STRL("chunk_length_penalty_size"), CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, IS_LONG); ++ /* size threshold for pipelining penalty */ ++ php_http_option_register(registry, ZEND_STRL("content_length_penalty_size"), CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, IS_LONG); ++ /* pipelining server blacklist */ ++ if ((opt = php_http_option_register(registry, ZEND_STRL("pipelining_server_bl"), CURLMOPT_PIPELINING_SERVER_BL, IS_ARRAY))) { ++ opt->setter = php_http_curlm_option_set_pipelining_bl; ++ } ++ /* pipelining host blacklist */ ++ if ((opt = php_http_option_register(registry, ZEND_STRL("pipelining_site_bl"), CURLMOPT_PIPELINING_SITE_BL, IS_ARRAY))) { ++ opt->setter = php_http_curlm_option_set_pipelining_bl; ++ } ++#endif + /* events */ + if ((opt = php_http_option_register(registry, ZEND_STRL("use_eventloop"), 0, 0))) { + opt->setter = php_http_curlm_option_set_use_eventloop; +-- +2.51.0 + diff --git a/0001-return-string-in-output-handler.patch b/0001-return-string-in-output-handler.patch deleted file mode 100644 index 717e603..0000000 --- a/0001-return-string-in-output-handler.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 36201dbbe628f2bc40cb1ed6c22f4486f3468b27 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Fri, 18 Jul 2025 07:19:36 +0200 -Subject: [PATCH] return string in output handler - -Returning a non-string result from user output handler is deprecated - -From https://wiki.php.net/rfc/deprecations_php_8_4 - - A return value of true is treated like a context reset, - which is identical to returning an empty string. ---- - src/php_http_env_response.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/php_http_env_response.c b/src/php_http_env_response.c -index 3dba5b9..b44c58d 100644 ---- a/src/php_http_env_response.c -+++ b/src/php_http_env_response.c -@@ -1165,7 +1165,7 @@ static PHP_METHOD(HttpEnvResponse, __invoke) - } else { - php_http_message_body_append(obj->message->body, ob_str, ob_len); - } -- RETURN_TRUE; -+ RETURN_EMPTY_STRING(); - } - } - --- -2.50.1 - @@ -2,11 +2,11 @@ http HTTP Support => enabled -Extension Version => 4.2.6 +Extension Version => 4.3.1 Used Library => Compiled => Linked -libz => 1.2.13 => 1.2.13 -libcurl => 8.2.1 => 8.2.1 +libz => 1.3.1.zlib-ng => 1.3.1.zlib-ng +libcurl => 8.9.1 => 8.9.1 libevent => 2.1.12-stable => 2.1.12-stable libicu (IDNA2008/IDNA2003) => 74.2 => 74.2 libidn2 (IDNA2008) => disabled => disabled @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #116 http version 4.2.6 ] { +Extension [ <persistent> extension #136 http version 4.3.1 ] { - Dependencies { Dependency [ raphf (Required) ] @@ -39,15 +39,15 @@ Extension [ <persistent> extension #116 http version 4.2.6 ] { Constant [ int http\Client\Curl\Features\ZSTD ] { 67108864 } Constant [ int http\Client\Curl\Features\UNICODE ] { 134217728 } Constant [ int http\Client\Curl\Features\HSTS ] { 268435456 } - Constant [ string http\Client\Curl\VERSIONS ] { libcurl/8.2.1 OpenSSL/3.1.4 zlib/1.2.13 libidn2/2.3.7 nghttp2/1.55.1 } - Constant [ string http\Client\Curl\Versions\CURL ] { 8.2.1 } - Constant [ string http\Client\Curl\Versions\SSL ] { OpenSSL/3.1.4 } - Constant [ string http\Client\Curl\Versions\LIBZ ] { 1.2.13 } + Constant [ string http\Client\Curl\VERSIONS ] { libcurl/8.9.1 OpenSSL/3.2.4 zlib/1.3.1.zlib-ng libidn2/2.3.8 nghttp2/1.62.1 } + Constant [ string http\Client\Curl\Versions\CURL ] { 8.9.1 } + Constant [ string http\Client\Curl\Versions\SSL ] { OpenSSL/3.2.4 } + Constant [ string http\Client\Curl\Versions\LIBZ ] { 1.3.1.zlib-ng } Constant [ null http\Client\Curl\Versions\ARES ] { } - Constant [ string http\Client\Curl\Versions\IDN ] { 2.3.7 } + Constant [ string http\Client\Curl\Versions\IDN ] { 2.3.8 } Constant [ null http\Client\Curl\Versions\ICONV ] { } Constant [ null http\Client\Curl\Versions\BROTLI ] { } - Constant [ string http\Client\Curl\Versions\NGHTTP2 ] { 1.55.1 } + Constant [ string http\Client\Curl\Versions\NGHTTP2 ] { 1.62.1 } Constant [ null http\Client\Curl\Versions\QUIC ] { } Constant [ string http\Client\Curl\Versions\CAINFO ] { /etc/pki/tls/certs/ca-bundle.crt } Constant [ null http\Client\Curl\Versions\CAPATH ] { } diff --git a/php-pecl-http.spec b/php-pecl-http.spec index 17aa5d4..b2931fa 100644 --- a/php-pecl-http.spec +++ b/php-pecl-http.spec @@ -31,7 +31,7 @@ # after 40-raphf %global ini_name 50-%{pecl_name}.ini -%global upstream_version 4.2.6 +%global upstream_version 4.3.1 #global upstream_prever beta1 #global upstream_lower beta1 %global sources %{proj_name}-%{upstream_version}%{?upstream_prever} @@ -39,7 +39,7 @@ Name: %{?scl_prefix}php-pecl-http Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}} -Release: 7%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://pecl.php.net/get/%{proj_name}-%{upstream_version}%{?upstream_prever}.tgz Summary: Extended HTTP support @@ -49,10 +49,7 @@ URL: https://pecl.php.net/package/pecl_http # From http://www.php.net/manual/en/http.configuration.php Source1: %{proj_name}.ini -Patch0: 0001-fix-incompatible-pointer-type.patch -Patch1: 0001-return-string-in-output-handler.patch -Patch2: 0001-fix-SplObjectStorage-at-de-tach-deprecation-warnings.patch -Patch3: 0002-fix-150.patch +Patch0: 0001-re-add-curl-7.61-specific-code.patch BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -60,7 +57,7 @@ BuildRequires: %{?scl_prefix}php-devel >= 8.0 BuildRequires: %{?scl_prefix}php-spl BuildRequires: %{?scl_prefix}php-pear BuildRequires: zlib-devel >= 1.2.0.4 -BuildRequires: curl-devel >= 7.18.2 +BuildRequires: curl-devel >= 7.61.1 # We require 73 to ensure we use the same version than PHP BuildRequires: pkgconfig(icu-i18n) >= 73 BuildRequires: %{?scl_prefix}php-pecl-raphf-devel >= 2 @@ -129,9 +126,6 @@ sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml cd %{sources} %patch -P0 -p1 -%patch -P1 -p1 -%patch -P2 -p1 -%patch -P3 -p1 extver=$(sed -n '/#define PHP_PECL_HTTP_VERSION/{s/.* "//;s/".*$//;p}' php_http.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then @@ -289,6 +283,16 @@ TEST_PHP_ARGS="-n $modules -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \ %changelog +* Fri Oct 10 2025 Remi Collet <remi@remirepo.net> - 4.3.1-1 +- update to 4.3.1 +- open https://github.com/m6w6/ext-http/issues/151 + test suite hangs with old libcurl (EL-8) +- fix build with libcurl 7.61 (EL-8) using patch from + https://github.com/m6w6/ext-http/pull/152 + +* Thu Sep 25 2025 Remi Collet <remi@remirepo.net> - 4.2.6-8 +- rebuild for PHP 8.5.0RC1 + * Mon Sep 1 2025 Remi Collet <remi@fedoraproject.org> - 4.2.6-7 - add upstream patches for 8.5.0beta2 |