diff --git a/components/esp_http_server/include/esp_http_server.h b/components/esp_http_server/include/esp_http_server.h index 0cfcbfd077..445d0c0c27 100644 --- a/components/esp_http_server/include/esp_http_server.h +++ b/components/esp_http_server/include/esp_http_server.h @@ -1492,13 +1492,17 @@ esp_err_t httpd_sess_update_lru_counter(httpd_handle_t handle, int sockfd); * @brief Returns list of current socket descriptors of active sessions * * @param[in] handle Handle to server returned by httpd_start - * @param[in,out] fds In: Number of fds allocated in the supplied structure client_fds + * @param[in,out] fds In: Size of provided client_fds array * Out: Number of valid client fds returned in client_fds, * @param[out] client_fds Array of client fds * + * @note Size of provided array has to be equal or greater then maximum number of opened + * sockets, configured upon initialization with max_open_sockets field in + * httpd_config_t structure. + * * @return * - ESP_OK : Successfully retrieved session list - * - ESP_ERR_INVALID_ARG : Wrong arguments or list is longer than allocated + * - ESP_ERR_INVALID_ARG : Wrong arguments or list is longer than provided array */ esp_err_t httpd_get_client_list(httpd_handle_t handle, size_t *fds, int *client_fds); diff --git a/components/esp_http_server/src/httpd_main.c b/components/esp_http_server/src/httpd_main.c index 61c7214feb..fda2b241b8 100644 --- a/components/esp_http_server/src/httpd_main.c +++ b/components/esp_http_server/src/httpd_main.c @@ -105,7 +105,7 @@ esp_err_t httpd_queue_work(httpd_handle_t handle, httpd_work_fn_t work, void *ar esp_err_t httpd_get_client_list(httpd_handle_t handle, size_t *fds, int *client_fds) { struct httpd_data *hd = (struct httpd_data *) handle; - if (hd == NULL || fds == NULL || *fds == 0 || client_fds == NULL || *fds < hd->config.max_open_sockets) { + if (hd == NULL || fds == NULL || *fds == 0 || client_fds == NULL) { return ESP_ERR_INVALID_ARG; } size_t max_fds = *fds; diff --git a/components/esp_http_server/src/httpd_uri.c b/components/esp_http_server/src/httpd_uri.c index 522ff3bb88..8f82f381df 100644 --- a/components/esp_http_server/src/httpd_uri.c +++ b/components/esp_http_server/src/httpd_uri.c @@ -329,9 +329,6 @@ esp_err_t httpd_uri(struct httpd_data *hd) aux->sd->ws_handshake_done = true; aux->sd->ws_handler = uri->handler; aux->sd->ws_control_frames = uri->handle_ws_control_frames; - - /* Return immediately after handshake, no need to call handler here */ - return ESP_OK; } #endif