You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by na...@apache.org on 2002/04/13 00:53:56 UTC
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_channel_apr_socket.c jk_shm.c
nacho 02/04/12 15:53:56
Modified: jk/native2 build.xml
jk/native2/common jk_channel_apr_socket.c jk_shm.c
Log:
Fixes for Win32 compatibility
Revision Changes Path
1.21 +26 -4 jakarta-tomcat-connectors/jk/native2/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/build.xml,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- build.xml 11 Apr 2002 05:20:48 -0000 1.20
+++ build.xml 12 Apr 2002 22:53:56 -0000 1.21
@@ -76,6 +76,7 @@
<target name="apache20" depends="init" if="apache2.detect">
<property name="apr.include" location="${apache2.home}/include" />
+ <echo message="${apr.include}"/>
<mkdir dir="${build.dir}/apache2" />
<so sofile="mod_jk2"
buildDir="${build.dir}/apache2"
@@ -88,30 +89,52 @@
info="Read/Write buffer size" />
<def name="USE_APACHE_MD5"
info="Use the MD5 implementation that is part of apache2" />
- <def name="HAS_APR"
+ <def name="HAS_APR"
info="Allow APR specific extensions" />
<def name="HAVE_JNI"
info="Jni worker" />
<def name="HPUX11" if="hpux" />
- <src dir=".">
+ <def name="WIN32" if="win32" />
+ <def name="NDEBUG" if="win32" />
+ <def name="_WINDOWS" if="win32" />
+ <def name="_MBCS" if="win32" />
+ <def name="_USRDLL" if="win32" />
+ <def name="MOD_JK2_EXPORTS" if="win32" />
+ <src dir=".">
<include name="server/apache2/*.c" />
<include name="common/*.c" />
<include name="common/apr/*.c" />
- <include name="jni/*.c" />
+ <include name="jni/*.c" unless="win32"/>
+ <!-- <exclude name="common/jk_channel_apr_socket.c" if="win32"/> -->
</src>
<includes>
<include name="${native.dir}/common" />
<include name="${apache2.include}" />
<include name="${apr.include}" />
+ <include name="${apr-util.include}" />
<include name="${native.dir}/include" />
<include name="${java.home}/../include" />
<include name="${java.home}/../include/linux" if="linux" />
<include name="${java.home}/../include/hp-ux" if="hpux" />
+ <include name="${java.home}/../include/win32" if="win32" />
</includes>
<depends>
<fileset dir="${native.dir}/common" includes="*.h" />
<fileset dir="${native.dir}/include" includes="*.h" />
</depends>
+ <import fileName="libhttpd.lib" if="win32" />
+ <import fileName="libapr.lib" if="win32" />
+ <import fileName="libaprutil.lib" if="win32" />
+ <import fileName="wsock32.lib" if="win32" />
+ <import fileName="kernel32.lib" if="win32" />
+ <import fileName="user32.lib" if="win32" />
+ <import fileName="gdi32.lib" if="win32" />
+ <import fileName="winspool.lib" if="win32" />
+ <import fileName="comdlg32.lib" if="win32" />
+ <linkOpt value="/libpath:"${build.compiler.base}/lib"" if="win32" />
+ <linkOpt value="/libpath:"${apr.lib}"" if="win32" />
+ <linkOpt value="/libpath:"${apr-util.lib}"" if="win32" />
+ <linkOpt value="/libpath:"${apache2.lib}"" if="win32" />
</so>
</target>
@@ -180,7 +203,6 @@
<include name="${java.home}/../include/netware" if="netware" />
<include name="${java.home}/../include/win32" if="win32" />
- <include name="${java.home}/../include/linux" if="linux" />
<include name="${java.home}/../include/linux" if="linux" />
</includes>
<depends>
1.7 +18 -6 jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c
Index: jk_channel_apr_socket.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- jk_channel_apr_socket.c 11 Apr 2002 19:29:40 -0000 1.6
+++ jk_channel_apr_socket.c 12 Apr 2002 22:53:56 -0000 1.7
@@ -95,7 +95,9 @@
struct jk_channel_apr_private {
int ndelay;
apr_sockaddr_t *addr;
+#ifdef HAVE_UNIXSOCKETS
struct sockaddr_un unix_addr;
+#endif
int type; /* AF_INET or AF_UNIX */
char *host;
short port;
@@ -106,7 +108,9 @@
typedef struct jk_channel_apr_data {
int type; /* AF_INET or AF_UNIX */
apr_socket_t *sock;
+#ifdef HAVE_UNIXSOCKETS
int unixsock;
+#endif
} jk_channel_apr_data_t;
typedef struct jk_channel_apr_private jk_channel_apr_private_t;
@@ -205,6 +209,7 @@
/* env->l->jkLog(env, env->l, JK_LOG_ERROR, */
/* "jk2_channel_apr_resolve: %s %d\n", */
/* host, port); */
+#ifdef HAVE_UNIXSOCKETS
if (host[0]=='/') {
rc->type = TYPE_UNIX;
memset(&rc->unix_addr, 0, sizeof(struct sockaddr_un));
@@ -212,7 +217,9 @@
strcpy(rc->unix_addr.sun_path, host);
env->l->jkLog(env, env->l, JK_LOG_INFO,
"channelApr.resolve(): create AF_UNIX %s\n", host );
- } else {
+ } else
+#endif
+ {
rc->type = TYPE_NET;
env->l->jkLog(env, env->l, JK_LOG_INFO,
"channelApr.resolve(): create AF_NET %s %d\n", host, port );
@@ -244,6 +251,8 @@
apr_interval_time_t timeout = 2 * APR_USEC_PER_SEC;
char msg[128];
+#ifdef HAVE_UNIXSOCKETS
+
int unixsock;
/* UNIX socket (to be moved in APR) */
@@ -279,6 +288,7 @@
sd->type = socketInfo->type;
return JK_TRUE;
}
+#endif
if (apr_socket_create(&sock, remote_sa->family, SOCK_STREAM,
@@ -353,11 +363,12 @@
if( chD==NULL )
return JK_FALSE;
+#ifdef HAVE_UNIXSOCKETS
if (chD->type==TYPE_UNIX) {
close( chD->unixsock );
return 0;
}
-
+#endif
sd=chD->sock;
chD->sock=NULL; /* XXX check it. */
/* nothing else to clean, the socket_data was allocated ouf of
@@ -406,8 +417,9 @@
b=msg->buf;
sock=chD->sock;
+#ifdef HAVE_UNIXSOCKETS
unixsock=chD->unixsock;
-
+#endif
env->l->jkLog(env, env->l, JK_LOG_ERROR,
"jk2_channel_apr_send %d\n",chD->type);
@@ -463,10 +475,10 @@
if( chD==NULL )
return JK_FALSE;
- sd=chD->unixsock;
sock=chD->sock;
rdlen = 0;
-
+#ifdef HAVE_UNIXSOCKETS
+ sd=chD->unixsock;
/* this should be moved in APR */
if (chD->type==TYPE_UNIX) {
while(rdlen < len) {
@@ -487,7 +499,7 @@
}
return rdlen;
}
-
+#endif
length = (apr_size_t) len;
stat = apr_recv(sock, b, &length);
1.3 +1 -1 jakarta-tomcat-connectors/jk/native2/common/jk_shm.c
Index: jk_shm.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_shm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- jk_shm.c 10 Apr 2002 23:44:56 -0000 1.2
+++ jk_shm.c 12 Apr 2002 22:53:56 -0000 1.3
@@ -209,7 +209,7 @@
}
-int jk2_shm_factory( jk_env_t *env, jk_pool_t *pool,
+int JK_METHOD jk2_shm_factory( jk_env_t *env, jk_pool_t *pool,
jk_bean_t *result,
const char *type, const char *name)
{
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>