fix(http_server): Don't require LWIP_NETIF_LOOPBACK for Linux target

This commit is contained in:
snake-4
2024-08-21 04:25:10 +02:00
committed by GitHub
parent cdee290a5d
commit 8bade3bf2c

View File

@@ -15,24 +15,22 @@
#include "ctrl_sock.h"
#if CONFIG_IDF_TARGET_LINUX
#define IPV4_ENABLED 1
#define IPV6_ENABLED 1
#define IPV4_ENABLED 1
#define IPV6_ENABLED 1
#define LOOPBACK_ENABLED 1
#else // CONFIG_IDF_TARGET_LINUX
#define IPV4_ENABLED CONFIG_LWIP_IPV4
#define IPV6_ENABLED CONFIG_LWIP_IPV6
#define IPV4_ENABLED CONFIG_LWIP_IPV4
#define IPV6_ENABLED CONFIG_LWIP_IPV6
#define LOOPBACK_ENABLED CONFIG_LWIP_NETIF_LOOPBACK
#endif // !CONFIG_IDF_TARGET_LINUX
#if !CONFIG_LWIP_NETIF_LOOPBACK
static const char *TAG = "esp_http_server";
#endif
/* Control socket, because in some network stacks select can't be woken up any
* other way
*/
int cs_create_ctrl_sock(int port)
{
#if !CONFIG_LWIP_NETIF_LOOPBACK
ESP_LOGE(TAG, "Please enable LWIP_NETIF_LOOPBACK for %s API", __func__);
#if !LOOPBACK_ENABLED
ESP_LOGE("esp_http_server", "Please enable LWIP_NETIF_LOOPBACK for %s API", __func__);
return -1;
#endif