From 81d41f567debee9dce4607c50b1f396dc0967fb9 Mon Sep 17 00:00:00 2001 From: nick Date: Thu, 20 Jun 2013 10:26:34 +0100 Subject: [PATCH] proxy: Reduce the reconnect cooldown from 15 seconds to 3. Exponential backoff would be better, but that's OK --- src/proxy.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/proxy.c b/src/proxy.c index 893cda6..a7722ec 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -697,6 +697,7 @@ void proxy_session( struct proxier* proxy ) if ( connect_to_upstream_cooldown ) { connect_to_upstream_cooldown = 0; + select_timeout.tv_sec = 3; } else { proxy_start_connect_to_upstream( proxy ); @@ -705,10 +706,8 @@ void proxy_session( struct proxier* proxy ) continue; } FD_SET( proxy->upstream_fd, &wfds ); + select_timeout.tv_sec = 15; } - /* non-blocking connect() or a simple sleep */ - select_timeout.tv_sec = 15; - break; case READ_INIT_FROM_UPSTREAM: case READ_FROM_UPSTREAM: