costin 00/12/19 13:19:22 Modified: src/native/mod_jk/apache2.0 Makefile.linux build-unix.sh mod_jk.c Log: First round of changes to support the latest Apache2.0 It should compile ( with warnings - there are still functions that haven't been changed ). Revision Changes Path 1.3 +6 -4 jakarta-tomcat/src/native/mod_jk/apache2.0/Makefile.linux Index: Makefile.linux =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/apache2.0/Makefile.linux,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Makefile.linux 2000/09/26 03:49:53 1.2 +++ Makefile.linux 2000/12/19 21:19:20 1.3 @@ -1,18 +1,20 @@ ## You need to edit this file - configure later :-) -APACHE_HOME=/usr/local/apache2.0 -AP20_SRC=/home/costin/src/jakarta/apache-2.0/src +APACHE_HOME=/usr/local/apache-2.0a9 OS=linux +# AP20_SRC=/home/costin/src/jakarta/apache-2.0/src + ## I assume this one is set up already # JAVA_HOME= ## -AP20_INCL=-I${APACHE_HOME}/include/apr -I${APACHE_HOME}/include +AP20_INCL=-I${APACHE_HOME}/include/apr -I${APACHE_HOME}/include/apr-util -I${APACHE_HOME}/include JAVA_INCL=-I${JAVA_HOME}/include -I${JAVA_HOME}/include/${OS} JAVA_LIB=-L${JAVA_HOME}/jre/lib/${ARCH} -L${JAVA_HOME}/lib/${ARCH}/native_threads -AP20SRC_INCL=-I. -I${AP20_SRC}/modules/standard -I${AP20_SRC} -I${AP20_SRC}/include -I${AP20_SRC}/lib/apr/include -I${AP20_SRC}/os/unix + +# AP20SRC_INCL=-I. -I${AP20_SRC}/modules/standard -I${AP20_SRC} -I${AP20_SRC}/include -I${AP20_SRC}/lib/apr/include -I${AP20_SRC}/os/unix CFLAGS=-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT -pthread -DLINUX -Wall -DAPACHE2_SIGHACK 1.2 +5 -3 jakarta-tomcat/src/native/mod_jk/apache2.0/build-unix.sh Index: build-unix.sh =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/apache2.0/build-unix.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- build-unix.sh 2000/08/26 01:21:40 1.1 +++ build-unix.sh 2000/12/19 21:19:20 1.2 @@ -1,6 +1,6 @@ #!/bin/sh -# $Id: build-unix.sh,v 1.1 2000/08/26 01:21:40 alex Exp $ +# $Id: build-unix.sh,v 1.2 2000/12/19 21:19:20 costin Exp $ # build.sh for mod_jk.so # Usage: build-unix.sh @@ -43,14 +43,16 @@ # platform for "linux" # JAVA_INCLUDE="-I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux" -INCLUDE="-I ../common $JAVA_INCLUDE" -SRC="mod_jk.c ../common/*.c" +INCLUDE="-I ../common -I$APACHE_HOME/include/apr-util $JAVA_INCLUDE" +# SRC="mod_jk.c ../common/*.c" +SRC="*.c" #echo INCLUDE=$INCLUDE #echo SRC=$SRC # Run APXS to compile module echo Compiling mod_jk +cp ../common/*.c . $APXS -c -o mod_jk.so $INCLUDE $LIB $SRC # Copy mod_jk.so into the apache libexec directory 1.3 +16 -14 jakarta-tomcat/src/native/mod_jk/apache2.0/mod_jk.c Index: mod_jk.c =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/apache2.0/mod_jk.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mod_jk.c 2000/09/26 03:49:54 1.2 +++ mod_jk.c 2000/12/19 21:19:21 1.3 @@ -219,7 +219,7 @@ apache_private_data_t *p = s->ws_private; if(l) { - BUFF *bf = p->r->connection->client; + // BUFF *bf = p->r->connection->client; size_t w = (size_t)l; size_t r = 0; @@ -230,7 +230,8 @@ } - ap_bwrite(bf, (const char *)b, w, &r); + //ap_bwrite(bf, (const char *)b, w, &r); + r = ap_bwrite((const char *)b, w, p->r ); if(w != r) { return JK_FALSE; } @@ -238,7 +239,8 @@ /* * To allow server push. */ - if(ap_bflush(bf) != APR_SUCCESS) { + // if(ap_bflush(bf) != APR_SUCCESS) { + if(ap_rflush(p->r) != APR_SUCCESS) { return JK_FALSE; } } @@ -330,10 +332,10 @@ s->headers_values = NULL; s->num_headers = 0; if(r->headers_in && ap_table_elts(r->headers_in)) { - ap_array_header_t *t = ap_table_elts(r->headers_in); + apr_array_header_t *t = ap_table_elts(r->headers_in); if(t && t->nelts) { int i; - ap_table_entry_t *elts = (ap_table_entry_t *)t->elts; + apr_table_entry_t *elts = (apr_table_entry_t *)t->elts; s->num_headers = t->nelts; s->headers_names = ap_palloc(r->pool, sizeof(char *) * t->nelts); s->headers_values = ap_palloc(r->pool, sizeof(char *) * t->nelts); @@ -446,7 +448,7 @@ /* The JK module handlers */ /* ========================================================================= */ -ap_status_t jk_cleanup_endpoint( void *data ) { +apr_status_t jk_cleanup_endpoint( void *data ) { jk_endpoint_t *end = (jk_endpoint_t *)data; /* printf("XXX jk_cleanup1 %ld\n", data); */ end->done(&end, NULL); @@ -494,8 +496,8 @@ */ #ifdef REUSE_WORKER - ap_pool_t *rpool=r->pool; - ap_pool_t *tpool=rpool->parent->parent; + apr_pool_t *rpool=r->pool; + apr_pool_t *tpool=rpool->parent->parent; ap_get_userdata( &end, "jk_thread_endpoint", tpool ); if(end==NULL ) { @@ -526,7 +528,7 @@ return HTTP_INTERNAL_SERVER_ERROR; } -static void *create_jk_config(ap_pool_t *p, server_rec *s) +static void *create_jk_config(apr_pool_t *p, server_rec *s) { jk_server_conf_t *c = (jk_server_conf_t *) ap_pcalloc(p, sizeof(jk_server_conf_t)); @@ -548,7 +550,7 @@ } -static void *merge_jk_config(ap_pool_t *p, +static void *merge_jk_config(apr_pool_t *p, void *basev, void *overridesv) { @@ -585,7 +587,7 @@ return overrides; } -static void jk_child_init(ap_pool_t *pconf, +static void jk_child_init(apr_pool_t *pconf, server_rec *s) { char *p = getenv("WAS_BORN_BY_APACHE"); @@ -619,9 +621,9 @@ jk_error_exit(APLOG_MARK, APLOG_EMERG, s, "Error while opening the workers"); } -static void jk_post_config(ap_pool_t *pconf, - ap_pool_t *plog, - ap_pool_t *ptemp, +static void jk_post_config(apr_pool_t *pconf, + apr_pool_t *plog, + apr_pool_t *ptemp, server_rec *s) { if(!s->is_virtual) {