From: Guus Sliepen Date: Thu, 10 Oct 2019 18:48:16 +0000 (+0200) Subject: Replace two hardcoded timeout values with utcp->timeout. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=ae9033c7c9211f6e9dfa3d6b3dfeebd6e1d9ba00;p=utcp Replace two hardcoded timeout values with utcp->timeout. --- diff --git a/utcp.c b/utcp.c index 4c3cbdb..ac162fe 100644 --- a/utcp.c +++ b/utcp.c @@ -1346,7 +1346,7 @@ ssize_t utcp_recv(struct utcp *utcp, const void *data, size_t len) { case CLOSING: if(c->snd.una == c->snd.last) { gettimeofday(&c->conn_timeout, NULL); - c->conn_timeout.tv_sec += 60; + c->conn_timeout.tv_sec += utcp->timeout; set_state(c, TIME_WAIT); } @@ -1505,7 +1505,7 @@ skip_ack: case FIN_WAIT_2: gettimeofday(&c->conn_timeout, NULL); - c->conn_timeout.tv_sec += 60; + c->conn_timeout.tv_sec += utcp->timeout; set_state(c, TIME_WAIT); break;