summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--CMakeLists.txt4
-rw-r--r--RELEASE-NOTES3
-rw-r--r--acinclude.m489
-rw-r--r--configure.ac3
-rw-r--r--curl-style.el2
-rw-r--r--include/curl/curlbuild.h.dist4
-rw-r--r--lib/Makefile.netware4
-rw-r--r--lib/config-amigaos.h7
-rw-r--r--lib/config-os400.h3
-rw-r--r--lib/config-riscos.h3
-rw-r--r--lib/config-symbian.h3
-rw-r--r--lib/config-tpf.h3
-rw-r--r--lib/config.dos1
-rw-r--r--lib/config.h.cmake3
-rw-r--r--lib/connect.c8
-rw-r--r--lib/curl_addrinfo.c2
-rw-r--r--lib/curl_addrinfo.h4
-rw-r--r--lib/ftp.c14
-rw-r--r--lib/krb5.c2
-rw-r--r--lib/memdebug.c2
-rw-r--r--lib/setup-os400.h9
-rw-r--r--lib/setup_once.h100
-rw-r--r--lib/tftp.c4
-rw-r--r--packages/OS400/os400sys.c8
-rw-r--r--packages/vms/config-vms.h5
-rw-r--r--src/Makefile.netware4
-rw-r--r--src/config-riscos.h3
-rw-r--r--tests/server/sockfilt.c2
-rw-r--r--tests/server/tftpd.c4
30 files changed, 41 insertions, 265 deletions
diff --git a/CHANGES b/CHANGES
index 3d48cbff5..416b66ce8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,9 @@
Changelog
+Yang Tse (2 May 2009)
+- Use a build-time configured curl_socklen_t data type instead of socklen_t.
+
Yang Tse (1 May 2009)
- Applied David McCreedy's patches "TPF-platform specific changes to various
files" and "http.c fix to Curl_proxyCONNECT for non-ASCII platforms", the
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c7862f4ff..1ffc32888 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -688,10 +688,6 @@ ENDIF(HAVE_INET_NTOA_R_DECL_REENTRANT)
# Some other minor tests
-IF(NOT HAVE_SOCKLEN_T)
- SET(socklen_t "int")
-ENDIF(NOT HAVE_SOCKLEN_T)
-
IF(NOT HAVE_IN_ADDR_T)
SET(in_addr_t "unsigned long")
ENDIF(NOT HAVE_IN_ADDR_T)
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index db1e33a74..be289f07f 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -15,6 +15,7 @@ This release includes the following changes:
the build-time fixed number
o CURLOPT_SEEKFUNCTION may now return CURL_SEEKFUNC_CANTSEEK
o curl can now upload with resume even when reading from a pipe
+ o a build-time configured curl_socklen_t is now used instead of socklen_t
This release includes the following bugfixes:
@@ -49,6 +50,6 @@ advice from friends like these:
Andre Guibert de Bruet, Andreas Farber, Frank Hempel, Pierre Brico,
Kamil Dudka, Jim Freeman, Daniel Johnson, Toshio Kuratomi, Martin Storsjo,
Pramod Sharma, Gisle Vanem, Leanic Lefever, Rainer Koenig, Sven Wegener,
- Tim Chen, Constantine Sapuntzakis David McCreedy
+ Tim Chen, Constantine Sapuntzakis, David McCreedy
Thanks! (and sorry if I forgot to mention someone)
diff --git a/acinclude.m4 b/acinclude.m4
index 0f7dbf44a..2fe93c7fe 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -983,94 +983,6 @@ AC_DEFUN([CURL_CHECK_HEADER_MEMORY], [
])
-dnl CURL_CHECK_TYPE_SOCKLEN_T
-dnl -------------------------------------------------
-dnl Check for existing socklen_t type, and provide
-dnl an equivalent type if socklen_t not available
-
-AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
- AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
- AC_CHECK_TYPE([socklen_t], ,[
- dnl socklen_t not available
- AC_CACHE_CHECK([for socklen_t equivalent],
- [curl_cv_socklen_t_equiv], [
- curl_cv_socklen_t_equiv="unknown"
- for arg1 in 'int' 'SOCKET'; do
- for arg2 in "struct sockaddr" void; do
- for t in int size_t unsigned long "unsigned long"; do
- if test "$curl_cv_socklen_t_equiv" = "unknown"; then
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[
-#undef inline
-#ifdef HAVE_WINDOWS_H
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#else
-#ifdef HAVE_WINSOCK_H
-#include <winsock.h>
-#endif
-#endif
-#define GETPEERNCALLCONV PASCAL
-#else
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#define GETPEERNCALLCONV
-#endif
- extern int GETPEERNCALLCONV getpeername($arg1, $arg2 *, $t *);
- ]],[[
- $t len=0;
- getpeername(0,0,&len);
- ]])
- ],[
- curl_cv_socklen_t_equiv="$t"
- ])
- fi
- done
- done
- done
- ])
- case "$curl_cv_socklen_t_equiv" in
- unknown)
- AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
- ;;
- *)
- AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
- [Type to use in place of socklen_t when system does not provide it.])
- ;;
- esac
- ],[
-#undef inline
-#ifdef HAVE_WINDOWS_H
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#ifdef HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
-#endif
-#endif
-#else
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#endif
- ])
-])
-
-
dnl CURL_CHECK_FUNC_GETNAMEINFO
dnl -------------------------------------------------
dnl Test if the getnameinfo function is available,
@@ -1084,7 +996,6 @@ dnl argument in GETNAMEINFO_QUAL_ARG1.
AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
- AC_REQUIRE([CURL_CHECK_TYPE_SOCKLEN_T])dnl
AC_CHECK_HEADERS(sys/types.h sys/socket.h netdb.h)
#
AC_MSG_CHECKING([for getnameinfo])
diff --git a/configure.ac b/configure.ac
index 351b873d9..35958a8a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2021,9 +2021,6 @@ AC_CHECK_TYPE([bool],[
CURL_CONFIGURE_CURL_SOCKLEN_T
-# Check for socklen_t or equivalent
-CURL_CHECK_TYPE_SOCKLEN_T
-
TYPE_IN_ADDR_T
TYPE_SOCKADDR_STORAGE
diff --git a/curl-style.el b/curl-style.el
index 25bcd1a37..1cb24f3b9 100644
--- a/curl-style.el
+++ b/curl-style.el
@@ -35,7 +35,7 @@
(setq tab-width 8
indent-tabs-mode nil ; Use spaces. Not tabs.
comment-column 40
- c-font-lock-extra-types (append '("bool" "CURL" "CURLcode" "ssize_t" "size_t" "socklen_t" "fd_set" "time_t" "curl_off_t" "curl_socket_t" "in_addr_t" "CURLSHcode" "CURLMcode" "Curl_addrinfo"))
+ c-font-lock-extra-types (append '("bool" "CURL" "CURLcode" "ssize_t" "size_t" "curl_socklen_t" "fd_set" "time_t" "curl_off_t" "curl_socket_t" "in_addr_t" "CURLSHcode" "CURLMcode" "Curl_addrinfo"))
)
;; keybindings for C, C++, and Objective-C. We can put these in
;; c-mode-base-map because of inheritance ...
diff --git a/include/curl/curlbuild.h.dist b/include/curl/curlbuild.h.dist
index 20fdef8ac..0de850263 100644
--- a/include/curl/curlbuild.h.dist
+++ b/include/curl/curlbuild.h.dist
@@ -389,8 +389,8 @@
# define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL
# endif
-# define CURL_TYPEOF_CURL_SOCKLEN_T FIXME
-# define CURL_SIZEOF_CURL_SOCKLEN_T -1
+# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
+# define CURL_SIZEOF_CURL_SOCKLEN_T 4
#elif defined(__OS400__)
# if defined(__ILEC400__)
diff --git a/lib/Makefile.netware b/lib/Makefile.netware
index c1c2b251d..6ab10bae6 100644
--- a/lib/Makefile.netware
+++ b/lib/Makefile.netware
@@ -407,7 +407,6 @@ ifeq ($(LIBARCH),CLIB)
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
- @echo $(DL)#define socklen_t int$(DL) >> $@
@echo $(DL)#define pressanykey PressAnyKeyToContinue$(DL) >> $@
else
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
@@ -557,9 +556,6 @@ endif
@echo $(DL)#else$(DL) >> $@
@echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@
@echo $(DL)#endif$(DL) >> $@
-ifdef OLD_NOVELLSDK
- @echo $(DL)#define socklen_t int$(DL) >> $@
-endif
ifdef CABUNDLE
@echo $(DL)#define CURL_CA_BUNDLE "$(CABUNDLE)"$(DL) >> $@
else
diff --git a/lib/config-amigaos.h b/lib/config-amigaos.h
index 6a871d047..3da27426d 100644
--- a/lib/config-amigaos.h
+++ b/lib/config-amigaos.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -108,9 +108,6 @@
#define TIME_WITH_SYS_TIME 1
#define in_addr_t int
-#ifndef socklen_t
-# define socklen_t int
-#endif
#ifndef O_RDONLY
# define O_RDONLY 0x0000
@@ -119,7 +116,7 @@
#define HAVE_GETNAMEINFO 1
#define GETNAMEINFO_QUAL_ARG1 const
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
-#define GETNAMEINFO_TYPE_ARG2 socklen_t
+#define GETNAMEINFO_TYPE_ARG2 int
#define GETNAMEINFO_TYPE_ARG46 size_t
#define GETNAMEINFO_TYPE_ARG7 int
diff --git a/lib/config-os400.h b/lib/config-os400.h
index efb019551..371cbea28 100644
--- a/lib/config-os400.h
+++ b/lib/config-os400.h
@@ -48,9 +48,6 @@
/* Define this to 'int' if ssize_t is not an available typedefed type */
#undef ssize_t
-/* Type to use in place of socklen_t when system does not provide it. */
-#undef socklen_t
-
/* Define this as a suitable file to read random data from */
#undef RANDOM_FILE
diff --git a/lib/config-riscos.h b/lib/config-riscos.h
index e525c6a60..95e45d6fd 100644
--- a/lib/config-riscos.h
+++ b/lib/config-riscos.h
@@ -44,9 +44,6 @@
/* Define this to 'int' if ssize_t is not an available typedefed type */
#undef ssize_t
-/* Type to use in place of socklen_t when system does not provide it. */
-#undef socklen_t
-
/* Define this as a suitable file to read random data from */
#undef RANDOM_FILE
diff --git a/lib/config-symbian.h b/lib/config-symbian.h
index de5fd851d..1cdce2616 100644
--- a/lib/config-symbian.h
+++ b/lib/config-symbian.h
@@ -788,9 +788,6 @@
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
-/* Type to use in place of socklen_t when system does not provide it. */
-/* #undef socklen_t */
-
/* the signed version of size_t */
/* #undef ssize_t */
diff --git a/lib/config-tpf.h b/lib/config-tpf.h
index e67467ba6..3e482a6bd 100644
--- a/lib/config-tpf.h
+++ b/lib/config-tpf.h
@@ -668,9 +668,6 @@
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */
-/* Type to use in place of socklen_t when system does not provide it. */
-/* #undef socklen_t */
-
/* the signed version of size_t */
/* #undef ssize_t */
diff --git a/lib/config.dos b/lib/config.dos
index cceefb814..e515f3ea9 100644
--- a/lib/config.dos
+++ b/lib/config.dos
@@ -117,7 +117,6 @@
#define CURL_DISABLE_LDAP 1
#define in_addr_t u_long
-#define socklen_t int
#if defined(__HIGHC__) || \
(defined(__GNUC__) && __GNUC__ < 4) /* gcc 4.x built-in ? */
diff --git a/lib/config.h.cmake b/lib/config.h.cmake
index bb0d552b5..d7f00de1c 100644
--- a/lib/config.h.cmake
+++ b/lib/config.h.cmake
@@ -946,8 +946,5 @@
/* Define to `unsigned int' if <sys/types.h> does not define. */
#cmakedefine size_t ${size_t}
-/* Type to use in place of socklen_t when system does not provide it. */
-#cmakedefine socklen_t ${socklen_t}
-
/* the signed version of size_t */
#cmakedefine ssize_t ${ssize_t}
diff --git a/lib/connect.c b/lib/connect.c
index d4b621f33..d7b2f7fc0 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -281,7 +281,7 @@ static CURLcode bindlocal(struct connectdata *conn,
struct Curl_sockaddr_storage sa;
struct sockaddr *sock = (struct sockaddr *)&sa; /* bind to this address */
- socklen_t sizeof_sa = 0; /* size of the data sock points to */
+ curl_socklen_t sizeof_sa = 0; /* size of the data sock points to */
struct sockaddr_in *si4 = (struct sockaddr_in *)&sa;
#ifdef ENABLE_IPV6
struct sockaddr_in6 *si6 = (struct sockaddr_in6 *)&sa;
@@ -427,7 +427,7 @@ static CURLcode bindlocal(struct connectdata *conn,
if( bind(sockfd, sock, sizeof_sa) >= 0) {
/* we succeeded to bind */
struct Curl_sockaddr_storage add;
- socklen_t size = sizeof(add);
+ curl_socklen_t size = sizeof(add);
memset(&add, 0, sizeof(struct Curl_sockaddr_storage));
if(getsockname(sockfd, (struct sockaddr *) &add, &size) < 0) {
data->state.os_errno = error = SOCKERRNO;
@@ -470,7 +470,7 @@ static bool verifyconnect(curl_socket_t sockfd, int *error)
bool rc = TRUE;
#ifdef SO_ERROR
int err = 0;
- socklen_t errSize = sizeof(err);
+ curl_socklen_t errSize = sizeof(err);
#ifdef WIN32
/*
@@ -657,7 +657,7 @@ static void tcpnodelay(struct connectdata *conn,
{
#ifdef TCP_NODELAY
struct SessionHandle *data= conn->data;
- socklen_t onoff = (socklen_t) data->set.tcp_nodelay;
+ curl_socklen_t onoff = (curl_socklen_t) data->set.tcp_nodelay;
int proto = IPPROTO_TCP;
#if 0
diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c
index a9db3d75f..24ba4fa20 100644
--- a/lib/curl_addrinfo.c
+++ b/lib/curl_addrinfo.c
@@ -221,7 +221,7 @@ Curl_getaddrinfo_ex(const char *nodename,
* int ai_family;
* int ai_socktype;
* int ai_protocol;
- * socklen_t ai_addrlen; * Follow rfc3493 struct addrinfo *
+ * curl_socklen_t ai_addrlen; * Follow rfc3493 struct addrinfo *
* char *ai_canonname;
* struct sockaddr *ai_addr;
* struct Curl_addrinfo *ai_next;
diff --git a/lib/curl_addrinfo.h b/lib/curl_addrinfo.h
index 50480fa09..2fbb47a68 100644
--- a/lib/curl_addrinfo.h
+++ b/lib/curl_addrinfo.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -57,7 +57,7 @@ struct Curl_addrinfo {
int ai_family;
int ai_socktype;
int ai_protocol;
- socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
+ curl_socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
char *ai_canonname;
struct sockaddr *ai_addr;
struct Curl_addrinfo *ai_next;
diff --git a/lib/ftp.c b/lib/ftp.c
index ca14b977d..e8f51c685 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -332,7 +332,7 @@ static CURLcode AllowServerConnect(struct connectdata *conn)
#else
struct sockaddr_in add;
#endif
- socklen_t size = (socklen_t) sizeof(add);
+ curl_socklen_t size = (curl_socklen_t) sizeof(add);
if(0 == getsockname(sock, (struct sockaddr *) &add, &size)) {
size = sizeof(add);
@@ -888,7 +888,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
*/
struct Curl_sockaddr_storage ss;
Curl_addrinfo *res, *ai;
- socklen_t sslen;
+ curl_socklen_t sslen;
char hbuf[NI_MAXHOST];
struct sockaddr *sa=(struct sockaddr *)&ss;
struct sockaddr_in * const sa4 = (void *)sa;
@@ -925,7 +925,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
return CURLE_FTP_PORT_FAILED;
}
- if(sslen > (socklen_t)sizeof(ss))
+ if(sslen > (curl_socklen_t)sizeof(ss))
sslen = sizeof(ss);
rc = getnameinfo((struct sockaddr *)&ss, sslen, hbuf, sizeof(hbuf), NULL,
0, NIFLAGS);
@@ -992,7 +992,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
else
sa6->sin6_port = 0;
- if(sslen > (socklen_t)sizeof(ss))
+ if(sslen > (curl_socklen_t)sizeof(ss))
sslen = sizeof(ss);
if(bind(portsock, sa, sslen)) {
@@ -1112,7 +1112,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
Curl_addrinfo *addr = NULL;
unsigned short ip[4];
bool freeaddr = TRUE;
- socklen_t sslen = sizeof(sa);
+ curl_socklen_t sslen = sizeof(sa);
const char *ftpportstr = data->set.str[STRING_FTPPORT];
(void)fcmd; /* not used in the IPv4 code */
@@ -1161,7 +1161,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
Curl_strerror(conn, SOCKERRNO) );
return CURLE_FTP_PORT_FAILED;
}
- if(sslen > (socklen_t)sizeof(sa))
+ if(sslen > (curl_socklen_t)sizeof(sa))
sslen = sizeof(sa);
sa_filled_in = TRUE; /* the sa struct is filled in */
@@ -1189,7 +1189,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
if(bind(portsock, (struct sockaddr *)&sa, sslen) == 0) {
/* we succeeded to bind */
struct sockaddr_in add;
- socklen_t socksize = sizeof(add);
+ curl_socklen_t socksize = sizeof(add);
if(getsockname(portsock, (struct sockaddr *) &add,
&socksize)) {
diff --git a/lib/krb5.c b/lib/krb5.c
index d64161df0..e76391228 100644
--- a/lib/krb5.c
+++ b/lib/krb5.c
@@ -162,7 +162,7 @@ krb5_auth(void *app_data, struct connectdata *conn)
char *p;
const char *host = conn->dns_entry->addr->ai_canonname;
ssize_t nread;
- socklen_t l = sizeof(conn->local_addr);
+ curl_socklen_t l = sizeof(conn->local_addr);
struct SessionHandle *data = conn->data;
CURLcode result;
const char *service = "ftp", *srv_host = "host";
diff --git a/lib/memdebug.c b/lib/memdebug.c
index 3c74df025..3a0cf7153 100644
--- a/lib/memdebug.c
+++ b/lib/memdebug.c
@@ -255,7 +255,7 @@ int curl_accept(int s, void *saddr, void *saddrlen,
int line, const char *source)
{
struct sockaddr *addr = (struct sockaddr *)saddr;
- socklen_t *addrlen = (socklen_t *)saddrlen;
+ curl_socklen_t *addrlen = (curl_socklen_t *)saddrlen;
int sockfd=accept(s, addr, addrlen);
if(logfile)
fprintf(logfile, "FD %s:%d accept() = %d\n",
diff --git a/lib/setup-os400.h b/lib/setup-os400.h
index eb51bc24c..636ee7fa2 100644
--- a/lib/setup-os400.h
+++ b/lib/setup-os400.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -47,9 +47,10 @@ extern int Curl_getaddrinfo_a(const char * nodename, const char * servname,
#define getaddrinfo Curl_getaddrinfo_a
-extern int Curl_getnameinfo_a(const struct sockaddr * sa, socklen_t salen,
- char * nodename, socklen_t nodenamelen,
- char * servname, socklen_t servnamelen,
+extern int Curl_getnameinfo_a(const struct sockaddr * sa,
+ curl_socklen_t salen,
+ char * nodename, curl_socklen_t nodenamelen,
+ char * servname, curl_socklen_t servnamelen,
int flags);
#define getnameinfo Curl_getnameinfo_a
diff --git a/lib/setup_once.h b/lib/setup_once.h
index c1c899631..933d95abb 100644
--- a/lib/setup_once.h
+++ b/lib/setup_once.h
@@ -106,23 +106,6 @@ struct timeval {
#endif
-/*
- * Windows build targets have socklen_t definition in
- * ws2tcpip.h but some versions of ws2tcpip.h do not
- * have the definition. It seems that when the socklen_t
- * definition is missing from ws2tcpip.h the definition
- * for INET_ADDRSTRLEN is also missing, and that when one
- * definition is present the other one also is available.
- */
-
-#if defined(WIN32) && !defined(HAVE_CONFIG_H)
-# if ( defined(_MSC_VER) && !defined(INET_ADDRSTRLEN) ) || \
- (!defined(_MSC_VER) && !defined(HAVE_WS2TCPIP_H) )
-# define socklen_t int
-# endif
-#endif
-
-
#if defined(__minix)
/* Minix doesn't support recv on TCP sockets */
#define sread(x,y,z) (ssize_t)read((RECV_TYPE_ARG1)(x), \
@@ -451,88 +434,5 @@ typedef int sig_atomic_t;
#define ZERO_NULL 0
-#if defined (__LP64__) && defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED)
-#include <sys/socket.h>
-/* HP-UX has this oddity where it features a few functions that don't work
- with socklen_t so we need to convert to ints
-
- This is due to socklen_t being a 64bit int under 64bit ABI, but the
- pre-xopen (default) interfaces require an int, which is 32bits.
-
- Therefore, Anytime socklen_t is passed by pointer, the libc function
- truncates the 64bit socklen_t value by treating it as a 32bit value.
-
-
- Note that some socket calls are allowed to have a NULL pointer for
- the socklen arg.
-*/
-
-inline static int Curl_hp_getsockname(int s, struct sockaddr *name,
- socklen_t *namelen)
-{
- int rc;
- if(namelen) {
- int len = *namelen;
- rc = getsockname(s, name, &len);
- *namelen = len;
- }
- else
- rc = getsockname(s, name, 0);
- return rc;
-}
-
-inline static int Curl_hp_getsockopt(int s, int level, int optname,
- void *optval, socklen_t *optlen)
-{
- int rc;
- if(optlen) {
- int len = *optlen;
- rc = getsockopt(s, level, optname, optval, &len);
- *optlen = len;
- }
- else
- rc = getsockopt(s, level, optname, optval, 0);
- return rc;
-}
-
-inline static int Curl_hp_accept(int sockfd, struct sockaddr *addr,
- socklen_t *addrlen)
-{
- int rc;
- if(addrlen) {
- int len = *addrlen;
- rc = accept(sockfd, addr, &len);
- *addrlen = len;
- }
- else
- rc = accept(sockfd, addr, 0);
- return rc;
-}
-
-
-inline static ssize_t Curl_hp_recvfrom(int s, void *buf, size_t len, int flags,
- struct sockaddr *from,
- socklen_t *fromlen)
-{
- ssize_t rc;
- if(fromlen) {
- int fromlen32 = *fromlen;
- rc = recvfrom(s, buf, len, flags, from, &fromlen32);
- *fromlen = fromlen32;
- }
- else {
- rc = recvfrom(s, buf, len, flags, from, 0);
- }
- return rc;
-}
-
-#define getsockname(a,b,c) Curl_hp_getsockname((a),(b),(c))
-#define getsockopt(a,b,c,d,e) Curl_hp_getsockopt((a),(b),(c),(d),(e))
-#define accept(a,b,c) Curl_hp_accept((a),(b),(c))
-#define recvfrom(a,b,c,d,e,f) Curl_hp_recvfrom((a),(b),(c),(d),(e),(f))
-
-#endif /* HPUX work-around */
-
-
#endif /* __SETUP_ONCE_H */
diff --git a/lib/tftp.c b/lib/tftp.c
index 6440f8025..b095cc532 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -147,7 +147,7 @@ typedef struct tftp_state_data {
unsigned short block;
struct Curl_sockaddr_storage local_addr;
struct Curl_sockaddr_storage remote_addr;
- socklen_t remote_addrlen;
+ curl_socklen_t remote_addrlen;
ssize_t rbytes;
size_t sbytes;
size_t blksize;
@@ -947,7 +947,7 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done)
CURLcode code;
int rc;
struct Curl_sockaddr_storage fromaddr;
- socklen_t fromlen;
+ curl_socklen_t fromlen;
int check_time = 0;
struct SingleRequest *k = &data->req;
diff --git a/packages/OS400/os400sys.c b/packages/OS400/os400sys.c
index 73e13fda0..05db5c27f 100644
--- a/packages/OS400/os400sys.c
+++ b/packages/OS400/os400sys.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -237,9 +237,9 @@ buffer_undef(localkey_t key, long size)
int
-Curl_getnameinfo_a(const struct sockaddr * sa, socklen_t salen,
- char * nodename, socklen_t nodenamelen,
- char * servname, socklen_t servnamelen,
+Curl_getnameinfo_a(const struct sockaddr * sa, curl_socklen_t salen,
+ char * nodename, curl_socklen_t nodenamelen,
+ char * servname, curl_socklen_t servnamelen,
int flags)
{
diff --git a/packages/vms/config-vms.h b/packages/vms/config-vms.h
index 646ee9921..88be0466f 100644
--- a/packages/vms/config-vms.h
+++ b/packages/vms/config-vms.h
@@ -25,9 +25,6 @@
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
-/* Type to use in place of socklen_t when system does not provide it. */
-#define socklen_t size_t
-
/* The number of bytes in a long double. */
#define SIZEOF_LONG_DOUBLE 8
@@ -287,7 +284,7 @@
#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
/* Define to the type of arg 2 for getnameinfo. */
-#define GETNAMEINFO_TYPE_ARG2 socklen_t
+#define GETNAMEINFO_TYPE_ARG2 unsigned int
/* Define to the type of args 4 and 6 for getnameinfo. */
#define GETNAMEINFO_TYPE_ARG46 size_t
diff --git a/src/Makefile.netware b/src/Makefile.netware
index 7ebdf17ba..b044105f8 100644
--- a/src/Makefile.netware
+++ b/src/Makefile.netware
@@ -395,7 +395,6 @@ ifeq ($(LIBARCH),CLIB)
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
- @echo $(DL)#define socklen_t int$(DL) >> $@
@echo $(DL)#define pressanykey PressAnyKeyToContinue$(DL) >> $@
else
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
@@ -545,9 +544,6 @@ endif
@echo $(DL)#else$(DL) >> $@
@echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@
@echo $(DL)#endif$(DL) >> $@
-ifdef OLD_NOVELLSDK
- @echo $(DL)#define socklen_t int$(DL) >> $@
-endif
ifdef CABUNDLE
@echo $(DL)#define CURL_CA_BUNDLE "$(CABUNDLE)"$(DL) >> $@
else
diff --git a/src/config-riscos.h b/src/config-riscos.h
index 72ef674dc..ab898230b 100644
--- a/src/config-riscos.h
+++ b/src/config-riscos.h
@@ -47,9 +47,6 @@
/* Define this to 'int' if ssize_t is not an available typedefed type */
#undef ssize_t
-/* Type to use in place of socklen_t when system does not provide it. */
-#undef socklen_t
-
/* Define this as a suitable file to read random data from */
#undef RANDOM_FILE
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 1e4522dc8..8ac653c58 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -751,7 +751,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock,
got */
/* we succeeded to bind */
struct sockaddr_in add;
- socklen_t socksize = sizeof(add);
+ curl_socklen_t socksize = sizeof(add);
if(getsockname(sock, (struct sockaddr *) &add,
&socksize)<0) {
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
index 6dcd89409..afd7f4fdd 100644
--- a/tests/server/tftpd.c
+++ b/tests/server/tftpd.c
@@ -152,7 +152,7 @@ static int maxtimeout = 5*TIMEOUT;
static char buf[PKTSIZE];
static char ackbuf[PKTSIZE];
static struct sockaddr_in from;
-static socklen_t fromlen;
+static curl_socklen_t fromlen;
struct bf {
int counter; /* size of data in buffer, or flag */
@@ -376,7 +376,7 @@ static int synchnet(curl_socket_t f /* socket to flush */)
int j = 0;
char rbuf[PKTSIZE];
struct sockaddr_in fromaddr;
- socklen_t fromaddrlen;
+ curl_socklen_t fromaddrlen;
while (1) {
#if defined(HAVE_IOCTLSOCKET)