mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-11 15:01:02 +03:00
review: cover Terminal in the displacement test, correct the ipc comment
Terminal is a kind the rule accepts and the test did not exercise. It stays in the main select loop, so nothing but the assertion was missing. `Displaced` ends one connection, not the session - the session is precisely what continues, on the connection that replaced it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns
This commit is contained in:
@@ -355,9 +355,10 @@ pub enum Data {
|
||||
MouseMoveTime(i64),
|
||||
Authorize,
|
||||
Close,
|
||||
// A newer authorized connection has taken this one's place. Ends the session like `Close`
|
||||
// but sends the peer nothing: the peer that owned this one has already moved on, and the
|
||||
// link it would be sent over is the very one that stopped working.
|
||||
// A newer authorized connection has taken this one's place. Ends the superseded connection
|
||||
// like `Close` - the session itself continues on the newer one - and sends the peer nothing:
|
||||
// the peer has already moved on, and the link it would be sent over is the very one that
|
||||
// stopped working.
|
||||
Displaced,
|
||||
#[cfg(windows)]
|
||||
SAS,
|
||||
|
||||
@@ -7635,12 +7635,13 @@ mod test {
|
||||
let mine = key(7, "peer");
|
||||
|
||||
// Every kind displaces its own: a stale remote control or camera view keeps the capture
|
||||
// loop waiting on it, and a stale transfer or tunnel holds its own resources.
|
||||
// loop waiting on it, and a stale transfer, tunnel or terminal holds its own resources.
|
||||
for kind in [
|
||||
AuthConnType::Remote,
|
||||
AuthConnType::ViewCamera,
|
||||
AuthConnType::FileTransfer,
|
||||
AuthConnType::PortForward,
|
||||
AuthConnType::Terminal,
|
||||
] {
|
||||
assert!(
|
||||
AuthedConnID::is_displaced(&conn(1, kind, mine.clone()), 2, kind, &mine),
|
||||
@@ -7661,6 +7662,7 @@ mod test {
|
||||
AuthConnType::FileTransfer,
|
||||
AuthConnType::PortForward,
|
||||
AuthConnType::ViewCamera,
|
||||
AuthConnType::Terminal,
|
||||
] {
|
||||
assert!(
|
||||
!AuthedConnID::is_displaced(
|
||||
|
||||
Reference in New Issue
Block a user