1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-11-23 12:02:58 -05:00

cancel context after finish

This commit is contained in:
Darien Raymond
2017-03-31 21:10:33 +02:00
parent 4b15ff5034
commit a57531ef5d
9 changed files with 17 additions and 1 deletions

View File

@@ -61,6 +61,8 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
return errors.New("Dokodemo: Unable to get destination.")
}
ctx, cancel := context.WithCancel(ctx)
defer cancel()
timeout := time.Second * time.Duration(d.config.Timeout)
if timeout == 0 {
timeout = time.Minute * 2