0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01: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 resource_request(const http::request::head &);
bool handle_request(parse::capstan &pc); bool handle_request(parse::capstan &pc);
bool main() noexcept; bool main() noexcept;
void async(); bool async();
public: public:
client(std::shared_ptr<socket>); client(std::shared_ptr<socket>);

View file

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

View file

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

View file

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