mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-14 20:39:36 +03:00
Fix: TFO AsIs bug (#452)
This commit is contained in:
@ -130,7 +130,7 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
|
||||
}
|
||||
|
||||
if isTCPSocket(network) {
|
||||
tfo := int(config.Tfo)
|
||||
tfo := config.ParseTFOValue()
|
||||
if tfo > 0 {
|
||||
tfo = 1
|
||||
}
|
||||
@ -163,9 +163,10 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig)
|
||||
}
|
||||
}
|
||||
if isTCPSocket(network) {
|
||||
if config.Tfo >= 0 {
|
||||
if err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_FASTOPEN, int(config.Tfo)); err != nil {
|
||||
return newError("failed to set TCP_FASTOPEN=", config.Tfo).Base(err)
|
||||
tfo := config.ParseTFOValue()
|
||||
if tfo >= 0 {
|
||||
if err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_FASTOPEN, tfo); err != nil {
|
||||
return newError("failed to set TCP_FASTOPEN=", tfo).Base(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user