lib/curl/Multi: remove the Wait() overload with "int" timeout

Enforce type-safety.
This commit is contained in:
Max Kellermann 2024-08-20 11:08:53 +02:00 committed by Max Kellermann
parent 435f1eb6cc
commit d207c144d6
1 changed files with 2 additions and 6 deletions

View File

@ -98,16 +98,12 @@ public:
return running_handles;
}
unsigned Wait(int timeout) {
unsigned Wait(std::chrono::duration<int, std::chrono::milliseconds::period> 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());
}
};