From d207c144d626b117d6cd5aabaadce38b14014e74 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 20 Aug 2024 11:08:53 +0200 Subject: [PATCH] lib/curl/Multi: remove the Wait() overload with "int" timeout Enforce type-safety. --- src/lib/curl/Multi.hxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib/curl/Multi.hxx b/src/lib/curl/Multi.hxx index 92ebe8b46..d157de664 100644 --- a/src/lib/curl/Multi.hxx +++ b/src/lib/curl/Multi.hxx @@ -98,16 +98,12 @@ public: return running_handles; } - unsigned Wait(int timeout) { + unsigned Wait(std::chrono::duration timeout) { int numfds; - auto code = curl_multi_wait(handle, nullptr, 0, timeout, + auto code = curl_multi_wait(handle, nullptr, 0, timeout.count(), &numfds); if (code != CURLM_OK) throw std::runtime_error(curl_multi_strerror(code)); return numfds; } - - unsigned Wait(std::chrono::milliseconds timeout) { - return Wait(timeout.count()); - } };