Re: [PATCH 1/2] http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping
- From
Daniel Stenberg <daniel@haxx.se>
- Date
- Nov 2, 2011, 22:40 UTC
- Message-ID
- <alpine.DEB.2.00.1111022336270.7774@tvnag.unkk.fr>
- In-Reply-To
- <CAOs=hR+QqUpYuth8Uvi2o7pm1LO8ogO2pN7nrMchYj96Cutmww@mail.gmail.com>
On Wed, 2 Nov 2011, Mika Fischer wrote:
Show 7 quoted lines
> The only problem I can see is that curl_multi_fdset is not guaranteed to > return any fds. So in theory it could be possible that we don't get fds, but > we're actually reading stuff. In this case things would get slow, because we > would sleep for 50ms after every read... > > However, I don't know if this is a case that actually comes up in the real > world. Maybe Daniel has some advice on this.
It doesn't really happen so it should be safe.
The case where no fds are returned is when libcurl cannot return a socket to wait for during name resolving (if your particular libcurl is built to use such a resolver backend - libcurl has several different ones). And during name resolving there won't be any data to read for the libcurl-app anyway.
-- / daniel.haxx.se