Silence a crash in update_engine when dns resolution fails am: 96ff7b28c6

Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/3351181

Change-Id: I4186dd5b9dbc06036a7a7b57f97c4a0fdb518a11
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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.