Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update http_stream.c (AUD-3393) #706

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions components/audio_stream/http_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,9 @@ static esp_err_t _http_open(audio_element_handle_t self)
}

char *buffer = NULL;
int post_len = esp_http_client_get_post_field(http->client, &buffer);
int post_len = 0;
_stream_redirect:
post_len = esp_http_client_get_post_field(http->client, &buffer);
if ((err = esp_http_client_open(http->client, post_len)) != ESP_OK) {
ESP_LOGE(TAG, "Failed to open http stream");
return err;
Expand Down Expand Up @@ -706,8 +707,9 @@ esp_err_t http_stream_auto_connect_next_track(audio_element_handle_t el)
if (track) {
esp_http_client_set_url(http->client, track);
char *buffer = NULL;
int post_len = esp_http_client_get_post_field(http->client, &buffer);
int post_len = 0;
redirection:
post_len = esp_http_client_get_post_field(http->client, &buffer);
if ((esp_http_client_open(http->client, post_len)) != ESP_OK) {
ESP_LOGE(TAG, "Failed to open http stream");
return ESP_FAIL;
Expand Down