1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

log timeout in freedom

This commit is contained in:
Darien Raymond 2017-03-31 17:45:55 +02:00
parent 00822812d4
commit e39a67d5bc
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -111,8 +111,9 @@ func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dial
ctx, cancel := context.WithCancel(ctx) ctx, cancel := context.WithCancel(ctx)
timeout := time.Second * time.Duration(v.timeout) timeout := time.Second * time.Duration(v.timeout)
if timeout == 0 { if timeout == 0 {
timeout = time.Minute * 10 timeout = time.Minute * 5
} }
log.Debug("Freedom: Cancel after ", timeout)
timer := signal.CancelAfterInactivity(ctx, cancel, timeout) timer := signal.CancelAfterInactivity(ctx, cancel, timeout)
requestDone := signal.ExecuteAsync(func() error { requestDone := signal.ExecuteAsync(func() error {
@ -135,6 +136,7 @@ func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dial
if err := signal.ErrorOrFinish2(ctx, requestDone, responseDone); err != nil { if err := signal.ErrorOrFinish2(ctx, requestDone, responseDone); err != nil {
log.Info("Freedom: Connection ending with ", err) log.Info("Freedom: Connection ending with ", err)
cancel()
input.CloseError() input.CloseError()
output.CloseError() output.CloseError()
return err return err