Files
rustdesk/src/flutter.rs
rustdesk 471a176b15 client: send the clipboard only to a peer that has accepted the login
The clipboard listener is one per process, started by the first session to
log in, and its broadcast went to every session - one whose login was still
waiting on a password, 2FA or the peer's consent included. What the user
copied meanwhile went to a machine that had not admitted them; the peer
drops it unread before authorization, but it is in that peer's hands.

A session now records the PeerInfo that answers its login, the moment it is
in, and is passed over until then - and again from the first act of every
connection round, so a reconnect waiting on its password is passed over too.
connection_round_state cannot stand in for that: it says Connected as soon
as the transport is up.

The unauthenticated cap on the other side is how this came up: a clipboard
over 128 KiB ended such a login with "Reset by the peer". The small case had
always gone through quietly.

A test puts two sessions in the table, one with its PeerInfo in and one
without, and broadcasts: the first receives, the second not until its
PeerInfo is in too.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab
2026-09-19 23:58:21 +08:00

82 KiB