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

ircd: Various exception assertions; minor cleanup.

This commit is contained in:
Jason Volk 2018-03-15 13:44:29 -07:00
parent a48426e25d
commit 3810b8d57f
4 changed files with 20 additions and 12 deletions

View file

@ -62,7 +62,7 @@ struct ircd::client
bool resource_request(const http::request::head &);
bool handle_request(parse::capstan &pc);
bool main() noexcept;
void async();
bool async();
public:
client(std::shared_ptr<socket>);

View file

@ -30,7 +30,7 @@ struct ircd::ctx::pool
std::vector<context> ctxs;
void next();
void main();
void main() noexcept;
public:
// indicators

View file

@ -267,9 +267,10 @@ namespace ircd
///
/// This call returns immediately so we no longer block the current context and
/// its stack while waiting for activity on idle connections between requests.
void
bool
ircd::client::async()
{
const unwind::nominal::assertion na;
assert(bool(this->sock));
assert(bool(this->conf));
auto &sock(*this->sock);
@ -289,6 +290,7 @@ ircd::client::async()
};
sock(opts, std::move(handler));
return true;
}
/// The client's socket is ready for reading. This intermediate handler

View file

@ -727,7 +727,7 @@ ircd::ctx::pool::interrupt()
void
ircd::ctx::pool::main()
try
noexcept try
{
++running;
const unwind avail([this]
@ -741,10 +741,13 @@ try
catch(const interrupted &e)
{
/*
log::debug("pool(%p) ctx(%p): %s",
this,
&cur(),
e.what());
log::debug
{
"pool(%p) ctx(%p): %s",
this,
&cur(),
e.what()
};
*/
}
@ -773,10 +776,13 @@ catch(const interrupted &e)
}
catch(const std::exception &e)
{
log::critical("pool(%p) ctx(%p): unhandled: %s",
this,
&cur(),
e.what());
log::critical
{
"pool(%p) ctx(%p): unhandled: %s",
this,
&cur(),
e.what()
};
}
void