lwip update

* The mdns responder has been reworked to lower stack and memory usage. This is
  a variation on the upstream code, it use malloc whereas the upstream code uses
  pools. The high stack usage of the mdns responder was problem for
  esp-open-rtos, so we might have to maintain the differences for now.

* Improved lwip core locking, and lock checking. Upstream improvements, that
  need some added support from esp-open-rtos specific code. More core lock is
  performed when calling from the esp-open-rtos code now, so a little safer. The
  checking is not enforced, but projects might see warning messages and might
  want to look into them.

* The esp-open-rtos lwip support has been sync'ed with the new freertos port
  included with lwip. There are still some minor differences.

* A few lwip timer bugs have been resolved. This might help resolve some issues.

* Plus it picks up all the other upstream fixes and improvements.

* The default lwip stack has been lowered from 768 words to 480 words,
  due to the reduced stack usage by the mdns responder.
This commit is contained in:
Our Air Quality 2018-01-24 14:56:24 +11:00
parent 5f8b3d43c7
commit 3c81f7d587
12 changed files with 345 additions and 185 deletions

View file

@ -1689,7 +1689,9 @@ static void server_task(void *pvParameters)
struct netif *softap_netif = sdk_system_get_netif(SOFTAP_IF);
if ((wifi_sta_mdns && station_netif) || (wifi_ap_mdns && softap_netif)) {
#if LWIP_MDNS_RESPONDER
LOCK_TCPIP_CORE();
mdns_resp_init();
UNLOCK_TCPIP_CORE();
#endif
#if EXTRAS_MDNS_RESPONDER
mdns_init();
@ -1697,16 +1699,22 @@ static void server_task(void *pvParameters)
#endif
}
#if LWIP_MDNS_RESPONDER
LOCK_TCPIP_CORE();
if (wifi_sta_mdns && station_netif) {
LOCK_TCPIP_CORE();
mdns_resp_add_netif(station_netif, hostname, 120);
mdns_resp_add_service(station_netif, hostname, "_http",
DNSSD_PROTO_TCP, 80, 3600, NULL, NULL);
UNLOCK_TCPIP_CORE();
}
if (wifi_ap_mdns && softap_netif) {
LOCK_TCPIP_CORE();
mdns_resp_add_netif(softap_netif, hostname, 120);
mdns_resp_add_service(softap_netif, hostname, "_http",
DNSSD_PROTO_TCP, 80, 3600, NULL, NULL);
UNLOCK_TCPIP_CORE();
}
UNLOCK_TCPIP_CORE();
#endif
free(hostname);
@ -2233,10 +2241,6 @@ void wificfg_init(uint32_t port, const wificfg_dispatch *dispatch)
params->dispatch = dispatch;
size_t stack_size = 464;
#if LWIP_MDNS_RESPONDER
/* Uses a lot of stack space, so allocate extra. */
stack_size += 128;
#endif
xTaskCreate(server_task, "WiFi Cfg HTTP", stack_size, params, 2, NULL);
}
}