diff options
Diffstat (limited to 'src/lib/curl/Global.cxx')
-rw-r--r-- | src/lib/curl/Global.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/curl/Global.cxx b/src/lib/curl/Global.cxx index 4acb16fe6..0cd8b533d 100644 --- a/src/lib/curl/Global.cxx +++ b/src/lib/curl/Global.cxx @@ -225,6 +225,13 @@ CurlGlobal::UpdateTimeout(long timeout_ms) noexcept return; } + if (timeout_ms < 1) + /* CURL's threaded resolver sets a timeout of 0ms, which + means we're running in a busy loop. Quite a bad + idea to waste so much CPU. Let's use a lower limit + of 1ms. */ + timeout_ms = 1; + timeout_event.Schedule(std::chrono::milliseconds(timeout_ms)); } |