From 79216c657e7e867f12efe91ad843a643d42e30dc Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Mon, 14 Nov 2022 17:50:40 +0530 Subject: [PATCH] esp_http_server: modify error print for clarifying internal socket usage Closes https://github.com/espressif/esp-idf/issues/10108 Closes IDFGH-8663 --- components/esp_http_server/include/esp_http_server.h | 2 +- components/esp_http_server/src/httpd_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_http_server/include/esp_http_server.h b/components/esp_http_server/include/esp_http_server.h index 92c057c4bb..8103dcf1b7 100644 --- a/components/esp_http_server/include/esp_http_server.h +++ b/components/esp_http_server/include/esp_http_server.h @@ -155,7 +155,7 @@ typedef struct httpd_config { */ uint16_t ctrl_port; - uint16_t max_open_sockets; /*!< Max number of sockets/clients connected at any time*/ + uint16_t max_open_sockets; /*!< Max number of sockets/clients connected at any time (3 sockets are reserved for internal working of the HTTP server) */ uint16_t max_uri_handlers; /*!< Maximum allowed uri handlers */ uint16_t max_resp_headers; /*!< Maximum allowed additional headers in HTTP response */ uint16_t backlog_conn; /*!< Number of backlog connections */ diff --git a/components/esp_http_server/src/httpd_main.c b/components/esp_http_server/src/httpd_main.c index 50ca7d8bf6..6268ca79fe 100644 --- a/components/esp_http_server/src/httpd_main.c +++ b/components/esp_http_server/src/httpd_main.c @@ -466,7 +466,7 @@ esp_err_t httpd_start(httpd_handle_t *handle, const httpd_config_t *config) * So the total number of required sockets is max_open_sockets + 3 */ if (CONFIG_LWIP_MAX_SOCKETS < config->max_open_sockets + 3) { - ESP_LOGE(TAG, "Configuration option max_open_sockets is too large (max allowed %d)\n\t" + ESP_LOGE(TAG, "Config option max_open_sockets is too large (max allowed %d, 3 sockets used by HTTP server internally)\n\t" "Either decrease this or configure LWIP_MAX_SOCKETS to a larger value", CONFIG_LWIP_MAX_SOCKETS - 3); return ESP_ERR_INVALID_ARG;