mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-10 02:53:12 +00:00
Fix inject conn
This commit is contained in:
parent
44818701bc
commit
f5e0ead01c
|
@ -177,7 +177,7 @@ func (a *myInboundAdapter) loopTCPIn() {
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
go a.injectTCP(conn)
|
||||
go a.injectTCP(conn, adapter.InboundContext{})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -199,9 +199,9 @@ func (a *myInboundAdapter) createMetadata(conn net.Conn, metadata adapter.Inboun
|
|||
return metadata
|
||||
}
|
||||
|
||||
func (a *myInboundAdapter) injectTCP(conn net.Conn) {
|
||||
func (a *myInboundAdapter) injectTCP(conn net.Conn, metadata adapter.InboundContext) {
|
||||
ctx := log.ContextWithNewID(a.ctx)
|
||||
metadata := a.createMetadata(conn, adapter.InboundContext{})
|
||||
metadata = a.createMetadata(conn, metadata)
|
||||
a.logger.InfoContext(ctx, "inbound connection from ", metadata.Source)
|
||||
hErr := a.connHandler.NewConnection(ctx, conn, metadata)
|
||||
if hErr != nil {
|
||||
|
|
|
@ -146,7 +146,7 @@ func (h *Trojan) Close() error {
|
|||
}
|
||||
|
||||
func (h *Trojan) newTransportConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
|
||||
h.injectTCP(conn)
|
||||
h.injectTCP(conn, metadata)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ func (h *VMess) Close() error {
|
|||
}
|
||||
|
||||
func (h *VMess) newTransportConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
|
||||
h.injectTCP(conn)
|
||||
h.injectTCP(conn, metadata)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue