Don't ignore return value of httpd_stop

This commit is contained in:
Nathan Phillips
2022-04-22 11:19:27 +01:00
committed by BOT
parent 523c51818c
commit e8e63a06e8
10 changed files with 34 additions and 40 deletions

View File

@@ -206,12 +206,12 @@ static httpd_handle_t start_wss_echo_server(void)
return server;
}
static void stop_wss_echo_server(httpd_handle_t server)
static esp_err_t stop_wss_echo_server(httpd_handle_t server)
{
// Stop keep alive thread
wss_keep_alive_stop(httpd_get_global_user_ctx(server));
// Stop the httpd server
httpd_ssl_stop(server);
return httpd_ssl_stop(server);
}
static void disconnect_handler(void* arg, esp_event_base_t event_base,
@@ -219,8 +219,8 @@ static void disconnect_handler(void* arg, esp_event_base_t event_base,
{
httpd_handle_t* server = (httpd_handle_t*) arg;
if (*server) {
stop_wss_echo_server(*server);
*server = NULL;
if (stop_wss_echo_server(*server) == ESP_OK)
*server = NULL;
}
}