Fix inject conn

This commit is contained in:
世界 2022-08-29 19:02:14 +08:00
parent 44818701bc
commit f5e0ead01c
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
3 changed files with 5 additions and 5 deletions

View file

@ -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 {

View file

@ -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
}

View file

@ -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
}