mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-09 14:01:06 +03:00
port forward: one tunnel per mapping, bound to the authenticated target
The login latches `PortForward.host`/`port` into the session scope and approval is shown that target, but a window-wide tunnel let any later `open` name another target with only `enable-tunnel` rechecked. A tunnel now belongs to one listener and serves the one target its login authenticated: the controlled side refuses an `open` for any other target, and a window with several targets uses one connection each, approved on its own. With one owner per tunnel the claim needs no waiters: `Establishing`, `Claim::Wait` and `wait_ready` go, and `try_claim` becomes a plain read. The CM label that followed a tunnel's targets goes with them; a row shows its mapping's target, as before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZ49AbZJYfm8NTp5yDPMab
This commit is contained in:
@@ -436,8 +436,6 @@ class FfiModel with ChangeNotifier {
|
||||
parent.target?.chatModel.onVoiceCallIncoming();
|
||||
} else if (name == 'update_voice_call_state') {
|
||||
parent.target?.serverModel.updateVoiceCallState(evt);
|
||||
} else if (name == 'update_port_forward') {
|
||||
parent.target?.serverModel.updatePortForward(evt);
|
||||
} else if (name == 'fingerprint') {
|
||||
FingerprintState.find(peerId).value = evt['fingerprint'] ?? '';
|
||||
} else if (name == "sync_peer_hash_password_to_personal_ab") {
|
||||
|
||||
@@ -768,16 +768,6 @@ class ServerModel with ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
void updatePortForward(Map<String, dynamic> evt) {
|
||||
final id = int.tryParse(evt['id']?.toString() ?? '');
|
||||
final portForward = evt['port_forward']?.toString() ?? '';
|
||||
if (id == null || portForward.isEmpty) return;
|
||||
final index = _clients.indexWhere((c) => c.id == id);
|
||||
if (index < 0) return;
|
||||
_clients[index].portForward = portForward;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void androidUpdatekeepScreenOn() async {
|
||||
if (!isAndroid) return;
|
||||
var floatingWindowDisabled =
|
||||
|
||||
Reference in New Issue
Block a user