Skip to content

Commit 89d916b

Browse files
committed
Merge branch 'bugfix/fix_cipserver_error' into 'master'
fix(espconn): fix AT+CIPSERVER=0 not close socket See merge request sdk/ESP8266_NONOS_SDK!285
2 parents be2f86d + 0d34ee2 commit 89d916b

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ phy:
1717
gitlab:
1818
driver : 5a2a54b4
1919
json : f55d5fee
20-
lwip : 5623f48f
20+
lwip : f6bc9a8c
2121
mbedtls : 82b93fe5
2222
smartconfig : ea1d4a13(v2.5.5)

lib/liblwip.a

280 Bytes
Binary file not shown.

third_party/include/lwip/app/espconn.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ typedef struct _espconn_msg{
191191
uint8 recv_hold_flag;
192192
uint16 recv_holded_buf_Len;
193193
//*******************************************************
194+
uint8 close_flag;
194195
ringbuf *readbuf;
195196
}espconn_msg;
196197

third_party/lwip/app/espconn.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,9 @@ espconn_get_connection_info(struct espconn *pespconn, remot_info **pcon_info, ui
897897
premot[pespconn->link_cnt].state = plist->pespconn->state;
898898
premot[pespconn->link_cnt].remote_port = plist->pcommon.remote_port;
899899
os_memcpy(premot[pespconn->link_cnt].remote_ip,plist->pcommon.remote_ip, 4);
900-
pespconn->link_cnt ++;
900+
if (!plist->close_flag) {
901+
pespconn->link_cnt ++;
902+
}
901903
}
902904
plist = plist->pnext;
903905
}

third_party/lwip/app/espconn_tcp.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,20 @@ espconn_Task(os_event_t *events)
434434
break;
435435
case SIG_ESPCONN_ERRER:
436436
/*remove the node from the client's active connection list*/
437-
if (espconn_manual_recv_enabled(task_msg))
438-
espconn_list_delete(&plink_active, task_msg);
437+
if (espconn_manual_recv_enabled(task_msg)) {
438+
espconn_list_delete(&plink_active, task_msg);
439+
} else {
440+
plist->close_flag = 1;
441+
}
439442
espconn_tcp_reconnect(task_msg);
440443
break;
441444
case SIG_ESPCONN_CLOSE:
442445
/*remove the node from the client's active connection list*/
443-
if (espconn_manual_recv_enabled(task_msg))
444-
espconn_list_delete(&plink_active, task_msg);
446+
if (espconn_manual_recv_enabled(task_msg)) {
447+
espconn_list_delete(&plink_active, task_msg);
448+
} else {
449+
plist->close_flag = 1;
450+
}
445451
espconn_tcp_disconnect_successful(task_msg);
446452
break;
447453
default:

0 commit comments

Comments
 (0)