This commit is contained in:
Sergio R. Caprile
2025-11-05 13:55:14 -03:00
parent b8994f8bc3
commit 84e9ea76db
2 changed files with 16 additions and 2 deletions
+8 -1
View File
@@ -6100,8 +6100,14 @@ static void init_closure(struct mg_connection *c) {
struct connstate *s = (struct connstate *) (c + 1);
if (c->is_udp == false && c->is_listening == false &&
c->is_connecting == false) { // For TCP conns,
<<<<<<< HEAD
tx_tcp(c->mgr->ifp, s->mac, &c->loc, &c->rem, TH_FIN | TH_ACK,
mg_htonl(s->seq), mg_htonl(s->ack), NULL, 0);
=======
uint32_t rem_ip = c->rem.ip4;
tx_tcp(c->mgr->ifp, s->mac, rem_ip, TH_FIN | TH_ACK, c->loc.port,
c->rem.port, mg_htonl(s->seq), mg_htonl(s->ack), NULL, 0);
>>>>>>> 81b87991 (wip)
settmout(c, MIP_TTYPE_FIN);
}
}
@@ -6168,7 +6174,8 @@ bool mg_send(struct mg_connection *c, const void *buf, size_t len) {
res = tx_udp(ifp, s->mac, &c->loc, &c->rem, buf, len);
} else {
res = mg_iobuf_add(&c->send, c->send.len, buf, len);
// res == 0 means an OOM condition (iobuf couldn't resize), yet this is so far recoverable, let the caller decide
// res == 0 means an OOM condition (iobuf couldn't resize), yet this is so
// far recoverable, let the caller decide
}
return res;
}
+8 -1
View File
@@ -1936,8 +1936,14 @@ static void init_closure(struct mg_connection *c) {
struct connstate *s = (struct connstate *) (c + 1);
if (c->is_udp == false && c->is_listening == false &&
c->is_connecting == false) { // For TCP conns,
<<<<<<< HEAD
tx_tcp(c->mgr->ifp, s->mac, &c->loc, &c->rem, TH_FIN | TH_ACK,
mg_htonl(s->seq), mg_htonl(s->ack), NULL, 0);
=======
uint32_t rem_ip = c->rem.ip4;
tx_tcp(c->mgr->ifp, s->mac, rem_ip, TH_FIN | TH_ACK, c->loc.port,
c->rem.port, mg_htonl(s->seq), mg_htonl(s->ack), NULL, 0);
>>>>>>> 81b87991 (wip)
settmout(c, MIP_TTYPE_FIN);
}
}
@@ -2004,7 +2010,8 @@ bool mg_send(struct mg_connection *c, const void *buf, size_t len) {
res = tx_udp(ifp, s->mac, &c->loc, &c->rem, buf, len);
} else {
res = mg_iobuf_add(&c->send, c->send.len, buf, len);
// res == 0 means an OOM condition (iobuf couldn't resize), yet this is so far recoverable, let the caller decide
// res == 0 means an OOM condition (iobuf couldn't resize), yet this is so
// far recoverable, let the caller decide
}
return res;
}