diff options
| -rw-r--r-- | 0001-re-add-curl-7.61-specific-code.patch | 94 | ||||
| -rw-r--r-- | PHPINFO | 6 | ||||
| -rw-r--r-- | REFLECTION | 14 | ||||
| -rw-r--r-- | php-pecl-http.spec | 63 |
4 files changed, 156 insertions, 21 deletions
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 + @@ -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 ba7b312..b2931fa 100644 --- a/php-pecl-http.spec +++ b/php-pecl-http.spec @@ -3,9 +3,9 @@ # # Fedora spec file for php-pecl-http # -# Copyright (c) 2012-2024 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2012-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # @@ -22,6 +22,8 @@ %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner m6w6 %global gh_project ext-http +%global pie_vend m6w6 +%global pie_proj ext-http # The project is pecl_http but the extension is only http %global proj_name pecl_http %global pecl_name http @@ -29,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} @@ -47,13 +49,15 @@ URL: https://pecl.php.net/package/pecl_http # From http://www.php.net/manual/en/http.configuration.php Source1: %{proj_name}.ini +Patch0: 0001-re-add-curl-7.61-specific-code.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc 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 @@ -75,12 +79,17 @@ Obsoletes: %{?scl_prefix}php-pecl-http1 < 2 # to allow migration from PHP 7 (last is 2.1.0) Obsoletes: %{?scl_prefix}php-pecl-propro < 2.2 -Provides: %{?scl_prefix}php-pecl(%{proj_name}) = %{version} -Provides: %{?scl_prefix}php-pecl(%{proj_name})%{?_isa} = %{version} -Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} -Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} -Provides: %{?scl_prefix}php-%{pecl_name} = %{version} -Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} +# Extension +Provides: %{?scl_prefix}php-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} +# PECL +Provides: %{?scl_prefix}php-pecl(%{proj_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{proj_name})%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +# PIE +Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} +Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version} %description @@ -116,6 +125,8 @@ These are the files needed to compile programs using HTTP extension. sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml cd %{sources} +%patch -P0 -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 : Error: Upstream HTTP version is now ${extver}, expecting %{upstream_version}%{?upstream_prever}. @@ -272,6 +283,36 @@ 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 + +* Wed Jul 30 2025 Remi Collet <remi@fedoraproject.org> - 4.2.6-6 +- ignore 1 test with PHP 8.5.0apha3 reported as + https://github.com/m6w6/ext-http/issues/150 + +* Fri Jul 18 2025 Remi Collet <remi@fedoraproject.org> - 4.2.6-5 +- add patch for test suite with PHP 8.5.0apha2 from + https://github.com/m6w6/ext-http/pull/149 + +* Tue Jul 8 2025 Remi Collet <remi@fedoraproject.org> - 4.2.6-4 +- add patch for test suite with PHP 8.5.0alpha1 from + https://github.com/m6w6/ext-http/pull/148 + +* Thu Jan 23 2025 Remi Collet <remi@fedoraproject.org> - 4.2.6-3 +- fix incompatible pointer type FTBFS #2341063 + using patch from https://github.com/m6w6/ext-http/pull/143 +- re-license spec file to CECILL-2.1 + * Wed Nov 6 2024 Remi Collet <remi@remirepo.net> - 4.2.6-1 - update to 4.2.6 |
