mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
Fix context layering in Shadowsocks UDP
This commit is contained in:
parent
3e13d79af7
commit
38868e0469
@ -132,9 +132,10 @@ func (s *Server) handlerUDPPayload(ctx context.Context, conn internet.Connection
|
||||
continue
|
||||
}
|
||||
|
||||
currentPacketCtx := ctx
|
||||
dest := request.Destination()
|
||||
if inbound.Source.IsValid() {
|
||||
ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{
|
||||
currentPacketCtx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{
|
||||
From: inbound.Source,
|
||||
To: dest,
|
||||
Status: log.AccessAccepted,
|
||||
@ -142,10 +143,10 @@ func (s *Server) handlerUDPPayload(ctx context.Context, conn internet.Connection
|
||||
Email: request.User.Email,
|
||||
})
|
||||
}
|
||||
newError("tunnelling request to ", dest).WriteToLog(session.ExportIDToError(ctx))
|
||||
newError("tunnelling request to ", dest).WriteToLog(session.ExportIDToError(currentPacketCtx))
|
||||
|
||||
ctx = protocol.ContextWithRequestHeader(ctx, request)
|
||||
udpServer.Dispatch(ctx, dest, data)
|
||||
currentPacketCtx = protocol.ContextWithRequestHeader(currentPacketCtx, request)
|
||||
udpServer.Dispatch(currentPacketCtx, dest, data)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user