Browse Source

Fix a rare crash caused by a stopped client still being in write_ready_clients

Vitaliy Filippov 2 years ago
parent
commit
2ccb75974b
  1. 3
      msgr_send.cpp

3
msgr_send.cpp

@ -153,7 +153,8 @@ void osd_messenger_t::send_replies()
for (int i = 0; i < write_ready_clients.size(); i++)
{
int peer_fd = write_ready_clients[i];
if (!try_send(clients[peer_fd]))
auto cl_it = clients.find(peer_fd);
if (cl_it != clients.end() && !try_send(cl_it->second))
{
write_ready_clients.erase(write_ready_clients.begin(), write_ready_clients.begin() + i);
return;

Loading…
Cancel
Save