0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd::server: Additional assertions.

This commit is contained in:
Jason Volk 2018-04-07 06:01:38 -07:00
parent 8d91c90574
commit 6488141f64

View file

@ -367,6 +367,7 @@ void
ircd::server::peer::close(const net::close_opts &opts) ircd::server::peer::close(const net::close_opts &opts)
{ {
op_fini = true; op_fini = true;
assert(!op_resolve);
std::vector<link *> links(this->links.size()); std::vector<link *> links(this->links.size());
pointers(this->links, links); pointers(this->links, links);
for(const auto &link : links) for(const auto &link : links)
@ -577,7 +578,10 @@ ircd::server::peer::link_add(const size_t &num)
assert(!finished()); assert(!finished());
if(e) if(e)
{
std::rethrow_exception(e->eptr); std::rethrow_exception(e->eptr);
__builtin_unreachable();
}
assert(!op_fini); assert(!op_fini);
links.emplace_back(*this); links.emplace_back(*this);
@ -856,12 +860,14 @@ ircd::server::peer::handle_resolve(std::exception_ptr eptr,
const ipport &ipport) const ipport &ipport)
try try
{ {
assert(op_resolve);
op_resolve = false; op_resolve = false;
if(eptr) if(eptr)
{ {
err_set(eptr); err_set(eptr);
std::rethrow_exception(eptr); std::rethrow_exception(eptr);
__builtin_unreachable();
} }
this->remote = ipport; this->remote = ipport;