0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 15:30:52 +01:00

ircd::json::stack: Add method to check for pending eptr.

This commit is contained in:
Jason Volk 2019-03-28 15:36:33 -07:00
parent 8523aea56a
commit 840b3c4b0c
2 changed files with 10 additions and 2 deletions

View file

@ -68,6 +68,7 @@ struct ircd::json::stack
public:
bool opened() const; ///< Current stacking in progress.
bool closed() const; ///< No stacking in progress.
bool failed() const; ///< Exception pending in eptr.
bool clean() const; ///< Never opened.
bool done() const; ///< Opened and closed.
size_t remaining() const;

View file

@ -671,7 +671,7 @@ ircd::json::stack::append(const size_t &expect,
const window_buffer::closure &closure)
noexcept try
{
if(unlikely(eptr))
if(unlikely(failed()))
return;
if(expect > buf.remaining())
@ -724,7 +724,7 @@ noexcept try
if(!flusher)
return false;
if(unlikely(eptr))
if(unlikely(failed()))
return false;
if(!force && buf.consumed() < lowat)
@ -787,6 +787,13 @@ const
return buf.remaining();
}
bool
ircd::json::stack::failed()
const
{
return bool(eptr);
}
bool
ircd::json::stack::done()
const