mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Format VLESS inbound.go and outbound.go
This commit is contained in:
parent
b70912799b
commit
74416570d4
2 changed files with 10 additions and 13 deletions
|
@ -485,16 +485,13 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||
var p uintptr
|
||||
if tlsConn, ok := iConn.(*tls.Conn); ok {
|
||||
if tlsConn.ConnectionState().Version != gotls.VersionTLS13 {
|
||||
return newError(`failed to use ` + requestAddons.Flow + `, found outer tls version `, tlsConn.ConnectionState().Version).AtWarning()
|
||||
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
|
||||
}
|
||||
if sc, ok := netConn.(syscall.Conn); ok {
|
||||
rawConn, _ = sc.SyscallConn()
|
||||
}
|
||||
t = reflect.TypeOf(tlsConn.Conn).Elem()
|
||||
p = uintptr(unsafe.Pointer(tlsConn.Conn))
|
||||
} else if _, ok := iConn.(*tls.UConn); ok {
|
||||
|
@ -504,6 +501,9 @@ 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 sc, ok := netConn.(syscall.Conn); ok {
|
||||
rawConn, _ = sc.SyscallConn()
|
||||
}
|
||||
i, _ := t.FieldByName("input")
|
||||
r, _ := t.FieldByName("rawInput")
|
||||
input = (*bytes.Reader)(unsafe.Pointer(p + i.Offset))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue