Skip to content

Commit

Permalink
Merge pull request #616 from huming2207/master
Browse files Browse the repository at this point in the history
fix(websocket): don't fetch transport from the list if external transport is set
  • Loading branch information
gabsuren authored Jul 22, 2024
2 parents cb1bc41 + 9d4d5d2 commit e583848
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 e583848

Please sign in to comment.