]> git.meshlink.io Git - utcp/commitdiff
Only call the poll callback when state is ESTABLISHED or CLOSE_WAIT.
authorGuus Sliepen <guus@meshlink.io>
Thu, 30 Oct 2014 13:55:07 +0000 (14:55 +0100)
committerGuus Sliepen <guus@meshlink.io>
Thu, 30 Oct 2014 13:55:07 +0000 (14:55 +0100)
utcp.c

diff --git a/utcp.c b/utcp.c
index f48460d6f7aa6bf1686fec55cb6841139b62070f..3206cd74b4a054776e799e636b028d4ea5cc9757 100644 (file)
--- 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, <))