Am Tuesday 15 May 2012 schrieb Hrvoje Niksic:
> 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?

Some parts in the source call select_fd() with timeout==0, supposed to return 
immediately with -1, 0 or 1. Changing select_fd() simply won't work. I wrote 
more about that in my answer to Guiseppe's reply.

> 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.

That's the way it should be (just straight forward). But without changing 
well-tested code (that ex- or implicitely calls select_fd), it can't be done.

Maybe I am wrong and someone comes with the 'voila' one-liner that fixes the 
issue.

Tim

Reply via email to