fix rdp not work, caused by test_delay_timer (#7274)

* fix rdp not work, caused by test_delay_timer

Signed-off-by: 21pages <pages21@163.com>

* Update connection.rs

---------

Signed-off-by: 21pages <pages21@163.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
This commit is contained in:
21pages 2024-02-28 00:11:02 +08:00 committed by GitHub
parent 50d080d098
commit 7fca0ba588
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -423,7 +423,14 @@ impl Connection {
if !conn.block_input {
conn.send_permission(Permission::BlockInput, false).await;
}
let mut test_delay_timer = crate::rustdesk_interval(time::interval(TEST_DELAY_TIMEOUT));
// Note: The start parameter of interval_at needs to add TEST_DELAY_TIMEOUT, otherwise windows rdp will be affected.
// This is because controlling's TestDelay messsage comes late and injects to rdp data flow.
// Todo: Controlling side sends a notification message to controlled side before entering port forward loop, https://github.com/rustdesk/rustdesk/blob/50d080d098b22f53e46744fbdd286f2d81d64a4d/src/port_forward.rs#L187
//, and controller side waits for this notification before entering port forward loop.
let mut test_delay_timer = crate::rustdesk_interval(time::interval_at(
Instant::now() + TEST_DELAY_TIMEOUT,
TEST_DELAY_TIMEOUT,
));
let mut last_recv_time = Instant::now();
conn.stream.set_send_timeout(