mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 08:12:37 +01:00
ircd::json: Improve return count; add condition for noisy dwarning.
This commit is contained in:
parent
6edb1d4eec
commit
305aa691e7
1 changed files with 13 additions and 9 deletions
22
ircd/json.cc
22
ircd/json.cc
|
@ -1077,14 +1077,15 @@ noexcept try
|
|||
invalidate_checkpoints()
|
||||
};
|
||||
|
||||
log::dwarning
|
||||
{
|
||||
"Flushing json::stack(%p) bytes:%zu level:%zu checkpoints:%zu",
|
||||
this,
|
||||
size(buf.completed()),
|
||||
level,
|
||||
invalidated,
|
||||
};
|
||||
if(invalidated)
|
||||
log::dwarning
|
||||
{
|
||||
"Flushing json::stack(%p) bytes:%zu level:%zu checkpoints:%zu",
|
||||
this,
|
||||
size(buf.completed()),
|
||||
level,
|
||||
invalidated,
|
||||
};
|
||||
}
|
||||
|
||||
// The user returns the portion of the buffer they were able to flush
|
||||
|
@ -1111,8 +1112,11 @@ size_t
|
|||
ircd::json::stack::invalidate_checkpoints()
|
||||
{
|
||||
size_t ret(0);
|
||||
for(auto cp(this->cp); cp; cp = cp->pc, ++ret)
|
||||
for(auto cp(this->cp); cp; cp = cp->pc)
|
||||
{
|
||||
ret += cp->s != nullptr;
|
||||
cp->s = nullptr;
|
||||
}
|
||||
|
||||
this->cp = nullptr;
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue