DPD_TRIES was defined and increased to 5 from 3

This commit is contained in:
Nikos Mavrogiannopoulos
2013-02-19 22:04:25 +01:00
parent a9658a7f5f
commit 4d7b353ed5

View File

@@ -53,6 +53,9 @@
*/ */
#define UDP_SWITCH_TIME 15 #define UDP_SWITCH_TIME 15
/* The number of DPD packets a client skips before he's kicked */
#define DPD_TRIES 5
/* HTTP requests prior to disconnection */ /* HTTP requests prior to disconnection */
#define MAX_HTTP_REQUESTS 8 #define MAX_HTTP_REQUESTS 8
@@ -782,11 +785,11 @@ unsigned mtu_overhead, tls_mtu = 0;
if (ret == 0) { /* timeout */ if (ret == 0) { /* timeout */
now = time(0); now = time(0);
/* check DPD. Otherwise exit */ /* check DPD. Otherwise exit */
if (now-ws->last_dpd_udp > 3*ws->config->dpd) { if (now-ws->last_dpd_udp > DPD_TRIES*ws->config->dpd) {
oclog(ws, LOG_ERR, "have not received UDP DPD for long (%d secs)", (int)(now-ws->last_dpd_udp)); oclog(ws, LOG_ERR, "have not received UDP DPD for long (%d secs)", (int)(now-ws->last_dpd_udp));
goto exit; goto exit;
} }
if (now-ws->last_dpd_tcp > 3*ws->config->dpd) { if (now-ws->last_dpd_tcp > DPD_TRIES*ws->config->dpd) {
oclog(ws, LOG_ERR, "have not received TCP DPD for long (%d secs)", (int)(now-ws->last_dpd_tcp)); oclog(ws, LOG_ERR, "have not received TCP DPD for long (%d secs)", (int)(now-ws->last_dpd_tcp));
goto exit; goto exit;
} }