Do not close already closed connection

PUBLISHED_FROM=9e345f2319141f20b89e28a2d29adba21ea213e1
This commit is contained in:
Deomid Ryabkov 2017-06-20 20:49:50 +01:00 committed by Cesanta Bot
parent 02707364f0
commit f374ac5f9a

View File

@ -14230,7 +14230,7 @@ static err_t mg_lwip_tcp_recv_cb(void *arg, struct tcp_pcb *tpcb,
struct mg_connection *nc = (struct mg_connection *) arg;
DBG(("%p %p %u %d", nc, tpcb, (p != NULL ? p->tot_len : 0), err));
if (p == NULL) {
if (nc != NULL) {
if (nc != NULL && !(nc->flags & MG_F_CLOSE_IMMEDIATELY)) {
mg_lwip_post_signal(MG_SIG_CLOSE_CONN, nc);
} else {
/* Tombstoned connection, do nothing. */