Tim Ruehsen <[email protected]> writes: > There are three obvious ways to fix the issue once and for all: > a) > when given the timeout value 0, use INFINITY and special handle this value in > select_fd() to call select with timeout NULL.
Why call select() or select_fd() at all when timeout is 0? Wget is supposed to simply use blocking reads when opt.read_timeout is 0 (i.e. infinity). poll_internal gets this right and skips the call to the actual poller if the timeout is 0. One can think of 0-means-infinity as a high-level feature of functions aware of opt.read_timeout and similar configuration options, so the special handling of 0 (or another infinity marker) needs happen at that point. In this design the low-level functions should just call select() or equivalent with the correct arguments.
