From 52eeda5e47e8a081cd2f94b78536c6376592a526 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 30 Oct 2014 14:55:07 +0100 Subject: [PATCH] Only call the poll callback when state is ESTABLISHED or CLOSE_WAIT. --- utcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utcp.c b/utcp.c index f48460d..3206cd7 100644 --- a/utcp.c +++ b/utcp.c @@ -1055,7 +1055,7 @@ int utcp_timeout(struct utcp *utcp) { retransmit(c); } - if(c->poll && c->sndbufsize < c->maxsndbufsize / 2) + if(c->poll && c->sndbufsize < c->maxsndbufsize / 2 && (c->state == ESTABLISHED || c->state == CLOSE_WAIT)) c->poll(c, c->maxsndbufsize - c->sndbufsize); if(timerisset(&c->conn_timeout) && timercmp(&c->conn_timeout, &next, <)) -- 2.39.5