fix: client sends Hangup before disconnect, relay handles timeouts gracefully

Client: sends SignalMessage::Hangup(Normal) before closing in all modes
(send-tone, file mode, silence mode) so the relay knows the session ended.

Relay: downgrades "timed out" / "reset" / "closed" recv errors from
ERROR to INFO since these are normal disconnect scenarios.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Siavash Sameni
2026-03-28 15:15:47 +04:00
parent 4d2c9838c5
commit 6310864b0b
2 changed files with 16 additions and 4 deletions

View File

@@ -281,7 +281,12 @@ async fn run_participant_plain(
break;
}
Err(e) => {
error!(%addr, participant = participant_id, "recv error: {e}");
let msg = e.to_string();
if msg.contains("timed out") || msg.contains("reset") || msg.contains("closed") {
info!(%addr, participant = participant_id, "connection closed: {e}");
} else {
error!(%addr, participant = participant_id, "recv error: {e}");
}
break;
}
};