[coastguard skipped] Merge sparse cherrypicks from sparse-13018634-L50400030009417638 into 25Q2-release.
COASTGUARD_SKIP: I590cb5b30f5bb2cc0b4b35e5bb332eccc1ff5a4a
COASTGUARD_SKIP: If5970a9c0ab5e132a584092cb404ed32671e5d50
COASTGUARD_SKIP: I630b5c327dfefc9ee5cc3fedf765c87ce073e679
Change-Id: I4eba8212a147480b4b8618d92bb1b3e6b8053239
diff --git a/libcurl_http_fetcher.cc b/libcurl_http_fetcher.cc
index 08c8a67..db94a6f 100644
--- a/libcurl_http_fetcher.cc
+++ b/libcurl_http_fetcher.cc
@@ -648,11 +648,17 @@
return;
}
CHECK(curl_handle_);
- CHECK_EQ(curl_easy_pause(curl_handle_, CURLPAUSE_CONT), CURLE_OK);
- // Since the transfer is in progress, we need to dispatch a CurlPerformOnce()
- // now to let the connection continue, otherwise it would be called by the
- // TimeoutCallback but with a delay.
- CurlPerformOnce();
+ auto ret = curl_easy_pause(curl_handle_, CURLPAUSE_CONT);
+ if (ret != CURLE_OK) {
+ LOG(ERROR) << "Failed to unpause connection, reason: " << ret
+ << ". Terminating transfer.";
+ TerminateTransfer();
+ } else {
+ // Since the transfer is in progress, we need to dispatch a
+ // CurlPerformOnce() now to let the connection continue, otherwise it would
+ // be called by the TimeoutCallback but with a delay.
+ CurlPerformOnce();
+ }
}
// This method sets up callbacks with the MessageLoop.