mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 00:37:43 +00:00
Merge pull request #768
43962f4
abstract_tcp_server2: possible fix for exception in handle_accept (moneromooo-monero)
This commit is contained in:
commit
2572706c2c
1 changed files with 17 additions and 4 deletions
|
@ -252,11 +252,24 @@ PRAGMA_WARNING_DISABLE_VS(4355)
|
||||||
template<class t_protocol_handler>
|
template<class t_protocol_handler>
|
||||||
void connection<t_protocol_handler>::save_dbg_log()
|
void connection<t_protocol_handler>::save_dbg_log()
|
||||||
{
|
{
|
||||||
|
std::string address, port;
|
||||||
|
boost::system::error_code e;
|
||||||
|
|
||||||
|
boost::asio::ip::tcp::endpoint endpoint = socket_.remote_endpoint(e);
|
||||||
|
if (e)
|
||||||
|
{
|
||||||
|
address = "<not connected>";
|
||||||
|
port = "<not connected>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
address = endpoint.address().to_string();
|
||||||
|
port = boost::lexical_cast<std::string>(endpoint.port());
|
||||||
|
}
|
||||||
_mark_c("net/kind" ,
|
_mark_c("net/kind" ,
|
||||||
" connection type " << to_string( m_connection_type ) << " "
|
" connection type " << to_string( m_connection_type ) << " "
|
||||||
<< socket_.local_endpoint().address().to_string() << ":" << socket_.local_endpoint().port()
|
<< socket_.local_endpoint().address().to_string() << ":" << socket_.local_endpoint().port()
|
||||||
<< " <--> " << socket_.remote_endpoint().address().to_string() << ":" << socket_.remote_endpoint().port()
|
<< " <--> " << address << ":" << port);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
template<class t_protocol_handler>
|
template<class t_protocol_handler>
|
||||||
|
|
Loading…
Reference in a new issue