0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-18 01:48:27 +02:00

ircd::server: Add an op_open; handle control return to link::open().

This commit is contained in:
Jason Volk 2019-04-16 22:27:24 -07:00
parent 0f404a0bda
commit 83193d0ff9
2 changed files with 13 additions and 1 deletions

View file

@ -25,6 +25,7 @@ struct ircd::server::link
std::list<tag> queue; ///< link's work queue
bool op_init {false}; ///< link is connecting
bool op_fini {false}; ///< link is disconnecting
bool op_open {false};
bool op_write {false}; ///< async operation state
bool op_read {false}; ///< async operation state
bool exclude {false}; ///< link is excluded

View file

@ -1723,12 +1723,23 @@ ircd::server::link::open(const net::open_opts &open_opts)
};
op_init = true;
op_open = true;
const unwind::exceptional unhandled{[this]
{
op_init = false;
op_open = false;
}};
socket = net::open(open_opts, std::move(handler));
op_open = false;
if(finished())
{
assert(peer);
peer->handle_finished(*this);
return false;
}
return true;
}
@ -2351,7 +2362,7 @@ const
if(!bool(socket))
return true;
return !opened() && op_fini && !op_init && !op_write && !op_read;
return !opened() && op_fini && !op_init && !op_open && !op_write && !op_read;
}
size_t