mmanders 2002/12/06 10:52:50 Modified: jk/native/common jk_connect.c Log: Modified code to go through a WinSock code path on NetWare if building for Apache 2. Revision Changes Path 1.7 +31 -5 jakarta-tomcat-connectors/jk/native/common/jk_connect.c Index: jk_connect.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_connect.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_connect.c 30 Oct 2002 22:12:20 -0000 1.6 +++ jk_connect.c 6 Dec 2002 18:52:50 -0000 1.7 @@ -66,9 +66,35 @@ */ +#if defined(NETWARE) && defined(__NOVELL_LIBC__) +/* Since we want to use WinSock functionality here, don't allow the + * non-winsock headers + */ +#define __sys_types_h__ +#define __sys_socket_h__ +#define __netdb_h__ +#define __netinet_in_h__ +#define __arpa_inet_h__ +#define __sys_timeval_h__ +#endif + #include "jk_connect.h" #include "jk_util.h" +#if defined(NETWARE) && defined(__NOVELL_LIBC__) +/* Now remove the defines so that including the WinSock headers won't cause + * complaining + */ +#undef __sys_types_h__ +#undef __sys_socket_h__ +#undef __netdb_h__ +#undef __netinet_in_h__ +#undef __arpa_inet_h__ +#undef __sys_timeval_h__ + +#include <novsock2.h> +#endif + /** resolve the host IP */ int jk_resolve(char *host, @@ -140,7 +166,7 @@ ret = connect(sock, (struct sockaddr *)addr, sizeof(struct sockaddr_in)); -#ifdef WIN32 +#if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__)) if(SOCKET_ERROR == ret) { errno = WSAGetLastError() - WSABASEERR; } @@ -177,7 +203,7 @@ jk_log(l, JK_LOG_INFO, "jk_open_socket, connect() failed errno = %d\n", errno); jk_close_socket(sock); } else { -#ifdef WIN32 +#if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__)) errno = WSAGetLastError() - WSABASEERR; #endif /* WIN32 */ jk_log(l, JK_LOG_ERROR, "jk_open_socket, socket() failed errno = %d\n", errno); @@ -190,7 +216,7 @@ int jk_close_socket(int s) { -#ifdef WIN32 +#if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__)) if(INVALID_SOCKET != s) { return closesocket(s) ? -1 : 0; } @@ -256,7 +282,7 @@ len - rdlen, 0); if(-1 == this_time) { -#ifdef WIN32 +#if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__)) if(SOCKET_ERROR == this_time) { errno = WSAGetLastError() - WSABASEERR; }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>