mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-05 22:08:23 +00:00
mg_lwip: Fix race during clean conenction teardown
Set CLOSE_IMMEDIATELY flag when destroying conn. This avoid some races in LWIP adapter. CL: mg_lwip: Fix race during clean conenction teardown PUBLISHED_FROM=5c67982390dfaf83527e85d1291f64c6050aa932
This commit is contained in:
1 parent
d949c19c7e
commit
9ba6eb716d
4 files changed
+20
-8
No files matched your search
@@ -126,7 +126,7 @@ static err_t mg_lwip_tcp_conn_cb(void *arg, struct tcp_pcb *tpcb, err_t err) {
|
||||
static void mg_lwip_tcp_error_cb(void *arg, err_t err) {
|
||||
struct mg_connection *nc = (struct mg_connection *) arg;
|
||||
DBG(("%p conn error %d", nc, err));
|
||||
if (nc == NULL) return;
|
||||
if (nc == NULL || (nc->flags & MG_F_CLOSE_IMMEDIATELY)) return;
|
||||
struct mg_lwip_conn_state *cs = (struct mg_lwip_conn_state *) nc->sock;
|
||||
cs->pcb.tcp = NULL; /* Has already been deallocated */
|
||||
if (nc->flags & MG_F_CONNECTING) {
|
||||
|
||||
Reference in new issue
Block a user