From a9658a7f5f2b1293b35d42b124507901461ab3c5 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 19 Feb 2013 21:59:26 +0100 Subject: [PATCH] small optimizations --- src/worker-vpn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/worker-vpn.c b/src/worker-vpn.c index 9f45b628..09939935 100644 --- a/src/worker-vpn.c +++ b/src/worker-vpn.c @@ -991,12 +991,13 @@ time_t now; now = time(0); if (ws->session == ts) { + ws->last_dpd_tcp = now; ret = tls_send(ts, "STF\x01\x00\x00\x04\x00", 8); - ws->last_dpd_tcp = time(0); oclog(ws, LOG_DEBUG, "received TLS DPD; sent response (%d bytes)", ret); } else { /* Use DPD for MTU discovery in DTLS */ + ws->last_dpd_udp = now; ws->buffer[0] = 0x04; /* if we received a dpd sooner than expected reply with minimal @@ -1021,7 +1022,6 @@ time_t now; mtu_ok(ws); } - ws->last_dpd_udp = time(0); oclog(ws, LOG_DEBUG, "received DTLS DPD; sent response (%d bytes)", ret); }