mirror of
https://github.com/transmission/transmission
synced 2024-12-23 16:24:02 +00:00
fix: assertion failed: port_empty in tr_swarm::remove_peer()
(#6062)
This commit is contained in:
parent
170f589b64
commit
5808f72f50
1 changed files with 9 additions and 9 deletions
|
@ -273,8 +273,7 @@ public:
|
|||
|
||||
auto* const peer_info = peer->peer_info;
|
||||
auto const socket_address = peer->socket_address();
|
||||
auto const listen_socket_address = peer_info->listen_socket_address();
|
||||
auto const was_incoming = peer->is_incoming_connection();
|
||||
[[maybe_unused]] auto const is_incoming = peer->is_incoming_connection();
|
||||
TR_ASSERT(peer_info != nullptr);
|
||||
|
||||
--stats.peer_count;
|
||||
|
@ -288,16 +287,17 @@ public:
|
|||
|
||||
delete peer;
|
||||
|
||||
if (was_incoming)
|
||||
if (std::empty(peer_info->listen_port())) // is not connectable
|
||||
{
|
||||
[[maybe_unused]] auto const port_empty = std::empty(peer_info->listen_port());
|
||||
if (incoming_pool.erase(socket_address) != 0U)
|
||||
TR_ASSERT(is_incoming);
|
||||
[[maybe_unused]] auto const count = incoming_pool.erase(socket_address);
|
||||
TR_ASSERT(count != 0U);
|
||||
}
|
||||
else
|
||||
{
|
||||
TR_ASSERT(port_empty);
|
||||
graveyard_pool.erase(peer_info->listen_socket_address());
|
||||
}
|
||||
}
|
||||
graveyard_pool.erase(listen_socket_address);
|
||||
}
|
||||
|
||||
void remove_all_peers()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue