cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: approaching another release

From: Joe Halpin <j.p.h_at_comcast.net>
Date: Tue, 18 May 2004 11:02:05 -0500

Daniel Stenberg wrote:

> Currently I'm only aware of one somewhat annoying bug, and that is bug #948950
> in the bug tracker which makes libcurl crash if you use more than FD_SETSIZE
> file descriptors in your app and then use libcurl. I'm not sure if I'll focus
> on addressing that before this release.
>

Just off the top of my head, how about something like this?

Index: lib/connect.c
===================================================================
RCS file: /repository/curl/lib/connect.c,v
retrieving revision 1.101
diff -u -r1.101 connect.c
--- lib/connect.c 13 May 2004 10:40:17 -0000 1.101
+++ lib/connect.c 18 May 2004 15:59:23 -0000
@@ -206,6 +206,10 @@
    verifyconnect(sockfd, NULL);
  #endif

+ /* Make sure sockfd won't overflow the fd_set */
+ if(sockfd >= FD_SETSIZE)
+ return WAITCONN_SELECT_ERROR;
+
    /* now select() until we get connect or timeout */
    FD_ZERO(&fd);
    FD_SET(sockfd, &fd);
Received on 2004-05-18