From dec508aebb8cac9c305698410d6a55570d1ff111 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 25 Feb 2022 09:20:31 +0100 Subject: [PATCH] add upstream patch for recent libcurl --- pecl_http-upstream.patch | 46 ++++++++++++++++++++++++++++++++++++++++ php-pecl-http.spec | 12 +++++++++-- 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 pecl_http-upstream.patch diff --git a/pecl_http-upstream.patch b/pecl_http-upstream.patch new file mode 100644 index 0000000..452fedb --- /dev/null +++ b/pecl_http-upstream.patch @@ -0,0 +1,46 @@ +From e7b1f15da7b31de77e75cd81c2b2fc8816200f27 Mon Sep 17 00:00:00 2001 +From: Michael Wallner +Date: Mon, 21 Feb 2022 11:04:09 +0100 +Subject: [PATCH] fix recursive calls to curl_multi API from the user handler + +--- + src/php_http_client_curl_user.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/php_http_client_curl_user.c b/src/php_http_client_curl_user.c +index 1f69a51..95ea6f5 100644 +--- a/src/php_http_client_curl_user.c ++++ b/src/php_http_client_curl_user.c +@@ -57,9 +57,7 @@ static void php_http_client_curl_user_timer(CURLM *multi, long timeout_ms, void + fprintf(stderr, "\ntimer <- timeout_ms: %ld\n", timeout_ms); + #endif + +- if (timeout_ms <= 0) { +- php_http_client_curl_loop(context->client, CURL_SOCKET_TIMEOUT, 0); +- } else { ++ if (timeout_ms >= 0) { + zval args[1], *ztimeout = &args[0]; + + ZVAL_LONG(ztimeout, timeout_ms); +From 9fb1c51406519a06bf58589dc8e1c80b82beee09 Mon Sep 17 00:00:00 2001 +From: Michael Wallner +Date: Mon, 21 Feb 2022 11:06:19 +0100 +Subject: [PATCH] fix recursive calls to curl_multi API from the event handler + +--- + src/php_http_client_curl_event.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/php_http_client_curl_event.c b/src/php_http_client_curl_event.c +index b8db1b2..2e663ed 100644 +--- a/src/php_http_client_curl_event.c ++++ b/src/php_http_client_curl_event.c +@@ -97,8 +97,6 @@ static void php_http_client_curl_event_timer(CURLM *multi, long timeout_ms, void + } + break; + case 0: +- php_http_client_curl_event_handler(context, CURL_SOCKET_TIMEOUT, 0); +- break; + default: + if (!event_initialized(context->timeout)) { + event_assign(context->timeout, context->evbase, CURL_SOCKET_TIMEOUT, 0, php_http_client_curl_event_timeout_callback, context); diff --git a/php-pecl-http.spec b/php-pecl-http.spec index eba8254..ac54370 100644 --- a/php-pecl-http.spec +++ b/php-pecl-http.spec @@ -1,6 +1,6 @@ # Fedora spec file for php-pecl-http # -# Copyright (c) 2012-2021 Remi Collet +# Copyright (c) 2012-2022 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -28,7 +28,7 @@ Name: php-pecl-http Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 4%{?dist} +Release: 5%{?dist} Summary: Extended HTTP support License: BSD @@ -38,6 +38,9 @@ Source0: https://pecl.php.net/get/%{proj_name}-%{upstream_version}%{?upst # From http://www.php.net/manual/en/http.configuration.php Source1: %{proj_name}.ini +# Upstream patches for recent libcurl +Patch0: %{proj_name}-upstream.patch + BuildRequires: make BuildRequires: gcc BuildRequires: php-devel >= 8.0 @@ -107,6 +110,8 @@ sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml mv %{proj_name}-%{upstream_version}%{?upstream_prever} NTS cd NTS +%patch0 -p1 -b .up + extver=$(sed -n '/#define PHP_PECL_HTTP_VERSION/{s/.* "//;s/".*$//;p}' php_http.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}%{?gh_date:dev}"; then : Error: Upstream HTTP version is now ${extver}, expecting %{upstream_version}%{?upstream_prever}%{?gh_date:dev}. @@ -253,6 +258,9 @@ NO_INTERACTION=1 \ %changelog +* Fri Feb 25 2022 Remi Collet - 4.2.1-5 +- add upstream patch for recent libcurl + * Fri Jan 21 2022 Fedora Release Engineering - 4.2.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild