mirror of
https://github.com/matrix-construct/construct
synced 2024-11-30 02:32:43 +01:00
ircd::server: Fix dynamic chunked encoding buffers not reused, affecting large transfers.
This commit is contained in:
parent
95d692d36a
commit
d194635a5e
1 changed files with 8 additions and 2 deletions
|
@ -4041,11 +4041,17 @@ ircd::server::tag::read_chunk_dynamic_content(const const_buffer &buffer,
|
||||||
if(req.in.progress && !done)
|
if(req.in.progress && !done)
|
||||||
req.in.progress(buffer, const_buffer{chunk, state.chunk_read});
|
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);
|
chunk_dynamic_content_completed(*this, done);
|
||||||
|
|
||||||
assert(state.chunk_read <= state.chunk_length);
|
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 {};
|
return {};
|
||||||
|
|
||||||
assert(state.chunk_read <= state.content_read);
|
assert(state.chunk_read <= state.content_read);
|
||||||
|
|
Loading…
Reference in a new issue