mirror of https://github.com/v2ray/v2ray-core
increase default timeout to 5 minutes
parent
109a37fe7e
commit
3a27ff8239
|
@ -62,7 +62,7 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
|
||||||
|
|
||||||
timeout := time.Second * time.Duration(d.config.Timeout)
|
timeout := time.Second * time.Duration(d.config.Timeout)
|
||||||
if timeout == 0 {
|
if timeout == 0 {
|
||||||
timeout = time.Minute * 2
|
timeout = time.Minute * 5
|
||||||
}
|
}
|
||||||
ctx, timer := signal.CancelAfterInactivity(ctx, timeout)
|
ctx, timer := signal.CancelAfterInactivity(ctx, timeout)
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ func (s *Server) handleConnect(ctx context.Context, request *http.Request, reade
|
||||||
|
|
||||||
timeout := time.Second * time.Duration(s.config.Timeout)
|
timeout := time.Second * time.Duration(s.config.Timeout)
|
||||||
if timeout == 0 {
|
if timeout == 0 {
|
||||||
timeout = time.Minute * 2
|
timeout = time.Minute * 5
|
||||||
}
|
}
|
||||||
ctx, timer := signal.CancelAfterInactivity(ctx, timeout)
|
ctx, timer := signal.CancelAfterInactivity(ctx, timeout)
|
||||||
ray, err := dispatcher.Dispatch(ctx, dest)
|
ray, err := dispatcher.Dispatch(ctx, dest)
|
||||||
|
|
|
@ -91,7 +91,7 @@ func (v *Client) Process(ctx context.Context, outboundRay ray.OutboundRay, diale
|
||||||
request.Option |= RequestOptionOneTimeAuth
|
request.Option |= RequestOptionOneTimeAuth
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, timer := signal.CancelAfterInactivity(ctx, time.Minute*2)
|
ctx, timer := signal.CancelAfterInactivity(ctx, time.Minute*5)
|
||||||
|
|
||||||
if request.Command == protocol.RequestCommandTCP {
|
if request.Command == protocol.RequestCommandTCP {
|
||||||
bufferedWriter := buf.NewBufferedWriter(conn)
|
bufferedWriter := buf.NewBufferedWriter(conn)
|
||||||
|
|
|
@ -84,7 +84,7 @@ func (c *Client) Process(ctx context.Context, ray ray.OutboundRay, dialer proxy.
|
||||||
return newError("failed to establish connection to server").AtWarning().Base(err)
|
return newError("failed to establish connection to server").AtWarning().Base(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, timer := signal.CancelAfterInactivity(ctx, time.Minute*2)
|
ctx, timer := signal.CancelAfterInactivity(ctx, time.Minute*5)
|
||||||
|
|
||||||
var requestFunc func() error
|
var requestFunc func() error
|
||||||
var responseFunc func() error
|
var responseFunc func() error
|
||||||
|
|
|
@ -108,7 +108,7 @@ func (*Server) handleUDP() error {
|
||||||
func (v *Server) transport(ctx context.Context, reader io.Reader, writer io.Writer, dest net.Destination, dispatcher dispatcher.Interface) error {
|
func (v *Server) transport(ctx context.Context, reader io.Reader, writer io.Writer, dest net.Destination, dispatcher dispatcher.Interface) error {
|
||||||
timeout := time.Second * time.Duration(v.config.Timeout)
|
timeout := time.Second * time.Duration(v.config.Timeout)
|
||||||
if timeout == 0 {
|
if timeout == 0 {
|
||||||
timeout = time.Minute * 2
|
timeout = time.Minute * 5
|
||||||
}
|
}
|
||||||
ctx, timer := signal.CancelAfterInactivity(ctx, timeout)
|
ctx, timer := signal.CancelAfterInactivity(ctx, timeout)
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dial
|
||||||
|
|
||||||
session := encoding.NewClientSession(protocol.DefaultIDHash)
|
session := encoding.NewClientSession(protocol.DefaultIDHash)
|
||||||
|
|
||||||
ctx, timer := signal.CancelAfterInactivity(ctx, time.Minute*2)
|
ctx, timer := signal.CancelAfterInactivity(ctx, time.Minute*5)
|
||||||
|
|
||||||
requestDone := signal.ExecuteAsync(func() error {
|
requestDone := signal.ExecuteAsync(func() error {
|
||||||
writer := buf.NewBufferedWriter(conn)
|
writer := buf.NewBufferedWriter(conn)
|
||||||
|
|
Loading…
Reference in New Issue