You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fu...@apache.org on 2005/05/13 10:23:11 UTC
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_connect.c
fuankg 2005/05/13 01:23:11
Modified: jk/native/common jk_connect.c
Log:
fix for NetWare compiler to deal with different types between AP13 and AP2 SDKs.
Revision Changes Path
1.59 +17 -6 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.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- jk_connect.c 27 Apr 2005 18:38:52 -0000 1.58
+++ jk_connect.c 13 May 2005 08:23:11 -0000 1.59
@@ -45,6 +45,13 @@
#define JK_GET_SOCKET_ERRNO() ((void)0)
#endif /* WIN32 */
+/* our compiler cant deal with char* <-> const char* ... */
+#if defined(NETWARE) && !defined(__NOVELL_LIBC__)
+typedef char* SET_TYPE;
+#else
+typedef const char* SET_TYPE;
+#endif
+
static int soblock(int sd)
{
/* BeOS uses setsockopt at present for non blocking... */
@@ -263,7 +270,11 @@
/* XXX : WARNING : We should really use gethostbyname_r in multi-threaded env */
/* Fortunatly when APR is available, ie under Apache 2.0, we use it */
+#if defined(NETWARE) && !defined(__NOVELL_LIBC__)
+ struct hostent *hoste = gethostbyname((char*)host);
+#else
struct hostent *hoste = gethostbyname(host);
+#endif
if (!hoste) {
return JK_FALSE;
}
@@ -305,7 +316,7 @@
return -1;
}
/* Disable Nagle algorithm */
- if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&set,
+ if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (SET_TYPE)&set,
sizeof(set))) {
jk_log(l, JK_LOG_ERROR,
"failed setting TCP_NODELAY with errno=%d", errno);
@@ -318,7 +329,7 @@
"socket TCP_NODELAY set to On");
if (keepalive) {
set = 1;
- if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (const char *)&set,
+ if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (SET_TYPE)&set,
sizeof(set))) {
jk_log(l, JK_LOG_ERROR,
"failed setting SO_KEEPALIVE with errno=%d", errno);
@@ -334,7 +345,7 @@
if (sock_buf > 0) {
set = sock_buf;
/* Set socket send buffer size */
- if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (const char *)&set,
+ if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (SET_TYPE)&set,
sizeof(set))) {
JK_GET_SOCKET_ERRNO();
jk_log(l, JK_LOG_ERROR,
@@ -345,7 +356,7 @@
}
set = sock_buf;
/* Set socket receive buffer size */
- if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (const char *)&set,
+ if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (SET_TYPE)&set,
sizeof(set))) {
JK_GET_SOCKET_ERRNO();
jk_log(l, JK_LOG_ERROR,
@@ -400,7 +411,7 @@
#ifdef SO_LINGER
/* Make hard closesocket by disabling lingering */
li.l_linger = li.l_onoff = 0;
- if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (const char *)&li,
+ if (setsockopt(sock, SOL_SOCKET, SO_LINGER, (SET_TYPE)&li,
sizeof(li))) {
JK_GET_SOCKET_ERRNO();
jk_log(l, JK_LOG_ERROR,
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org