lwip_sock_tcp: close accepted connection if queue is full

This commit is contained in:
Martine Lenders 2020-02-21 20:06:26 +01:00 committed by Martine S. Lenders
parent e98e2f6143
commit 1a4e6e9cdb
No known key found for this signature in database
GPG Key ID: CCD317364F63286F

View File

@ -243,6 +243,13 @@ int sock_tcp_accept(sock_tcp_queue_t *queue, sock_tcp_t **sock,
} }
} }
else { else {
while (cib_avail(&queue->base.conn->acceptmbox.mbox.cib)) {
/* close connections potentially accepted by lwIP */
if (netconn_accept(queue->base.conn, &tmp) == ERR_OK) {
netconn_close(tmp);
netconn_delete(tmp);
}
}
res = -ENOMEM; res = -ENOMEM;
} }
#if LWIP_SO_RCVTIMEO #if LWIP_SO_RCVTIMEO