summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-12-24 16:07:33 +0100
committerMax Kellermann <max@musicpd.org>2019-12-24 16:09:26 +0100
commit6d54928d7c0aac758f3eddfe82169e27109a6255 (patch)
treef154ca922900b73115130fec4e35ab2f0368ea9a
parent0dffe05bf7849b440695e2e92e4fb26b5bc32469 (diff)
Revert "lib/curl/Global: remove lower bound on timeouts"
This reverts commit 4475b8ca04b2798519d0f6eb68913c55cf3d1846. Further testing revealed that the threaded resolver still uses a timeout of 0ms. This revert however lowers the bound to a minimum of 1ms instead of 10ms.
-rw-r--r--src/lib/curl/Global.cxx7
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));
}