mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-10 07:45:54 -04:00
propagate context
This commit is contained in:
@@ -43,6 +43,8 @@ type tcpWorker struct {
|
||||
downlinkCounter stats.Counter
|
||||
|
||||
hub internet.Listener
|
||||
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
func getTProxyType(s *internet.MemoryStreamConfig) internet.SocketConfig_TProxyMode {
|
||||
@@ -53,7 +55,7 @@ func getTProxyType(s *internet.MemoryStreamConfig) internet.SocketConfig_TProxyM
|
||||
}
|
||||
|
||||
func (w *tcpWorker) callback(conn internet.Connection) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
ctx, cancel := context.WithCancel(w.ctx)
|
||||
sid := session.NewID()
|
||||
ctx = session.ContextWithID(ctx, sid)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user