mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
http_server: Add a flag to enable using control frames in user handlers
This commit is contained in:
@@ -772,8 +772,9 @@ esp_err_t httpd_req_new(struct httpd_data *hd, struct sock_db *sd)
|
||||
ESP_LOGD(TAG, LOG_FMT("Received PONG frame"));
|
||||
}
|
||||
|
||||
/* Call handler if it's a non-control frame */
|
||||
if (ret == ESP_OK && ra->ws_type <= HTTPD_WS_TYPE_PONG) {
|
||||
/* Call handler if it's a non-control frame (or if handler requests control frames, as well) */
|
||||
if (ret == ESP_OK &&
|
||||
(ra->ws_type < HTTPD_WS_TYPE_CLOSE || sd->ws_control_frames)) {
|
||||
ret = sd->ws_handler(r);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user