cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl_socklen_t - CURL_TYPEOF_CURL_SOCKLEN_T

From: Yang Tse <yangsita_at_gmail.com>
Date: Sat, 2 May 2009 15:03:10 +0200

Hi friends,

curl_socklen_t is now being used in the cURL source code tree to
replace socklen_t, the need of this curl_socklen_t data type is to
improve curl and libcurl's portability. This change should improve
users experience with libcurl on HP-UX and will also benefit other
systems on which the 'socklen_t' data type that should be used changes
depending on the configuration the user is actually using.

The gory details relative to HP-UX systems requirements are on this
thread http://curl.haxx.se/mail/lib-2009-04/0287.html

Thus, the curl_socklen_t data type is a build-time property, and as
such the definition is done in curlbuild.h.

Systems/platforms where only a single curl_socklen_t intrinsic type
definition is actually required are not affected by any sort of ABI
breakage. On those systems/platforms which now have the possibility of
using more than one actual curl_socklen_t type definition, curlrules.h
will take care of protecting the user from library mismatches.

As usual, on configure-capable systems the configure script takes care
of everything and the user won't have to worry about this issue any
further. Hopefully!

For systems not capable of running the configure script there are a
couple of symbols in curlbuild.h.dist which need to be properly
configured ASAP. These are CURL_TYPEOF_CURL_SOCKLEN_T and
CURL_SIZEOF_CURL_SOCKLEN_T which right now are respectively configured
with 'FIXME' and '-1' for mostly all platforms. This ensures that
there won't be any ABI breakage as it is impossible to build the
library with those definitions in place.

So if you are affected by a 'FIXME' definition in
http://cool.haxx.se/cvs.cgi/curl/include/curl/curlbuild.h.dist your
help is needed to fix it, don't count on someone else fixing it,
otherwise next release will be broken for you.

If you have to fix your platform definition we need the following details...

For CURL_TYPEOF_CURL_SOCKLEN_T the pointer data type used as the third
argument of the getpeername() function, if your platform lacks this
function then look at the 5th argument of setsockopt() or expose your
doubts and I'll try. For CURL_SIZEOF_CURL_SOCKLEN_T the size returned
by sizeof() for the above data type.

If the data type being used, or its size, changes with some definition
we also need this info.

If the data type definition is done in some header we need to know
which header(s) need to be included to properly use the data type. For
example 'int' won't require a header, but socklen_t will most
certainly do.

From this point onwards any curl_socklen_t issue must be considered as
something which needs fixing. So report it, and help yourself, helping
us. There might still be some adjustment required for HP-UX.
Autobuilds are being actively monitored for all this.

OTHER KNOWN ISSUES:

OS400 file curl/packages/OS400/curlinc.in still uses 'socklen_t'. I
suppose that it should be changed to whatever type is used for
CURL_SIZEOF_CURL_SOCKLEN_T on OS400. Patrick, help.

Have fun,

-- 
-=[Yang]=-
Received on 2009-05-02