mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-12-05 07:48:06 +00:00
fix: wait for the peer to close after a login error or privacy-mode notice
A LoginResponse error is often the last message before the connection closes (login scope change, switch-sides rejection, ID whitelist, privacy mode on, offline). The PrvOnByOther notice is likewise sent right before on_close. Over WebRTC or KCP, dropping the stream right after these sends can discard them, so they now take the same bounded delivery wait as CloseReason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
This commit is contained in:
1 parent
0de25e4fd4
commit
24fff979e1
1 file changed
+3
@@ -1206,6 +1206,7 @@ impl Connection<'_> {
|
||||
back_notification::PrivacyModeState::PrvOnByOther,
|
||||
String::new(),
|
||||
)).await;
|
||||
conn.sent_close_reason = true;
|
||||
conn.on_close("privacy mode", false).await;
|
||||
break;
|
||||
}
|
||||
@@ -2491,6 +2492,8 @@ impl Connection<'_> {
|
||||
self.lr.trusted_device_v2_supported && self.trusted_device.is_some();
|
||||
msg_out.set_login_response(res);
|
||||
self.send(msg_out).await;
|
||||
// Many callers close right after this, so the error needs the same delivery wait.
|
||||
self.sent_close_reason = true;
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
||||
Reference in new issue
Block a user