mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Added tcp fragmentation for freedom outbound (#2021)
* Added tcp fragmentation for freedom outbound * Added TCP_NODELAY to outbound sockopt * Changed fragment parameters to accept ranges and changed strategy to use length * Changed packetNumber to packets, supporting range. * Refactored the freedom fragment logic * Refine Write() --------- Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
parent
c80646a045
commit
5f5ae37571
10 changed files with 392 additions and 71 deletions
|
@ -126,6 +126,12 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
|
|||
return newError("failed to unset SO_KEEPALIVE", err)
|
||||
}
|
||||
}
|
||||
|
||||
if config.TcpNoDelay {
|
||||
if err := unix.SetsockoptInt(int(fd), unix.IPPROTO_TCP, unix.TCP_NODELAY, 1); err != nil {
|
||||
return newError("failed to set TCP_NODELAY", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue