mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
Merge branch 'feature/support_ws_handshake_callback' into 'master'
example: Identify the callback whether is hanshake or frame-receive by req->method Closes IDFGH-4796 and IDFCI-488 See merge request espressif/esp-idf!12634
This commit is contained in:
commit
67cb6b98f8
@ -67,6 +67,10 @@ static esp_err_t trigger_async_send(httpd_handle_t handle, httpd_req_t *req)
|
||||
*/
|
||||
static esp_err_t echo_handler(httpd_req_t *req)
|
||||
{
|
||||
if (req->method == HTTP_GET) {
|
||||
ESP_LOGI(TAG, "Handshake done, the new connection was opened");
|
||||
return ESP_OK;
|
||||
}
|
||||
httpd_ws_frame_t ws_pkt;
|
||||
memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t));
|
||||
ws_pkt.type = HTTPD_WS_TYPE_TEXT;
|
||||
|
@ -33,6 +33,10 @@ static const size_t max_clients = 4;
|
||||
|
||||
static esp_err_t ws_handler(httpd_req_t *req)
|
||||
{
|
||||
if (req->method == HTTP_GET) {
|
||||
ESP_LOGI(TAG, "Handshake done, the new connection was opened");
|
||||
return ESP_OK;
|
||||
}
|
||||
httpd_ws_frame_t ws_pkt;
|
||||
memset(&ws_pkt, 0, sizeof(httpd_ws_frame_t));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user