Browse Source

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

tags/v0.5.1
Vitaliy Filippov 2 months ago
parent
commit
2ccb75974b
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      msgr_send.cpp

+ 2
- 1
msgr_send.cpp View File

@@ -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