From 409002b1c3e8c7cadef9cb5a955f6adb977a9717 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 28 Aug 2019 10:41:41 +0200 Subject: [PATCH] curl/Easy: add Perform() --- src/lib/curl/Easy.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/curl/Easy.hxx b/src/lib/curl/Easy.hxx index 298aaa617..67ce8ce33 100644 --- a/src/lib/curl/Easy.hxx +++ b/src/lib/curl/Easy.hxx @@ -187,6 +187,12 @@ public: : -1; } + void Perform() { + CURLcode code = curl_easy_perform(handle); + if (code != CURLE_OK) + throw std::runtime_error(curl_easy_strerror(code)); + } + bool Unpause() noexcept { return ::curl_easy_pause(handle, CURLPAUSE_CONT) == CURLE_OK; }