X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=utcp.c;h=25590a091560df177d7bbd4d75afed8ad01ba4e1;hb=f795503080bc1e7a812d58da62513219d2b5db74;hp=1b498a2897d0c4063b568040c24804c6235f636d;hpb=0c29e6bb0a943f9d06067628f894495dcc01c5ba;p=utcp diff --git a/utcp.c b/utcp.c index 1b498a2..25590a0 100644 --- a/utcp.c +++ b/utcp.c @@ -1017,6 +1017,7 @@ ssize_t utcp_recv(struct utcp *utcp, const void *data, size_t len) { //Reset the congestion window so we wait for ACKs. c->snd.nxt = c->snd.una; c->snd.cwnd = utcp->mtu; + start_retransmit_timer(c); } } } @@ -1164,8 +1165,7 @@ ssize_t utcp_recv(struct utcp *utcp, const void *data, size_t len) { // - or we got an ack, so we should maybe send a bit more data // -> sendatleastone = false -ack: - ack(c, prevrcvnxt != c->rcv.nxt); + ack(c, len || prevrcvnxt != c->rcv.nxt); return 0; reset: @@ -1322,6 +1322,7 @@ struct timeval utcp_timeout(struct utcp *utcp) { if(!c) continue; + // delete connections that have been utcp_close()d. if(c->state == CLOSED) { if(c->reapable) { debug("Reaping %p\n", c); @@ -1340,6 +1341,7 @@ struct timeval utcp_timeout(struct utcp *utcp) { } if(timerisset(&c->rtrx_timeout) && timercmp(&c->rtrx_timeout, &now, <)) { + debug("retransmit()\n"); retransmit(c); }