mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-24 19:19:00 +08:00
Ignore tcp sent cb when there's no asscociated nc
TCP ACK may arrive after the we've corresponding mg_connection has already been closed. Fixes cesanta/mongoose-os#235 PUBLISHED_FROM=8164b86131ef08c1b2a6a08630920d600b3f91ac
This commit is contained in:
parent
1cee8a16b9
commit
84907d5bc4
@ -14203,6 +14203,7 @@ static err_t mg_lwip_tcp_sent_cb(void *arg, struct tcp_pcb *tpcb,
|
||||
u16_t num_sent) {
|
||||
struct mg_connection *nc = (struct mg_connection *) arg;
|
||||
DBG(("%p %p %u", nc, tpcb, num_sent));
|
||||
if (nc == NULL) return ERR_OK;
|
||||
if ((nc->flags & MG_F_SEND_AND_CLOSE) && !(nc->flags & MG_F_WANT_WRITE) &&
|
||||
nc->send_mbuf.len == 0 && tpcb->unacked == 0) {
|
||||
mg_lwip_post_signal(MG_SIG_CLOSE_CONN, nc);
|
||||
|
Loading…
Reference in New Issue
Block a user