|
@@ -442,6 +442,9 @@ static err_t http_accept(void *arg, struct tcp_pcb *pcb, err_t err)
|
|
|
{
|
|
|
struct http_state *hs;
|
|
|
|
|
|
+
|
|
|
+ tcp_setprio(pcb, TCP_PRIO_MIN);
|
|
|
+
|
|
|
|
|
|
hs = mem_malloc(sizeof(struct http_state));
|
|
|
|
|
@@ -499,13 +502,25 @@ void HTTP_Init()
|
|
|
{
|
|
|
char buf[MAX_WEB_COOKIE_LEN];
|
|
|
uint8_t user_id;
|
|
|
-
|
|
|
+ err_t err;
|
|
|
struct tcp_pcb *pcb;
|
|
|
|
|
|
- pcb = tcp_new();
|
|
|
- tcp_bind(pcb, IP_ADDR_ANY, 80);
|
|
|
- pcb = tcp_listen(pcb);
|
|
|
- tcp_accept(pcb, http_accept);
|
|
|
+
|
|
|
+ pcb = tcp_new_ip_type(IPADDR_TYPE_ANY);
|
|
|
+ LWIP_ASSERT("httpd_init: tcp_new failed", pcb != NULL);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ err = tcp_bind(pcb, IP_ANY_TYPE, 80);
|
|
|
+ LWIP_UNUSED_ARG(err);
|
|
|
+ LWIP_ASSERT("httpd_init: tcp_bind failed", err == ERR_OK);
|
|
|
+
|
|
|
+
|
|
|
+ pcb = tcp_listen(pcb);
|
|
|
+
|
|
|
+ tcp_accept(pcb, http_accept);
|
|
|
|
|
|
for (user_id = 0; user_id < MAX_WEB_USERS; user_id++) {
|
|
|
|