cvs commit: jakarta-tomcat/src/native/mod_jk/common jk_msg_buff.c jk_msg_buff.h
hgomez 01/04/19 14:25:28 Modified:src/native/mod_jk/common jk_msg_buff.c jk_msg_buff.h Log: Added jk_dump_msg helper function to help dump what's in a jk_buff Revision ChangesPath 1.3 +24 -1 jakarta-tomcat/src/native/mod_jk/common/jk_msg_buff.c Index: jk_msg_buff.c === RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/common/jk_msg_buff.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- jk_msg_buff.c 2000/11/10 18:48:50 1.2 +++ jk_msg_buff.c 2001/04/19 21:25:27 1.3 @@ -57,7 +57,8 @@ * Description: Data marshaling. XDR like * * Author: Costin <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.2 $ * + * Author: Henri Gomez <[EMAIL PROTECTED]> * + * Version: $Revision: 1.3 $ * ***/ #include "jk_pool.h" @@ -65,6 +66,7 @@ #include "jk_util.h" #include "jk_sockbuf.h" #include "jk_msg_buff.h" +#include "jk_logger.h" struct jk_msg_buf { jk_pool_t *pool; @@ -330,3 +332,24 @@ *dst++ = *(src + 1 ); *dst= *src; } + +/** Helpie dump function + */ +void jk_dump_buff(jk_logger_t *l, + const char *file, + int line, + int level, + char * what, + jk_msg_buf_t * msg) +{ +#ifdef USE_ALSO_BODY +jk_log(l, file, line, level, "%s #%d %.*s\n", + what, + jk_b_get_len(msg), + jk_b_get_len(msg), + jk_b_get_buff(msg)); +#else +jk_log(l, file, line, level, "%s #%d\n", what, jk_b_get_len(msg)); +#endif +} + 1.3 +9 -1 jakarta-tomcat/src/native/mod_jk/common/jk_msg_buff.h Index: jk_msg_buff.h === RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/common/jk_msg_buff.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- jk_msg_buff.h 2000/11/10 18:48:50 1.2 +++ jk_msg_buff.h 2001/04/19 21:25:27 1.3 @@ -57,7 +57,7 @@ * Description: Data marshaling. XDR like * * Author: Costin <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.2 $ * + * Version: $Revision: 1.3 $ * ***/ #ifndef JK_MSG_BUF_H @@ -183,6 +183,14 @@ unsigned char jk_b_pget_byte(jk_msg_buf_t *msg, int pos); + +/* - Help */ +void jk_dump_buff(jk_logger_t *l, + const char *file, + int line, + int level, + char * what, + jk_msg_buf_t * msg); #ifdef __cplusplus }
cvs commit: jakarta-tomcat/src/native/mod_jk/common jk_ajp13_worker.c
hgomez 01/04/19 14:26:44 Modified:src/native/mod_jk/common jk_ajp13_worker.c Log: The previous patch to solve the Tomcat restart problem corrected only GET method. This one add POST method support. Revision ChangesPath 1.7 +82 -40jakarta-tomcat/src/native/mod_jk/common/jk_ajp13_worker.c Index: jk_ajp13_worker.c === RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/common/jk_ajp13_worker.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_ajp13_worker.c 2001/03/27 22:42:04 1.6 +++ jk_ajp13_worker.c 2001/04/19 21:26:43 1.7 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. + * Copyright (c) 1997-2001 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -58,7 +58,7 @@ * Author: Henri Gomez <[EMAIL PROTECTED]> * * Author: Costin <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.6 $ * + * Version: $Revision: 1.7 $ * ***/ #include "jk_pool.h" @@ -75,6 +75,8 @@ #define DEF_CACHE_SZ(1) #define JK_INTERNAL_ERROR (-2) #define MAX_SEND_BODY_SZ(DEF_BUFFER_SZ - 6) +#define AJP13_HEADER_LEN (4) +#define AJP13_HEADER_SZ_LEN (2) struct ajp13_operation; typedef struct ajp13_operation ajp13_operation_t; @@ -196,6 +198,8 @@ { jk_b_end(msg); +jk_dump_buff(l, JK_LOG_DEBUG, "sending to ajp13", msg); + if(0 > jk_tcp_socket_sendfull(ep->sd, jk_b_get_buff(msg), jk_b_get_len(msg))) { @@ -209,11 +213,11 @@ jk_msg_buf_t *msg, jk_logger_t *l) { -unsigned char head[4]; +unsigned char head[AJP13_HEADER_LEN]; int rc; int msglen; -rc = jk_tcp_socket_recvfull(ep->sd, head, 4); +rc = jk_tcp_socket_recvfull(ep->sd, head, AJP13_HEADER_LEN); if(rc < 0) { jk_log(l, JK_LOG_ERROR, @@ -246,6 +250,7 @@ return JK_FALSE; } +jk_dump_buff(l, JK_LOG_DEBUG, "received from ajp13", msg); return JK_TRUE; } @@ -280,8 +285,8 @@ jk_b_reset(msg); -read_buf += 4; /* leave some space for the buffer headers */ -read_buf += 2; /* leave some space for the read length */ +read_buf += AJP13_HEADER_LEN;/* leave some space for the buffer headers */ +read_buf += AJP13_HEADER_SZ_LEN; /* leave some space for the read length */ if(read_fully_from_server(r, read_buf, len) < 0) { jk_log(l, JK_LOG_ERROR, @@ -564,6 +569,9 @@ ajp13_endpoint_t *p, ajp13_operation_t *op) { + /* Up to now, we can recover */ + op->recoverable = JK_TRUE; + /* * First try to reuse open connections... */ @@ -584,7 +592,6 @@ * After we are connected, each error that we are going to * have is probably unrecoverable */ - op->recoverable = JK_FALSE; if(!connection_tcp_send_message(p, op->request, l)) { jk_log(l, JK_LOG_ERROR, "Error sending request on a fresh connection\n"); return JK_FALSE; @@ -599,21 +606,47 @@ * From now on an error means that we have an internal server error * or Tomcat crashed. In any case we cannot recover this. */ - op->recoverable = JK_FALSE; - if(p->left_bytes_to_send > 0) { - unsigned len = p->left_bytes_to_send; - if(len > MAX_SEND_BODY_SZ) - len = MAX_SEND_BODY_SZ; - if(!read_into_msg_buff(p, s, op->reply, l, len)) - return JK_FALSE; - s->content_read = len; + jk_log(l, JK_LOG_DEBUG, "send_request 2: request body to send %d - request body to resend %d\n", + p->left_bytes_to_send, jk_b_get_len(op->reply) - AJP13_HEADER_LEN); + + /* + * POST recovery job is done here. + * It's not very fine to have posted data in reply but that's the only easy + * way to do that for
cvs commit: jakarta-tomcat/src/native/mod_jk/common jk_util.c
hgomez 01/04/23 03:45:07 Modified:src/native/mod_jk/common jk_util.c Log: Removed the HGO fdatasync in log (nobody objected during week-end) Revision ChangesPath 1.6 +0 -7 jakarta-tomcat/src/native/mod_jk/common/jk_util.c Index: jk_util.c === RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/common/jk_util.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- jk_util.c 2001/03/27 21:58:26 1.5 +++ jk_util.c 2001/04/23 10:45:05 1.6 @@ -57,7 +57,7 @@ * Description: Utility functions (mainly configuration) * * Author: Henri Gomez <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.5 $ * + * Version: $Revision: 1.6 $ * ***/ @@ -129,13 +129,6 @@ fwrite(what, 1, sz, p->logfile); /* [V] Flush the dam' thing! */ fflush(p->logfile); -#ifndef WIN32 -#ifndef FREEBSD -#ifndef NETWARE - fdatasync(fileno(p->logfile)); -#endif -#endif -#endif } return JK_TRUE;
cvs commit: jakarta-tomcat/src/native/mod_jk/common jk_uri_worker_map.c
hgomez 01/04/23 04:20:25 Modified:src/native/mod_jk/common jk_uri_worker_map.c Log: Cleanup following some ideas from Rainer Jng Revision ChangesPath 1.4 +8 -10 jakarta-tomcat/src/native/mod_jk/common/jk_uri_worker_map.c Index: jk_uri_worker_map.c === RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/common/jk_uri_worker_map.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jk_uri_worker_map.c 2001/01/23 03:23:03 1.3 +++ jk_uri_worker_map.c 2001/04/23 11:20:24 1.4 @@ -65,7 +65,7 @@ * servlet container. * * * * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.3 $ * + * Version: $Revision: 1.4 $ * ***/ #include "jk_pool.h" @@ -170,8 +170,6 @@ int uri_worker_map_free(jk_uri_worker_map_t **uw_map, jk_logger_t *l) { -int rc = JK_FALSE; - jk_log(l, JK_LOG_DEBUG, "Into jk_uri_worker_map_t::uri_worker_map_free\n"); @@ -179,11 +177,13 @@ uri_worker_map_close(*uw_map, l); free(*uw_map); *uw_map = NULL; + return JK_TRUE; } - -jk_log(l, JK_LOG_ERROR, +else + jk_log(l, JK_LOG_ERROR, "In jk_uri_worker_map_t::uri_worker_map_free, NULL parameters\n"); -return rc; + +return JK_FALSE; } int uri_worker_map_open(jk_uri_worker_map_t *uw_map, @@ -321,20 +321,18 @@ int uri_worker_map_close(jk_uri_worker_map_t *uw_map, jk_logger_t *l) { -int rc = JK_FALSE; - jk_log(l, JK_LOG_DEBUG, "Into jk_uri_worker_map_t::uri_worker_map_close\n"); if(uw_map) { jk_close_pool(&uw_map->p); -rc = JK_TRUE; + return JK_TRUE; } jk_log(l, JK_LOG_ERROR, "jk_uri_worker_map_t::uri_worker_map_close, NULL parameter\n"); -return rc; +return JK_FALSE; } char *map_uri_to_worker(jk_uri_worker_map_t *uw_map,
cvs commit: jakarta-tomcat/src/native/mod_jk/nt_service jk_nt_service.c
hgomez 01/04/24 01:49:48 Modified:src/native/mod_jk/nt_service jk_nt_service.c Log: Update to follow new Win2K services cmd Obtained from: William A Rowe <[EMAIL PROTECTED]> Revision ChangesPath 1.3 +3 -2 jakarta-tomcat/src/native/mod_jk/nt_service/jk_nt_service.c Index: jk_nt_service.c === RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/nt_service/jk_nt_service.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- jk_nt_service.c 2000/11/19 04:15:13 1.2 +++ jk_nt_service.c 2001/04/24 08:49:46 1.3 @@ -56,7 +56,7 @@ /*** * Description: NT System service for Jakarta/Tomcat * * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.2 $ * + * Version: $Revision: 1.3 $ * ***/ #include "jk_global.h" @@ -248,6 +248,7 @@ /* * Stop the service. */ +case SERVICE_CONTROL_SHUTDOWN: case SERVICE_CONTROL_STOP: ssStatus.dwCurrentState = SERVICE_STOP_PENDING; stop_jk_service(); @@ -281,7 +282,7 @@ if(dwCurrentState == SERVICE_START_PENDING) { ssStatus.dwControlsAccepted = 0; } else { -ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; +ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; } ssStatus.dwCurrentState = dwCurrentState;
cvs commit: jakarta-tomcat/proposals/web-connector - New directory
hgomez 01/05/03 06:45:42 jakarta-tomcat/proposals/web-connector - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/native - New directory
hgomez 01/05/03 06:46:43 jakarta-tomcat/proposals/web-connector/native - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/java - New directory
hgomez 01/05/03 06:46:58 jakarta-tomcat/proposals/web-connector/java - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/doc - New directory
hgomez 01/05/03 06:47:13 jakarta-tomcat/proposals/web-connector/doc - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/native README
hgomez 01/05/03 06:50:13 Added: proposals/web-connector/native README Log: Initial readme Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/README Index: README === README for web-connector $Id: README,v 1.1 2001/05/03 13:50:11 hgomez Exp $ Please see doc/mod_jk-howto.html for more verbose instructions * What is web-connector ? web-connector is a new project to release web-servers connector for the jakarta Tomcat servlet engine. This project didn't start from null since it reuse the latest code from mod_jk for the native parts and tomcat 3.3 for the java side of the force. From mod_jk we gain : * A connector (plugin) for many Web Server, including Apache HTTP Server, Netscape/IPLanet NES and Microsoft IIS It also support JNI (and seems to used at least by IBM under AS/400 for Apache/WebSphere connectivity). * Fault-tolerance and load-balancing. mod_jk use the concept of workers which handle a particular request, and a special worker , the lb worker, is a group (cluster ?) of physical workers. * Direct access to Tomcat 3.2/3.3 servlet engine via ajp12/ajp13 protocol. * OK, then how do I build web-connector ? For Unix: Change to the apache1.3 or apache2.0 directory, depending on which version of Apache you are running. Execute "./build-unix.sh" This script sets some environment variables and then calls Apache's apxs script to do the actual compile. If this doesn't work, please check the source for build-unix.sh. You may have to edit some variables. Alternately, you may have more luck with the makefiles. Execute them with e.g. "make -f Makefile.linux mod_jk.so" For Windows: [need more info feel free to contact me] * How do I install mod_jk.so? Copy mod_jk.so into your APACHE_HOME/libexec Add the following line to APACHE_HOME/conf/httpd.conf. Replace "TOMCAT_HOME" with the actual directory name. Include TOMCAT_HOME/conf/mod_jk.conf-auto That's it! When Tomcat starts, it automatically writes out mod_jk.conf-auto based on your server.xml settings. If this is inadequate for your needs, you can copy mod_jk.conf-auto to a new file called "mod_jk.conf" and then change httpd.conf to read Include TOMCAT_HOME/conf/mod_jk.conf Note that Tomcat must be started *before* Apache for mod_jk to initialize correctly. Since "tomcat.sh start" launches Tomcat in the background, you may have to do something like the following in your startup script: cd $TOMCAT_HOME/bin ./tomcat.sh start sleep 4 $APACHE_HOME/bin/apachectl start [Note: apachectl should be run as root, but Tomcat should be run as a local user; this means that the above script would lead to a security problem. Any suggestions to fix?] * Where do I report bugs/errors? See http://jakarta.apache.org/getinvolved/mail.html and http://jakarta.apache.org/bugs/index.html for information. --- Credits: mod_jk written by Gal Shachor and many others README and .sh scripts written by Alex Chaffee
cvs commit: jakarta-tomcat/proposals/web-connector/native/apache1.3 - New directory
hgomez 01/05/03 06:50:58 jakarta-tomcat/proposals/web-connector/native/apache1.3 - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/native/apache2.0 - New directory
hgomez 01/05/03 06:51:01 jakarta-tomcat/proposals/web-connector/native/apache2.0 - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/native/common - New directory
hgomez 01/05/03 06:51:03 jakarta-tomcat/proposals/web-connector/native/common - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/native/iis - New directory
hgomez 01/05/03 06:51:06 jakarta-tomcat/proposals/web-connector/native/iis - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/native/netscape - New directory
hgomez 01/05/03 06:51:12 jakarta-tomcat/proposals/web-connector/native/netscape - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/native/jni - New directory
hgomez 01/05/03 06:51:09 jakarta-tomcat/proposals/web-connector/native/jni - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/native/nt_service - New directory
hgomez 01/05/03 06:51:15 jakarta-tomcat/proposals/web-connector/native/nt_service - New directory
cvs commit: jakarta-tomcat/proposals/web-connector/native/apache1.3 Makefile.freebsd Makefile.linux Makefile.nw README.hpux README.solaris build-hpux-cc.sh build-hpux.sh build-solaris.sh build-unix.sh install-unix.sh mod_jk.c mod_jk.dsp
hgomez 01/05/03 06:54:37 Added: proposals/web-connector/native/apache1.3 Makefile.freebsd Makefile.linux Makefile.nw README.hpux README.solaris build-hpux-cc.sh build-hpux.sh build-solaris.sh build-unix.sh install-unix.sh mod_jk.c mod_jk.dsp Log: Up to date mod_jk stuff for Apache 1.3 Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/apache1.3/Makefile.freebsd Index: Makefile.freebsd === ## You need to edit this file - configure later :-) APACHE_HOME=/usr/local/apache OS=freebsd APXS=${APACHE_HOME}/bin/apxs A13_FLAGS=-I${APACHE_HOME}/include ## I assume this one is set up already # JAVA_HOME= 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 CFLAGS=-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT -pthread -DLINUX -Wall JK=../common/ 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 OBJS=${patsubst %.c,%.o,${SRCS}} %.o: ../common/%.c ${CC} -c ${CFLAGS} ${JAVA_INCL} ${A13_FLAGS} $< -o $@ .c.o: ${APXS} -c ${JAVA_INCL} -DFREEBSD ${A13_FLAGS} -I../common $< all: mod_jk.so mod_jk.so: ${OBJS} mod_jk.o $(APXS) -c -o mod_jk.so ${OBJS} mod_jk.o # $(CC) -shared -o mod_jk.so ${OBJS} mod_jk.o clean: rm *.o *.so 1.1 jakarta-tomcat/proposals/web-connector/native/apache1.3/Makefile.linux Index: Makefile.linux === ## You need to edit this file - configure later :-) ## I assume this one is set up already # JAVA_HOME= OS=linux 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 #ifndef APXS APXS=/usr/sbin/apxs #endif JK=../common/ SRCS=${JK}/jk_ajp12_worker.c ${JK}/jk_connect.c ${JK}/jk_msg_buff.c ${JK}/jk_util.c ${JK}/jk_ajp13.c \ ${JK}/jk_jni_worker.c ${JK}/jk_pool.c ${JK}/jk_worker.c ${JK}/jk_ajp13_worker.c ${JK}/jk_lb_worker.c \ ${JK}/jk_sockbuf.c ${JK}/jk_map.c ${JK}/jk_uri_worker_map.c all: mod_jk.so mod_jk.so: $(APXS) -I ${JK} ${JAVA_INCL} -c -o $@ mod_jk.c $(SRCS) clean: rm *.o *.so 1.1 jakarta-tomcat/proposals/web-connector/native/apache1.3/Makefile.nw Index: Makefile.nw === .SILENT: NLM_NAME=mod_jk JDKPATH=k:\jdk\jdk-1_2_2 NOVELLNDK=r:\nwsdk APACHE_HOME=d:\apache_1.3.12\src WINSOCK_INCDIR=k:\ws295sdk\include METROWERKSPATH=k:\mw\5.3 CC=$(METROWERKSPATH)\bin\mwccnlm LINK=$(METROWERKSPATH)\bin\mwldnlm JK_OBJS=\ jk_ajp12_worker.obj \ jk_ajp13.obj \ jk_ajp13_worker.obj \ jk_connect.obj \ jk_jni_worker.obj \ jk_lb_worker.obj \ jk_map.obj \ jk_msg_buff.obj \ jk_pool.obj \ jk_sockbuf.obj \ jk_uri_worker_map.obj \ jk_util.obj \ jk_worker.obj \ mod_jk.obj \ jk_nwmain.obj \ all: $(NLM_NAME).nlm $(NLM_NAME).nlm: $(JK_OBJS) link.opt @echo Linking $@ @$(LINK) @link.opt %.obj: %.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt %.obj: ../common/%.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt cc.opt: Makefile.nw -@del cc.opt 2> NUL @echo Generating $@ @echo -nosyspath -ext obj -c -align 1 -w nocmdline -bool on >> $@ ifdef DEBUG @echo -g >> $@ endif @echo -I$(NOVELLNDK)\include\nlm >> $@ @echo -I$(NOVELLNDK)\include >> $@ @echo -I. >> $@ @echo -I..\common >> $@ @echo -I$(METROWERKSPATH)\include >> $@ @echo -I$(JDKPATH)\include >> $@ @echo -I$(JDKPATH)\include\netware >> $@ @echo -I$(APACHE_HOME)\include >> $@ @echo -I$(APACHE_HOME)\os\netware >> $@ @echo -I$(WINSOCK_INCDIR) >> $@ @echo -DN_PLAT_NLM >> $@ @echo -DNETWARE >> $@ @echo -DXP_NETWARE >> $@ link.opt: Makefile.nw -@del link.opt 2> NUL -@del link.def 2> NUL @echo -warnings off >> $@ @echo -zerobss >> $@ @echo -desc "Apache 1.3 Plugin for Tomcat" >> $@ @echo -o $(NLM_NAME).nlm >> $@
cvs commit: jakarta-tomcat/proposals/web-connector/native/apache2.0 Makefile.linux build-unix.sh install-unix.sh mod_jk.c mod_jk.dsp
hgomez 01/05/03 06:56:20 Added: proposals/web-connector/native/apache2.0 Makefile.linux build-unix.sh install-unix.sh mod_jk.c mod_jk.dsp Log: Latest mod_jk stuff for Apache 2.0 Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/apache2.0/Makefile.linux Index: Makefile.linux === ## You need to edit this file - configure later :-) ## I assume this one is set up already # JAVA_HOME= OS=linux 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 # # I've built a RPM, named apache2 (ftp://ftp.falsehope.com/home/gomez/apache2/), # which postfix all apache2 stuff with 2, ie apxs = apxs2. # It will allow to have both apache 1.3 and 2.0 the same time on the system # #ifndef APXS APXS=/usr/sbin/apxs2 #endif JK=../common SRCS=${JK}/jk_ajp12_worker.c ${JK}/jk_connect.c ${JK}/jk_msg_buff.c ${JK}/jk_util.c ${JK}/jk_ajp13.c \ ${JK}/jk_jni_worker.c ${JK}/jk_pool.c ${JK}/jk_worker.c ${JK}/jk_ajp13_worker.c ${JK}/jk_lb_worker.c \ ${JK}/jk_sockbuf.c ${JK}/jk_map.c ${JK}/jk_uri_worker_map.c LSRCS=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 all: mod_jk.so mod_jk.so: $(APXS) -I ${JK} ${JAVA_INCL} -c -o mod_jk.la mod_jk.c $(SRCS) mv .libs/mod_jk.so . clean: rm -f *.o *.so *.lo *.la *.slo ${JK}/*.o ${JK}/*.so ${JK}/*.lo ${JK}/*.la ${JK}/*.slo rm -rf .libs 1.1 jakarta-tomcat/proposals/web-connector/native/apache2.0/build-unix.sh Index: build-unix.sh === #!/bin/sh # $Id: build-unix.sh,v 1.1 2001/05/03 13:56:16 hgomez Exp $ # build.sh for mod_jk.so # Usage: build-unix.sh # Sets a bunch of variables and calls APXS to build mod_jk # on Unix. An alternative to the makefiles, hopefully more portable. # Configure by changing the following variables: # JAVA_HOME is required, but it should be set in the environment, not here #JAVA_HOME=/usr/local/jdk1.2 # Where your apache lives if [ -z "$APACHE_HOME" ] then echo APACHE_HOME=/usr/local/apache APACHE_HOME=/usr/local/apache fi # name of subdir under JAVA_HOME/jre/lib ARCH=i386 CFLAGS="-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT -pthread -DLINUX -Wall" APXS=$APACHE_HOME/bin/apxs # Find JAVA_HOME if [ -z "$JAVA_HOME" ] then echo "Please set JAVA_HOME" exit 1 fi # Figure out INCLUDE directories # use "find" to pick the right include directories for current machine JAVA_INCLUDE="`find ${JAVA_HOME}/include -type d -printf \"-I %p \"`" || echo "find failed, edit build-unix.sh source to fix" # if "find" fails, use (uncomment) the following instead, substituting your # platform for "linux" # JAVA_INCLUDE="-I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux" 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 echo Installing mod_jk.so into $APACHE_HOME/libexec cp mod_jk.so $APACHE_HOME/libexec # Done! echo "Done. Install by running ./install-unix.sh" 1.1 jakarta-tomcat/proposals/web-connector/native/apache2.0/install-unix.sh Index: install-unix.sh === #!/bin/sh # $Id: install-unix.sh,v 1.1 2001/05/03 13:56:17 hgomez Exp $ # install.sh for mod_jk.so # copies built mod_jk.so into apache/libexec dir # Usage: install-unix.sh # Sets a bunch of variables and calls APXS to install mod_jk # on Unix. An alternative to the makefiles, hopefully more portable. # Find APACHE_HOME if [ -z "$APACHE_HOME" ] then # Where your apache lives APACHE_HOME=/usr/local/apache fi # Copy mod_jk.so into the apache libexec directory echo Installing mod_jk.so into $APACHE_HOME/libexec cp mod_jk.so $APACHE_HOME/libexec # Done! echo Done. Add the following line to $APACHE_HOME/conf/httpd.conf: echo " " Include TOMCAT_HOME/conf/mod_jk.conf-auto echo '(replace "TOMCAT_HOME" with the actual directory name)' 1.1
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_ajp12_worker.c jk_ajp12_worker.h
hgomez 01/05/03 06:59:16 Added: proposals/web-connector/native/common jk_ajp12_worker.c jk_ajp12_worker.h Log: ajp12 protocol handling Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_ajp12_worker.c Index: jk_ajp12_worker.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: ajpv1.2 worker, used to call local or remote jserv hosts * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Based on:jserv_ajpv12.c from Jserv * * Version: $Revision: 1.1 $ * ***/ #include "jk_ajp12_worker.h" #include "jk_pool.h" #include "jk_connect.h" #include "jk_util.h" #include "jk_sockbuf.h" #define AJP_DEF_HOST("localhost") #define AJP_DEF_PORT(8007) #define READ_BUF_SIZE (8*1024) #define DEF_RETRY_ATTEMPTS (1) struct ajp12_worker { struct sockaddr_in worker_inet_addr; unsigned connect_retry_attempts; char *name; jk_worker_t worker; }; typedef struct ajp12_worker ajp12_worker_t; struct ajp12_endpoint { ajp12_worker_t *worker; int sd; jk_sockbuf_t sb; jk_endpoint_t endpoint; }; typedef struct ajp12_endpoint ajp12_endpoint_t; static int ajpv12_mark(ajp12_endpoint_t *p, unsigned char type); static int ajpv12_sendstring(ajp12_endpoint_t *p, const char *buffer); static int ajpv12_sendint(ajp12_endpoint_t *p, int d); static int ajpv12_sendnbytes(ajp12_endpoint_t *p, const void *buffer, int buff
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_ajp13.c jk_ajp13.h jk_ajp13_worker.c jk_ajp13_worker.h
hgomez 01/05/03 06:59:57 Added: proposals/web-connector/native/common jk_ajp13.c jk_ajp13.h jk_ajp13_worker.c jk_ajp13_worker.h Log: ajp13 protocol handling Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_ajp13.c Index: jk_ajp13.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Experimental bi-directionl protocol handler. * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_global.h" #include "jk_util.h" #include "jk_ajp13.h" /* * Conditional request attributes * */ #define SC_A_CONTEXT(unsigned char)1 #define SC_A_SERVLET_PATH (unsigned char)2 #define SC_A_REMOTE_USER(unsigned char)3 #define SC_A_AUTH_TYPE (unsigned char)4 #define SC_A_QUERY_STRING (unsigned char)5 #define SC_A_JVM_ROUTE (unsigned char)6 #define SC_A_SSL_CERT (unsigned char)7 #define SC_A_SSL_CIPHER (unsigned char)8 #define SC_A_SSL_SESSION(unsigned char)9 #define SC_A_REQ_ATTRIBUTE (unsigned char)10 #define SC_A_ARE_DONE (unsigned char)0xFF /* * Request methods, coded as numbers instead of strings. * The list of methods was taken from Section 5.1.1 of RFC 2616, * RFC 2518, and the ACL IETF draft. * Method= "OPTIONS" *| "GET" *| "HEAD" *| "POST" *| "PUT" *| "DELETE" *| "TRACE" *| "PROPFIND" *
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_connect.c jk_connect.h
hgomez 01/05/03 07:00:59 Added: proposals/web-connector/native/common jk_connect.c jk_connect.h Log: networks stuff (tcp/ip) Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_connect.c Index: jk_connect.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Socket/Naming manipulation functions * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Based on:Various Jserv files* * Version: $Revision: 1.1 $ * ***/ #include "jk_connect.h" #include "jk_util.h" int jk_resolve(char *host, short port, struct sockaddr_in *rc) { int x; u_long laddr; rc->sin_port = htons((short)port); rc->sin_family = AF_INET; /* Check if we only have digits in the string */ for(x = 0 ; '\0' != host[x] ; x++) { if(!isdigit(host[x]) && host[x] != '.') { break; } } if(host[x] != '\0') { /* If we found also characters we use gethostbyname()*/ struct hostent *hoste = gethostbyname(host); if(!hoste) { return JK_FALSE; } laddr = ((struct in_addr *)hoste->h_addr_list[0])->s_addr; } else { /* If we found only digits we use inet_addr() */ laddr = inet_addr(host); } memcpy(&(rc->sin_addr), &laddr , sizeof(laddr)); return JK_TRUE; } int jk_open_socket(struct sockaddr_in *addr, int ndelay, jk_logger_t *l) { int sock; jk_log(l, JK_LOG_DEBUG, "Into jk_open_socket\n");
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_global.h
hgomez 01/05/03 07:01:48 Added: proposals/web-connector/native/common jk_global.h Log: General include Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_global.h Index: jk_global.h === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Global definitions and include files that should exist * * anywhere * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #ifndef JK_GLOBAL_H #define JK_GLOBAL_H #include #include #include #include #include #include #include #include #include #ifdef WIN32 #include #include #else #include #include #include #include #ifndef NETWARE #include #include #include #include #ifndef HPUX11 #include #endif #endif #include #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define JK_WORKER_FILE_TAG ("worker_file") #define JK_MOUNT_FILE_TAG ("worker_mount_file") #define JK_LOG_LEVEL_TAG("log_level") #define JK_LOG_FILE_TAG ("log_file") #define JK_WORKER_NAME_TAG ("worker") #define JK_WORKER_FILE_DEF ("workers.properties") #define JK_LOG_LEVEL_DEF("emerg") #define JK_TRUE (1) #define JK_FALSE (0) #define JK_LF (10) #define JK_CR (13) #define JK_SESSION_IDENTIFIER "JSESSIONID" #define JK_PATH_SESSION_IDENTIFIER ";jsessionid" #if defined(WIN32) || defined(NETWARE) #define JK_METHOD
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_map.c jk_map.h
hgomez 01/05/03 07:26:25 Added: proposals/web-connector/native/common jk_map.c jk_map.h Log: Mapping stuff Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_map.c Index: jk_map.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: General purpose map object * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_global.h" #include "jk_map.h" #include "jk_pool.h" #include "jk_map.h" #include "jk_util.h" #define CAPACITY_INC_SIZE (50) #define LENGTH_OF_LINE(1024) struct jk_map { jk_pool_t p; jk_pool_atom_t buf[SMALL_POOL_SIZE]; char **names; void **values; unsigned capacity; unsigned size; }; static void trim_prp_comment(char *prp); static int trim(char *s); static int map_realloc(jk_map_t *m); static char *update_env_variables(char *value, jk_map_t *m); int map_alloc(jk_map_t **m) { if(m) { return map_open(*m = (jk_map_t *)malloc(sizeof(jk_map_t))); } return JK_FALSE; } int map_free(jk_map_t **m) { int rc = JK_FALSE; if(m && *m) { map_close(*m); free(*m); *m = NULL; } return rc; } int map_open(jk_map_t *m) { int rc = JK_FALSE; if(m) { jk_open_pool(&m->p, m->buf, sizeof(jk_pool_atom_t) * SMALL_POOL_SIZE); m->capacity = 0; m->size = 0; m->names= NULL; m->values = NULL; rc = JK_TRUE; } return rc; } int map_close(jk_map_t *m) { int rc = JK_FALSE; if(m) { j
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_jni_worker.c jk_jni_worker.h
hgomez 01/05/03 07:27:03 Added: proposals/web-connector/native/common jk_jni_worker.c jk_jni_worker.h Log: JNI connectivity Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_jni_worker.c Index: jk_jni_worker.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: In process JNI worker * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Based on: * * Version: $Revision: 1.1 $ * ***/ #if !defined(WIN32) && !defined(NETWARE) #include #endif #include #include "jk_pool.h" #include "jk_jni_worker.h" #include "jk_util.h" #if defined LINUX && defined APACHE2_SIGHACK #include #include #include #endif #ifdef NETWARE #include #include #endif #ifndef JNI_VERSION_1_1 #define JNI_VERSION_1_1 0x00010001 #endif #define null_check(e) if ((e) == 0) return JK_FALSE jint (JNICALL *jni_get_default_java_vm_init_args)(void *) = NULL; jint (JNICALL *jni_create_java_vm)(JavaVM **, JNIEnv **, void *) = NULL; #define JAVA_BRIDGE_CLASS_NAME ("org/apache/tomcat/service/JNIEndpoint") static jk_worker_t *the_singleton_jni_worker = NULL; struct jni_worker { int was_verified; int was_initialized; jk_pool_t p; jk_pool_atom_t buf[TINY_POOL_SIZE]; /* * JVM Object pointer. */ JavaVM *jvm; /* * [V] JNIEnv used for boostraping from validate -> init w/o an attach */ JNIEnv*tmp_env; /* * Web Server to Java bridge, instance and class. */ jobject jk_java_bridge_object; jcl
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_lb_worker.c jk_lb_worker.h
hgomez 01/05/03 07:28:24 Added: proposals/web-connector/native/common jk_lb_worker.c jk_lb_worker.h Log: load balancing worker Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_lb_worker.c Index: jk_lb_worker.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Load balancer worker, knows how to load balance among * * several workers. * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Based on: * * Version: $Revision: 1.1 $ * ***/ #include "jk_pool.h" #include "jk_service.h" #include "jk_util.h" #include "jk_worker.h" #include "jk_lb_worker.h" /* * The load balancing code in this */ /* * Time to wait before retry... */ #define WAIT_BEFORE_RECOVER (60*1) #define ADDITINAL_WAIT_LOAD (20) struct worker_record { char*name; double lb_factor; double lb_value; int in_error_state; int in_recovering; time_t error_time; jk_worker_t *w; }; typedef struct worker_record worker_record_t; struct lb_worker { worker_record_t *lb_workers; unsigned num_of_workers; jk_pool_t p; jk_pool_atom_t buf[TINY_POOL_SIZE]; char *name; jk_worker_t worker; }; typedef struct lb_worker lb_worker_t; struct lb_endpoint { jk_endpoint_t *e; lb_worker_t *worker; jk_endpoint_t endpoint; }; typedef struct lb_endpoint lb_endpoint_t; /* = */ /* Retrieve the parameter with the given name
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_msg_buff.c jk_msg_buff.h
hgomez 01/05/03 07:29:23 Added: proposals/web-connector/native/common jk_msg_buff.c jk_msg_buff.h Log: buffer stuff Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_msg_buff.c Index: jk_msg_buff.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Data marshaling. XDR like * * Author: Costin <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Author: Henri Gomez <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_pool.h" #include "jk_connect.h" #include "jk_util.h" #include "jk_sockbuf.h" #include "jk_msg_buff.h" #include "jk_logger.h" struct jk_msg_buf { jk_pool_t *pool; unsigned char *buf; int pos; int len; int maxlen; }; /* * Simple marshaling code. */ /* XXX what's above this line can go to .h XXX */ void jk_b_dump(jk_msg_buf_t *msg, char *err) { int i=0; printf("%s %d/%d/%d %x %x %x %x - %x %x %x %x - %x %x %x %x - %x %x %x %x\n", err, msg->pos, msg->len, msg->maxlen, msg->buf[i++],msg->buf[i++],msg->buf[i++],msg->buf[i++], msg->buf[i++],msg->buf[i++],msg->buf[i++],msg->buf[i++], msg->buf[i++],msg->buf[i++],msg->buf[i++],msg->buf[i++], msg->buf[i++],msg->buf[i++],msg->buf[i++],msg->buf[i++]); i = msg->pos - 4; if(i < 0) { i=0; } printf("%x %x %x %x - %x %x %x %x --- %x %x %x %x - %x %x %x %x\n&q
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_mt.h
hgomez 01/05/03 07:30:04 Added: proposals/web-connector/native/common jk_mt.h Log: multi-threading defines Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_mt.h Index: jk_mt.h === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Multi thread portability code for JK * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $* ***/ #ifndef _JK_MT_H #define _JK_MT_H #include "jk_global.h" /* * All WIN32 code is MT, UNIX code that uses pthreads is marked by the POSIX * _REENTRANT define. */ #if defined (WIN32) || defined(_REENTRANT) /* * Marks execution under MT compilation */ #define _MT_CODE #ifdef WIN32 #include typedef CRITICAL_SECTION JK_CRIT_SEC; #define JK_INIT_CS(x, rc) InitializeCriticalSection(x); rc = JK_TRUE; #define JK_DELETE_CS(x, rc) DeleteCriticalSection(x); rc = JK_TRUE; #define JK_ENTER_CS(x, rc) EnterCriticalSection(x); rc = JK_TRUE; #define JK_LEAVE_CS(x, rc) LeaveCriticalSection(x); rc = JK_TRUE; #else /* Unix pthreads */ #include typedef pthread_mutex_t JK_CRIT_SEC; #define JK_INIT_CS(x, rc)\ if(pthread_mutex_init(x, NULL)) rc = JK_FALSE; else rc = JK_TRUE; #define JK_DELETE_CS(x, rc)\ if(pthread_mutex_lock(x)) rc = JK_FALSE; else rc = JK_TRUE; #define JK_ENTER_CS(x, rc)\ if(pthread_mutex_unlock(x)) rc = JK_FALSE; else rc = JK_TRUE; #define JK_LEAVE_CS(x, rc)\ if(pthread_mutex_destroy(x)) rc = JK_FALSE; else rc = JK_TRUE; #endif /* Unix pthreads */ #else /* Not an MT code */
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_nwmain.c
hgomez 01/05/03 07:30:44 Added: proposals/web-connector/native/common jk_nwmain.c Log: netware stuff Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_nwmain.c Index: jk_nwmain.c === #ifdef NETWARE /* * NATIVE_MAIN */ /* * INCLUDES */ #include #include #include NETDB_DEFINE_CONTEXT /* * main () * * Main entry point -- don't do much more than I've provided * * Entry: * * Exit: *Nothing */ void main () { ExitThread (TSR_THREAD, 0); } #endif
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_pool.c jk_pool.h
hgomez 01/05/03 07:31:14 Added: proposals/web-connector/native/common jk_pool.c jk_pool.h Log: memory pool Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_pool.c Index: jk_pool.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Simple memory pool * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_pool.h" static void *jk_pool_dyn_alloc(jk_pool_t *p, size_t size); void jk_open_pool(jk_pool_t *p, jk_pool_atom_t *buf, unsigned size) { p->pos = 0; p->size = size; p->buf = (char *)buf; p->dyn_pos = 0; p->dynamic = NULL; p->dyn_size = 0; } void jk_close_pool(jk_pool_t *p) { if(p) { jk_reset_pool(p); if(p->dynamic) { free(p->dynamic); } } } void jk_reset_pool(jk_pool_t *p) { if(p && p->dyn_pos && p->dynamic) { unsigned i; for(i = 0 ; i < p->dyn_pos ; i++) { if(p->dynamic[i]) { free(p->dynamic[i]); } } } p->dyn_pos = 0; p->pos = 0; } void *jk_pool_alloc(jk_pool_t *p, size_t size) { void *rc = NULL; if(p && size > 0) { /* Round size to the upper mult of 8. */ size -= 1; size /= 8; size = (size + 1) * 8; if((p->size - p->pos) >= size) { rc = &(p->buf[p->pos]); p->pos += size; } else { rc = jk_poo
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_service.h
hgomez 01/05/03 07:32:00 Added: proposals/web-connector/native/common jk_service.h Log: jk service wrapper define Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_service.h Index: jk_service.h === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Definitions of the objects used during the service step. * * These are the web server (ws) the worker and the connection* * JVM connection point * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Dan Milstein <[EMAIL PROTECTED]> * Version: $Revision: 1.1 $ * ***/ #ifndef JK_SERVICE_H #define JK_SERVICE_H #include "jk_map.h" #include "jk_global.h" #include "jk_logger.h" #include "jk_pool.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ struct jk_ws_service; struct jk_endpoint; struct jk_worker; typedef struct jk_ws_service jk_ws_service_t; typedef struct jk_endpoint jk_endpoint_t; typedef struct jk_worker jk_worker_t; /* * The web server service 'class'. An instance of this class is created * for each request which is forwarded from the web server to the servlet * container. Contains the basic information about the request * (e.g. protocol, req_uri, etc), and also contains a series of methods * which provide access to core web server functionality (start_response, * read, write). This class might be more accurately called ws_request. * * As with all the core jk classes, this is essentially an abstract base * class which is implemented/extended by classes which are specific to a * particular web server. By using an abstract base class in this mann
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_sockbuf.c jk_sockbuf.h
hgomez 01/05/03 07:33:09 Added: proposals/web-connector/native/common jk_sockbuf.c jk_sockbuf.h Log: socket stuff Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_sockbuf.c Index: jk_sockbuf.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Simple buffer object to handle buffered socket IO * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_global.h" #include "jk_sockbuf.h" static int fill_buffer(jk_sockbuf_t *sb); int jk_sb_open(jk_sockbuf_t *sb, int sd) { if(sb && sd > 0) { sb->end = 0; sb->start = 0; sb->sd= sd; return JK_TRUE; } return JK_FALSE; } int jk_sb_write(jk_sockbuf_t *sb, const void *buf, unsigned sz) { if(sb && buf && sz) { if((SOCKBUF_SIZE - sb->end) >= sz) { memcpy(sb->buf + sb->end, buf, sz); sb->end += sz; } else { if(!jk_sb_flush(sb)) { return JK_FALSE; } if(sz > SOCKBUF_SIZE) { return (send(sb->sd, buf, sz, 0) == (int)sz); } memcpy(sb->buf + sb->end, buf, sz); sb->end += sz; } return JK_TRUE; } return JK_FALSE; } int jk_sb_flush(jk_sockbuf_t *sb) { if(sb) { int save_out = sb->end; sb->end = sb->start = 0; if(save_out) { return send(sb->sd, sb->buf, save_out, 0) == save_out; }
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_uri_worker_map.c jk_uri_worker_map.h
hgomez 01/05/03 07:36:13 Added: proposals/web-connector/native/common jk_uri_worker_map.c jk_uri_worker_map.h Log: uri stuff Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_uri_worker_map.c Index: jk_uri_worker_map.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: URI to worker map object. * * Maps can be * * * * Exact Context -> /exact/uri=worker e.g. /examples/do*=ajp12 * * Context Based -> /context/*=worker e.g. /examples/*=ajp12 * * Context and suffix ->/context/*.suffix=worker e.g. /examples/*.jsp=ajp12* * * * This lets us either partition the work among the web server and the * * servlet container. * * * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_pool.h" #include "jk_util.h" #include "jk_uri_worker_map.h" #define MATCH_TYPE_EXACT(0) #define MATCH_TYPE_CONTEXT (1) #define MATCH_TYPE_SUFFIX (2) struct uri_worker_record { /* Original uri for logging */ char *uri; /* Name of worker mapped */ char *worker_name; /* Suffix of uri */ char *suffix; /* Base context */ char *context; /* char length of the context */ unsigned ctxt_len; int match_type; }; typedef struct uri_worker_record uri_worker_r
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_util.c jk_util.h
hgomez 01/05/03 07:37:34 Added: proposals/web-connector/native/common jk_util.c jk_util.h Log: utilities Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_util.c Index: jk_util.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Utility functions (mainly configuration) * * Author: Henri Gomez <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_util.h" #include "jk_ajp12_worker.h" #define SYSPROPS_OF_WORKER ("sysprops") #define STDERR_OF_WORKER("stderr") #define STDOUT_OF_WORKER("stdout") #define MX_OF_WORKER("mx") #define MS_OF_WORKER("ms") #define CP_OF_WORKER("class_path") #define JVM_OF_WORKER ("jvm_lib") #define LIBPATH_OF_WORKER ("ld_path") #define CMD_LINE_OF_WORKER ("cmd_line") #define NATIVE_LIB_OF_WORKER("native_lib") #define PREFIX_OF_WORKER("worker") #define HOST_OF_WORKER ("host") #define PORT_OF_WORKER ("port") #define TYPE_OF_WORKER ("type") #define CACHE_OF_WORKER ("cachesize") #define LOAD_FACTOR_OF_WORKER ("lbfactor") #define BALANCED_WORKERS("balanced_workers") #define WORKER_AJP12("ajp12") #define DEFAULT_WORKER_TYPE JK_AJP12_WORKER_NAME #define DEFAULT_WORKER JK_AJP12_WORKER_NAME #define WORKER_LIST_PROPERTY_NA
cvs commit: jakarta-tomcat/proposals/web-connector/native/common jk_worker.c jk_worker.h jk_worker_list.h
hgomez 01/05/03 07:38:27 Added: proposals/web-connector/native/common jk_worker.c jk_worker.h jk_worker_list.h Log: worker stuff Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/common/jk_worker.c Index: jk_worker.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Workers controller * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #define _PLACE_WORKER_LIST_HERE #include "jk_worker_list.h" #include "jk_worker.h" #include "jk_util.h" static void close_workers(void); static worker_factory get_factory_for(char *type); static int build_worker_map(jk_map_t *init_data, char **worker_list, unsigned num_of_workers, jk_logger_t *l); int wc_open(jk_map_t *init_data, jk_logger_t *l) { char **worker_list = NULL; unsigned num_of_workers = 0; jk_log(l, JK_LOG_DEBUG, "Into wc_open\n"); if(!map_alloc(&worker_map)) { return JK_FALSE; } if(!jk_get_worker_list(init_data, &worker_list, &num_of_workers)) { return JK_FALSE; } if(!build_worker_map(init_data, worker_list, num_of_workers, l)) { close_workers(); return JK_FALSE; } jk_log(l, JK_LOG_DEBUG, "wc_open, done\n"); return JK_TRUE; } void wc_close(jk_logger_t *l) { jk_log(l, JK_LOG_DEBUG, "Into wc_close\n");
cvs commit: jakarta-tomcat/proposals/web-connector/native/iis isapi.def isapi.dsp isapi.dsw jk_isapi_plugin.c
hgomez 01/05/03 07:39:44 Added: proposals/web-connector/native/iis isapi.def isapi.dsp isapi.dsw jk_isapi_plugin.c Log: ISA stuff Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/iis/isapi.def Index: isapi.def === LIBRARY"isapi_redirect" EXPORTS HttpFilterProc GetFilterVersion GetExtensionVersion HttpExtensionProc TerminateFilter TerminateExtension 1.1 jakarta-tomcat/proposals/web-connector/native/iis/isapi.dsp Index: isapi.dsp === # Microsoft Developer Studio Project File - Name="isapi" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=isapi - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "isapi.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "isapi.mak" CFG="isapi - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "isapi - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "isapi - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "isapi - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "isapi___Win32_Release" # PROP BASE Intermediate_Dir "isapi___Win32_Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "isapi_release" # PROP Intermediate_Dir "isapi_release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ISAPI_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\common" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ISAPI_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 wsock32.lib advapi32.lib /nologo /dll /machine:I386 /out:"isapi_release/isapi_redirect.dll" !ELSEIF "$(CFG)" == "isapi - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "isapi___Win32_Debug" # PROP BASE Intermediate_Dir "isapi___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "isapi_debug" # PROP Intermediate_Dir "isapi_debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ISAPI_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\common" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ISAPI_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut3
cvs commit: jakarta-tomcat/proposals/web-connector/native/jni Makefile.nw Makefile.solaris jk_jnicb.c jk_jnicb.exp jk_jnicb.h jni_connect.dsp jni_connect.dsw
hgomez 01/05/03 07:40:56 Added: proposals/web-connector/native/jni Makefile.nw Makefile.solaris jk_jnicb.c jk_jnicb.exp jk_jnicb.h jni_connect.dsp jni_connect.dsw Log: jni stuff Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/jni/Makefile.nw Index: Makefile.nw === .SILENT: NLM_NAME=jni_conn JDKPATH=k:\jdk\jdk-1_2_2 NOVELLNDK=r:\nwsdk METROWERKSPATH=k:\mw\5.3 CC=$(METROWERKSPATH)\bin\mwccnlm LINK=$(METROWERKSPATH)\bin\mwldnlm JK_OBJS=\ jk_map.obj \ jk_pool.obj \ jk_util.obj \ jk_jnicb.obj \ jk_nwmain.obj \ all: $(NLM_NAME).nlm $(NLM_NAME).nlm: $(JK_OBJS) link.opt @echo Linking $@ @$(LINK) @link.opt %.obj: %.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt %.obj: ../common/%.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt cc.opt: Makefile.nw -@del cc.opt 2> NUL @echo Generating $@ @echo -nosyspath -ext obj -c -align 1 -w nocmdline -bool on >> $@ ifdef DEBUG @echo -g >> $@ endif @echo -I$(NOVELLNDK)\include\nlm >> $@ @echo -I$(NOVELLNDK)\include >> $@ @echo -I. >> $@ @echo -I..\common >> $@ @echo -I$(METROWERKSPATH)\include >> $@ @echo -I$(JDKPATH)\include >> $@ @echo -I$(JDKPATH)\include\netware >> $@ @echo -DN_PLAT_NLM >> $@ @echo -DNETWARE >> $@ @echo -DXP_NETWARE >> $@ link.opt: Makefile.nw -@del link.opt 2> NUL -@del link.def 2> NUL @echo -warnings off >> $@ @echo -zerobss >> $@ @echo -desc "JNI Natives for Tomcat" >> $@ @echo -o $(NLM_NAME).nlm >> $@ @echo -screenname "System Console" >> $@ @echo -nlmversion 0,1,0 >> $@ ifdef DEBUG @echo -g >> $@ @echo -sym internal >> $@ @echo -sym codeview4 >> $@ @echo -osym $(NLM_NAME).sym >> $@ endif @echo -nodefaults >> $@ @echo -map $(NLM_NAME).map >> $@ @echo -threadname "JK_JNI Thread" >> $@ @echo -stacksize 64000 >> $@ @echo $(METROWERKSPATH)\lib\nwpre.obj $(strip $(JK_OBJS)) >> $@ @echo -commandfile link.def >> $@ @echo module nsapi >> link.def @echo Import @$(NOVELLNDK)\imports\clib.imp >> link.def @echo Import @$(NOVELLNDK)\imports\lib0.imp >> link.def @echo Import @$(NOVELLNDK)\imports\nlmlib.imp >> link.def @echo Import @$(NOVELLNDK)\imports\threads.imp >> link.def @echo Import @$(NOVELLNDK)\imports\socklib.imp >> link.def @echo Export @jk_jnicb.exp >> link.def clean: -@del *.obj 2> NUL -@del *.map 2> NUL -@del link.* 2> NUL -@del cc.opt 2> NUL -@del *.nlm 2> NUL -@del *.sym 2> NUL 1.1 jakarta-tomcat/proposals/web-connector/native/jni/Makefile.solaris Index: Makefile.solaris === # Defines for example NSAPI programs running under SOLARIS CC_CMD=gcc -DSOLARIS -D_REENTRANT LD_SHAREDCMD=ld -G all: prepare: OS_TYPE=solaris INCLUDEDIR=../common JAVA_INCLUDE=$(JAVA_HOME)/include JK_OBJS = ../common/jk_map.o ../common/jk_util.o ../common/jk_pool.o jk_jnicb.o INCLUDE_FLAGS=-I$(INCLUDEDIR) -I$(JAVA_INCLUDE) -I$(JAVA_INCLUDE)/$(OS_TYPE) COMMON_DEFS=-Wall all: jni_connect.so jni_connect.so: $(JK_OBJS) $(MAKE) prepare $(LD_SHAREDCMD) $(JK_OBJS) -o jni_connect.so $(EXTRA_LDDEFINES) .c.o: $(CC_CMD) $(COMMON_DEFS) $(INCLUDE_FLAGS) -c $< clean: rm $(JK_OBJS) 1.1 jakarta-tomcat/proposals/web-connector/native/jni/jk_jnicb.c Index: jk_jnicb.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *di
cvs commit: jakarta-tomcat/proposals/web-connector/native/netscape Makefile.nw Makefile.solaris jk_nsapi_plugin.c nsapi.dsp nsapi.dsw
hgomez 01/05/03 07:43:38 Added: proposals/web-connector/native/netscape Makefile.nw Makefile.solaris jk_nsapi_plugin.c nsapi.dsp nsapi.dsw Log: Netscape/IPlanet stuff Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/netscape/Makefile.nw Index: Makefile.nw === .SILENT: NLM_NAME=nsapi_rd JDKPATH=k:\jdk\jdk-1_2_2 NOVELLNDK=r:\nwsdk NSSDK=r:\netscape METROWERKSPATH=k:\mw\5.3 CC=$(METROWERKSPATH)\bin\mwccnlm LINK=$(METROWERKSPATH)\bin\mwldnlm JK_OBJS=\ jk_ajp12_worker.obj \ jk_ajp13_worker.obj \ jk_ajp13.obj \ jk_connect.obj \ jk_jni_worker.obj \ jk_lb_worker.obj \ jk_map.obj \ jk_msg_buff.obj \ jk_nsapi_plugin.obj \ jk_pool.obj \ jk_sockbuf.obj \ jk_uri_worker_map.obj \ jk_util.obj \ jk_worker.obj \ jk_nwmain.obj \ all: $(NLM_NAME).nlm $(NLM_NAME).nlm: $(JK_OBJS) link.opt @echo Linking $@ @$(LINK) @link.opt %.obj: %.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt %.obj: ../common/%.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt cc.opt: Makefile.nw -@del cc.opt 2> NUL @echo Generating $@ @echo -nosyspath -ext obj -c -align 1 -w nocmdline -bool on >> $@ ifdef DEBUG @echo -g >> $@ endif @echo -I$(NOVELLNDK)\include\nlm >> $@ @echo -I$(NOVELLNDK)\include >> $@ @echo -I$(NSSDK)\include >> $@ @echo -I. >> $@ @echo -I..\common >> $@ @echo -I$(METROWERKSPATH)\include >> $@ @echo -I$(JDKPATH)\include >> $@ @echo -I$(JDKPATH)\include\netware >> $@ @echo -DN_PLAT_NLM >> $@ @echo -DNETWARE >> $@ @echo -DXP_NETWARE >> $@ link.opt: Makefile.nw -@del link.opt 2> NUL -@del link.def 2> NUL @echo -warnings off >> $@ @echo -zerobss >> $@ @echo -desc "Netscape Plugin for Tomcat" >> $@ @echo -o $(NLM_NAME).nlm >> $@ @echo -screenname "System Console" >> $@ @echo -nlmversion 0,1,0 >> $@ ifdef DEBUG @echo -g >> $@ @echo -sym internal >> $@ @echo -sym codeview4 >> $@ @echo -osym $(NLM_NAME).sym >> $@ endif @echo -nodefaults >> $@ @echo -map $(NLM_NAME).map >> $@ @echo -threadname "NSTomcat Thread" >> $@ @echo -stacksize 64000 >> $@ @echo $(METROWERKSPATH)\lib\nwpre.obj $(strip $(JK_OBJS)) >> $@ @echo -commandfile link.def >> $@ @echo module nsapi >> link.def @echo Import @$(NOVELLNDK)\imports\clib.imp >> link.def @echo Import @$(NOVELLNDK)\imports\lib0.imp >> link.def @echo Import @$(NOVELLNDK)\imports\nlmlib.imp >> link.def @echo Import @$(NOVELLNDK)\imports\threads.imp >> link.def @echo Import @$(NOVELLNDK)\imports\socklib.imp >> link.def @echo Import @$(NSSDK)\imports\nsapi.imp >> link.def @echo Export jk_init, jk_service >> link.def clean: -@del *.obj 2> NUL -@del *.map 2> NUL -@del link.* 2> NUL -@del cc.opt 2> NUL -@del *.nlm 2> NUL -@del *.sym 2> NUL 1.1 jakarta-tomcat/proposals/web-connector/native/netscape/Makefile.solaris Index: Makefile.solaris === # Defines for example NSAPI programs running under SOLARIS CC_CMD=gcc -DNET_SSL -DSOLARIS -D_REENTRANT LD_SHAREDCMD=ld -G all: prepare: OS_TYPE=solaris INCLUDEDIR=$(SUITSPOT_HOME)/include JAVA_INCLUDE=$(JAVA_HOME)/include JK_OBJS = jk_ajp12_worker.o jk_lb_worker.o jk_sockbuf.o jk_connect.o jk_map.o \ jk_uri_worker_map.o jk_nsapi_plugin.o jk_util.o jk_jni_worker.o \ jk_pool.o jk_worker.o INCLUDE_FLAGS=-I$(INCLUDEDIR) -I$(INCLUDEDIR)/base -I$(INCLUDEDIR)/frame -I$(JAVA_INCLUDE) -I$(JAVA_INCLUDE)/$(OS_TYPE) COMMON_DEFS=-DMCC_HTTPD -DXP_UNIX -DSPAPI20 -DSOLARIS -Wall all: nsapi_redirector.so nsapi_redirector.so: $(JK_OBJS) $(MAKE) prepare $(LD_SHAREDCMD) $(JK_OBJS) -o nsapi_redirector.so $(EXTRA_LDDEFINES) .c.o: $(CC_CMD) $(COMMON_DEFS) $(INCLUDE_FLAGS) -c $< clean: rm $(JK_OBJS) 1.1 jakarta-tomcat/proposals/web-connector/native/netscape/jk_nsapi_plugin.c Index: jk_nsapi_plugin.c =
cvs commit: jakarta-tomcat/proposals/web-connector/native/nt_service jk_nt_service.c nt_service.dsp
hgomez 01/05/03 07:47:24 Added: proposals/web-connector/native/nt_service jk_nt_service.c nt_service.dsp Log: nt_service stuff Revision ChangesPath 1.1 jakarta-tomcat/proposals/web-connector/native/nt_service/jk_nt_service.c Index: jk_nt_service.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: NT System service for Jakarta/Tomcat * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_global.h" #include "jk_util.h" #include "jk_ajp13.h" #include "jk_connect.h" #include #include #include #include #define AJP12_TAG ("ajp12") #define AJP13_TAG ("ajp13") #define BASE_REGISTRY_LOCATION ("SYSTEM\\CurrentControlSet\\Services\\") #define IMAGE_NAME ("ImagePath") #define PARAMS_LOCATION("Parameters") #define PRP_LOCATION ("PropertyFile") // internal variables static SERVICE_STATUS ssStatus; // current status of the service static SERVICE_STATUS_HANDLE sshStatusHandle; static DWORD dwErr = 0; static charszErr[1024] = ""; static HANDLE hServerStopEvent = NULL; static int shutdown_port; static char*shutdown_protocol = AJP12_TAG; struct jk_tomcat_startup_data { char *classpath; char *tomcat_home; char *stdout_file; char *stderr_file; char *java_bin; char *tomcat_class; char *server_file; char *cmd_line; int shutdown_port; char *shutdown_protocol; char *extra_path; }; typedef struct jk
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/server Ajp12.java
hgomez 01/04/27 02:26:42 Modified:src/share/org/apache/tomcat/modules/server Ajp12.java Log: A quick and dirty patch to set SSL scheme in ajp12. We check if the web server port was 443 and in that case set the scheme to https I recommand you to use ajp13 instead :) Revision ChangesPath 1.17 +7 -0 jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12.java Index: Ajp12.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Ajp12.java2001/03/02 04:49:23 1.16 +++ Ajp12.java2001/04/27 09:26:42 1.17 @@ -183,6 +183,13 @@ any.printStackTrace(); } req.setServerPort( serverPort ); + +/* Quick and dirty patch to set https scheme in ajp12 + * but I recommand using ajp13 instead + */ +if (serverPort == 443) + req.scheme().setString("https"); + // System.out.println("XXX port: " + req.getServerPort()); //server protocol
cvs commit: jakarta-tomcat-connectors/jk/src/native - New directory
hgomez 01/05/14 02:08:42 jakarta-tomcat-connectors/jk/src/native - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native README
hgomez 01/05/14 02:09:44 Added: jk/src/native README Log: the usual README Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/README Index: README === README for jakarta-tomcat-connector $Id: README,v 1.1 2001/05/14 09:09:42 hgomez Exp $ Please see doc/mod_jk-howto.html for more verbose instructions * What is jakarta-tomcat-connector ? jakarta-tomcat-connector is a new project to release web-servers connector for the jakarta Tomcat servlet engine. This project didn't start from null since it reuse the latest code from mod_jk for the native parts and tomcat 3.3 for the java side of the force. From mod_jk we gain : * A connector (plugin) for many Web Server, including Apache HTTP Server, Netscape/IPLanet NES and Microsoft IIS It also support JNI (and seems to used at least by IBM under AS/400 for Apache/WebSphere connectivity). * Fault-tolerance and load-balancing. mod_jk use the concept of workers which handle a particular request, and a special worker , the lb worker, is a group (cluster ?) of physical workers. * Direct access to Tomcat 3.2/3.3 servlet engine via ajp12/ajp13 protocol. * OK, then how do I build web-connector ? For Unix: Change to the apache1.3 or apache2.0 directory, depending on which version of Apache you are running. Execute "./build-unix.sh" This script sets some environment variables and then calls Apache's apxs script to do the actual compile. If this doesn't work, please check the source for build-unix.sh. You may have to edit some variables. Alternately, you may have more luck with the makefiles. Execute them with e.g. "make -f Makefile.linux mod_jtc.so" For Windows: [need more info feel free to contact me] * How do I install mod_jtc.so? Copy mod_jtc.so into your APACHE_HOME/libexec Add the following line to APACHE_HOME/conf/httpd.conf. Replace "TOMCAT_HOME" with the actual directory name. Include TOMCAT_HOME/conf/mod_jtc.conf-auto That's it! When Tomcat starts, it automatically writes out mod_jtc.conf-auto based on your server.xml settings. If this is inadequate for your needs, you can copy mod_jtc.conf-auto to a new file called "mod_jtc.conf" and then change httpd.conf to read Include TOMCAT_HOME/conf/mod_jtc.conf Note that Tomcat must be started *before* Apache for mod_jtc to initialize correctly. Since "tomcat.sh start" launches Tomcat in the background, you may have to do something like the following in your startup script: cd $TOMCAT_HOME/bin ./tomcat.sh start sleep 4 $APACHE_HOME/bin/apachectl start [Note: apachectl should be run as root, but Tomcat should be run as a local user; this means that the above script would lead to a security problem. Any suggestions to fix?] * Where do I report bugs/errors? See http://jakarta.apache.org/getinvolved/mail.html and http://jakarta.apache.org/bugs/index.html for information. --- Credits: mod_jk written by Gal Shachor and many others README and .sh scripts written by Alex Chaffee
cvs commit: jakarta-tomcat-connectors/jk/src/doc - New directory
hgomez 01/05/14 02:14:57 jakarta-tomcat-connectors/jk/src/doc - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache1.3 - New directory
hgomez 01/05/14 02:17:43 jakarta-tomcat-connectors/jk/src/native/apache1.3 - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache1.3 Makefile.freebsd Makefile.linux Makefile.nw
hgomez 01/05/14 02:20:42 Added: jk/src/native/apache1.3 Makefile.freebsd Makefile.linux Makefile.nw Log: Makefiles Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache1.3/Makefile.freebsd Index: Makefile.freebsd === ## You need to edit this file - configure later :-) APACHE_HOME=/usr/local/apache OS=freebsd APXS=${APACHE_HOME}/bin/apxs A13_FLAGS=-I${APACHE_HOME}/include ## I assume this one is set up already # JAVA_HOME= 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 CFLAGS=-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT -pthread -DLINUX -Wall JK=../common/ 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 OBJS=${patsubst %.c,%.o,${SRCS}} %.o: ../common/%.c ${CC} -c ${CFLAGS} ${JAVA_INCL} ${A13_FLAGS} $< -o $@ .c.o: ${APXS} -c ${JAVA_INCL} -DFREEBSD ${A13_FLAGS} -I../common $< all: mod_jk.so mod_jk.so: ${OBJS} mod_jk.o $(APXS) -c -o mod_jk.so ${OBJS} mod_jk.o # $(CC) -shared -o mod_jk.so ${OBJS} mod_jk.o clean: rm *.o *.so 1.1 jakarta-tomcat-connectors/jk/src/native/apache1.3/Makefile.linux Index: Makefile.linux === ## You need to edit this file - configure later :-) ## I assume this one is set up already # JAVA_HOME= OS=linux 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 #ifndef APXS APXS=/usr/sbin/apxs #endif JK=../common/ SRCS=${JK}/jk_ajp12_worker.c ${JK}/jk_connect.c ${JK}/jk_msg_buff.c ${JK}/jk_util.c ${JK}/jk_ajp13.c \ ${JK}/jk_jni_worker.c ${JK}/jk_pool.c ${JK}/jk_worker.c ${JK}/jk_ajp13_worker.c ${JK}/jk_lb_worker.c \ ${JK}/jk_sockbuf.c ${JK}/jk_map.c ${JK}/jk_uri_worker_map.c all: mod_jk.so mod_jk.so: $(APXS) -I ${JK} ${JAVA_INCL} -c -o $@ mod_jk.c $(SRCS) clean: rm *.o *.so 1.1 jakarta-tomcat-connectors/jk/src/native/apache1.3/Makefile.nw Index: Makefile.nw === .SILENT: NLM_NAME=mod_jk JDKPATH=k:\jdk\jdk-1_2_2 NOVELLNDK=r:\nwsdk APACHE_HOME=d:\apache_1.3.12\src WINSOCK_INCDIR=k:\ws295sdk\include METROWERKSPATH=k:\mw\5.3 CC=$(METROWERKSPATH)\bin\mwccnlm LINK=$(METROWERKSPATH)\bin\mwldnlm JK_OBJS=\ jk_ajp12_worker.obj \ jk_ajp13.obj \ jk_ajp13_worker.obj \ jk_connect.obj \ jk_jni_worker.obj \ jk_lb_worker.obj \ jk_map.obj \ jk_msg_buff.obj \ jk_pool.obj \ jk_sockbuf.obj \ jk_uri_worker_map.obj \ jk_util.obj \ jk_worker.obj \ mod_jk.obj \ jk_nwmain.obj \ all: $(NLM_NAME).nlm $(NLM_NAME).nlm: $(JK_OBJS) link.opt @echo Linking $@ @$(LINK) @link.opt %.obj: %.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt %.obj: ../common/%.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt cc.opt: Makefile.nw -@del cc.opt 2> NUL @echo Generating $@ @echo -nosyspath -ext obj -c -align 1 -w nocmdline -bool on >> $@ ifdef DEBUG @echo -g >> $@ endif @echo -I$(NOVELLNDK)\include\nlm >> $@ @echo -I$(NOVELLNDK)\include >> $@ @echo -I. >> $@ @echo -I..\common >> $@ @echo -I$(METROWERKSPATH)\include >> $@ @echo -I$(JDKPATH)\include >> $@ @echo -I$(JDKPATH)\include\netware >> $@ @echo -I$(APACHE_HOME)\include >> $@ @echo -I$(APACHE_HOME)\os\netware >> $@ @echo -I$(WINSOCK_INCDIR) >> $@ @echo -DN_PLAT_NLM >> $@ @echo -DNETWARE >> $@ @echo -DXP_NETWARE >> $@ link.opt: Makefile.nw -@del link.opt 2> NUL -@del link.def 2> NUL @echo -warnings off >> $@ @echo -zerobss >> $@ @echo -desc "Apache 1.3 Plugin for Tomcat" >> $@ @echo -o $(NLM_NAME).nlm >> $@ @echo -screenname "System Console" >> $@ @echo -nlmversion 0,1,0 >> $@ ifdef DEBUG @echo -g >> $@ @echo -sym internal >> $@ @echo -sym codeview4 >> $@ @echo -osym $(NLM_NAME).
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache1.3 build-hpux-cc.sh build-hpux.sh build-solaris.sh build-unix.sh
hgomez 01/05/14 02:21:04 Added: jk/src/native/apache1.3 build-hpux-cc.sh build-hpux.sh build-solaris.sh build-unix.sh Log: build files Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache1.3/build-hpux-cc.sh Index: build-hpux-cc.sh === #!/bin/sh # build-hpux.sh for mod_jk.so # # Usage: # sh build-hpux.sh # for hpux 11 using gcc # Note: See README-hpux for details. This builds mod_jk without JNI support. # # Mike Braden # Update the following according to your installation APACHE_HOME=/usr/local/apache JAVA_HOME=/opt/java1.3 End of configuration - do not change below if [ -f $APACHE_HOME/bin/apxs ] ; then APXS=$APACHE_HOME/bin/apxs else echo Error: Unable to locate apxs. echo Verify that APACHE_HOME is set correctly in this script. exit 1 fi if [ ! -d $JAVA_HOME/include/hp-ux ] ; then echo Error: Unable to locate Java libraries. echo Verify that JAVA_HOME is set correctly in this script. exit 1 fi JAVA_INCLUDE="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/hp-ux" INCLUDE="-I../common $JAVA_INCLUDE" #SRC="../common/jk_ajp12_worker.c ../common/jk_ajp13.c ../common/jk_ajp13_worker.c ../common/jk_connect.c ../common/jk_lb_worker.c ../common/jk_map.c ../common/jk_msg_buff.c ../common/jk_nwmain.c ../common/jk_pool.c ../common/jk_sockbuf.c ../common/jk_uri_worker_map.c ../common/jk_util.c ../common/jk_worker.c mod_jk.c" SRC="../common/*.c mod_jk.c" # Run APXS to compile the mod_jk module and its components echo Building mod_jk $APXS -o mod_jk.so $INCLUDE -c $SRC # Check to see if the last command completed if [ $? -ne 0 ] ; then echo Error with apxs exit 1 fi echo mod_jk build complete. # # Clean up # rm jk_*.o rm mod_jk.o echo Configuring apache... # Use apxs to add the correct lines to httpd.conf # Since our auto-config does this in the include # file (mod_jk-conf-auto), we'll add them as # commented statements for change later if # we decide not to use the auto-conf. # #$APXS -i -a mod_jk.so $APXS -i -A mod_jk.so # Check to see if the last command completed if [ $? -ne 0 ] ; then echo Error using apxs to add configuration to httpd.conf exit 1 fi # Steps to complete install cat< module in the server.xml file: Apache configs: " Example (TOMCAT_HOME/conf/serverl.xml): For more information, see the mod_jk-howto located in the docs dir of TOMCAT. (doc/mod_jk-howto.html) END 1.1 jakarta-tomcat-connectors/jk/src/native/apache1.3/build-hpux.sh Index: build-hpux.sh === #!/bin/sh # build-hpux.sh for mod_jk.so # # Usage: # sh build-hpux.sh # for hpux 11 using gcc # Note: See README-hpux for details. This builds mod_jk without JNI support. # # Mike Braden # Update the following according to your installation APACHE_HOME=/usr/local/apache JAVA_HOME=/opt/java1.3 End of configuration - do not change below if [ -f $APACHE_HOME/bin/apxs ] ; then APXS=$APACHE_HOME/bin/apxs else echo Error: Unable to locate apxs. echo Verify that APACHE_HOME is set correctly in this script. exit 1 fi if [ ! -d $JAVA_HOME/include/hp-ux ] ; then echo Error: Unable to locate Java libraries. echo Verify that JAVA_HOME is set correctly in this script. exit 1 fi JAVA_INCLUDE="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/hp-ux" INCLUDE="-I../common $JAVA_INCLUDE" SRC="../common/jk_ajp12_worker.c ../common/jk_ajp13.c ../common/jk_ajp13_worker.c ../common/jk_connect.c ../common/jk_lb_worker.c ../common/jk_map.c ../common/jk_msg_buff.c ../common/jk_nwmain.c ../common/jk_pool.c ../common/jk_sockbuf.c ../common/jk_uri_worker_map.c ../common/jk_util.c ../common/jk_worker.c mod_jk.c" # Run APXS to compile the mod_jk module and its components echo Building mod_jk $APXS -DHPUX11GCC -o mod_jk.so $INCLUDE -c $SRC # Check to see if the last command completed if [ $? -ne 0 ] ; then echo Error with apxs exit 1 fi echo mod_jk build complete. # # Clean up # rm jk_*.o rm mod_jk.o echo Configuring apache... # Use apxs to add the correct lines to httpd.conf # Since our auto-config does this in the include # file (mod_jk-conf-auto), we'll add them as # commented statements for change later if # we decide not to use the auto-conf. # #$APXS -i -a mod_jk.so $APXS -i -A mod_jk.so # Check to see if the last command completed if [ $? -ne 0 ] ; then echo Error using apxs to add configuration to htt
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache1.3 README.hpux README.solaris
hgomez 01/05/14 02:21:29 Added: jk/src/native/apache1.3 README.hpux README.solaris Log: READMEs Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache1.3/README.hpux Index: README.hpux === mod_jk README for HP-UX 11 Mike Braden March 05, 2001 This README explains how to build mod_jk on HP-UX 11 systems. There are two build scripts for HP-UX: build-hpux.sh Use if you have the GNU gcc compiler build-hpux-cc.sh Use if you have the HP ANSI C compiler The first package is for use with the gcc compiler. It produces 32-bit code that should run on both PA1.1 and PA2.0 based architectures. The second script is for use with the HP add-on ANSI C Complier package. This will not work with the stripped down cc version that ships with HP-UX. That compiler is just for kernel rebuilds. If you do not have the HP ANSI C compiler package, then obtain gcc and use the first script. PREREQUISITES This script requires that GCC 2.95.2 be installed and in your path. You should also have the GNU binutils installed. You can obtain the binary depot files for these at: http://gatekeep.cs.utah.edu/ Before running the build script, verify that APACHE_HOME and JAVA_HOME are set correct in the script. BUILDING MOD_JK The build script should be run as root as follows: # sh build-hpux.sh After the script completes you will need to modify the Tomcat server.xml file to tell it to generate the auto configuration for mod_jk. To do this, edit $TOMCAT_HOME/conf/server.xml and add the following after The next time you startup Tomcat, it will generate TOMCAT_HOME/conf/jk/mod_jk.conf-auto with the necessary commands to use Tomcat through Apache. Tomcat will automatically add any webapps that it finds in its webapps directory. See the Tomcat Users Guide and Release Notes for more information. TROUBLESHOOTING If you experience problems using the build script, make sure that your apache installation matches your system. Apache's apxs is a perl script that is configured when you compile apache for your system. If you are using a binary install of apache, it will most likely not be configured correctly for your system. NOTE: Most apxs errors are due to the use of an Apache binary installation. BUILD AND INSTALL APACHE FROM SOURCE. IT'S NOT THAT HARD! The best solution is to build apache from source as follows: Download apache from http://httpd.apache.org Put the source file in /usr/local/src # cd /usr/local/src # gzip -dc apache_1.3.17.tar.gz|tar xvf - # cd apache_1.3.17 # ./configure --prefix=/usr/local/apache --enable-module=most / --enable-shared=max # make # make install This will build apache and install it into the /usr/local/apache directory. Note: In order to build mod_jk for HPUX11 using GCC, support for JNI was removed. This should not affect Apache 1.3 installations since it is not recommended to run mod_jk in In-Process mode under Apache 1.3. If you wish to include support for JNI, you must build mod_jk with the HP ANSI Compiler using 64-bit mode. The second build script listed at the top of this document will work. 1.1 jakarta-tomcat-connectors/jk/src/native/apache1.3/README.solaris Index: README.solaris === mod_jk README for Solaris Mike Braden March 05, 2001 This README explains how to build mod_jk on Sun Solaris systems. build-solaris.sh Use with the GNU gcc compiler This script works with the GNU gcc compiler. This script works on both SPARC and x86 architecture systems. PREREQUISITES This script requires that GCC 2.95.2 be installed and in your path. You can obtain a gcc binary package from: http://www.sunfreeware.com/ Before running the build script, verify that APACHE_HOME and JAVA_HOME are set correct in the script. BUILDING MOD_JK The build script should be run as root as follows: # sh build-solaris.sh After the script completes you will need to modify the Tomcat server.xml file to tell it to generate the auto configuration for mod_jk. To do this, edit $TOMCAT_HOME/conf/server.xml and add the following after The next time you startup Tomcat, it will generate TOMCAT_HOME/conf/jk/mod_jk.conf-auto with the necessary commands to use Tomcat through Apache. Tomcat will automatically add any webapps that it finds in its webapps directory. See the Tomcat Users Guide and Release Notes for more information. TROUBLESHOOTING If you experience problems using the build script, make sure that your apache in
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache1.3 mod_jk.c
hgomez 01/05/14 02:22:05 Added: jk/src/native/apache1.3 mod_jk.c Log: apache 1.3 module Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache1.3/mod_jk.c Index: mod_jk.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Apache 1.3 plugin for Jakarta/Tomcat * * See ../common/jk_service.h for general mod_jk info * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Dan Milstein <[EMAIL PROTECTED]>* * Henri Gomez <[EMAIL PROTECTED]> * * Version: $ $* ***/ /* * mod_jk: keeps all servlet/jakarta related ramblings together. */ #include "ap_config.h" #include "httpd.h" #include "http_config.h" #include "http_request.h" #include "http_core.h" #include "http_protocol.h" #include "http_main.h" #include "http_log.h" #include "util_script.h" #include "util_date.h" #include "http_conf_globals.h" /* * Jakarta (jk_) include files */ #ifdef NETWARE #define _SYS_TYPES_H_ #define _NETDB_H_INCLUDED #define _IN_ #define _INET_ #define _SYS_TIMEVAL_H_ #define _SYS_SOCKET_H_ #endif #include "jk_global.h" #include "jk_util.h" #include "jk_map.h" #include "jk_pool.h" #include "jk_service.h" #include "jk_worker.h" #include "jk_uri_worker_map.h" #define JK_WORKER_ID("jakarta.worker") #define JK_HANDLER ("jakarta-servlet") #define JK_MAGIC_TYPE ("application/x-jakarta-servlet") #define NULL_FOR_EMPTY(x) ((x &am
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache1.3 mod_jk.dsp
hgomez 01/05/14 02:22:40 Added: jk/src/native/apache1.3 mod_jk.dsp Log: MSVC build file Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache1.3/mod_jk.dsp Index: mod_jk.dsp === # Microsoft Developer Studio Project File - Name="mod_jk" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=mod_jk - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "mod_jk.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "mod_jk.mak" CFG="mod_jk - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "mod_jk - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "mod_jk - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "mod_jk - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MOD_JK_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\common" /I "$(APACHE1_HOME)\src\include" /I "$(APACHE1_HOME)\src\os\win32" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MOD_JK_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 ApacheCore.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"$(APACHE1_HOME)\src\CoreR" /libpath:"$(APACHE1_HOME)\src\Release" !ELSEIF "$(CFG)" == "mod_jk - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MOD_JK_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\common" /I "$(APACHE1_HOME)\src\include" /I "$(APACHE1_HOME)\src\os\win32" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MOD_JK_EXPORTS" /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 ApacheCore.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib co
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache2.0 - New directory
hgomez 01/05/14 02:23:51 jakarta-tomcat-connectors/jk/src/native/apache2.0 - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache2.0 Makefile.linux
hgomez 01/05/14 02:25:04 Added: jk/src/native/apache2.0 Makefile.linux Log: Linux make file (since I've got a Apache 2.0 running on that OS) Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache2.0/Makefile.linux Index: Makefile.linux === ## You need to edit this file - configure later :-) ## I assume this one is set up already # JAVA_HOME= OS=linux 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 # # I've built a RPM, named apache2 (ftp://ftp.falsehope.com/home/gomez/apache2/), # which postfix all apache2 stuff with 2, ie apxs = apxs2. # It will allow to have both apache 1.3 and 2.0 the same time on the system # #ifndef APXS APXS=/usr/sbin/apxs2 #endif JK=../common SRCS=${JK}/jk_ajp12_worker.c ${JK}/jk_connect.c ${JK}/jk_msg_buff.c ${JK}/jk_util.c ${JK}/jk_ajp13.c \ ${JK}/jk_jni_worker.c ${JK}/jk_pool.c ${JK}/jk_worker.c ${JK}/jk_ajp13_worker.c ${JK}/jk_lb_worker.c \ ${JK}/jk_sockbuf.c ${JK}/jk_map.c ${JK}/jk_uri_worker_map.c LSRCS=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 all: mod_jk.so mod_jk.so: $(APXS) -I ${JK} ${JAVA_INCL} -c -o mod_jk.la mod_jk.c $(SRCS) mv .libs/mod_jk.so . clean: rm -f *.o *.so *.lo *.la *.slo ${JK}/*.o ${JK}/*.so ${JK}/*.lo ${JK}/*.la ${JK}/*.slo rm -rf .libs
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache2.0 build-unix.sh
hgomez 01/05/14 02:25:23 Added: jk/src/native/apache2.0 build-unix.sh Log: build file Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache2.0/build-unix.sh Index: build-unix.sh === #!/bin/sh # $Id: build-unix.sh,v 1.1 2001/05/14 09:25:22 hgomez Exp $ # build.sh for mod_jk.so # Usage: build-unix.sh # Sets a bunch of variables and calls APXS to build mod_jk # on Unix. An alternative to the makefiles, hopefully more portable. # Configure by changing the following variables: # JAVA_HOME is required, but it should be set in the environment, not here #JAVA_HOME=/usr/local/jdk1.2 # Where your apache lives if [ -z "$APACHE_HOME" ] then echo APACHE_HOME=/usr/local/apache APACHE_HOME=/usr/local/apache fi # name of subdir under JAVA_HOME/jre/lib ARCH=i386 CFLAGS="-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT -pthread -DLINUX -Wall" APXS=$APACHE_HOME/bin/apxs # Find JAVA_HOME if [ -z "$JAVA_HOME" ] then echo "Please set JAVA_HOME" exit 1 fi # Figure out INCLUDE directories # use "find" to pick the right include directories for current machine JAVA_INCLUDE="`find ${JAVA_HOME}/include -type d -printf \"-I %p \"`" || echo "find failed, edit build-unix.sh source to fix" # if "find" fails, use (uncomment) the following instead, substituting your # platform for "linux" # JAVA_INCLUDE="-I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux" 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 echo Installing mod_jk.so into $APACHE_HOME/libexec cp mod_jk.so $APACHE_HOME/libexec # Done! echo "Done. Install by running ./install-unix.sh"
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache2.0 install-unix.sh
hgomez 01/05/14 02:25:42 Added: jk/src/native/apache2.0 install-unix.sh Log: install file Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache2.0/install-unix.sh Index: install-unix.sh === #!/bin/sh # $Id: install-unix.sh,v 1.1 2001/05/14 09:25:40 hgomez Exp $ # install.sh for mod_jk.so # copies built mod_jk.so into apache/libexec dir # Usage: install-unix.sh # Sets a bunch of variables and calls APXS to install mod_jk # on Unix. An alternative to the makefiles, hopefully more portable. # Find APACHE_HOME if [ -z "$APACHE_HOME" ] then # Where your apache lives APACHE_HOME=/usr/local/apache fi # Copy mod_jk.so into the apache libexec directory echo Installing mod_jk.so into $APACHE_HOME/libexec cp mod_jk.so $APACHE_HOME/libexec # Done! echo Done. Add the following line to $APACHE_HOME/conf/httpd.conf: echo " " Include TOMCAT_HOME/conf/mod_jk.conf-auto echo '(replace "TOMCAT_HOME" with the actual directory name)'
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache2.0 mod_jk.c
hgomez 01/05/14 02:26:07 Added: jk/src/native/apache2.0 mod_jk.c Log: apache 2.0 module Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache2.0/mod_jk.c Index: mod_jk.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor <[EMAIL PROTECTED]> * *Henri Gomez <[EMAIL PROTECTED]> * * Version: $ $* ***/ /* * mod_jk: keeps all servlet/jakarta related ramblings together. */ #include "ap_config.h" #include "httpd.h" #include "http_config.h" #include "http_request.h" #include "http_core.h" #include "http_protocol.h" #include "http_main.h" #include "http_log.h" #include "util_script.h" #include "util_date.h" #include "apr_strings.h" /* * Jakarta (jk_) include files */ #include "jk_global.h" #include "jk_util.h" #include "jk_map.h" #include "jk_pool.h" #include "jk_service.h" #include "jk_worker.h" #include "jk_uri_worker_map.h" #define JK_WORKER_ID("jakarta.worker") #define JK_HANDLER ("jakarta-servlet") #define JK_MAGIC_TYPE ("application/x-jakarta-servlet") #define NULL_FOR_EMPTY(x) ((x && !strlen(x)) ? NULL : x) /* module MODULE_VAR_EXPORT jk_module; */ AP_DECLARE_DATA module jk_module; typedef struct { char *log_file; int log_level; jk_logger_t *log; char *worker_file; int mountcopy; jk_map_t *uri_to_context; jk_uri_worker_map_t *uw_m
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache2.0 mod_jk.dsp
hgomez 01/05/14 02:26:34 Added: jk/src/native/apache2.0 mod_jk.dsp Log: MSVC build file Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache2.0/mod_jk.dsp Index: mod_jk.dsp === # Microsoft Developer Studio Project File - Name="apache" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=apache - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "mod_jk.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "mod_jk.mak" CFG="apache - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "apache - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "apache - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "apache - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHE_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "../common" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "$(APACHE2_HOME)\src\include" /I "$(APACHE2_HOME)\src\lib\apr\include" /I "$(APACHE2_HOME)\src\os\win32" /D "_WIN32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "WIN32_LEAN_AND_MEAN" /D "_MBCS" /D "_USRDLL" /D "SHARED_MODULE" /FD /c # SUBTRACT CPP /Fr /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 ApacheCore.lib aprlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /libpath:"$(APACHE2_HOME)\src\lib\apr\Release" /libpath:"$(APACHE2_HOME)\src\CoreR" !ELSEIF "$(CFG)" == "apache - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "APACHE_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "../common" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "$(APACHE2_HOME)\src\include" /I "$(APACHE2_HOME)\src\lib\apr\include" /I "$(APACHE2_HOME)\src\os\win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHARED_MODULE" /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.li
cvs commit: jakarta-tomcat-connectors/jk/src/native/common - New directory
hgomez 01/05/14 02:27:08 jakarta-tomcat-connectors/jk/src/native/common - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_ajp12_worker.c jk_ajp12_worker.h
hgomez 01/05/14 02:32:21 Added: jk/src/native/common jk_ajp12_worker.c jk_ajp12_worker.h Log: ajp12 stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_ajp12_worker.c Index: jk_ajp12_worker.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: ajpv1.2 worker, used to call local or remote jserv hosts * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Based on:jserv_ajpv12.c from Jserv * * Version: $Revision: 1.1 $ * ***/ #include "jk_ajp12_worker.h" #include "jk_pool.h" #include "jk_connect.h" #include "jk_util.h" #include "jk_sockbuf.h" #define AJP_DEF_HOST("localhost") #define AJP_DEF_PORT(8007) #define READ_BUF_SIZE (8*1024) #define DEF_RETRY_ATTEMPTS (1) struct ajp12_worker { struct sockaddr_in worker_inet_addr; unsigned connect_retry_attempts; char *name; jk_worker_t worker; }; typedef struct ajp12_worker ajp12_worker_t; struct ajp12_endpoint { ajp12_worker_t *worker; int sd; jk_sockbuf_t sb; jk_endpoint_t endpoint; }; typedef struct ajp12_endpoint ajp12_endpoint_t; static int ajpv12_mark(ajp12_endpoint_t *p, unsigned char type); static int ajpv12_sendstring(ajp12_endpoint_t *p, const char *buffer); static int ajpv12_sendint(ajp12_endpoint_t *p, int d); static int ajpv12_sendnbytes(ajp12_endpoint_t *p, const void *buffer, int bufferlen); static int ajpv12_flush(ajp12_endpoint_t *p); static int ajpv12_handle_res
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_ajp13.c jk_ajp13.h
hgomez 01/05/14 02:32:51 Added: jk/src/native/common jk_ajp13.c jk_ajp13.h Log: ajp13 protocol stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_ajp13.c Index: jk_ajp13.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Experimental bi-directionl protocol handler. * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_global.h" #include "jk_util.h" #include "jk_ajp13.h" /* * Conditional request attributes * */ #define SC_A_CONTEXT(unsigned char)1 #define SC_A_SERVLET_PATH (unsigned char)2 #define SC_A_REMOTE_USER(unsigned char)3 #define SC_A_AUTH_TYPE (unsigned char)4 #define SC_A_QUERY_STRING (unsigned char)5 #define SC_A_JVM_ROUTE (unsigned char)6 #define SC_A_SSL_CERT (unsigned char)7 #define SC_A_SSL_CIPHER (unsigned char)8 #define SC_A_SSL_SESSION(unsigned char)9 #define SC_A_REQ_ATTRIBUTE (unsigned char)10 #define SC_A_ARE_DONE (unsigned char)0xFF /* * Request methods, coded as numbers instead of strings. * The list of methods was taken from Section 5.1.1 of RFC 2616, * RFC 2518, and the ACL IETF draft. * Method= "OPTIONS" *| "GET" *| "HEAD" *| "POST" *| "PUT" *| "DELETE" *| "TRACE" *| "PROPFIND" *| "PROPPATCH" *| "MKCOL" *
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_ajp13_worker.c jk_ajp13_worker.h
hgomez 01/05/14 02:33:13 Added: jk/src/native/common jk_ajp13_worker.c jk_ajp13_worker.h Log: ajp13 worker stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_ajp13_worker.c Index: jk_ajp13_worker.c === /* * Copyright (c) 1997-2001 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Bi-directional protocol. * * Author: Henri Gomez <[EMAIL PROTECTED]> * * Author: Costin <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_pool.h" #include "jk_connect.h" #include "jk_util.h" #include "jk_msg_buff.h" #include "jk_ajp13.h" #include "jk_mt.h" #define AJP_DEF_HOST("localhost") #define AJP_DEF_PORT(8008) #define READ_BUF_SIZE (8*1024) #define DEF_RETRY_ATTEMPTS (1) #define DEF_CACHE_SZ(1) #define JK_INTERNAL_ERROR (-2) #define MAX_SEND_BODY_SZ(DEF_BUFFER_SZ - 6) #define AJP13_HEADER_LEN (4) #define AJP13_HEADER_SZ_LEN (2) struct ajp13_operation; typedef struct ajp13_operation ajp13_operation_t; struct ajp13_endpoint; typedef struct ajp13_endpoint ajp13_endpoint_t; struct ajp13_worker { struct sockaddr_in worker_inet_addr; /* Contains host and port */ unsigned connect_retry_attempts; char *name; /* * Open connections cache... * * 1. Critical section object to protect the cache. * 2. Cache size. * 3. An array of "open" endpoints. */ JK_CRIT_SEC cs; unsigned ep_cache_sz; ajp13_endpoint_t **ep_cache; jk_work
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_connect.c jk_connect.h
hgomez 01/05/14 02:34:12 Added: jk/src/native/common jk_connect.c jk_connect.h Log: network stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_connect.c Index: jk_connect.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Socket/Naming manipulation functions * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Based on:Various Jserv files* * Version: $Revision: 1.1 $ * ***/ #include "jk_connect.h" #include "jk_util.h" int jk_resolve(char *host, short port, struct sockaddr_in *rc) { int x; u_long laddr; rc->sin_port = htons((short)port); rc->sin_family = AF_INET; /* Check if we only have digits in the string */ for(x = 0 ; '\0' != host[x] ; x++) { if(!isdigit(host[x]) && host[x] != '.') { break; } } if(host[x] != '\0') { /* If we found also characters we use gethostbyname()*/ struct hostent *hoste = gethostbyname(host); if(!hoste) { return JK_FALSE; } laddr = ((struct in_addr *)hoste->h_addr_list[0])->s_addr; } else { /* If we found only digits we use inet_addr() */ laddr = inet_addr(host); } memcpy(&(rc->sin_addr), &laddr , sizeof(laddr)); return JK_TRUE; } int jk_open_socket(struct sockaddr_in *addr, int ndelay, jk_logger_t *l) { int sock; jk_log(l, JK_LOG_DEBUG, "Into jk_open_socket\n"); sock = socket(AF_INET, SOCK_STREAM, 0); if(sock &g
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_global.h
hgomez 01/05/14 02:34:30 Added: jk/src/native/common jk_global.h Log: general defines Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_global.h Index: jk_global.h === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Global definitions and include files that should exist * * anywhere * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #ifndef JK_GLOBAL_H #define JK_GLOBAL_H #include #include #include #include #include #include #include #include #include #ifdef WIN32 #include #include #else #include #include #include #include #ifndef NETWARE #include #include #include #include #ifndef HPUX11 #include #endif #endif #include #include #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #define JK_WORKER_FILE_TAG ("worker_file") #define JK_MOUNT_FILE_TAG ("worker_mount_file") #define JK_LOG_LEVEL_TAG("log_level") #define JK_LOG_FILE_TAG ("log_file") #define JK_WORKER_NAME_TAG ("worker") #define JK_WORKER_FILE_DEF ("workers.properties") #define JK_LOG_LEVEL_DEF("emerg") #define JK_TRUE (1) #define JK_FALSE (0) #define JK_LF (10) #define JK_CR (13) #define JK_SESSION_IDENTIFIER "JSESSIONID" #define JK_PATH_SESSION_IDENTIFIER ";jsessionid" #if defined(WIN32) || defined(NETWARE) #define JK_METHOD __stdcall #define C_LEVEL_TRY_START
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_jni_worker.c jk_jni_worker.h
hgomez 01/05/14 02:34:49 Added: jk/src/native/common jk_jni_worker.c jk_jni_worker.h Log: jni worker stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_jni_worker.c Index: jk_jni_worker.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: In process JNI worker * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Based on: * * Version: $Revision: 1.1 $ * ***/ #if !defined(WIN32) && !defined(NETWARE) #include #endif #include #include "jk_pool.h" #include "jk_jni_worker.h" #include "jk_util.h" #if defined LINUX && defined APACHE2_SIGHACK #include #include #include #endif #ifdef NETWARE #include #include #endif #ifndef JNI_VERSION_1_1 #define JNI_VERSION_1_1 0x00010001 #endif #define null_check(e) if ((e) == 0) return JK_FALSE jint (JNICALL *jni_get_default_java_vm_init_args)(void *) = NULL; jint (JNICALL *jni_create_java_vm)(JavaVM **, JNIEnv **, void *) = NULL; #define JAVA_BRIDGE_CLASS_NAME ("org/apache/tomcat/service/JNIEndpoint") static jk_worker_t *the_singleton_jni_worker = NULL; struct jni_worker { int was_verified; int was_initialized; jk_pool_t p; jk_pool_atom_t buf[TINY_POOL_SIZE]; /* * JVM Object pointer. */ JavaVM *jvm; /* * [V] JNIEnv used for boostraping from validate -> init w/o an attach */ JNIEnv*tmp_env; /* * Web Server to Java bridge, instance and class. */ jobject jk_java_bridge_object; jclass jk_java_bridge_class;
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_lb_worker.c jk_lb_worker.h
hgomez 01/05/14 02:35:16 Added: jk/src/native/common jk_lb_worker.c jk_lb_worker.h Log: load-balancing worker Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_lb_worker.c Index: jk_lb_worker.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Load balancer worker, knows how to load balance among * * several workers. * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Based on: * * Version: $Revision: 1.1 $ * ***/ #include "jk_pool.h" #include "jk_service.h" #include "jk_util.h" #include "jk_worker.h" #include "jk_lb_worker.h" /* * The load balancing code in this */ /* * Time to wait before retry... */ #define WAIT_BEFORE_RECOVER (60*1) #define ADDITINAL_WAIT_LOAD (20) struct worker_record { char*name; double lb_factor; double lb_value; int in_error_state; int in_recovering; time_t error_time; jk_worker_t *w; }; typedef struct worker_record worker_record_t; struct lb_worker { worker_record_t *lb_workers; unsigned num_of_workers; jk_pool_t p; jk_pool_atom_t buf[TINY_POOL_SIZE]; char *name; jk_worker_t worker; }; typedef struct lb_worker lb_worker_t; struct lb_endpoint { jk_endpoint_t *e; lb_worker_t *worker; jk_endpoint_t endpoint; }; typedef struct lb_endpoint lb_endpoint_t; /* = */ /* Retrieve the parameter with the given name*/ static char *get_path_param(jk_w
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_logger.h
hgomez 01/05/14 02:35:35 Added: jk/src/native/common jk_logger.h Log: log defines Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_logger.h Index: jk_logger.h === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Logger object definitions * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #ifndef JK_LOGGER_H #define JK_LOGGER_H #include "jk_global.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct jk_logger jk_logger_t; struct jk_logger { void *logger_private; int level; int (JK_METHOD *log)(jk_logger_t *l, int level, const char *what); }; #define JK_LOG_DEBUG_LEVEL 0 #define JK_LOG_INFO_LEVEL 1 #define JK_LOG_ERROR_LEVEL 2 #define JK_LOG_EMERG_LEVEL 3 #define JK_LOG_DEBUG_VERB "debug" #define JK_LOG_INFO_VERB"info" #define JK_LOG_ERROR_VERB "error" #define JK_LOG_EMERG_VERB "emerg" #define JK_LOG_DEBUG __FILE__,__LINE__,JK_LOG_DEBUG_LEVEL #define JK_LOG_INFO __FILE__,__LINE__,JK_LOG_INFO_LEVEL #define JK_LOG_ERROR __FILE__,__LINE__,JK_LOG_ERROR_LEVEL #define JK_LOG_EMERG __FILE__,__LINE__,JK_LOG_EMERG_LEVEL #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* JK_LOGGER_H */
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_map.c jk_map.h
hgomez 01/05/14 02:35:55 Added: jk/src/native/common jk_map.c jk_map.h Log: mapping stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_map.c Index: jk_map.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: General purpose map object * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_global.h" #include "jk_map.h" #include "jk_pool.h" #include "jk_map.h" #include "jk_util.h" #define CAPACITY_INC_SIZE (50) #define LENGTH_OF_LINE(1024) struct jk_map { jk_pool_t p; jk_pool_atom_t buf[SMALL_POOL_SIZE]; char **names; void **values; unsigned capacity; unsigned size; }; static void trim_prp_comment(char *prp); static int trim(char *s); static int map_realloc(jk_map_t *m); static char *update_env_variables(char *value, jk_map_t *m); int map_alloc(jk_map_t **m) { if(m) { return map_open(*m = (jk_map_t *)malloc(sizeof(jk_map_t))); } return JK_FALSE; } int map_free(jk_map_t **m) { int rc = JK_FALSE; if(m && *m) { map_close(*m); free(*m); *m = NULL; } return rc; } int map_open(jk_map_t *m) { int rc = JK_FALSE; if(m) { jk_open_pool(&m->p, m->buf, sizeof(jk_pool_atom_t) * SMALL_POOL_SIZE); m->capacity = 0; m->size = 0; m->names= NULL; m->values = NULL; rc = JK_TRUE; } return rc; } int map_close(jk_map_t *m) { int rc = JK_FALSE; if(m) { jk_close_pool(&
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_msg_buff.c jk_msg_buff.h
hgomez 01/05/14 02:36:21 Added: jk/src/native/common jk_msg_buff.c jk_msg_buff.h Log: buffers stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_msg_buff.c Index: jk_msg_buff.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Data marshaling. XDR like * * Author: Costin <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Author: Henri Gomez <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_pool.h" #include "jk_connect.h" #include "jk_util.h" #include "jk_sockbuf.h" #include "jk_msg_buff.h" #include "jk_logger.h" struct jk_msg_buf { jk_pool_t *pool; unsigned char *buf; int pos; int len; int maxlen; }; /* * Simple marshaling code. */ /* XXX what's above this line can go to .h XXX */ void jk_b_dump(jk_msg_buf_t *msg, char *err) { int i=0; printf("%s %d/%d/%d %x %x %x %x - %x %x %x %x - %x %x %x %x - %x %x %x %x\n", err, msg->pos, msg->len, msg->maxlen, msg->buf[i++],msg->buf[i++],msg->buf[i++],msg->buf[i++], msg->buf[i++],msg->buf[i++],msg->buf[i++],msg->buf[i++], msg->buf[i++],msg->buf[i++],msg->buf[i++],msg->buf[i++], msg->buf[i++],msg->buf[i++],msg->buf[i++],msg->buf[i++]); i = msg->pos - 4; if(i < 0) { i=0; } printf("%x %x %x %x - %x %x %x %x --- %x %x %x %x - %x %x %x %x\n", msg->buf[i++]
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_mt.h
hgomez 01/05/14 02:37:08 Added: jk/src/native/common jk_mt.h Log: Multi threading defines (compatibility) Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_mt.h Index: jk_mt.h === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Multi thread portability code for JK * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $* ***/ #ifndef _JK_MT_H #define _JK_MT_H #include "jk_global.h" /* * All WIN32 code is MT, UNIX code that uses pthreads is marked by the POSIX * _REENTRANT define. */ #if defined (WIN32) || defined(_REENTRANT) /* * Marks execution under MT compilation */ #define _MT_CODE #ifdef WIN32 #include typedef CRITICAL_SECTION JK_CRIT_SEC; #define JK_INIT_CS(x, rc) InitializeCriticalSection(x); rc = JK_TRUE; #define JK_DELETE_CS(x, rc) DeleteCriticalSection(x); rc = JK_TRUE; #define JK_ENTER_CS(x, rc) EnterCriticalSection(x); rc = JK_TRUE; #define JK_LEAVE_CS(x, rc) LeaveCriticalSection(x); rc = JK_TRUE; #else /* Unix pthreads */ #include typedef pthread_mutex_t JK_CRIT_SEC; #define JK_INIT_CS(x, rc)\ if(pthread_mutex_init(x, NULL)) rc = JK_FALSE; else rc = JK_TRUE; #define JK_DELETE_CS(x, rc)\ if(pthread_mutex_lock(x)) rc = JK_FALSE; else rc = JK_TRUE; #define JK_ENTER_CS(x, rc)\ if(pthread_mutex_unlock(x)) rc = JK_FALSE; else rc = JK_TRUE; #define JK_LEAVE_CS(x, rc)\ if(pthread_mutex_destroy(x)) rc = JK_FALSE; else rc = JK_TRUE; #endif /* Unix pthreads */ #else /* Not an MT code */
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_nwmain.c
hgomez 01/05/14 02:37:46 Added: jk/src/native/common jk_nwmain.c Log: netware wrapper Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_nwmain.c Index: jk_nwmain.c === #ifdef NETWARE /* * NATIVE_MAIN */ /* * INCLUDES */ #include #include #include NETDB_DEFINE_CONTEXT /* * main () * * Main entry point -- don't do much more than I've provided * * Entry: * * Exit: *Nothing */ void main () { ExitThread (TSR_THREAD, 0); } #endif
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_pool.c jk_pool.h
hgomez 01/05/14 02:40:12 Added: jk/src/native/common jk_pool.c jk_pool.h Log: memory pool stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_pool.c Index: jk_pool.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Simple memory pool * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_pool.h" static void *jk_pool_dyn_alloc(jk_pool_t *p, size_t size); void jk_open_pool(jk_pool_t *p, jk_pool_atom_t *buf, unsigned size) { p->pos = 0; p->size = size; p->buf = (char *)buf; p->dyn_pos = 0; p->dynamic = NULL; p->dyn_size = 0; } void jk_close_pool(jk_pool_t *p) { if(p) { jk_reset_pool(p); if(p->dynamic) { free(p->dynamic); } } } void jk_reset_pool(jk_pool_t *p) { if(p && p->dyn_pos && p->dynamic) { unsigned i; for(i = 0 ; i < p->dyn_pos ; i++) { if(p->dynamic[i]) { free(p->dynamic[i]); } } } p->dyn_pos = 0; p->pos = 0; } void *jk_pool_alloc(jk_pool_t *p, size_t size) { void *rc = NULL; if(p && size > 0) { /* Round size to the upper mult of 8. */ size -= 1; size /= 8; size = (size + 1) * 8; if((p->size - p->pos) >= size) { rc = &(p->buf[p->pos]); p->pos += size; } else { rc = jk_pool_dyn_alloc(p, size)
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_service.h
hgomez 01/05/14 02:40:56 Added: jk/src/native/common jk_service.h Log: service (worker) defines Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_service.h Index: jk_service.h === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Definitions of the objects used during the service step. * * These are the web server (ws) the worker and the connection* * JVM connection point * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Dan Milstein <[EMAIL PROTECTED]> * Version: $Revision: 1.1 $ * ***/ #ifndef JK_SERVICE_H #define JK_SERVICE_H #include "jk_map.h" #include "jk_global.h" #include "jk_logger.h" #include "jk_pool.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ struct jk_ws_service; struct jk_endpoint; struct jk_worker; typedef struct jk_ws_service jk_ws_service_t; typedef struct jk_endpoint jk_endpoint_t; typedef struct jk_worker jk_worker_t; /* * The web server service 'class'. An instance of this class is created * for each request which is forwarded from the web server to the servlet * container. Contains the basic information about the request * (e.g. protocol, req_uri, etc), and also contains a series of methods * which provide access to core web server functionality (start_response, * read, write). This class might be more accurately called ws_request. * * As with all the core jk classes, this is essentially an abstract base * class which is implemented/extended by classes which are specific to a * particular web server. By using an abstract base class in this manner, * workers can be wr
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_sockbuf.c jk_sockbuf.h
hgomez 01/05/14 02:41:32 Added: jk/src/native/common jk_sockbuf.c jk_sockbuf.h Log: network IO stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_sockbuf.c Index: jk_sockbuf.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Simple buffer object to handle buffered socket IO * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_global.h" #include "jk_sockbuf.h" static int fill_buffer(jk_sockbuf_t *sb); int jk_sb_open(jk_sockbuf_t *sb, int sd) { if(sb && sd > 0) { sb->end = 0; sb->start = 0; sb->sd= sd; return JK_TRUE; } return JK_FALSE; } int jk_sb_write(jk_sockbuf_t *sb, const void *buf, unsigned sz) { if(sb && buf && sz) { if((SOCKBUF_SIZE - sb->end) >= sz) { memcpy(sb->buf + sb->end, buf, sz); sb->end += sz; } else { if(!jk_sb_flush(sb)) { return JK_FALSE; } if(sz > SOCKBUF_SIZE) { return (send(sb->sd, buf, sz, 0) == (int)sz); } memcpy(sb->buf + sb->end, buf, sz); sb->end += sz; } return JK_TRUE; } return JK_FALSE; } int jk_sb_flush(jk_sockbuf_t *sb) { if(sb) { int save_out = sb->end; sb->end = sb->start = 0; if(save_out) { return send(sb->sd, sb->buf, save_out, 0) == save_out; } return JK_TRUE; } return JK_FALSE;
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_uri_worker_map.c jk_uri_worker_map.h
hgomez 01/05/14 02:41:57 Added: jk/src/native/common jk_uri_worker_map.c jk_uri_worker_map.h Log: uri mapping stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_uri_worker_map.c Index: jk_uri_worker_map.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: URI to worker map object. * * Maps can be * * * * Exact Context -> /exact/uri=worker e.g. /examples/do*=ajp12 * * Context Based -> /context/*=worker e.g. /examples/*=ajp12 * * Context and suffix ->/context/*.suffix=worker e.g. /examples/*.jsp=ajp12* * * * This lets us either partition the work among the web server and the * * servlet container. * * * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_pool.h" #include "jk_util.h" #include "jk_uri_worker_map.h" #define MATCH_TYPE_EXACT(0) #define MATCH_TYPE_CONTEXT (1) #define MATCH_TYPE_SUFFIX (2) struct uri_worker_record { /* Original uri for logging */ char *uri; /* Name of worker mapped */ char *worker_name; /* Suffix of uri */ char *suffix; /* Base context */ char *context; /* char length of the context */ unsigned ctxt_len; int match_type; }; typedef struct uri_worker_record uri_worker_record_t; struct jk_uri_worker_map {
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_util.c jk_util.h
hgomez 01/05/14 02:42:25 Added: jk/src/native/common jk_util.c jk_util.h Log: utilities Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_util.c Index: jk_util.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Utility functions (mainly configuration) * * Author: Henri Gomez <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_util.h" #include "jk_ajp12_worker.h" #define SYSPROPS_OF_WORKER ("sysprops") #define STDERR_OF_WORKER("stderr") #define STDOUT_OF_WORKER("stdout") #define MX_OF_WORKER("mx") #define MS_OF_WORKER("ms") #define CP_OF_WORKER("class_path") #define JVM_OF_WORKER ("jvm_lib") #define LIBPATH_OF_WORKER ("ld_path") #define CMD_LINE_OF_WORKER ("cmd_line") #define NATIVE_LIB_OF_WORKER("native_lib") #define PREFIX_OF_WORKER("worker") #define HOST_OF_WORKER ("host") #define PORT_OF_WORKER ("port") #define TYPE_OF_WORKER ("type") #define CACHE_OF_WORKER ("cachesize") #define LOAD_FACTOR_OF_WORKER ("lbfactor") #define BALANCED_WORKERS("balanced_workers") #define WORKER_AJP12("ajp12") #define DEFAULT_WORKER_TYPE JK_AJP12_WORKER_NAME #define DEFAULT_WORKER JK_AJP12_WORKER_NAME #define WORKER_LIST_PROPERTY_NAME ("worker.list&
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_worker.c jk_worker.h jk_worker_list.h
hgomez 01/05/14 02:44:45 Added: jk/src/native/common jk_worker.c jk_worker.h jk_worker_list.h Log: workers stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/common/jk_worker.c Index: jk_worker.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Workers controller * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #define _PLACE_WORKER_LIST_HERE #include "jk_worker_list.h" #include "jk_worker.h" #include "jk_util.h" static void close_workers(void); static worker_factory get_factory_for(char *type); static int build_worker_map(jk_map_t *init_data, char **worker_list, unsigned num_of_workers, jk_logger_t *l); int wc_open(jk_map_t *init_data, jk_logger_t *l) { char **worker_list = NULL; unsigned num_of_workers = 0; jk_log(l, JK_LOG_DEBUG, "Into wc_open\n"); if(!map_alloc(&worker_map)) { return JK_FALSE; } if(!jk_get_worker_list(init_data, &worker_list, &num_of_workers)) { return JK_FALSE; } if(!build_worker_map(init_data, worker_list, num_of_workers, l)) { close_workers(); return JK_FALSE; } jk_log(l, JK_LOG_DEBUG, "wc_open, done\n"); return JK_TRUE; } void wc_close(jk_logger_t *l) { jk_log(l, JK_LOG_DEBUG, "Into wc_close\n"); close_workers(); jk_l
cvs commit: jakarta-tomcat-connectors/jk/src/native/iis - New directory
hgomez 01/05/14 02:46:26 jakarta-tomcat-connectors/jk/src/native/iis - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native/iis isapi.def isapi.dsp isapi.dsw
hgomez 01/05/14 02:47:30 Added: jk/src/native/iis isapi.def isapi.dsp isapi.dsw Log: IIS build files Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/iis/isapi.def Index: isapi.def === LIBRARY"isapi_redirect" EXPORTS HttpFilterProc GetFilterVersion GetExtensionVersion HttpExtensionProc TerminateFilter TerminateExtension 1.1 jakarta-tomcat-connectors/jk/src/native/iis/isapi.dsp Index: isapi.dsp === # Microsoft Developer Studio Project File - Name="isapi" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=isapi - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "isapi.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "isapi.mak" CFG="isapi - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "isapi - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "isapi - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "isapi - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "isapi___Win32_Release" # PROP BASE Intermediate_Dir "isapi___Win32_Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "isapi_release" # PROP Intermediate_Dir "isapi_release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ISAPI_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\common" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ISAPI_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 wsock32.lib advapi32.lib /nologo /dll /machine:I386 /out:"isapi_release/isapi_redirect.dll" !ELSEIF "$(CFG)" == "isapi - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "isapi___Win32_Debug" # PROP BASE Intermediate_Dir "isapi___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "isapi_debug" # PROP Intermediate_Dir "isapi_debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ISAPI_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\common" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ISAPI_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I38
cvs commit: jakarta-tomcat-connectors/jk/src/native/iis jk_isapi_plugin.c
hgomez 01/05/14 02:47:58 Added: jk/src/native/iis jk_isapi_plugin.c Log: jk iis module Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: ISAPI plugin for IIS/PWS * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include #include #include #include "jk_global.h" #include "jk_util.h" #include "jk_map.h" #include "jk_pool.h" #include "jk_service.h" #include "jk_worker.h" #include "jk_ajp12_worker.h" #include "jk_uri_worker_map.h" #define VERSION_STRING "Jakarta/ISAPI/1.0b1" /* * We use special two headers to pass values from the filter to the * extension. These values are: * * 1. The real URI before redirection took place * 2. The name of the worker to be used. * */ #define URI_HEADER_NAME ("TOMCATURI:") #define WORKER_HEADER_NAME ("TOMCATWORKER:") #define HTTP_URI_HEADER_NAME ("HTTP_TOMCATURI") #define HTTP_WORKER_HEADER_NAME ("HTTP_TOMCATWORKER") #define REGISTRY_LOCATION ("Software\\Apache Software Foundation\\Jakarta Isapi Redirector\\1.0") #define EXTENSION_URI_TAG ("extension_uri") #define GET_SERVER_VARIABLE_VALUE(name, place) {\ (place) = NULL; \ huge_buf_sz = sizeof(huge_buf); \ if(get_server_value(private_data->lpEcb,\ (name), \ huge_buf, \
cvs commit: jakarta-tomcat-connectors/jk/src/native/jni - New directory
hgomez 01/05/14 02:48:29 jakarta-tomcat-connectors/jk/src/native/jni - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native/nt_service - New directory
hgomez 01/05/14 02:48:33 jakarta-tomcat-connectors/jk/src/native/nt_service - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native/netscape - New directory
hgomez 01/05/14 02:48:31 jakarta-tomcat-connectors/jk/src/native/netscape - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native/jni Makefile.nw Makefile.solaris
hgomez 01/05/14 02:49:38 Added: jk/src/native/jni Makefile.nw Makefile.solaris Log: makefiles Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/jni/Makefile.nw Index: Makefile.nw === .SILENT: NLM_NAME=jni_conn JDKPATH=k:\jdk\jdk-1_2_2 NOVELLNDK=r:\nwsdk METROWERKSPATH=k:\mw\5.3 CC=$(METROWERKSPATH)\bin\mwccnlm LINK=$(METROWERKSPATH)\bin\mwldnlm JK_OBJS=\ jk_map.obj \ jk_pool.obj \ jk_util.obj \ jk_jnicb.obj \ jk_nwmain.obj \ all: $(NLM_NAME).nlm $(NLM_NAME).nlm: $(JK_OBJS) link.opt @echo Linking $@ @$(LINK) @link.opt %.obj: %.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt %.obj: ../common/%.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt cc.opt: Makefile.nw -@del cc.opt 2> NUL @echo Generating $@ @echo -nosyspath -ext obj -c -align 1 -w nocmdline -bool on >> $@ ifdef DEBUG @echo -g >> $@ endif @echo -I$(NOVELLNDK)\include\nlm >> $@ @echo -I$(NOVELLNDK)\include >> $@ @echo -I. >> $@ @echo -I..\common >> $@ @echo -I$(METROWERKSPATH)\include >> $@ @echo -I$(JDKPATH)\include >> $@ @echo -I$(JDKPATH)\include\netware >> $@ @echo -DN_PLAT_NLM >> $@ @echo -DNETWARE >> $@ @echo -DXP_NETWARE >> $@ link.opt: Makefile.nw -@del link.opt 2> NUL -@del link.def 2> NUL @echo -warnings off >> $@ @echo -zerobss >> $@ @echo -desc "JNI Natives for Tomcat" >> $@ @echo -o $(NLM_NAME).nlm >> $@ @echo -screenname "System Console" >> $@ @echo -nlmversion 0,1,0 >> $@ ifdef DEBUG @echo -g >> $@ @echo -sym internal >> $@ @echo -sym codeview4 >> $@ @echo -osym $(NLM_NAME).sym >> $@ endif @echo -nodefaults >> $@ @echo -map $(NLM_NAME).map >> $@ @echo -threadname "JK_JNI Thread" >> $@ @echo -stacksize 64000 >> $@ @echo $(METROWERKSPATH)\lib\nwpre.obj $(strip $(JK_OBJS)) >> $@ @echo -commandfile link.def >> $@ @echo module nsapi >> link.def @echo Import @$(NOVELLNDK)\imports\clib.imp >> link.def @echo Import @$(NOVELLNDK)\imports\lib0.imp >> link.def @echo Import @$(NOVELLNDK)\imports\nlmlib.imp >> link.def @echo Import @$(NOVELLNDK)\imports\threads.imp >> link.def @echo Import @$(NOVELLNDK)\imports\socklib.imp >> link.def @echo Export @jk_jnicb.exp >> link.def clean: -@del *.obj 2> NUL -@del *.map 2> NUL -@del link.* 2> NUL -@del cc.opt 2> NUL -@del *.nlm 2> NUL -@del *.sym 2> NUL 1.1 jakarta-tomcat-connectors/jk/src/native/jni/Makefile.solaris Index: Makefile.solaris === # Defines for example NSAPI programs running under SOLARIS CC_CMD=gcc -DSOLARIS -D_REENTRANT LD_SHAREDCMD=ld -G all: prepare: OS_TYPE=solaris INCLUDEDIR=../common JAVA_INCLUDE=$(JAVA_HOME)/include JK_OBJS = ../common/jk_map.o ../common/jk_util.o ../common/jk_pool.o jk_jnicb.o INCLUDE_FLAGS=-I$(INCLUDEDIR) -I$(JAVA_INCLUDE) -I$(JAVA_INCLUDE)/$(OS_TYPE) COMMON_DEFS=-Wall all: jni_connect.so jni_connect.so: $(JK_OBJS) $(MAKE) prepare $(LD_SHAREDCMD) $(JK_OBJS) -o jni_connect.so $(EXTRA_LDDEFINES) .c.o: $(CC_CMD) $(COMMON_DEFS) $(INCLUDE_FLAGS) -c $< clean: rm $(JK_OBJS)
cvs commit: jakarta-tomcat-connectors/jk/src/native/jni jk_jnicb.c jk_jnicb.exp jk_jnicb.h
hgomez 01/05/14 02:50:03 Added: jk/src/native/jni jk_jnicb.c jk_jnicb.exp jk_jnicb.h Log: jk jni Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/jni/jk_jnicb.c Index: jk_jnicb.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: JNI callbacks implementation for the JNI in process adapter* * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_jnicb.h" #include "jk_service.h" #include "jk_util.h" #include "jk_pool.h" /* * Class: org_apache_tomcat_service_connector_JNIConnectionHandler * Method:getNumberOfHeaders * Signature: (JJ)I */ JNIEXPORT jint JNICALL Java_org_apache_tomcat_service_connector_JNIConnectionHandler_getNumberOfHeaders (JNIEnv *env, jobject o, jlong s, jlong l) { /* [V] Convert indirectly from jlong -> int -> pointer to shut up gcc */ /* I hope it's okay on other compilers and/or machines... */ jk_ws_service_t *ps = (jk_ws_service_t *)(int)s; jk_logger_t *pl = (jk_logger_t *)(int)l; jk_log(pl, JK_LOG_DEBUG, "Into JNIConnectionHandler::getNumberOfHeaders\n"); if(!ps) { jk_log(pl, JK_LOG_ERROR, "In JNIConnectionHandler::getNumberOfHeaders, NULL ws service object\n"); /* [V] JNIConnectionHandler doesn't handle this */ return -1; } jk_log(pl, JK_LOG_DEBUG, "Done JNIConnectionHandler::getNumberOfHeaders, found %d headers\n", ps->num_headers); return (jint)ps->num_headers; } /* * Class: org_apache_tomcat_service_connector_JNIConnectionHandler * Method:read * Signature: (JJ[BII)I */ JNIEXPORT jint JNICALL
cvs commit: jakarta-tomcat-connectors/jk/src/native/jni jni_connect.dsp jni_connect.dsw
hgomez 01/05/14 02:50:45 Added: jk/src/native/jni jni_connect.dsp jni_connect.dsw Log: jni MSVC stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/jni/jni_connect.dsp Index: jni_connect.dsp === # Microsoft Developer Studio Project File - Name="jni_connect" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=jni_connect - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "jni_connect.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "jni_connect.mak" CFG="jni_connect - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "jni_connect - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "jni_connect - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "jni_connect - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "release" # PROP Intermediate_Dir "release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JNI_CONNECT_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "..\common" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JNI_CONNECT_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 !ELSEIF "$(CFG)" == "jni_connect - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "debug" # PROP Intermediate_Dir "debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JNI_CONNECT_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /I "..\jk" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JNI_CONNECT_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "jni_connect - Win32 Release" # Name "jni_conne
cvs commit: jakarta-tomcat-connectors/jk/src/native/netscape Makefile.nw Makefile.solaris
hgomez 01/05/14 02:51:47 Added: jk/src/native/netscape Makefile.nw Makefile.solaris Log: makefiles Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/netscape/Makefile.nw Index: Makefile.nw === .SILENT: NLM_NAME=nsapi_rd JDKPATH=k:\jdk\jdk-1_2_2 NOVELLNDK=r:\nwsdk NSSDK=r:\netscape METROWERKSPATH=k:\mw\5.3 CC=$(METROWERKSPATH)\bin\mwccnlm LINK=$(METROWERKSPATH)\bin\mwldnlm JK_OBJS=\ jk_ajp12_worker.obj \ jk_ajp13_worker.obj \ jk_ajp13.obj \ jk_connect.obj \ jk_jni_worker.obj \ jk_lb_worker.obj \ jk_map.obj \ jk_msg_buff.obj \ jk_nsapi_plugin.obj \ jk_pool.obj \ jk_sockbuf.obj \ jk_uri_worker_map.obj \ jk_util.obj \ jk_worker.obj \ jk_nwmain.obj \ all: $(NLM_NAME).nlm $(NLM_NAME).nlm: $(JK_OBJS) link.opt @echo Linking $@ @$(LINK) @link.opt %.obj: %.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt %.obj: ../common/%.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt cc.opt: Makefile.nw -@del cc.opt 2> NUL @echo Generating $@ @echo -nosyspath -ext obj -c -align 1 -w nocmdline -bool on >> $@ ifdef DEBUG @echo -g >> $@ endif @echo -I$(NOVELLNDK)\include\nlm >> $@ @echo -I$(NOVELLNDK)\include >> $@ @echo -I$(NSSDK)\include >> $@ @echo -I. >> $@ @echo -I..\common >> $@ @echo -I$(METROWERKSPATH)\include >> $@ @echo -I$(JDKPATH)\include >> $@ @echo -I$(JDKPATH)\include\netware >> $@ @echo -DN_PLAT_NLM >> $@ @echo -DNETWARE >> $@ @echo -DXP_NETWARE >> $@ link.opt: Makefile.nw -@del link.opt 2> NUL -@del link.def 2> NUL @echo -warnings off >> $@ @echo -zerobss >> $@ @echo -desc "Netscape Plugin for Tomcat" >> $@ @echo -o $(NLM_NAME).nlm >> $@ @echo -screenname "System Console" >> $@ @echo -nlmversion 0,1,0 >> $@ ifdef DEBUG @echo -g >> $@ @echo -sym internal >> $@ @echo -sym codeview4 >> $@ @echo -osym $(NLM_NAME).sym >> $@ endif @echo -nodefaults >> $@ @echo -map $(NLM_NAME).map >> $@ @echo -threadname "NSTomcat Thread" >> $@ @echo -stacksize 64000 >> $@ @echo $(METROWERKSPATH)\lib\nwpre.obj $(strip $(JK_OBJS)) >> $@ @echo -commandfile link.def >> $@ @echo module nsapi >> link.def @echo Import @$(NOVELLNDK)\imports\clib.imp >> link.def @echo Import @$(NOVELLNDK)\imports\lib0.imp >> link.def @echo Import @$(NOVELLNDK)\imports\nlmlib.imp >> link.def @echo Import @$(NOVELLNDK)\imports\threads.imp >> link.def @echo Import @$(NOVELLNDK)\imports\socklib.imp >> link.def @echo Import @$(NSSDK)\imports\nsapi.imp >> link.def @echo Export jk_init, jk_service >> link.def clean: -@del *.obj 2> NUL -@del *.map 2> NUL -@del link.* 2> NUL -@del cc.opt 2> NUL -@del *.nlm 2> NUL -@del *.sym 2> NUL 1.1 jakarta-tomcat-connectors/jk/src/native/netscape/Makefile.solaris Index: Makefile.solaris === # Defines for example NSAPI programs running under SOLARIS CC_CMD=gcc -DNET_SSL -DSOLARIS -D_REENTRANT LD_SHAREDCMD=ld -G all: prepare: OS_TYPE=solaris INCLUDEDIR=$(SUITSPOT_HOME)/include JAVA_INCLUDE=$(JAVA_HOME)/include JK_OBJS = jk_ajp12_worker.o jk_lb_worker.o jk_sockbuf.o jk_connect.o jk_map.o \ jk_uri_worker_map.o jk_nsapi_plugin.o jk_util.o jk_jni_worker.o \ jk_pool.o jk_worker.o INCLUDE_FLAGS=-I$(INCLUDEDIR) -I$(INCLUDEDIR)/base -I$(INCLUDEDIR)/frame -I$(JAVA_INCLUDE) -I$(JAVA_INCLUDE)/$(OS_TYPE) COMMON_DEFS=-DMCC_HTTPD -DXP_UNIX -DSPAPI20 -DSOLARIS -Wall all: nsapi_redirector.so nsapi_redirector.so: $(JK_OBJS) $(MAKE) prepare $(LD_SHAREDCMD) $(JK_OBJS) -o nsapi_redirector.so $(EXTRA_LDDEFINES) .c.o: $(CC_CMD) $(COMMON_DEFS) $(INCLUDE_FLAGS) -c $< clean: rm $(JK_OBJS)
cvs commit: jakarta-tomcat-connectors/jk/src/native/netscape jk_nsapi_plugin.c
hgomez 01/05/14 02:52:10 Added: jk/src/native/netscape jk_nsapi_plugin.c Log: jk module for Netscape/IPlanet Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/netscape/jk_nsapi_plugin.c Index: jk_nsapi_plugin.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: NSAPI plugin for Netscape servers * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_global.h" #include "jk_util.h" #include "jk_map.h" #include "jk_pool.h" #include "jk_service.h" #include "jk_worker.h" #include "jk_ajp12_worker.h" #include "nsapi.h" #define URI_PATTERN "path" struct nsapi_private_data { jk_pool_t p; int request_started; pblock *pb; Session *sn; Request *rq; }; typedef struct nsapi_private_data nsapi_private_data_t; static int init_on_other_thread_is_done = JK_FALSE; static int init_on_other_thread_is_ok = JK_FALSE; static jk_logger_t *logger = NULL; static int JK_METHOD start_response(jk_ws_service_t *s, int status, const char *reason, const char * const *header_names, const char * const *header_values, unsigned num_of_headers); static int JK_METHOD ws_read(jk_ws_service_t *s, void *b, unsigned l, unsigned *a); static int JK_METHOD ws_write(jk_ws_service_t *s, const void *b,
cvs commit: jakarta-tomcat-connectors/jk/src/native/netscape nsapi.dsp nsapi.dsw
hgomez 01/05/14 02:52:36 Added: jk/src/native/netscape nsapi.dsp nsapi.dsw Log: netscape MSVC build stuff Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/netscape/nsapi.dsp Index: nsapi.dsp === # Microsoft Developer Studio Project File - Name="nsapi" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=nsapi - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "nsapi.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "nsapi.mak" CFG="nsapi - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "nsapi - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "nsapi - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "nsapi - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "nsapi_release" # PROP Intermediate_Dir "nsapi_release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NSAPI_EXPORTS" /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\common" /I "$(NS_HOME)\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NSAPI_EXPORTS" /D "XP_WIN32" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 wsock32.lib ns-httpd36.lib /nologo /dll /machine:I386 /out:"nsapi_release/nsapi_redirect.dll" /libpath:"$(NS_HOME)\lib" !ELSEIF "$(CFG)" == "nsapi - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "nsapi___Win32_Debug" # PROP BASE Intermediate_Dir "nsapi___Win32_Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "nsapi_debug" # PROP Intermediate_Dir "nsapi_debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NSAPI_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\common" /I "$(NS_HOME)\include" /I "$(JAVA_HOME)\include" /I "$(JAVA_HOME)\include\win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "NSAPI_EXPORTS" /D "XP_WIN32" /D "MCC_HTTPD" /D "SPAPI20" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 wsock32.lib ns-httpd36.lib /nologo /dll /debug /machine:I386 /out:"nsapi_debug/nsapi_redirect.dll" /pdbtype:sept /libpath:"$(NS_HOME)\lib" !ENDIF # Begin Targ
cvs commit: jakarta-tomcat-connectors/jk/src/native/nt_service jk_nt_service.c nt_service.dsp
hgomez 01/05/14 02:53:45 Added: jk/src/native/nt_service jk_nt_service.c nt_service.dsp Log: nt service and build file Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/nt_service/jk_nt_service.c Index: jk_nt_service.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: NT System service for Jakarta/Tomcat * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Version: $Revision: 1.1 $ * ***/ #include "jk_global.h" #include "jk_util.h" #include "jk_ajp13.h" #include "jk_connect.h" #include #include #include #include #define AJP12_TAG ("ajp12") #define AJP13_TAG ("ajp13") #define BASE_REGISTRY_LOCATION ("SYSTEM\\CurrentControlSet\\Services\\") #define IMAGE_NAME ("ImagePath") #define PARAMS_LOCATION("Parameters") #define PRP_LOCATION ("PropertyFile") // internal variables static SERVICE_STATUS ssStatus; // current status of the service static SERVICE_STATUS_HANDLE sshStatusHandle; static DWORD dwErr = 0; static charszErr[1024] = ""; static HANDLE hServerStopEvent = NULL; static int shutdown_port; static char*shutdown_protocol = AJP12_TAG; struct jk_tomcat_startup_data { char *classpath; char *tomcat_home; char *stdout_file; char *stderr_file; char *java_bin; char *tomcat_class; char *server_file; char *cmd_line; int shutdown_port; char *shutdown_protocol; char *extra_path; }; typedef struct jk_tomcat_startup_data jk_tomcat_startup_data
cvs commit: jakarta-tomcat build.xml
hgomez 01/05/15 02:49:37 Modified:.build.xml Log: Correct build file Revision ChangesPath 1.128 +1 -0 jakarta-tomcat/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-tomcat/build.xml,v retrieving revision 1.127 retrieving revision 1.128 diff -u -r1.127 -r1.128 --- build.xml 2001/05/10 12:19:39 1.127 +++ build.xml 2001/05/15 09:49:35 1.128 @@ -423,6 +423,7 @@ +
cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/facade HttpServletRequestFacade.java
hgomez 01/05/15 02:50:38 Modified:src/facade22/org/apache/tomcat/facade HttpServletRequestFacade.java Log: Fix the getRemoteHost() bugs for both ajp12/ajp13 Revision ChangesPath 1.23 +14 -1 jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpServletRequestFacade.java Index: HttpServletRequestFacade.java === RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpServletRequestFacade.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- HttpServletRequestFacade.java 2001/04/28 18:39:11 1.22 +++ HttpServletRequestFacade.java 2001/05/15 09:50:37 1.23 @@ -346,7 +346,20 @@ } public String getRemoteHost() { -return request.remoteHost().toString(); + String remoteHost = request.remoteHost().toString(); + +// AJP12 defaults to empty string, AJP13 defaults to null +if(remoteHost != null && remoteHost.length() != 0) +return remoteHost; + +try{ +remoteHost = InetAddress.getByName(request.remoteAddr().toString()).getHostName(); +}catch(Exception e){ +// If anything went wrong then fall back to using the remote hosts IP address +remoteHost = request.remoteAddr().toString(); +} + +return remoteHost; } public String getRequestURI() {
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache-1.3 - New directory
hgomez 01/05/15 02:54:56 jakarta-tomcat-connectors/jk/src/native/apache-1.3 - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache-2.0 - New directory
hgomez 01/05/15 02:55:05 jakarta-tomcat-connectors/jk/src/native/apache-2.0 - New directory
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache-2.0 mod_jk.c mod_jk.dsp
hgomez 01/05/15 02:57:40 Added: jk/src/native/apache-2.0 mod_jk.c mod_jk.dsp Log: move to apache-2.0 Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache-2.0/mod_jk.c Index: mod_jk.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor <[EMAIL PROTECTED]> * *Henri Gomez <[EMAIL PROTECTED]> * * Version: $ $* ***/ /* * mod_jk: keeps all servlet/jakarta related ramblings together. */ #include "ap_config.h" #include "httpd.h" #include "http_config.h" #include "http_request.h" #include "http_core.h" #include "http_protocol.h" #include "http_main.h" #include "http_log.h" #include "util_script.h" #include "util_date.h" #include "apr_strings.h" /* * Jakarta (jk_) include files */ #include "jk_global.h" #include "jk_util.h" #include "jk_map.h" #include "jk_pool.h" #include "jk_service.h" #include "jk_worker.h" #include "jk_uri_worker_map.h" #define JK_WORKER_ID("jakarta.worker") #define JK_HANDLER ("jakarta-servlet") #define JK_MAGIC_TYPE ("application/x-jakarta-servlet") #define NULL_FOR_EMPTY(x) ((x && !strlen(x)) ? NULL : x) /* module MODULE_VAR_EXPORT jk_module; */ AP_DECLARE_DATA module jk_module; typedef struct { char *log_file; int log_level; jk_logger_t *log; char *worker_file; int mountcopy; jk_map_t *uri_to_context; jk_uri_w
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache-2.0 Makefile.linux build-unix.sh install-unix.sh
hgomez 01/05/15 02:57:58 Added: jk/src/native/apache-2.0 Makefile.linux build-unix.sh install-unix.sh Log: move to apache-2.0 Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache-2.0/Makefile.linux Index: Makefile.linux === ## You need to edit this file - configure later :-) ## I assume this one is set up already # JAVA_HOME= OS=linux 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 # # I've built a RPM, named apache2 (ftp://ftp.falsehope.com/home/gomez/apache2/), # which postfix all apache2 stuff with 2, ie apxs = apxs2. # It will allow to have both apache 1.3 and 2.0 the same time on the system # #ifndef APXS APXS=/usr/sbin/apxs2 #endif JK=../common SRCS=${JK}/jk_ajp12_worker.c ${JK}/jk_connect.c ${JK}/jk_msg_buff.c ${JK}/jk_util.c ${JK}/jk_ajp13.c \ ${JK}/jk_jni_worker.c ${JK}/jk_pool.c ${JK}/jk_worker.c ${JK}/jk_ajp13_worker.c ${JK}/jk_lb_worker.c \ ${JK}/jk_sockbuf.c ${JK}/jk_map.c ${JK}/jk_uri_worker_map.c LSRCS=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 all: mod_jk.so mod_jk.so: $(APXS) -I ${JK} ${JAVA_INCL} -c -o mod_jk.la mod_jk.c $(SRCS) mv .libs/mod_jk.so . clean: rm -f *.o *.so *.lo *.la *.slo ${JK}/*.o ${JK}/*.so ${JK}/*.lo ${JK}/*.la ${JK}/*.slo rm -rf .libs 1.1 jakarta-tomcat-connectors/jk/src/native/apache-2.0/build-unix.sh Index: build-unix.sh === #!/bin/sh # $Id: build-unix.sh,v 1.1 2001/05/15 09:57:56 hgomez Exp $ # build.sh for mod_jk.so # Usage: build-unix.sh # Sets a bunch of variables and calls APXS to build mod_jk # on Unix. An alternative to the makefiles, hopefully more portable. # Configure by changing the following variables: # JAVA_HOME is required, but it should be set in the environment, not here #JAVA_HOME=/usr/local/jdk1.2 # Where your apache lives if [ -z "$APACHE_HOME" ] then echo APACHE_HOME=/usr/local/apache APACHE_HOME=/usr/local/apache fi # name of subdir under JAVA_HOME/jre/lib ARCH=i386 CFLAGS="-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT -pthread -DLINUX -Wall" APXS=$APACHE_HOME/bin/apxs # Find JAVA_HOME if [ -z "$JAVA_HOME" ] then echo "Please set JAVA_HOME" exit 1 fi # Figure out INCLUDE directories # use "find" to pick the right include directories for current machine JAVA_INCLUDE="`find ${JAVA_HOME}/include -type d -printf \"-I %p \"`" || echo "find failed, edit build-unix.sh source to fix" # if "find" fails, use (uncomment) the following instead, substituting your # platform for "linux" # JAVA_INCLUDE="-I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/linux" 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 echo Installing mod_jk.so into $APACHE_HOME/libexec cp mod_jk.so $APACHE_HOME/libexec # Done! echo "Done. Install by running ./install-unix.sh" 1.1 jakarta-tomcat-connectors/jk/src/native/apache-2.0/install-unix.sh Index: install-unix.sh === #!/bin/sh # $Id: install-unix.sh,v 1.1 2001/05/15 09:57:56 hgomez Exp $ # install.sh for mod_jk.so # copies built mod_jk.so into apache/libexec dir # Usage: install-unix.sh # Sets a bunch of variables and calls APXS to install mod_jk # on Unix. An alternative to the makefiles, hopefully more portable. # Find APACHE_HOME if [ -z "$APACHE_HOME" ] then # Where your apache lives APACHE_HOME=/usr/local/apache fi # Copy mod_jk.so into the apache libexec directory echo Installing mod_jk.so into $APACHE_HOME/libexec cp mod_jk.so $APACHE_HOME/libexec # Done! echo Done. Add the following line to $APACHE_HOME/conf/httpd.conf: echo " " Include TOMCAT_HOME/conf/mod_jk.conf-auto echo '(replace "TOMCAT_HOME" with the actual directory name)'
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache-1.3 Makefile.freebsd Makefile.linux Makefile.nw
hgomez 01/05/15 02:59:57 Added: jk/src/native/apache-1.3 Makefile.freebsd Makefile.linux Makefile.nw Log: move to apache-1.3 Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache-1.3/Makefile.freebsd Index: Makefile.freebsd === ## You need to edit this file - configure later :-) APACHE_HOME=/usr/local/apache OS=freebsd APXS=${APACHE_HOME}/bin/apxs A13_FLAGS=-I${APACHE_HOME}/include ## I assume this one is set up already # JAVA_HOME= 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 CFLAGS=-DHAVE_CONFIG_H -g -fpic -DSHARED_MODULE -O2 -D_REENTRANT -pthread -DLINUX -Wall JK=../common/ 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 OBJS=${patsubst %.c,%.o,${SRCS}} %.o: ../common/%.c ${CC} -c ${CFLAGS} ${JAVA_INCL} ${A13_FLAGS} $< -o $@ .c.o: ${APXS} -c ${JAVA_INCL} -DFREEBSD ${A13_FLAGS} -I../common $< all: mod_jk.so mod_jk.so: ${OBJS} mod_jk.o $(APXS) -c -o mod_jk.so ${OBJS} mod_jk.o # $(CC) -shared -o mod_jk.so ${OBJS} mod_jk.o clean: rm *.o *.so 1.1 jakarta-tomcat-connectors/jk/src/native/apache-1.3/Makefile.linux Index: Makefile.linux === ## You need to edit this file - configure later :-) ## I assume this one is set up already # JAVA_HOME= OS=linux 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 #ifndef APXS APXS=/usr/sbin/apxs #endif JK=../common/ SRCS=${JK}/jk_ajp12_worker.c ${JK}/jk_connect.c ${JK}/jk_msg_buff.c ${JK}/jk_util.c ${JK}/jk_ajp13.c \ ${JK}/jk_jni_worker.c ${JK}/jk_pool.c ${JK}/jk_worker.c ${JK}/jk_ajp13_worker.c ${JK}/jk_lb_worker.c \ ${JK}/jk_sockbuf.c ${JK}/jk_map.c ${JK}/jk_uri_worker_map.c all: mod_jk.so mod_jk.so: $(APXS) -I ${JK} ${JAVA_INCL} -c -o $@ mod_jk.c $(SRCS) clean: rm *.o *.so 1.1 jakarta-tomcat-connectors/jk/src/native/apache-1.3/Makefile.nw Index: Makefile.nw === .SILENT: NLM_NAME=mod_jk JDKPATH=k:\jdk\jdk-1_2_2 NOVELLNDK=r:\nwsdk APACHE_HOME=d:\apache_1.3.12\src WINSOCK_INCDIR=k:\ws295sdk\include METROWERKSPATH=k:\mw\5.3 CC=$(METROWERKSPATH)\bin\mwccnlm LINK=$(METROWERKSPATH)\bin\mwldnlm JK_OBJS=\ jk_ajp12_worker.obj \ jk_ajp13.obj \ jk_ajp13_worker.obj \ jk_connect.obj \ jk_jni_worker.obj \ jk_lb_worker.obj \ jk_map.obj \ jk_msg_buff.obj \ jk_pool.obj \ jk_sockbuf.obj \ jk_uri_worker_map.obj \ jk_util.obj \ jk_worker.obj \ mod_jk.obj \ jk_nwmain.obj \ all: $(NLM_NAME).nlm $(NLM_NAME).nlm: $(JK_OBJS) link.opt @echo Linking $@ @$(LINK) @link.opt %.obj: %.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt %.obj: ../common/%.c cc.opt @echo Compiling $< @$(CC) $< -o=$(@F) @cc.opt cc.opt: Makefile.nw -@del cc.opt 2> NUL @echo Generating $@ @echo -nosyspath -ext obj -c -align 1 -w nocmdline -bool on >> $@ ifdef DEBUG @echo -g >> $@ endif @echo -I$(NOVELLNDK)\include\nlm >> $@ @echo -I$(NOVELLNDK)\include >> $@ @echo -I. >> $@ @echo -I..\common >> $@ @echo -I$(METROWERKSPATH)\include >> $@ @echo -I$(JDKPATH)\include >> $@ @echo -I$(JDKPATH)\include\netware >> $@ @echo -I$(APACHE_HOME)\include >> $@ @echo -I$(APACHE_HOME)\os\netware >> $@ @echo -I$(WINSOCK_INCDIR) >> $@ @echo -DN_PLAT_NLM >> $@ @echo -DNETWARE >> $@ @echo -DXP_NETWARE >> $@ link.opt: Makefile.nw -@del link.opt 2> NUL -@del link.def 2> NUL @echo -warnings off >> $@ @echo -zerobss >> $@ @echo -desc "Apache 1.3 Plugin for Tomcat" >> $@ @echo -o $(NLM_NAME).nlm >> $@ @echo -screenname "System Console" >> $@ @echo -nlmversion 0,1,0 >> $@ ifdef DEBUG @echo -g >> $@ @echo -sym internal >> $@ @echo -sym codeview4 >> $@ @ech
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache-1.3 README.hpux README.solaris
hgomez 01/05/15 03:00:10 Added: jk/src/native/apache-1.3 README.hpux README.solaris Log: move to apache-1.3 Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache-1.3/README.hpux Index: README.hpux === mod_jk README for HP-UX 11 Mike Braden March 05, 2001 This README explains how to build mod_jk on HP-UX 11 systems. There are two build scripts for HP-UX: build-hpux.sh Use if you have the GNU gcc compiler build-hpux-cc.sh Use if you have the HP ANSI C compiler The first package is for use with the gcc compiler. It produces 32-bit code that should run on both PA1.1 and PA2.0 based architectures. The second script is for use with the HP add-on ANSI C Complier package. This will not work with the stripped down cc version that ships with HP-UX. That compiler is just for kernel rebuilds. If you do not have the HP ANSI C compiler package, then obtain gcc and use the first script. PREREQUISITES This script requires that GCC 2.95.2 be installed and in your path. You should also have the GNU binutils installed. You can obtain the binary depot files for these at: http://gatekeep.cs.utah.edu/ Before running the build script, verify that APACHE_HOME and JAVA_HOME are set correct in the script. BUILDING MOD_JK The build script should be run as root as follows: # sh build-hpux.sh After the script completes you will need to modify the Tomcat server.xml file to tell it to generate the auto configuration for mod_jk. To do this, edit $TOMCAT_HOME/conf/server.xml and add the following after The next time you startup Tomcat, it will generate TOMCAT_HOME/conf/jk/mod_jk.conf-auto with the necessary commands to use Tomcat through Apache. Tomcat will automatically add any webapps that it finds in its webapps directory. See the Tomcat Users Guide and Release Notes for more information. TROUBLESHOOTING If you experience problems using the build script, make sure that your apache installation matches your system. Apache's apxs is a perl script that is configured when you compile apache for your system. If you are using a binary install of apache, it will most likely not be configured correctly for your system. NOTE: Most apxs errors are due to the use of an Apache binary installation. BUILD AND INSTALL APACHE FROM SOURCE. IT'S NOT THAT HARD! The best solution is to build apache from source as follows: Download apache from http://httpd.apache.org Put the source file in /usr/local/src # cd /usr/local/src # gzip -dc apache_1.3.17.tar.gz|tar xvf - # cd apache_1.3.17 # ./configure --prefix=/usr/local/apache --enable-module=most / --enable-shared=max # make # make install This will build apache and install it into the /usr/local/apache directory. Note: In order to build mod_jk for HPUX11 using GCC, support for JNI was removed. This should not affect Apache 1.3 installations since it is not recommended to run mod_jk in In-Process mode under Apache 1.3. If you wish to include support for JNI, you must build mod_jk with the HP ANSI Compiler using 64-bit mode. The second build script listed at the top of this document will work. 1.1 jakarta-tomcat-connectors/jk/src/native/apache-1.3/README.solaris Index: README.solaris === mod_jk README for Solaris Mike Braden March 05, 2001 This README explains how to build mod_jk on Sun Solaris systems. build-solaris.sh Use with the GNU gcc compiler This script works with the GNU gcc compiler. This script works on both SPARC and x86 architecture systems. PREREQUISITES This script requires that GCC 2.95.2 be installed and in your path. You can obtain a gcc binary package from: http://www.sunfreeware.com/ Before running the build script, verify that APACHE_HOME and JAVA_HOME are set correct in the script. BUILDING MOD_JK The build script should be run as root as follows: # sh build-solaris.sh After the script completes you will need to modify the Tomcat server.xml file to tell it to generate the auto configuration for mod_jk. To do this, edit $TOMCAT_HOME/conf/server.xml and add the following after The next time you startup Tomcat, it will generate TOMCAT_HOME/conf/jk/mod_jk.conf-auto with the necessary commands to use Tomcat through Apache. Tomcat will automatically add any webapps that it finds in its webapps directory. See the Tomcat Users Guide and Release Notes for more information. TROUBLESHOOTING If you experience problems using the build script, make sure that you
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache-1.3 build-hpux-cc.sh build-hpux.sh build-solaris.sh build-unix.sh
hgomez 01/05/15 03:00:30 Added: jk/src/native/apache-1.3 build-hpux-cc.sh build-hpux.sh build-solaris.sh build-unix.sh Log: move to apache-1.3 Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache-1.3/build-hpux-cc.sh Index: build-hpux-cc.sh === #!/bin/sh # build-hpux.sh for mod_jk.so # # Usage: # sh build-hpux.sh # for hpux 11 using gcc # Note: See README-hpux for details. This builds mod_jk without JNI support. # # Mike Braden # Update the following according to your installation APACHE_HOME=/usr/local/apache JAVA_HOME=/opt/java1.3 End of configuration - do not change below if [ -f $APACHE_HOME/bin/apxs ] ; then APXS=$APACHE_HOME/bin/apxs else echo Error: Unable to locate apxs. echo Verify that APACHE_HOME is set correctly in this script. exit 1 fi if [ ! -d $JAVA_HOME/include/hp-ux ] ; then echo Error: Unable to locate Java libraries. echo Verify that JAVA_HOME is set correctly in this script. exit 1 fi JAVA_INCLUDE="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/hp-ux" INCLUDE="-I../common $JAVA_INCLUDE" #SRC="../common/jk_ajp12_worker.c ../common/jk_ajp13.c ../common/jk_ajp13_worker.c ../common/jk_connect.c ../common/jk_lb_worker.c ../common/jk_map.c ../common/jk_msg_buff.c ../common/jk_nwmain.c ../common/jk_pool.c ../common/jk_sockbuf.c ../common/jk_uri_worker_map.c ../common/jk_util.c ../common/jk_worker.c mod_jk.c" SRC="../common/*.c mod_jk.c" # Run APXS to compile the mod_jk module and its components echo Building mod_jk $APXS -o mod_jk.so $INCLUDE -c $SRC # Check to see if the last command completed if [ $? -ne 0 ] ; then echo Error with apxs exit 1 fi echo mod_jk build complete. # # Clean up # rm jk_*.o rm mod_jk.o echo Configuring apache... # Use apxs to add the correct lines to httpd.conf # Since our auto-config does this in the include # file (mod_jk-conf-auto), we'll add them as # commented statements for change later if # we decide not to use the auto-conf. # #$APXS -i -a mod_jk.so $APXS -i -A mod_jk.so # Check to see if the last command completed if [ $? -ne 0 ] ; then echo Error using apxs to add configuration to httpd.conf exit 1 fi # Steps to complete install cat< module in the server.xml file: Apache configs: " Example (TOMCAT_HOME/conf/serverl.xml): For more information, see the mod_jk-howto located in the docs dir of TOMCAT. (doc/mod_jk-howto.html) END 1.1 jakarta-tomcat-connectors/jk/src/native/apache-1.3/build-hpux.sh Index: build-hpux.sh === #!/bin/sh # build-hpux.sh for mod_jk.so # # Usage: # sh build-hpux.sh # for hpux 11 using gcc # Note: See README-hpux for details. This builds mod_jk without JNI support. # # Mike Braden # Update the following according to your installation APACHE_HOME=/usr/local/apache JAVA_HOME=/opt/java1.3 End of configuration - do not change below if [ -f $APACHE_HOME/bin/apxs ] ; then APXS=$APACHE_HOME/bin/apxs else echo Error: Unable to locate apxs. echo Verify that APACHE_HOME is set correctly in this script. exit 1 fi if [ ! -d $JAVA_HOME/include/hp-ux ] ; then echo Error: Unable to locate Java libraries. echo Verify that JAVA_HOME is set correctly in this script. exit 1 fi JAVA_INCLUDE="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/hp-ux" INCLUDE="-I../common $JAVA_INCLUDE" SRC="../common/jk_ajp12_worker.c ../common/jk_ajp13.c ../common/jk_ajp13_worker.c ../common/jk_connect.c ../common/jk_lb_worker.c ../common/jk_map.c ../common/jk_msg_buff.c ../common/jk_nwmain.c ../common/jk_pool.c ../common/jk_sockbuf.c ../common/jk_uri_worker_map.c ../common/jk_util.c ../common/jk_worker.c mod_jk.c" # Run APXS to compile the mod_jk module and its components echo Building mod_jk $APXS -DHPUX11GCC -o mod_jk.so $INCLUDE -c $SRC # Check to see if the last command completed if [ $? -ne 0 ] ; then echo Error with apxs exit 1 fi echo mod_jk build complete. # # Clean up # rm jk_*.o rm mod_jk.o echo Configuring apache... # Use apxs to add the correct lines to httpd.conf # Since our auto-config does this in the include # file (mod_jk-conf-auto), we'll add them as # commented statements for change later if # we decide not to use the auto-conf. # #$APXS -i -a mod_jk.so $APXS -i -A mod_jk.so # Check to see if the last command completed if [ $? -ne 0 ] ; then echo Error using apxs to add configura
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache-1.3 mod_jk.c mod_jk.dsp
hgomez 01/05/15 03:00:55 Added: jk/src/native/apache-1.3 mod_jk.c mod_jk.dsp Log: move to apache-1.3 Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/src/native/apache-1.3/mod_jk.c Index: mod_jk.c === /* * Copyright (c) 1997-1999 The Java Apache Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. All advertising materials mentioning features or use of this *software must display the following acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * 4. The names "Apache JServ", "Apache JServ Servlet Engine" and *"Java Apache Project" must not be used to endorse or promote products *derived from this software without prior written permission. * * 5. Products derived from this software may not be called "Apache JServ" *nor may "Apache" nor "Apache JServ" appear in their names without *prior written permission of the Java Apache Project. * * 6. Redistributions of any form whatsoever must retain the following *acknowledgment: *"This product includes software developed by the Java Apache *Project for use in the Apache JServ servlet engine project *<http://java.apache.org/>." * * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JAVA APACHE PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many * individuals on behalf of the Java Apache Group. For more information * on the Java Apache Project and the Apache JServ Servlet Engine project, * please see <http://java.apache.org/>. * */ /*** * Description: Apache 1.3 plugin for Jakarta/Tomcat * * See ../common/jk_service.h for general mod_jk info * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Dan Milstein <[EMAIL PROTECTED]>* * Henri Gomez <[EMAIL PROTECTED]> * * Version: $ $* ***/ /* * mod_jk: keeps all servlet/jakarta related ramblings together. */ #include "ap_config.h" #include "httpd.h" #include "http_config.h" #include "http_request.h" #include "http_core.h" #include "http_protocol.h" #include "http_main.h" #include "http_log.h" #include "util_script.h" #include "util_date.h" #include "http_conf_globals.h" /* * Jakarta (jk_) include files */ #ifdef NETWARE #define _SYS_TYPES_H_ #define _NETDB_H_INCLUDED #define _IN_ #define _INET_ #define _SYS_TIMEVAL_H_ #define _SYS_SOCKET_H_ #endif #include "jk_global.h" #include "jk_util.h" #include "jk_map.h" #include "jk_pool.h" #include "jk_service.h" #include "jk_worker.h" #include "jk_uri_worker_map.h" #define JK_WORKER_ID("jakarta.worker") #define JK_HANDLER ("jakarta-servlet") #define JK_MAGIC_TYPE ("application/x-jakarta-servlet") #define NULL_FOR_E
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache1.3 Makefile.freebsd Makefile.linux Makefile.nw README.hpux README.solaris build-hpux-cc.sh build-hpux.sh build-solaris.sh build-unix.sh mod_jk.c mod_jk.dsp
hgomez 01/05/15 03:04:22 Removed: jk/src/native/apache1.3 Makefile.freebsd Makefile.linux Makefile.nw README.hpux README.solaris build-hpux-cc.sh build-hpux.sh build-solaris.sh build-unix.sh mod_jk.c mod_jk.dsp Log: Moved from apache1.3 to apache-1.3
cvs commit: jakarta-tomcat-connectors/jk/src/native/apache2.0 Makefile.linux build-unix.sh install-unix.sh mod_jk.c mod_jk.dsp
hgomez 01/05/15 03:05:14 Removed: jk/src/native/apache2.0 Makefile.linux build-unix.sh install-unix.sh mod_jk.c mod_jk.dsp Log: moved from apache2.0 to apache-2.0
cvs commit: jakarta-tomcat-connectors/jk/src/native/common jk_msg_buff.h jk_msg_buff.c
hgomez 01/05/15 03:14:22 Modified:jk/src/native/common jk_msg_buff.h jk_msg_buff.c Log: New buf for ajp14 (long/bytes) Revision ChangesPath 1.2 +27 -9 jakarta-tomcat-connectors/jk/src/native/common/jk_msg_buff.h Index: jk_msg_buff.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/src/native/common/jk_msg_buff.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_msg_buff.h 2001/05/14 09:36:20 1.1 +++ jk_msg_buff.h 2001/05/15 10:14:16 1.2 @@ -57,7 +57,7 @@ * Description: Data marshaling. XDR like * * Author: Costin <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.1 $ * + * Version: $Revision: 1.2 $ * ***/ #ifndef JK_MSG_BUF_H @@ -152,36 +152,54 @@ /* Real encoding */ -void jk_b_set_int(jk_msg_buf_t *msg, - int pos, - unsigned short val); - int jk_b_append_byte(jk_msg_buf_t *msg, unsigned char val); +int jk_b_append_bytes(jk_msg_buf_t *msg, + const unsigned char * param, + int len); + int jk_b_append_int(jk_msg_buf_t *msg, unsigned short val); +int jk_b_append_long(jk_msg_buf_t *msg, + unsigned long val); + int jk_b_append_string(jk_msg_buf_t *msg, const char *param); /* Decoding */ -unsigned char *jk_b_get_string(jk_msg_buf_t *msg); +/** Get a byte from the current position + */ +unsigned char jk_b_get_byte(jk_msg_buf_t *msg); -/** Get an int from the current position +/** Get an int from the current position */ unsigned short jk_b_get_int(jk_msg_buf_t *msg); -unsigned char jk_b_get_byte(jk_msg_buf_t *msg); +/** Get a long from the current position + */ +unsigned long jk_b_get_long(jk_msg_buf_t *msg); +/** Get a String from the current position + */ +unsigned char *jk_b_get_string(jk_msg_buf_t *msg); + +/** Get a byte from an arbitrary position + */ +unsigned char jk_b_pget_byte(jk_msg_buf_t *msg, + int pos); + /** Get an int from an arbitrary position */ unsigned short jk_b_pget_int(jk_msg_buf_t *msg, int pos); -unsigned char jk_b_pget_byte(jk_msg_buf_t *msg, +/** Get a long from an arbitrary position + */ +unsigned long jk_b_pget_long(jk_msg_buf_t *msg, int pos); /* - Help */ 1.2 +83 -9 jakarta-tomcat-connectors/jk/src/native/common/jk_msg_buff.c Index: jk_msg_buff.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/src/native/common/jk_msg_buff.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_msg_buff.c 2001/05/14 09:36:19 1.1 +++ jk_msg_buff.c 2001/05/15 10:14:18 1.2 @@ -58,7 +58,7 @@ * Author: Costin <[EMAIL PROTECTED]> * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Author: Henri Gomez <[EMAIL PROTECTED]> * - * Version: $Revision: 1.1 $ * + * Version: $Revision: 1.2 $ * ***/ #include "jk_pool.h" @@ -112,12 +112,39 @@ msg->pos = 4; } -void jk_b_set_int(jk_msg_buf_t *msg, + +static void jk_b_set_long(jk_msg_buf_t *msg, + int pos, + unsigned long val) +{ +msg->buf[pos] = (unsigned char)((val >> 24) & 0xFF); +msg->buf[pos + 1] = (unsigned char)((val >> 16) & 0xFF); +msg->buf[pos + 2] = (unsigned char)((val >> 8) & 0xFF); +msg->buf[pos + 3] = (unsigned char)(val & 0xFF); +} + + +int jk_b_append_long(jk_msg_buf_t *msg, +unsigned long val) +{ +if(msg->len + 4 > msg->maxlen) { +return -1; +} + +jk_b_set_long(msg, msg->len, val); + +msg->len += 4; + +return 0; +} + + +static void jk_b_set_int(jk_msg_buf_t