You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@locus.apache.org on 2000/12/20 20:32:44 UTC
cvs commit: jakarta-tomcat/src/native/mod_jk/apache2.0 Makefile.linux mod_jk.c
costin 00/12/20 11:32:43
Modified: src/native/mod_jk/apache2.0 Makefile.linux mod_jk.c
Log:
More changes for Apache2.0.
Now it works for pages<4k, there is still a problem with ap_rwrite()
when we send larger pages ( probably we need to call a different apache
function )
Note that APXS changed and now uses libtool in a strange mode ( i.e. apxs *.c
will create a module for each c file instead of the previous behavior when
it creates a module containing all c files ).
That means you have to use Makefile.linux to build - I hope Dan or Henri will
take a look and write a "real" makefile.
Revision Changes Path
1.4 +6 -8 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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Makefile.linux 2000/12/19 21:19:20 1.3
+++ Makefile.linux 2000/12/20 19:32:42 1.4
@@ -1,34 +1,32 @@
## You need to edit this file - configure later :-)
-APACHE_HOME=/usr/local/apache-2.0a9
+APACHE_HOME=/usr/local/apache2.0
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/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
+JAVA_LIB=-L${JAVA_HOME}/jre/lib/${ARCH} -L${JAVA_HOME}/lib/${ARCH}/native_threads
CFLAGS=-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT -pthread -DLINUX -Wall -DAPACHE2_SIGHACK
SRCS=jk_ajp12_worker.c jk_connect.c jk_msg_buff.c jk_util.c jk_ajp13.c \
jk_jni_worker.c jk_pool.c jk_worker.c jk_ajp13_worker.c jk_lb_worker.c \
- jk_sockbuf.c jk_map.c jk_uri_worker_map.c
+ jk_sockbuf.c jk_map.c jk_uri_worker_map.c
OBJS=${patsubst %.c,%.o,${SRCS}}
%.o: ../common/%.c
- ${CC} -c ${CFLAGS} ${JAVA_INCL} ${AP20SRC_INCL} $< -o $@
+ ${CC} -c ${CFLAGS} ${JAVA_INCL} ${AP20_INCL} $< -o $@
.c.o:
- ${CC} -c ${CFLAGS} ${JAVA_INCL} ${AP20SRC_INCL} -I../common $<
+ ${CC} -c ${CFLAGS} ${JAVA_INCL} ${AP20_INCL} -I../common $<
all: mod_jk.so
1.5 +23 -13 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- mod_jk.c 2000/12/19 23:18:30 1.4
+++ mod_jk.c 2000/12/20 19:32:42 1.5
@@ -222,6 +222,7 @@
// BUFF *bf = p->r->connection->client;
size_t w = (size_t)l;
size_t r = 0;
+ long ll=l;
if(!p->response_started) {
if(!s->start_response(s, 200, NULL, NULL, NULL, 0)) {
@@ -229,20 +230,29 @@
}
}
-
- //ap_bwrite(bf, (const char *)b, w, &r);
- r = ap_rwrite((const char *)b, w, p->r );
- if(w != r) {
- return JK_FALSE;
- }
+ // Debug - try to get around rwrite
+ while( ll > 0 ) {
+ long toSend=(ll>2048) ? 2048 : ll;
+ r = ap_rwrite((const char *)b, toSend, p->r );
+ ll-=2048;
+
+ // DEBUG
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0,
+ NULL, "mod_jk: writing %ld (%ld) out of %ld bytes \n",
+ toSend, r, ll );
+ if(toSend != r) {
+ return JK_FALSE;
+ }
- /*
- * To allow server push.
- */
- // if(ap_bflush(bf) != APR_SUCCESS) {
- if(ap_rflush(p->r) != APR_SUCCESS) {
- return JK_FALSE;
- }
+ /*
+ * To allow server push.
+ */
+ if(ap_rflush(p->r) != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0,
+ NULL, "mod_jk: Error flushing \n" );
+ return JK_FALSE;
+ }
+ }
}
return JK_TRUE;