From 488a66580c31a873b93ed541505e1525607bbed8 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 15 Mar 2020 14:49:12 +0100 Subject: [PATCH] Report initial ssthresh value as 0 while debugging. The initial is actually UINT_MAX, but since this makes it hard to plot a graph of it with autoscaling axes, show it as 0 instead. This removes the hack where ssthresh is set to sndbuf.maxsize at the start of a connection, which is wrong when the application overrides the send buffer size later. --- utcp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/utcp.c b/utcp.c index 7c30246..b53541d 100644 --- a/utcp.c +++ b/utcp.c @@ -128,7 +128,7 @@ static void print_packet(struct utcp_connection *c, const char *dir, const void } static void debug_cwnd(struct utcp_connection *c) { - debug(c, "snd.cwnd %u snd.ssthresh %u\n", c->snd.cwnd, c->snd.ssthresh); + debug(c, "snd.cwnd %u snd.ssthresh %u\n", c->snd.cwnd, ~c->snd.ssthresh ? c->snd.ssthresh : 0); } #else #define debug(...) do {} while(0) @@ -402,11 +402,7 @@ static struct utcp_connection *allocate_connection(struct utcp *utcp, uint16_t s c->snd.nxt = c->snd.iss + 1; c->snd.last = c->snd.nxt; c->snd.cwnd = (utcp->mtu > 2190 ? 2 : utcp->mtu > 1095 ? 3 : 4) * utcp->mtu; -#if UTCP_DEBUG - c->snd.ssthresh = c->sndbuf.maxsize; -#else c->snd.ssthresh = ~0; -#endif debug_cwnd(c); c->utcp = utcp; -- 2.39.5