When darkhttpd is running with --timeout 0 (timeout disabled), and any
connection is idle, it will use 100% of the CPU. This happens because
select returns immediately when its timeout is zero, causing the main
httpd_poll loop to spin.
Fix this by adding a check to httpd_poll making select always
receive a NULL timeout when timeout_secs is zero.
When darkhttpd is running with
--timeout 0
(timeout disabled), and any connection is idle, it will use 100% of the CPU. This happens becauseselect
returns immediately when its timeout is zero, causing the mainhttpd_poll
loop to spin.Fix this by adding a check to
httpd_poll
makingselect
always receive aNULL
timeout whentimeout_secs
is zero.