Merge pull request #2638 from cesanta/ack

restart timer when acking
This commit is contained in:
Sergey Lyubka 2024-03-02 20:59:04 +00:00 committed by GitHub
commit 91bc79c14c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -662,6 +662,8 @@ static void read_conn(struct mg_connection *c, struct pkt *pkt) {
c->loc.port, c->rem.port, mg_htonl(s->seq), mg_htonl(s->ack), "",
0);
s->noack = 0;
// restart the ACK timer if already running
if (s->ttype == MIP_TTYPE_ACK) settmout(c, MIP_TTYPE_ACK);
} else {
// if not already running, setup a timer to send an ACK later
if (s->ttype != MIP_TTYPE_ACK) settmout(c, MIP_TTYPE_ACK);