Skip to content

Commit

Permalink
lib/curl/Easy: use pass std::chrono::duration to SetTimeout()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jul 23, 2024
1 parent cbee06c commit 009c24b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lib/curl/Easy.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <curl/curl.h>

#include <chrono>
#include <cstddef>
#include <span>
#include <stdexcept>
Expand Down Expand Up @@ -139,12 +140,12 @@ public:
SetOption(CURLOPT_PROXY_SSL_VERIFYPEER, value);
}

void SetConnectTimeout(long timeout) {
SetOption(CURLOPT_CONNECTTIMEOUT, timeout);
void SetConnectTimeout(std::chrono::duration<long> timeout) {
SetOption(CURLOPT_CONNECTTIMEOUT, timeout.count());
}

void SetTimeout(long timeout) {
SetOption(CURLOPT_TIMEOUT, timeout);
void SetTimeout(std::chrono::duration<long> timeout) {
SetOption(CURLOPT_TIMEOUT, timeout.count());
}

void SetHeaderFunction(size_t (*function)(char *buffer, size_t size,
Expand Down

0 comments on commit 009c24b

Please sign in to comment.