cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Patch: partial fix for bug #948950

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 17 Nov 2004 22:55:45 +0100 (CET)

On Wed, 17 Nov 2004, David Phillips wrote:

> Please note that this is done as part of my employment at Adknowledge, Inc.
> You can add them to the list of companies using libcurl for internal
> software.

Done! Thanks for telling.

>> Yes. We should add a function that better return the file descriptors in a
>> more generic manner so that the caller can use them for whatever function
>> it wants to use. poll() is just one way.
>
> A good method would be to allocate and return a struct pollfd array.

Only if the caller wants to use poll() and only if struct pollfd is a known
struct on the platform. There are other kinds of event loops and stuff that
use other methods, so I would suggest a more generic approach: possibly just
returning an array of read-file descriptors and one with write-file
descriptors.

Joe Orton also suggested something similar to this in his comment to the same
bug in the Redhat bug tracker:

  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=134794#c4

> The attached patch fixes the problem spotted by Dan Fandrich. It also
> includes test 515. Test 515 is the same as 500, except that it opens more
> than FD_SETSIZE file descriptors before using libcurl.

I'll try out your patch as soon as possible.

> What has to be done to get this patch included? Do you want to design the
> new API function(s)?

I think the patch is useful and good even without the new functions. I think
we can proceed and apply it as soon as it has been reviewed. I'll try to do it
within a day or two.

The new function(s) should still be added to allow libcurl to provide an even
better service.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-11-17