Fixes the Windows RDP + CredSSP/NLA failure reported in #109.
What was failing
surf5726 connected to a Windows RDP server (HYBRID_EX security protocol selected, NLA enabled — the default). The Rust diagnostic pipe surfaced:
RDP connect finalize failed: Error { context: "read frame by hint", kind: Custom,
source: Some(Os { code: 11, kind: WouldBlock, message: "Try again" }) }
This was the first Windows-target RDP attempt in this codebase that we have logs for — earlier xrdp-based testing never hit it because xrdp's default security mode is plain SSL with no CredSSP, so no blocking NTLM round-trip.
Root cause
rdp-kotlin/rust/src/lib.rs set the TCP socket's read timeout to 100 ms globally so the active session loop could poll the shutdown flag responsively. That timeout was too short for CredSSP/NLA against a Windows server — the NTLM challenge → AUTHENTICATE round-trip can comfortably exceed 100 ms. When the client's read fired before the server's reply arrived, ironrdp-blocking's connect_finalize bubbled the WouldBlock up as a fatal error instead of retrying.
The session-loop branch that handles read_pdu already catches WouldBlock/TimedOut and continues, but the connector path doesn't — and shouldn't, because that would mask real protocol errors.
Fix
- Set a generous 30 s read timeout for the handshake phase.
- Use a
try_clone'dTcpStreamhandle to shrink the timeout back to 100 ms right afterconnect_finalizereturns, just before the session loop starts. - Session-loop shutdown polling stays at 100 ms and is unchanged.
The try_clone lets us touch the underlying socket without reaching through the rustls TLS wrap, which would have been awkward.
Likely also fixes #106
#106 (tarokeitaro, TacticalGator) had the same "tap RDP, end up on empty Desktop tab, nothing happens" symptom — and pre-v5.24.21 the actual error was being swallowed silently. Both reporters were targeting Windows RDP, which means this same WouldBlock likely killed their handshakes too. Cross-posted on #106 asking them to retest.
Build artifacts
Signed APKs for arm64 and x86_64 attached. arm64 is the one for phones and tablets.