fix: Fix failure fetching encryption keys

In one of the low-latency changes, a change was made to HttpFile that
caused responses to HTTP POST requests to go missing.  This resulted
in failures to fetch encryption keys.

The breaking change was recommended by me in a PR review, and was not
caught by any unit tests.  New tests would be ideal, but I chose to
fix the bug first, rather than leave the repo broken.

This bug was brought to my attention in google/shaka-streamer#87 and
has not appeared in any release versions.

Change-Id: I9eca73d187a8a30f16c4a920fcdb7b4872253858
This commit is contained in:
Joey Parrish 2021-09-06 21:52:17 -07:00
parent c87c5bcdef
commit 7392d8003e
1 changed files with 1 additions and 2 deletions

View File

@ -296,8 +296,7 @@ void HttpFile::SetupRequest() {
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &CurlWriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA,
method_ == HttpMethod::kGet ? &download_cache_ : nullptr);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &download_cache_);
if (method_ != HttpMethod::kGet) {
curl_easy_setopt(curl, CURLOPT_READFUNCTION, &CurlReadCallback);
curl_easy_setopt(curl, CURLOPT_READDATA, &upload_cache_);