Skip to content

Commit

Permalink
sockets: Fix free-select-locked after udp close
Browse files Browse the repository at this point in the history
ESP_LWIP supports closing socket while waiting. This fixes potential
races.
Orig: fix bug for after udp close select_waiting assert (dd3b301)

Ref IDF-4794
  • Loading branch information
freakyxue authored and david-cermak committed Aug 16, 2022
1 parent 83edc19 commit 6666694
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,9 @@ free_socket_locked(struct lwip_sock *sock, int is_tcp, struct netconn **conn,

*lastdata = sock->lastdata;
sock->lastdata.pbuf = NULL;
#if ESP_LWIP
sock->select_waiting = 0;
#endif /* ESP_LWIP */
*conn = sock->conn;
sock->conn = NULL;
return 1;
Expand Down

0 comments on commit 6666694

Please sign in to comment.