0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd::server: Fix dynamic chunked encoding buffers not reused, affecting large transfers.

This commit is contained in:
Jason Volk 2020-12-07 12:02:24 -08:00
parent 95d692d36a
commit d194635a5e

View file

@ -4041,11 +4041,17 @@ ircd::server::tag::read_chunk_dynamic_content(const const_buffer &buffer,
if(req.in.progress && !done)
req.in.progress(buffer, const_buffer{chunk, state.chunk_read});
if(state.chunk_read == state.chunk_length)
const bool content_completed
{
state.chunk_read == state.chunk_length
};
if(content_completed)
chunk_dynamic_content_completed(*this, done);
assert(state.chunk_read <= state.chunk_length);
if(likely(state.chunk_read != state.chunk_length))
assert(!content_completed || state.chunk_read == state.chunk_length);
if(likely(!content_completed))
return {};
assert(state.chunk_read <= state.content_read);