0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-11 06:28:55 +02:00

ircd::server: Avoid unnecessary tail call on empty overrun buffer.

This commit is contained in:
Jason Volk 2019-06-28 19:32:52 -07:00
parent 1e45ffcba2
commit ca8dcb3271

View file

@ -3170,7 +3170,7 @@ ircd::server::tag::read_chunk_head(const const_buffer &buffer,
assert(state.chunk_length >= 2);
read_chunk_content(partial_chunk, done);
if(done)
if(done || empty(overrun))
return overrun;
// Prevent stack overflow from lots of tiny chunks nagled together.
@ -3384,7 +3384,7 @@ ircd::server::tag::read_chunk_dynamic_head(const const_buffer &buffer,
assert(state.chunk_length >= 2);
read_chunk_dynamic_content(partial_chunk, done);
if(done)
if(done || empty(overrun))
return overrun;
// Prevent stack overflow from lots of tiny chunks nagled together.