Upgrade github.com/xtls/reality to f34b4d174342

Fixes https://github.com/XTLS/Xray-core/issues/1712
This commit is contained in:
RPRX 2023-02-26 19:26:57 +08:00 committed by GitHub
parent a5b297f968
commit c38179a67f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 8 deletions

View file

@ -495,10 +495,6 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
return newError(`failed to use `+requestAddons.Flow+`, found outer tls version `, tlsConn.ConnectionState().Version).AtWarning()
}
netConn = tlsConn.NetConn()
if pc, ok := netConn.(*proxyproto.Conn); ok {
netConn = pc.Raw()
// 8192 > 4096, there is no need to process pc's bufReader
}
t = reflect.TypeOf(tlsConn.Conn).Elem()
p = uintptr(unsafe.Pointer(tlsConn.Conn))
} else if realityConn, ok := iConn.(*reality.Conn); ok {
@ -512,6 +508,10 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
} else {
return newError("XTLS only supports TCP, mKCP and DomainSocket for now.").AtWarning()
}
if pc, ok := netConn.(*proxyproto.Conn); ok {
netConn = pc.Raw()
// 8192 > 4096, there is no need to process pc's bufReader
}
if sc, ok := netConn.(syscall.Conn); ok {
rawConn, _ = sc.SyscallConn()
}