mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 10:40:47 +03:00
Merge branch 'fix/httpd_clang_tidy_missing_close_v6.0' into 'release/v6.0'
fix(network/http_server): fix clang-tidy warnings for missing close (v6.0) See merge request espressif/esp-idf!49864
This commit is contained in:
@@ -48,7 +48,7 @@ void esp_http_server_dispatch_event(int32_t event_id, const void* event_data, si
|
||||
}
|
||||
}
|
||||
|
||||
static esp_err_t httpd_accept_conn(struct httpd_data *hd, int listen_fd)
|
||||
static esp_err_t httpd_accept_conn(struct httpd_data *hd)
|
||||
{
|
||||
/* If no space is available for new session, close the least recently used one */
|
||||
if (hd->config.lru_purge_enable == true) {
|
||||
@@ -71,11 +71,13 @@ static esp_err_t httpd_accept_conn(struct httpd_data *hd, int listen_fd)
|
||||
|
||||
struct sockaddr_storage addr_from;
|
||||
socklen_t addr_from_len = sizeof(addr_from);
|
||||
int new_fd = accept(listen_fd, (struct sockaddr *)&addr_from, &addr_from_len);
|
||||
|
||||
int new_fd = accept(hd->listen_fd, (struct sockaddr *)&addr_from, &addr_from_len);
|
||||
if (new_fd < 0) {
|
||||
ESP_LOGE(TAG, LOG_FMT("error in accept (%d)"), errno);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
ESP_LOGD(TAG, LOG_FMT("newfd = %d"), new_fd);
|
||||
|
||||
struct timeval tv;
|
||||
@@ -318,7 +320,7 @@ static esp_err_t httpd_server(struct httpd_data *hd)
|
||||
* process? */
|
||||
if (FD_ISSET(hd->listen_fd, &read_set)) {
|
||||
ESP_LOGD(TAG, LOG_FMT("processing listen socket %d"), hd->listen_fd);
|
||||
if (httpd_accept_conn(hd, hd->listen_fd) != ESP_OK) {
|
||||
if (httpd_accept_conn(hd) != ESP_OK) {
|
||||
ESP_LOGW(TAG, LOG_FMT("error accepting new connection"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user