mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-01-25 18:26:34 +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 {
|
if err != nil {
|
||||||
return
|
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
|
return metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *myInboundAdapter) injectTCP(conn net.Conn) {
|
func (a *myInboundAdapter) injectTCP(conn net.Conn, metadata adapter.InboundContext) {
|
||||||
ctx := log.ContextWithNewID(a.ctx)
|
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)
|
a.logger.InfoContext(ctx, "inbound connection from ", metadata.Source)
|
||||||
hErr := a.connHandler.NewConnection(ctx, conn, metadata)
|
hErr := a.connHandler.NewConnection(ctx, conn, metadata)
|
||||||
if hErr != nil {
|
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 {
|
func (h *Trojan) newTransportConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
|
||||||
h.injectTCP(conn)
|
h.injectTCP(conn, metadata)
|
||||||
return nil
|
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 {
|
func (h *VMess) newTransportConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error {
|
||||||
h.injectTCP(conn)
|
h.injectTCP(conn, metadata)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue