From ae9033c7c9211f6e9dfa3d6b3dfeebd6e1d9ba00 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 10 Oct 2019 20:48:16 +0200 Subject: [PATCH] Replace two hardcoded timeout values with utcp->timeout. --- utcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.5