mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-04 14:13:03 +00:00
Format VLESS inbound.go and outbound.go
This commit is contained in:
parent
b70912799b
commit
74416570d4
@ -492,9 +492,6 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||||||
netConn = pc.Raw()
|
netConn = pc.Raw()
|
||||||
// 8192 > 4096, there is no need to process pc's bufReader
|
// 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()
|
t = reflect.TypeOf(tlsConn.Conn).Elem()
|
||||||
p = uintptr(unsafe.Pointer(tlsConn.Conn))
|
p = uintptr(unsafe.Pointer(tlsConn.Conn))
|
||||||
} else if _, ok := iConn.(*tls.UConn); ok {
|
} else if _, ok := iConn.(*tls.UConn); ok {
|
||||||
@ -504,6 +501,9 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
|
|||||||
} else {
|
} else {
|
||||||
return newError("XTLS only supports TCP, mKCP and DomainSocket for now.").AtWarning()
|
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")
|
i, _ := t.FieldByName("input")
|
||||||
r, _ := t.FieldByName("rawInput")
|
r, _ := t.FieldByName("rawInput")
|
||||||
input = (*bytes.Reader)(unsafe.Pointer(p + i.Offset))
|
input = (*bytes.Reader)(unsafe.Pointer(p + i.Offset))
|
||||||
|
@ -158,16 +158,10 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||||||
var p uintptr
|
var p uintptr
|
||||||
if tlsConn, ok := iConn.(*tls.Conn); ok {
|
if tlsConn, ok := iConn.(*tls.Conn); ok {
|
||||||
netConn = tlsConn.NetConn()
|
netConn = tlsConn.NetConn()
|
||||||
if sc, ok := netConn.(syscall.Conn); ok {
|
|
||||||
rawConn, _ = sc.SyscallConn()
|
|
||||||
}
|
|
||||||
t = reflect.TypeOf(tlsConn.Conn).Elem()
|
t = reflect.TypeOf(tlsConn.Conn).Elem()
|
||||||
p = uintptr(unsafe.Pointer(tlsConn.Conn))
|
p = uintptr(unsafe.Pointer(tlsConn.Conn))
|
||||||
} else if utlsConn, ok := iConn.(*tls.UConn); ok {
|
} else if utlsConn, ok := iConn.(*tls.UConn); ok {
|
||||||
netConn = utlsConn.Conn.NetConn()
|
netConn = utlsConn.NetConn()
|
||||||
if sc, ok := netConn.(syscall.Conn); ok {
|
|
||||||
rawConn, _ = sc.SyscallConn()
|
|
||||||
}
|
|
||||||
t = reflect.TypeOf(utlsConn.Conn).Elem()
|
t = reflect.TypeOf(utlsConn.Conn).Elem()
|
||||||
p = uintptr(unsafe.Pointer(utlsConn.Conn))
|
p = uintptr(unsafe.Pointer(utlsConn.Conn))
|
||||||
} else if _, ok := iConn.(*xtls.Conn); ok {
|
} else if _, ok := iConn.(*xtls.Conn); ok {
|
||||||
@ -175,6 +169,9 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||||||
} else {
|
} else {
|
||||||
return newError("XTLS only supports TCP, mKCP and DomainSocket for now.").AtWarning()
|
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")
|
i, _ := t.FieldByName("input")
|
||||||
r, _ := t.FieldByName("rawInput")
|
r, _ := t.FieldByName("rawInput")
|
||||||
input = (*bytes.Reader)(unsafe.Pointer(p + i.Offset))
|
input = (*bytes.Reader)(unsafe.Pointer(p + i.Offset))
|
||||||
|
Loading…
Reference in New Issue
Block a user