1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-06-17 08:19:57 -04:00

propagate context

This commit is contained in:
Shelikhoo
2020-06-18 12:37:10 +08:00
parent 73616ab9e2
commit 85bd352bc1
4 changed files with 9 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ import (
// CreateObject creates a new object based on the given V2Ray instance and config. The V2Ray instance may be nil.
func CreateObject(v *Instance, config interface{}) (interface{}, error) {
ctx := context.Background()
ctx := v.ctx
if v != nil {
ctx = context.WithValue(ctx, v2rayKey, v)
}