Allow backlog to be updated

This commit adds support to the sockets and netconn layer to update the
backlog by calling listen when the netconn is already in the listen state.
When backlog is not enabled, the call returns successfully

This commit also introduces a macro for setting the backlog value that
prevents a 0 sized (invalid) backlog
This commit is contained in:
Joel Cunningham
2016-02-18 09:33:21 -06:00
parent 163d7f9791
commit 8cb64698aa
3 changed files with 10 additions and 1 deletions

View File

@@ -587,7 +587,7 @@ tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)
#endif /* LWIP_CALLBACK_API */
#if TCP_LISTEN_BACKLOG
lpcb->accepts_pending = 0;
lpcb->backlog = (backlog ? backlog : 1);
tcp_backlog_set(lpcb, backlog);
#endif /* TCP_LISTEN_BACKLOG */
TCP_REG(&tcp_listen_pcbs.pcbs, (struct tcp_pcb *)lpcb);
return (struct tcp_pcb *)lpcb;