From: Guus Sliepen Date: Thu, 30 Oct 2014 13:55:07 +0000 (+0100) Subject: Only call the poll callback when state is ESTABLISHED or CLOSE_WAIT. X-Git-Url: http://git.meshlink.io/?p=utcp;a=commitdiff_plain;h=52eeda5e47e8a081cd2f94b78536c6376592a526 Only call the poll callback when state is ESTABLISHED or CLOSE_WAIT. --- 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, <))