From 7392d8003e27b424cf472509c2bc2782b326f18b Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Mon, 6 Sep 2021 21:52:17 -0700 Subject: [PATCH] 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 --- packager/file/http_file.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packager/file/http_file.cc b/packager/file/http_file.cc index c633b3345b..404ef6fb97 100644 --- a/packager/file/http_file.cc +++ b/packager/file/http_file.cc @@ -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_);