extmod/modlwip: Handle case of accept callback called with null PCB.

pull/4668/head
Damien George 2019-03-27 16:00:25 +11:00
rodzic da938a83b5
commit 2ec7838967
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -429,6 +429,11 @@ STATIC err_t _lwip_tcp_accept_finished(void *arg, struct tcp_pcb *pcb)
// Callback for incoming tcp connections.
STATIC err_t _lwip_tcp_accept(void *arg, struct tcp_pcb *newpcb, err_t err) {
// err can be ERR_MEM to notify us that there was no memory for an incoming connection
if (err != ERR_OK) {
return ERR_OK;
}
lwip_socket_obj_t *socket = (lwip_socket_obj_t*)arg;
tcp_recv(newpcb, _lwip_tcp_recv_unaccepted);