[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] need some advice for 0 timeout code

From: Hrvoje Niksic
Subject: Re: [Bug-wget] need some advice for 0 timeout code
Date: Tue, 15 May 2012 10:45:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Tim Ruehsen <address@hidden> 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]