mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd::resource::response: Add flush/push option to chunked::finish().
This commit is contained in:
parent
f30c5f381b
commit
44bee11fc0
2 changed files with 6 additions and 2 deletions
|
@ -96,7 +96,7 @@ struct ircd::resource::response::chunked
|
|||
|
||||
size_t write(const const_buffer &chunk, const bool &ignore_empty = true);
|
||||
const_buffer flush(const const_buffer &);
|
||||
bool finish();
|
||||
bool finish(const bool psh = false);
|
||||
|
||||
std::function<const_buffer (const const_buffer &)> flusher();
|
||||
|
||||
|
|
|
@ -880,13 +880,17 @@ ircd::resource::response::chunked::flusher()
|
|||
}
|
||||
|
||||
bool
|
||||
ircd::resource::response::chunked::finish()
|
||||
ircd::resource::response::chunked::finish(const bool psh)
|
||||
{
|
||||
if(!c)
|
||||
return false;
|
||||
|
||||
write(const_buffer{}, false);
|
||||
assert(finished);
|
||||
|
||||
if(psh)
|
||||
net::flush(*c->sock);
|
||||
|
||||
c = nullptr;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue