From e03ef8a24bb60c491906488d51e8b4843919b54e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 16 Aug 2023 17:39:28 +0200 Subject: [PATCH] istream/Chunked: copy the "fallback" flag in _FillBucketList() Fixes stalled transfer because the HTTP server library never tried to call Istream::Read(). --- debian/changelog | 1 + src/istream/ChunkedIstream.cxx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f1ad797eb..2d0371193 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ cm4all-beng-proxy (18.0.31) unstable; urgency=low * io_uring: fix endless loop (18.0.30 regression) * io_uring: re-enable sendfile() (18.0.30 regression) + * http: fix stalled chunk transfer -- diff --git a/src/istream/ChunkedIstream.cxx b/src/istream/ChunkedIstream.cxx index 55e300ecd..3c97fc5d5 100644 --- a/src/istream/ChunkedIstream.cxx +++ b/src/istream/ChunkedIstream.cxx @@ -361,8 +361,12 @@ ChunkedIstream::_FillBucketList(IstreamBucketList &list) missing_from_current_chunk); if (nbytes >= missing_from_current_chunk) list.Push(AsBytes(list.HasMore() ? "\r\n"sv : "\r\n0\r\n\r\n"sv)); - } else + } else { list.SetMore(); + + if (sub.ShouldFallback()) + list.EnableFallback(); + } } Istream::ConsumeBucketResult