extmod/modlwip: Use correct listening socket object in accept callback.

Since commit da938a83b5 the tcp_arg() that is
set for the new connection is the new connection itself, and the parent
listening socket is found in the pcb->connected entry.
This commit is contained in:
Damien George 2019-04-03 16:43:44 +11:00
parent 1f5d945afa
commit 3dda964785
1 changed files with 2 additions and 1 deletions

View File

@ -447,7 +447,8 @@ STATIC err_t _lwip_tcp_recv_unaccepted(void *arg, struct tcp_pcb *pcb, struct pb
// from accept callback itself. // from accept callback itself.
STATIC err_t _lwip_tcp_accept_finished(void *arg, struct tcp_pcb *pcb) STATIC err_t _lwip_tcp_accept_finished(void *arg, struct tcp_pcb *pcb)
{ {
lwip_socket_obj_t *socket = (lwip_socket_obj_t*)arg; // The ->connected entry of the pcb holds the listening socket of the accept
lwip_socket_obj_t *socket = (lwip_socket_obj_t*)pcb->connected;
tcp_poll(pcb, NULL, 0); tcp_poll(pcb, NULL, 0);
exec_user_callback(socket); exec_user_callback(socket);
return ERR_OK; return ERR_OK;