From 75fdcd9747a9b1966051d0ae939b69fc7cd0a801 Mon Sep 17 00:00:00 2001 From: Philip Gladstone Date: Sat, 30 Apr 2022 19:51:42 -0400 Subject: [PATCH] Make it compile without websocket support --- components/modules/httpd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/modules/httpd.c b/components/modules/httpd.c index ee666faf..d012a427 100644 --- a/components/modules/httpd.c +++ b/components/modules/httpd.c @@ -265,7 +265,12 @@ static esp_err_t auto_index_handler(httpd_req_t *req) static esp_err_t dynamic_handler_httpd(httpd_req_t *req) { +#ifdef CONFIG_NODEMCU_CMODULE_HTTPD_WS size_t query_len = req->method != HTTP_WEBSOCKET ? httpd_req_get_url_query_len(req) : 0; +#else + size_t query_len = httpd_req_get_url_query_len(req); +#endif + char *query = query_len ? malloc(query_len + 1) : NULL; if (query_len) httpd_req_get_url_query_str(req, query, query_len + 1);