mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-17 13:46:56 +08:00
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:
@@ -1308,6 +1308,12 @@ lwip_netconn_do_listen(struct api_msg_msg *msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (msg->conn->state == NETCONN_LISTEN) {
|
||||
/* already listening, allow updating of the backlog */
|
||||
msg->err = ERR_OK;
|
||||
#if TCP_LISTEN_BACKLOG
|
||||
tcp_backlog_set(msg->conn->pcb.tcp, msg->msg.lb.backlog);
|
||||
#endif /* TCP_LISTEN_BACKLOG */
|
||||
}
|
||||
} else {
|
||||
msg->err = ERR_ARG;
|
||||
|
||||
Reference in New Issue
Block a user