mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 11:29:36 +03:00
Add tcpMaxSeg
to sockopt
(#2002)
This commit is contained in:
@ -94,6 +94,13 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
|
||||
return newError("failed to set TCP_USER_TIMEOUT", err)
|
||||
}
|
||||
}
|
||||
|
||||
if config.TcpMaxSeg > 0 {
|
||||
if err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_MAXSEG, int(config.TcpMaxSeg)); err != nil {
|
||||
return newError("failed to set TCP_MAXSEG", err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if config.Tproxy.IsEnabled() {
|
||||
@ -156,6 +163,12 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig)
|
||||
return newError("failed to set TCP_USER_TIMEOUT", err)
|
||||
}
|
||||
}
|
||||
|
||||
if config.TcpMaxSeg > 0 {
|
||||
if err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_MAXSEG, int(config.TcpMaxSeg)); err != nil {
|
||||
return newError("failed to set TCP_MAXSEG", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if config.Tproxy.IsEnabled() {
|
||||
|
Reference in New Issue
Block a user