cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1733138 ] socket.c assumes xopen getsockopt/getsockname

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 07 Jun 2007 16:32:03 -0700

Bugs item #1733138, was opened at 2007-06-07 16:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1733138&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: rrauenza (rrauenza)
Assigned to: Daniel Stenberg (bagder)
Summary: socket.c assumes xopen getsockopt/getsockname

Initial Comment:

HPUX doesn't use the XOPEN getsockopt/getsockname interfaces by default (for backwards compatibility).

     int setsockopt(
          int s,
          int level,
          int optname,
          const void *optval,
          int optlen
      );

    _XOPEN_SOURCE_EXTENDED Only (UNIX 98)
      int getsockopt(
          int s,
          int level,
          int optname,
          void *optval,
          socklen_t *optlen
      );

When compiling 64bit, socklen_t is 64bit, but int is 32bit, so optlen ends up being 0 due the socklen being treated as a 32bit value.

Here's the required changes -- simply changing the parms to be ints instead of socklens when not using _XOPEN_SOURCE_EXTENDED and HPUX

$ rcsdiff connect.c
RCS file: connect.c,v
retrieving revision 1.1
rdiff -r1.1 connect.c
367a368,370
> #if defined(__hpux) && ! defined(_XOPEN_SOURCE_EXTENDED)
> int size;
> #else
368a372
> #endif
407a412,414
> #if defined(__hpux) && ! defined(_XOPEN_SOURCE_EXTENDED)
> int errSize = sizeof(err);
> #else
408a416
> #endif

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1733138&group_id=976
Received on 2007-06-08

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET