mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 02:02:38 +01:00
ircd::net::socket: Minor cleanup; move warning into unlikely branch.
This commit is contained in:
parent
6da9219039
commit
56c025ab7b
2 changed files with 14 additions and 15 deletions
|
@ -105,15 +105,12 @@ struct ircd::net::socket
|
|||
void wait(const wait_opts &);
|
||||
void wait(const wait_opts &, wait_callback_ec);
|
||||
void wait(const wait_opts &, wait_callback_eptr);
|
||||
|
||||
void cancel() noexcept;
|
||||
|
||||
// Alias to wait()
|
||||
template<class... args> auto operator()(args&&...);
|
||||
template<class... args> auto operator()(args&&...); // Alias to wait()
|
||||
|
||||
void disconnect(const close_opts &, eptr_handler);
|
||||
void handshake(const open_opts &, eptr_handler);
|
||||
void connect(const endpoint &, const open_opts &, eptr_handler);
|
||||
bool cancel() noexcept;
|
||||
|
||||
socket(asio::ssl::context & = sslv23_client,
|
||||
boost::asio::io_service & = ios::get());
|
||||
|
|
10
ircd/net.cc
10
ircd/net.cc
|
@ -2966,7 +2966,7 @@ catch(const std::exception &e)
|
|||
};
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
ircd::net::socket::cancel()
|
||||
noexcept
|
||||
{
|
||||
|
@ -2974,9 +2974,8 @@ noexcept
|
|||
|
||||
boost::system::error_code ec;
|
||||
sd.cancel(ec);
|
||||
if(likely(!ec))
|
||||
return;
|
||||
|
||||
if(unlikely(ec))
|
||||
{
|
||||
thread_local char ecbuf[64];
|
||||
log::dwarning
|
||||
{
|
||||
|
@ -2984,6 +2983,9 @@ noexcept
|
|||
this->id,
|
||||
string(ecbuf, ec)
|
||||
};
|
||||
}
|
||||
|
||||
return !ec;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue