cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: poll() POLLERR / POLLHUP without POLLIN / POLLOUT

From: Guenter <lists_at_gknw.net>
Date: Fri, 11 Sep 2009 16:15:43 +0200

Hi Yang,
Yang Tse schrieb:
> 10 Sep 2009 Joshua Kwan http://curl.haxx.se/mail/lib-2009-09/0138.html wrote:
>
>> This simple patch makes it so that cURL properly communicates
>> the POLLERR state to c-ares (as well as POLLHUP.)
>
> No the patch does not tell c-ares that the file descriptor has an
> POLLERR or POLLHUP condition, it simply tells that c-ares should
> process the file descriptor as if it had a POLLIN revent whenever it
> has a POLLERR or POLLHUP condition, and process the file descriptor as
> if it had a POLLOUT revent whenever it has a POLLERR.
>
> In this way , c-ares will attempt to read or write on the fd and fail.
> But this failure might very well trigger additional lookups and
> finally make c-ares mark all configured DNS servers as unavailable.
> Which isn't necessarily bad.
>
> My concern is that this patch addresses the lack of POLLIN and POLLOUT
> when POLLERR or POLLHUP is reported by poll in a very specific point
> of libcurl awaiting c-ares to resolve. But if the condition arises at
> other moments of the connection/transfer I fear that you will be
> facing the same problem of not detecting POLLERR or POLLHUP when poll
> does not set POLLIN or POLLOUT, but in this case libcurl should simply
> timeout somewhere.
so would you conclude to revert the patch?

Gün.
Received on 2009-09-11