From 41a9d196062bfea0aadde87bc30ae262890334b7 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 31 Jan 2019 10:26:04 +0100 Subject: [SERVER] Don't keep an uplink connection established forever In case we don't use background replication a connection to an uplink server can potentially stay around forever. This in turn would prevent the uplink server from freeing the image as it appears to be in use. --- src/serverconfig.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/serverconfig.h') diff --git a/src/serverconfig.h b/src/serverconfig.h index 6fcda58..0cbb320 100644 --- a/src/serverconfig.h +++ b/src/serverconfig.h @@ -26,11 +26,15 @@ // the timeout for cases where we wait for additional data or are actively sending a reply #define SOCKET_TIMEOUT_CLIENT_RETRIES 3 +#define SERVER_UPLINK_KEEPALIVE_INTERVAL 10 // (Seconds) Send keep-alive if nothing else is happening on the uplink +#define SERVER_UPLINK_IDLE_TIMEOUT 1800 // (Seconds) Timeout after which we tear down an uplink connection if no blocks needed to be fetched + // +++++ Other magic constants -#define SERVER_RTT_PROBES 5 -#define SERVER_RTT_DELAY_INIT 5 -#define SERVER_RTT_DELAY_MAX 45 -#define SERVER_RTT_DELAY_FAILED 180 +#define SERVER_RTT_PROBES 5 // How many probes to average over +#define SERVER_RTT_INTERVAL_INIT 5 // Initial interval between probes +#define SERVER_RTT_INTERVAL_MAX 45 // Maximum interval between probes +#define SERVER_RTT_BACKOFF_COUNT 5 // If we can't reach any uplink server this many times, consider the uplink bad +#define SERVER_RTT_INTERVAL_FAILED 180 // Interval to use if no uplink server is reachable for above many times #define SERVER_REMOTE_IMAGE_CHECK_CACHETIME 120 // 2 minutes -- cgit v1.2.3-55-g7522