From 9d4d5d2d4939633a2aff2d2061896bec1476b8a3 Mon Sep 17 00:00:00 2001 From: Jackson Ming Hu Date: Tue, 16 Jul 2024 16:53:40 +1000 Subject: [PATCH] fix(websocket): don't get transport from the list if external transport is used --- components/esp_websocket_client/esp_websocket_client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/esp_websocket_client/esp_websocket_client.c b/components/esp_websocket_client/esp_websocket_client.c index eb89215cc1..4095960383 100644 --- a/components/esp_websocket_client/esp_websocket_client.c +++ b/components/esp_websocket_client/esp_websocket_client.c @@ -955,7 +955,9 @@ static void esp_websocket_client_task(void *pv) client->run = true; //get transport by scheme - client->transport = esp_transport_list_get_transport(client->transport_list, client->config->scheme); + if (client->transport == NULL && client->config->ext_transport == NULL) { + client->transport = esp_transport_list_get_transport(client->transport_list, client->config->scheme); + } if (client->transport == NULL) { ESP_LOGE(TAG, "There are no transports valid, stop websocket client"); @@ -1135,6 +1137,7 @@ esp_err_t esp_websocket_client_start(esp_websocket_client_handle_t client) return ESP_FAIL; } xEventGroupClearBits(client->status_bits, STOPPED_BIT | CLOSE_FRAME_SENT_BIT); + ESP_LOGI(TAG, "Started"); return ESP_OK; }