]> git.meshlink.io Git - utcp/commitdiff
Replace two hardcoded timeout values with utcp->timeout.
authorGuus Sliepen <guus@sliepen.org>
Thu, 10 Oct 2019 18:48:16 +0000 (20:48 +0200)
committerGuus Sliepen <guus@sliepen.org>
Thu, 10 Oct 2019 18:48:16 +0000 (20:48 +0200)
utcp.c

diff --git a/utcp.c b/utcp.c
index 4c3cbdb36fc46bb43c36c7fdd5e4cc6cbac3c964..ac162fe708a0d657abffb4cb62ecd4881a7fc79a 100644 (file)
--- 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;