Skip to content

Commit

Permalink
dialers/desync: in relaxed mode, skip desync on udp errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Aug 11, 2024
1 parent f04ffb5 commit 00059c0
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 90 deletions.
2 changes: 2 additions & 0 deletions intra/dialers/ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import (
)

const (
errNilConn = net.UnknownNetworkError("nil connection")
errNoConn = net.UnknownNetworkError("no connection")
errNoSysConn = net.UnknownNetworkError("no sys connection")
errNoIps = net.UnknownNetworkError("no ips")
errNoDialer = net.UnknownNetworkError("no dialer")
errNoListener = net.UnknownNetworkError("no listener")
Expand Down
3 changes: 1 addition & 2 deletions intra/dialers/rdial.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ func desyncIpConnect(d *protect.RDial, proto string, ip netip.Addr, port int) (n
switch proto {
case "tcp", "tcp4", "tcp6":
if !ip.IsPrivate() {
payload := []byte(Http1_1String)
return DialWithSplitAndDesyncSmart(d, netip.AddrPortFrom(ip, uint16(port)), payload)
return DialWithSplitAndDesync(d, netip.AddrPortFrom(ip, uint16(port)))
}
return d.DialTCP(proto, nil, tcpaddr(ip, port))
case "udp", "udp4", "udp6":
Expand Down
Loading

3 comments on commit 00059c0

@ignoramous
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#81

@Lanius-collaris
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't understand "relaxed mode". Why did you write "skip" but overwrite the buffer like before? I think "relaxed mode" should be something like the old "direct_split" or WeirdSplitter (In this file, you can keep "real" data in the buffer and set DESYNC_NOOP_TTL to 1).

@ignoramous
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think relaxed mode is used (I had added it for testing)... probably should get rid.

Please sign in to comment.