From e2b7f4eb7172f912e9d33ac6467185be4ba3fac2 Mon Sep 17 00:00:00 2001 From: "a.stecher" Date: Wed, 11 Mar 2026 23:25:07 +0100 Subject: [PATCH 1/3] Add bailout check on curl progress. --- ext/curl/interface.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 5f69beac8e936..20ea85ab44a65 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -602,6 +602,11 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string) /* {{{ curl_progress */ static int curl_progress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { + /* 2. Check if we are in a "bailout" state (timeout) */ + if (EG(exception) || (EG(flags) & ZEN_EG_BAILOUT)) { + return 1; + } + php_curl *ch = (php_curl *)clientp; int rval = 0; From 048c504c9cbbfdbc39df2c880545cc5d4695c7e7 Mon Sep 17 00:00:00 2001 From: "a.stecher" Date: Sun, 15 Mar 2026 17:58:11 +0100 Subject: [PATCH 2/3] Curl shutdown check on progress. --- ext/curl/interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 20ea85ab44a65..ec76a10516580 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -602,9 +602,9 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string) /* {{{ curl_progress */ static int curl_progress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { - /* 2. Check if we are in a "bailout" state (timeout) */ - if (EG(exception) || (EG(flags) & ZEN_EG_BAILOUT)) { - return 1; + /* 2. Do not call progress callback if we are in a shutdown state (eg. timeout)*/ + if (UNEXPECTED(EG(flags) & EG_FLAGS_IN_SHUTDOWN)) { + return 0; } php_curl *ch = (php_curl *)clientp; From 0e8dea62bf6edeb098f9319c2911bf958a4e9fc9 Mon Sep 17 00:00:00 2001 From: "a.stecher" Date: Sun, 15 Mar 2026 17:58:32 +0100 Subject: [PATCH 3/3] curl shutdown check --- ext/curl/interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index ec76a10516580..1b22b14c1827f 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -602,7 +602,7 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string) /* {{{ curl_progress */ static int curl_progress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { - /* 2. Do not call progress callback if we are in a shutdown state (eg. timeout)*/ + /* Do not call progress callback if we are in a shutdown state (eg. timeout)*/ if (UNEXPECTED(EG(flags) & EG_FLAGS_IN_SHUTDOWN)) { return 0; }