mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 19:28:52 +02:00
ircd::server: Add an op_open; handle control return to link::open().
This commit is contained in:
parent
0f404a0bda
commit
83193d0ff9
2 changed files with 13 additions and 1 deletions
|
@ -25,6 +25,7 @@ struct ircd::server::link
|
||||||
std::list<tag> queue; ///< link's work queue
|
std::list<tag> queue; ///< link's work queue
|
||||||
bool op_init {false}; ///< link is connecting
|
bool op_init {false}; ///< link is connecting
|
||||||
bool op_fini {false}; ///< link is disconnecting
|
bool op_fini {false}; ///< link is disconnecting
|
||||||
|
bool op_open {false};
|
||||||
bool op_write {false}; ///< async operation state
|
bool op_write {false}; ///< async operation state
|
||||||
bool op_read {false}; ///< async operation state
|
bool op_read {false}; ///< async operation state
|
||||||
bool exclude {false}; ///< link is excluded
|
bool exclude {false}; ///< link is excluded
|
||||||
|
|
|
@ -1723,12 +1723,23 @@ ircd::server::link::open(const net::open_opts &open_opts)
|
||||||
};
|
};
|
||||||
|
|
||||||
op_init = true;
|
op_init = true;
|
||||||
|
op_open = true;
|
||||||
const unwind::exceptional unhandled{[this]
|
const unwind::exceptional unhandled{[this]
|
||||||
{
|
{
|
||||||
op_init = false;
|
op_init = false;
|
||||||
|
op_open = false;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
socket = net::open(open_opts, std::move(handler));
|
socket = net::open(open_opts, std::move(handler));
|
||||||
|
op_open = false;
|
||||||
|
|
||||||
|
if(finished())
|
||||||
|
{
|
||||||
|
assert(peer);
|
||||||
|
peer->handle_finished(*this);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2351,7 +2362,7 @@ const
|
||||||
if(!bool(socket))
|
if(!bool(socket))
|
||||||
return true;
|
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
|
size_t
|
||||||
|
|
Loading…
Reference in a new issue