]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
psgi_rproxy: fix uploads with small output buffers
authorEric Wong <e@80x24.org>
Thu, 23 Oct 2025 10:21:00 +0000 (10:21 +0000)
committerEric Wong <e@80x24.org>
Fri, 24 Oct 2025 08:15:17 +0000 (08:15 +0000)
commit9c3c2eb9b021cd4c07f401c262c16e88a5c09a74
tree22f5913309ffbced141f650f73cea241ee687f8a
parent5e2bbdf267f4ba263489fade9bd428604925a5f0
psgi_rproxy: fix uploads with small output buffers

Attempting to call pass_res_hdr directly fails when the previous
DS->write to the upstream hit EAGAIN.  Ensure correct ordering
by relying on DS->write to call the pass_res_hdr subroutine
after the previous DS->write is complete.  In other words, we
must not try reading the upstream response until our request is
fully sent to the upstream.

I noticed this after installing HTTP::Parser::XS
(p5-HTTP-Parser-XS) on my FreeBSD machine since our PsgiRproxy
module depends the XS package for parsing HTTP/1.x responses.
lib/PublicInbox/H1ReqRes.pm