diff --git a/pkgs/by-name/cu/curlMinimal/fix-h2-paused-transfers.patch b/pkgs/by-name/cu/curlMinimal/fix-h2-paused-transfers.patch new file mode 100644 index 000000000000..50e202684b8c --- /dev/null +++ b/pkgs/by-name/cu/curlMinimal/fix-h2-paused-transfers.patch @@ -0,0 +1,27 @@ +From 7e91f24c73256af59ac9061c41b73a184c4690aa Mon Sep 17 00:00:00 2001 +From: Stefan Eissing +Date: Mon, 3 Nov 2025 15:07:57 +0100 +Subject: [PATCH] cw-out: fix EAGAIN handling on pause + +The interim CURLE_AGAIN result was not always converted to a +CURLE_OK and then caused write callers to report a failure. + +Fixes #19334 +Reported-by: pennae on github +Closes #19338 +--- + lib/cw-out.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/cw-out.c b/lib/cw-out.c +index 1f4031649267..9c0a36e7e5e2 100644 +--- a/lib/cw-out.c ++++ b/lib/cw-out.c +@@ -302,6 +302,7 @@ static CURLcode cw_out_buf_flush(struct cw_out_ctx *ctx, + &consumed); + if(result && (result != CURLE_AGAIN)) + return result; ++ result = CURLE_OK; + + if(consumed) { + if(consumed == curlx_dyn_len(&cwbuf->b)) { diff --git a/pkgs/by-name/cu/curlMinimal/package.nix b/pkgs/by-name/cu/curlMinimal/package.nix index 2ce9522d6f4d..244454016e47 100644 --- a/pkgs/by-name/cu/curlMinimal/package.nix +++ b/pkgs/by-name/cu/curlMinimal/package.nix @@ -98,6 +98,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-QMjN28tsxiUcA96kI6Ryps6kA3vmVLpc9d7G6y0i/x0="; }; + patches = [ + # Bug introduced in curl@fa915b (8.16.0) https://github.com/curl/curl/issues/19334 Paused + # HTTP/2 transfers will return the wrong errors and trash the whole + # transfer. Remove this patch once curl is updated to 8.17.0 which will be + # released on the 5th November 2025. + ./fix-h2-paused-transfers.patch + ]; + # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion # necessary for FreeBSD code path in configure postPatch = ''