mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-28 20:58:31 +00:00
Schedule a poll when LwIP reports TCP data sent
PUBLISHED_FROM=0cf3029d9a9b851882325e2298b878bc83fc2d33
This commit is contained in:
1 parent
8b42353039
commit
aaf1fc3a4a
2 files changed
+14
No files matched your search
@@ -15220,6 +15220,9 @@ static err_t mg_lwip_tcp_sent_cb(void *arg, struct tcp_pcb *tpcb,
|
|||||||
nc->send_mbuf.len == 0 && tpcb->unsent == NULL && tpcb->unacked == NULL) {
|
nc->send_mbuf.len == 0 && tpcb->unsent == NULL && tpcb->unacked == NULL) {
|
||||||
mg_lwip_post_signal(MG_SIG_CLOSE_CONN, nc);
|
mg_lwip_post_signal(MG_SIG_CLOSE_CONN, nc);
|
||||||
}
|
}
|
||||||
|
if (nc->send_mbuf.len > 0 || (nc->flags & MG_F_WANT_WRITE)) {
|
||||||
|
mg_lwip_mgr_schedule_poll(nc->mgr);
|
||||||
|
}
|
||||||
(void) num_sent;
|
(void) num_sent;
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
@@ -15582,6 +15585,10 @@ static int mg_lwip_if_can_send(struct mg_connection *nc,
|
|||||||
can_send = (cs->pcb.udp != NULL);
|
can_send = (cs->pcb.udp != NULL);
|
||||||
} else {
|
} else {
|
||||||
can_send = (cs->pcb.tcp != NULL && cs->pcb.tcp->snd_buf > 0);
|
can_send = (cs->pcb.tcp != NULL && cs->pcb.tcp->snd_buf > 0);
|
||||||
|
/* See comment above. */
|
||||||
|
#if CS_PLATFORM == CS_P_ESP8266
|
||||||
|
if (cs->pcb.tcp->unacked != NULL) can_send = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return can_send;
|
return can_send;
|
||||||
|
|||||||
@@ -200,6 +200,9 @@ static err_t mg_lwip_tcp_sent_cb(void *arg, struct tcp_pcb *tpcb,
|
|||||||
nc->send_mbuf.len == 0 && tpcb->unsent == NULL && tpcb->unacked == NULL) {
|
nc->send_mbuf.len == 0 && tpcb->unsent == NULL && tpcb->unacked == NULL) {
|
||||||
mg_lwip_post_signal(MG_SIG_CLOSE_CONN, nc);
|
mg_lwip_post_signal(MG_SIG_CLOSE_CONN, nc);
|
||||||
}
|
}
|
||||||
|
if (nc->send_mbuf.len > 0 || (nc->flags & MG_F_WANT_WRITE)) {
|
||||||
|
mg_lwip_mgr_schedule_poll(nc->mgr);
|
||||||
|
}
|
||||||
(void) num_sent;
|
(void) num_sent;
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
@@ -562,6 +565,10 @@ static int mg_lwip_if_can_send(struct mg_connection *nc,
|
|||||||
can_send = (cs->pcb.udp != NULL);
|
can_send = (cs->pcb.udp != NULL);
|
||||||
} else {
|
} else {
|
||||||
can_send = (cs->pcb.tcp != NULL && cs->pcb.tcp->snd_buf > 0);
|
can_send = (cs->pcb.tcp != NULL && cs->pcb.tcp->snd_buf > 0);
|
||||||
|
/* See comment above. */
|
||||||
|
#if CS_PLATFORM == CS_P_ESP8266
|
||||||
|
if (cs->pcb.tcp->unacked != NULL) can_send = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return can_send;
|
return can_send;
|
||||||
|
|||||||
Reference in new issue
Block a user