Skip to content

chore(rendezvous): drop unsupported UDP PunchHoleRequest and LocalAddr handlers - #35

Merged
hashbk merged 2 commits into
masterfrom
chore/remove-unsupported-udp-handlers
Sep 5, 2026
Merged

chore(rendezvous): drop unsupported UDP PunchHoleRequest and LocalAddr handlers#35
hashbk merged 2 commits into
masterfrom
chore/remove-unsupported-udp-handlers

Conversation

@hashbk

@hashbk hashbk commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Remove UDP handlers in handle_udp for PunchHoleRequest and LocalAddr messages that the client never sends over UDP, and delete the now-dead handle_udp_punch_hole_request function.

Analysis

Independent code trace of the upstream client (rustdesk/rustdesk) confirms the actual transport channel for each rendezvous message:

Message Client send site Transport UDP handler needed?
PunchHoleRequest client.rs:482 (_start_inner) TCP (connect_tcp at client.rs:394) No
PunchHoleSent rendezvous_mediator.rs:735 (punch_udp_hole) UDP when ph.udp_port > 0 (new_direct_udp_for) Yes
LocalAddr rendezvous_mediator.rs:645 (handle_intranet_) TCP (connect_tcp at rendezvous_mediator.rs:629) No

The client always opens a TCP connection to the rendezvous server in _start_inner and sends PunchHoleRequest over that TCP socket. LocalAddr is likewise sent over a TCP connection in handle_intranet_. Only PunchHoleSent is genuinely sent over UDP (via punch_udp_hole when the peer's udp_port > 0).

Changes

  • handle_udp: replace PunchHoleRequest and LocalAddr arms with intentionally-unsupported no-ops (matching upstream's approach)
  • Delete handle_udp_punch_hole_request (was only called from the removed PunchHoleRequest arm)
  • Keep PunchHoleSent UDP handling unchanged — the client relies on it for UDP/KCP direct connections

Note

This aligns the server with what the client actually does over UDP, while preserving the PunchHoleSent UDP path that PR #32 intentionally kept (excluded from the upstream UDP punch-hole disabling).

…r handlers

The client never sends PunchHoleRequest or LocalAddr over UDP:
- PunchHoleRequest is sent over TCP/WS (client.rs _start_inner uses connect_tcp)
- LocalAddr is sent over TCP (rendezvous_mediator.rs handle_intranet_ uses connect_tcp)

Remove the dead UDP handlers in handle_udp and delete the now-unused
handle_udp_punch_hole_request function. Keep UDP PunchHoleSent handling
because the client does send it over UDP when ph.udp_port > 0.
@hashbk
hashbk merged commit bb4528a into master Sep 5, 2026
2 checks passed
@hashbk
hashbk deleted the chore/remove-unsupported-udp-handlers branch September 5, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant