From 2c9d100d445f8db82c811c011a2c2e9078e242a2 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Thu, 24 Oct 2024 13:53:39 -0700 Subject: [PATCH] fix(http): Fix "Failed sending data to the peer" errors (#1443) Upgrading curl fixes errors like "Failed sending data to the peer" flooding the log. This is described upstream in https://github.com/curl/curl/issues/10591 and fixed in curl 8.2.0. Here we upgrade to curl 8.9.1 (latest as of today). This required updating the way we attach c-ares to libcurl and updating CURLOPT_PUT (deprecated) to CURLOPT_UPLOAD (compatible equivalent AFAICT). --- packager/file/http_file.cc | 2 +- packager/third_party/curl/CMakeLists.txt | 2 +- packager/third_party/curl/source | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packager/file/http_file.cc b/packager/file/http_file.cc index b50fef6f07..dca43e26ca 100644 --- a/packager/file/http_file.cc +++ b/packager/file/http_file.cc @@ -311,7 +311,7 @@ void HttpFile::SetupRequest() { curl_easy_setopt(curl, CURLOPT_POST, 1L); break; case HttpMethod::kPut: - curl_easy_setopt(curl, CURLOPT_PUT, 1L); + curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); break; } diff --git a/packager/third_party/curl/CMakeLists.txt b/packager/third_party/curl/CMakeLists.txt index e4665ab102..73fc42ace4 100644 --- a/packager/third_party/curl/CMakeLists.txt +++ b/packager/third_party/curl/CMakeLists.txt @@ -45,5 +45,5 @@ add_subdirectory(source) # Our enabling of c-ares doesn't automatically set a dependency between libcurl # and c-ares. Fix that now. if(USE_ARES) - target_link_libraries(libcurl c-ares) + target_link_libraries(libcurl_static PUBLIC c-ares) endif() diff --git a/packager/third_party/curl/source b/packager/third_party/curl/source index 462196e6b4..83bedbd730 160000 --- a/packager/third_party/curl/source +++ b/packager/third_party/curl/source @@ -1 +1 @@ -Subproject commit 462196e6b4a47f924293a0e26b8e9c23d37ac26f +Subproject commit 83bedbd730d62b83744cc26fa0433d3f6e2e4cd6