Skip to content

Commit

Permalink
istream/Chunked: copy the "fallback" flag in _FillBucketList()
Browse files Browse the repository at this point in the history
Fixes stalled transfer because the HTTP server library never tried to
call Istream::Read().
  • Loading branch information
MaxKellermann committed Aug 16, 2023
1 parent 14d1d72 commit e03ef8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -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

--

Expand Down
6 changes: 5 additions & 1 deletion src/istream/ChunkedIstream.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e03ef8a

Please sign in to comment.