mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 11:18:51 +02:00
ircd::net: Add debugging messages for client connect; also for unhandled server errors.
This commit is contained in:
parent
5a8cc4e8cd
commit
fe4c59003f
2 changed files with 28 additions and 1 deletions
|
@ -474,7 +474,11 @@ ircd::handle_ec(client &client,
|
|||
case success: return handle_ec_success(client);
|
||||
case eof: return handle_ec_eof(client);
|
||||
case operation_canceled: return handle_ec_timeout(client);
|
||||
default: throw boost::system::system_error(ec);
|
||||
default:
|
||||
{
|
||||
log::debug("client(%p): %s", &client, ec.message());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
23
ircd/net.cc
23
ircd/net.cc
|
@ -619,6 +619,11 @@ ircd::net::socket::socket(const std::string &host,
|
|||
if(epit == end)
|
||||
throw nxdomain("host '%s' not found", host.data());
|
||||
|
||||
log::debug("resolved remote %s:%u => %s",
|
||||
host,
|
||||
port,
|
||||
string(*epit));
|
||||
|
||||
return *epit;
|
||||
}(),
|
||||
timeout,
|
||||
|
@ -632,9 +637,27 @@ ircd::net::socket::socket(const ip::tcp::endpoint &remote,
|
|||
const milliseconds &timeout,
|
||||
asio::ssl::context &ssl,
|
||||
boost::asio::io_service *const &ios)
|
||||
try
|
||||
:socket{ssl, ios}
|
||||
{
|
||||
log::debug("socket(%p) connecting to remote: %s timeout: %ld$ms",
|
||||
this,
|
||||
string(remote),
|
||||
timeout.count());
|
||||
|
||||
connect(remote, timeout);
|
||||
|
||||
log::debug("socket(%p) connected to remote: %s from local: %s",
|
||||
this,
|
||||
string(remote),
|
||||
string(local()));
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::debug("socket(%p) failed to connect to remote %s: %s",
|
||||
this,
|
||||
string(remote),
|
||||
e.what());
|
||||
}
|
||||
|
||||
ircd::net::socket::socket(asio::ssl::context &ssl,
|
||||
|
|
Loading…
Reference in a new issue