Skip to content

Commit

Permalink
espconn: remove scary global pktinfo
Browse files Browse the repository at this point in the history
A write-only global!  How about that.
  • Loading branch information
nwf committed Feb 2, 2020
1 parent 0d5ca1e commit dc299d4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
2 changes: 0 additions & 2 deletions app/lwip/app/espconn.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ espconn_msg *plink_active = NULL;
espconn_msg *pserver_list = NULL;
remot_info premot[linkMax];

struct espconn_packet pktinfo[2];

static uint8 espconn_tcp_get_buf_count(espconn_buf *pesp_buf);
/******************************************************************************
* FunctionName : espconn_copy_partial
Expand Down
5 changes: 0 additions & 5 deletions app/lwip/app/espconn_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ static const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;

extern espconn_msg *plink_active;
extern espconn_msg *pserver_list;
extern struct espconn_packet pktinfo[2];
extern struct tcp_pcb ** const tcp_pcb_lists[];

os_event_t espconn_TaskQueue[espconn_TaskQueueLen];
Expand Down Expand Up @@ -288,8 +287,6 @@ espconn_tcp_reconnect(void *arg)
os_free(perr_back);
perr_back = NULL;
}
os_bzero(&pktinfo[1], sizeof(struct espconn_packet));
os_memcpy(&pktinfo[1], (void*)&precon_cb->pcommon.packet_info, sizeof(struct espconn_packet));

if (espconn && espconn->proto.tcp && espconn->proto.tcp->reconnect_callback != NULL) {
espconn->proto.tcp->reconnect_callback(espconn, re_err);
Expand Down Expand Up @@ -382,8 +379,6 @@ espconn_tcp_disconnect_successful(void *arg)
os_free(pdis_back);
pdis_back = NULL;
}
os_bzero(&pktinfo[0], sizeof(struct espconn_packet));
os_memcpy(&pktinfo[0], (void*)&pdiscon_cb->pcommon.packet_info, sizeof(struct espconn_packet));

if (espconn->proto.tcp && espconn->proto.tcp->disconnect_callback != NULL) {
espconn->proto.tcp->disconnect_callback(espconn);
Expand Down

0 comments on commit dc299d4

Please sign in to comment.