mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-17 14:57:44 -05:00
branch context instead of layer it
This commit is contained in:
parent
8e791e92bc
commit
73616ab9e2
@ -229,10 +229,10 @@ func (s *Server) handleUDPPayload(ctx context.Context, conn internet.Connection,
|
|||||||
payload.Release()
|
payload.Release()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
currentPacketCtx := ctx
|
||||||
newError("send packet to ", request.Destination(), " with ", payload.Len(), " bytes").AtDebug().WriteToLog(session.ExportIDToError(ctx))
|
newError("send packet to ", request.Destination(), " with ", payload.Len(), " bytes").AtDebug().WriteToLog(session.ExportIDToError(ctx))
|
||||||
if inbound := session.InboundFromContext(ctx); inbound != nil && inbound.Source.IsValid() {
|
if inbound := session.InboundFromContext(ctx); inbound != nil && inbound.Source.IsValid() {
|
||||||
ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{
|
currentPacketCtx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{
|
||||||
From: inbound.Source,
|
From: inbound.Source,
|
||||||
To: request.Destination(),
|
To: request.Destination(),
|
||||||
Status: log.AccessAccepted,
|
Status: log.AccessAccepted,
|
||||||
@ -240,8 +240,8 @@ func (s *Server) handleUDPPayload(ctx context.Context, conn internet.Connection,
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = protocol.ContextWithRequestHeader(ctx, request)
|
currentPacketCtx = protocol.ContextWithRequestHeader(currentPacketCtx, request)
|
||||||
udpServer.Dispatch(ctx, request.Destination(), payload)
|
udpServer.Dispatch(currentPacketCtx, request.Destination(), payload)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user