mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-19 06:36:51 +08:00
tcp: changed accept handling to be done internally: the application does not have to call tcp_accepted() any more. Instead, when delaying accept (e.g. sockets do), call tcp_backlog_delayed()/tcp_backlog_accepted() (fixes bug #46696)
This commit is contained in:
@@ -2286,12 +2286,10 @@ static err_t
|
||||
http_accept(void *arg, struct tcp_pcb *pcb, err_t err)
|
||||
{
|
||||
struct http_state *hs;
|
||||
struct tcp_pcb_listen *lpcb = (struct tcp_pcb_listen*)arg;
|
||||
LWIP_UNUSED_ARG(arg);
|
||||
LWIP_UNUSED_ARG(err);
|
||||
LWIP_DEBUGF(HTTPD_DEBUG, ("http_accept %p / %p\n", (void*)pcb, arg));
|
||||
|
||||
/* Decrease the listen backlog counter */
|
||||
tcp_accepted(lpcb);
|
||||
/* Set priority */
|
||||
tcp_setprio(pcb, HTTPD_TCP_PRIO);
|
||||
|
||||
@@ -2343,8 +2341,7 @@ httpd_init(void)
|
||||
LWIP_ASSERT("httpd_init: tcp_bind failed", err == ERR_OK);
|
||||
pcb = tcp_listen(pcb);
|
||||
LWIP_ASSERT("httpd_init: tcp_listen failed", pcb != NULL);
|
||||
/* initialize callback arg and accept callback */
|
||||
tcp_arg(pcb, pcb);
|
||||
/* initialize accept callback */
|
||||
tcp_accept(pcb, http_accept);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user