Wrap HI response in try/catch

It's possible that the client has gone away, in which case we can get an
exception raised from an unroutable request.
This commit is contained in:
Jason Rhinelander 2020-02-29 16:06:08 -04:00
parent 3be632e73e
commit 1ad68b2605
1 changed files with 3 additions and 1 deletions

View File

@ -1332,7 +1332,9 @@ bool LokiMQ::proxy_handle_builtin(size_t conn_index, std::vector<zmq::message_t>
return true;
}
LMQ_LOG(info, "Incoming client from ", peer_address(parts.back()), " sent HI, replying with HELLO");
send_routed_message(connections[conn_index], std::string{route}, "HELLO");
try {
send_routed_message(connections[conn_index], std::string{route}, "HELLO");
} catch (const std::exception &e) { LMQ_LOG(warn, "Couldn't reply with HELLO: ", e.what()); }
return true;
} else if (cmd == "HELLO") {
if (!outgoing) {