cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: win32 autobuilds

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 9 Mar 2004 23:15:59 +0100 (CET)

On Tue, 9 Mar 2004, Greg Hewgill wrote:

> >... while socket() still returns an int? That's really odd.
>
> socket() returns a value of type SOCKET.

It does? Then I might spot a problem in the code that the compiler doesn't
warn about (lib/connect.c:589):

    /* create an IPv4 TCP socket */
    sockfd = socket(AF_INET, SOCK_STREAM, 0);
    if(-1 == sockfd) {
      failf(data, "couldn't create socket");
      return CURLE_COULDNT_CONNECT; /* big time error */
    }

Here, sockfd is an int. If the windows code returns an unsigned int. Does it
return 0xffffffff when it fails?

> Instead of addressing FD_SET specifically, another way to address the
> problem might be to use CURL_SOCKET for all socket handles, which would then
> be mapped to int or SOCKET as appropriate.

Yes, that would probably be a nicer fix. But then we need to address code such
as the above one as well, since comparing -1 with an unsigned variable isn't
nice.

BTW, you should try to mimic testcurl.sh even closer and the autobuild script
will like it even more. For example:

You script says 'testcurl: src/curl.exe was created fine' while the
server-side script scans for "testcurl: src/curl was created fine"...

Also, the testcurl.sh script displays the lib/config.h and src/config.h files,
and the server-side script parses that output to detect features that are
enabled in this particular build. (You could display the *-win32.h versions)

(And thanks a lot for working on this, it certainly helps!)

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
Received on 2004-03-09