Skip to content

Commit

Permalink
fix(websocket): don't get transport from the list if external transpo…
Browse files Browse the repository at this point in the history
…rt is used
  • Loading branch information
huming2207 committed Jul 16, 2024
1 parent 906e447 commit 9d4d5d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/esp_websocket_client/esp_websocket_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 9d4d5d2

Please sign in to comment.