mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd: Various exception assertions; minor cleanup.
This commit is contained in:
parent
a48426e25d
commit
3810b8d57f
4 changed files with 20 additions and 12 deletions
|
@ -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>);
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
16
ircd/ctx.cc
16
ircd/ctx.cc
|
@ -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
|
||||||
|
{
|
||||||
|
"pool(%p) ctx(%p): %s",
|
||||||
this,
|
this,
|
||||||
&cur(),
|
&cur(),
|
||||||
e.what());
|
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
|
||||||
|
{
|
||||||
|
"pool(%p) ctx(%p): unhandled: %s",
|
||||||
this,
|
this,
|
||||||
&cur(),
|
&cur(),
|
||||||
e.what());
|
e.what()
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue