mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-20 16:46:14 +00:00
esp_http_server: Add linger in httpd_config_t
Closes: https://github.com/espressif/esp-idf/issues/9514
This commit is contained in:
@@ -354,6 +354,13 @@ void httpd_sess_delete(struct httpd_data *hd, struct sock_db *session)
|
||||
}
|
||||
|
||||
ESP_LOGD(TAG, LOG_FMT("fd = %d"), session->fd);
|
||||
if (hd->config.enable_so_linger) {
|
||||
struct linger so_linger = {
|
||||
.l_onoff = true,
|
||||
.l_linger = hd->config.linger_timeout,
|
||||
};
|
||||
setsockopt(session->fd, SOL_SOCKET, SO_LINGER, &so_linger, sizeof(struct linger));
|
||||
}
|
||||
|
||||
// Call close function if defined
|
||||
if (hd->config.close_fn) {
|
||||
|
Reference in New Issue
Block a user