Don't warn when we can't send back to an non-SN incoming connection

This happens commonly when the remote has gone away and we shouldn't be
warning about it.
This commit is contained in:
Jason Rhinelander 2021-04-15 20:16:44 -03:00
parent 39dce56e14
commit 6d20a3614a
1 changed files with 6 additions and 1 deletions

View File

@ -176,7 +176,12 @@ void OxenMQ::proxy_send(bt_dict_consumer data) {
}
}
if (!retry) {
LMQ_LOG(warn, "Unable to send message to ", conn_id, ": ", e.what());
if (!conn_id.sn() && !conn_id.route.empty()) { // incoming non-SN connection
LMQ_LOG(debug, "Unable to send message to incoming connection ", conn_id, ": ", e.what(),
"; remote has probably disconnected");
} else {
LMQ_LOG(warn, "Unable to send message to ", conn_id, ": ", e.what());
}
nowarn = true;
if (callback_nosend) {
job([callback = std::move(callback_nosend), error = e] { callback(&error); });