mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-24 08:22:24 +00:00
net_node: fix connection leak when ping fails with bad response
If there is no comms error, but the response is not as expected, close would not be called.
This commit is contained in:
parent
1c66fe04bc
commit
7450656bf3
1 changed files with 1 additions and 0 deletions
|
@ -1319,6 +1319,7 @@ namespace nodetool
|
||||||
if(rsp.status != PING_OK_RESPONSE_STATUS_TEXT || pr != rsp.peer_id)
|
if(rsp.status != PING_OK_RESPONSE_STATUS_TEXT || pr != rsp.peer_id)
|
||||||
{
|
{
|
||||||
LOG_PRINT_CC_L2(ping_context, "back ping invoke wrong response \"" << rsp.status << "\" from" << ip << ":" << port << ", hsh_peer_id=" << pr_ << ", rsp.peer_id=" << rsp.peer_id);
|
LOG_PRINT_CC_L2(ping_context, "back ping invoke wrong response \"" << rsp.status << "\" from" << ip << ":" << port << ", hsh_peer_id=" << pr_ << ", rsp.peer_id=" << rsp.peer_id);
|
||||||
|
m_net_server.get_config_object().close(ping_context.m_connection_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_net_server.get_config_object().close(ping_context.m_connection_id);
|
m_net_server.get_config_object().close(ping_context.m_connection_id);
|
||||||
|
|
Loading…
Reference in a new issue