mirror of
https://github.com/espressif/esp-lwip.git
synced 2026-10-01 05:17:39 +00:00
fix the crash when close socket
when two targets has created TCP connection, and SO_LINGER is enabled, if close the target1's socket when target1 is sending large data to target2, the crash will happen
This commit is contained in:
+1
-1
@@ -1052,7 +1052,6 @@ lwip_netconn_do_close_internal(struct netconn *conn WRITE_DELAYED_PARAM)
|
||||
/* Closing done (succeeded, non-memory error, nonblocking error or timeout) */
|
||||
sys_sem_t* op_completed_sem = LWIP_API_MSG_SEM(conn->current_msg);
|
||||
conn->current_msg->err = err;
|
||||
conn->current_msg = NULL;
|
||||
conn->state = NETCONN_NONE;
|
||||
if (err == ERR_OK) {
|
||||
if (close) {
|
||||
@@ -1077,6 +1076,7 @@ lwip_netconn_do_close_internal(struct netconn *conn WRITE_DELAYED_PARAM)
|
||||
/* wake up the application task */
|
||||
#if ESP_LWIP
|
||||
if (sig_close) {
|
||||
conn->current_msg = NULL;
|
||||
sys_sem_signal(op_completed_sem);
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user