From 24bf52bc691cca9f8b3a668e26b4dd695ec4991c Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Tue, 20 May 2008 10:21:50 +0000 Subject: Adapting last changes to OS400: _ Updated packages/OS400/curl.inc.in with new definitions. _ New connect/bind/sendto/recvfrom wrappers to support AF_UNIX sockets. _ Include files line length shortened below 100 chars. _ Const parameter in lib/qssl.[ch]. _ Typos in packages/OS400/initscript.sh. --- lib/config-os400.h | 6 ++++++ lib/qssl.c | 6 +++--- lib/qssl.h | 2 +- lib/setup-os400.h | 16 ++++++++++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/config-os400.h b/lib/config-os400.h index 5e30e435d..edc398768 100644 --- a/lib/config-os400.h +++ b/lib/config-os400.h @@ -322,6 +322,9 @@ /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H +/* Define if you have the header file. */ +#define HAVE_SYS_UN_H + /* Define if you have the header file. */ #define HAVE_SYS_IOCTL_H @@ -379,6 +382,9 @@ #define SIZEOF_CURL_OFF_T 8 +/* Define this if you have struct sockaddr_storage */ +#define HAVE_STRUCT_SOCKADDR_STORAGE + /* Define if you have the ANSI C header files. */ #define STDC_HEADERS diff --git a/lib/qssl.c b/lib/qssl.c index 15684096d..2dd46c35c 100644 --- a/lib/qssl.c +++ b/lib/qssl.c @@ -372,15 +372,15 @@ int Curl_qsossl_shutdown(struct connectdata * conn, int sockindex) } -ssize_t Curl_qsossl_send(struct connectdata * conn, int sockindex, void * mem, - size_t len) +ssize_t Curl_qsossl_send(struct connectdata * conn, int sockindex, + const void * mem, size_t len) { /* SSL_Write() is said to return 'int' while write() and send() returns 'size_t' */ int rc; - rc = SSL_Write(conn->ssl[sockindex].handle, mem, (int) len); + rc = SSL_Write(conn->ssl[sockindex].handle, (void *) mem, (int) len); if(rc < 0) { switch(rc) { diff --git a/lib/qssl.h b/lib/qssl.h index 55d72d4dc..ff3f6f56a 100644 --- a/lib/qssl.h +++ b/lib/qssl.h @@ -38,7 +38,7 @@ int Curl_qsossl_shutdown(struct connectdata * conn, int sockindex); ssize_t Curl_qsossl_send(struct connectdata * conn, int sockindex, - void * mem, + const void * mem, size_t len); ssize_t Curl_qsossl_recv(struct connectdata * conn, /* connection data */ int num, /* socketindex */ diff --git a/lib/setup-os400.h b/lib/setup-os400.h index 8466d9c43..d6e704ace 100644 --- a/lib/setup-os400.h +++ b/lib/setup-os400.h @@ -137,4 +137,20 @@ extern OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 * minor_status, #define ldap_first_attribute Curl_ldap_first_attribute_a #define ldap_next_attribute Curl_ldap_next_attribute_a +/* Some socket functions must be wrapped to process textual addresses + like AF_UNIX. */ + +extern int Curl_os400_connect(int sd, struct sockaddr * destaddr, int addrlen); +extern int Curl_os400_bind(int sd, struct sockaddr * localaddr, int addrlen); +extern int Curl_os400_sendto(int sd, char * buffer, int buflen, int flags, + struct sockaddr * dstaddr, int addrlen); +extern int Curl_os400_recvfrom(int sd, char * buffer, int buflen, int flags, + struct sockaddr * fromaddr, int * addrlen); + +#define connect Curl_os400_connect +#define bind Curl_os400_bind +#define sendto Curl_os400_sendto +#define recvfrom Curl_os400_recvfrom + + #endif /* __SETUP_OS400_H */ -- cgit v1.2.3