You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by sh...@locus.apache.org on 2000/05/01 14:31:42 UTC
cvs commit: jakarta-tomcat/src/native/apache2.0 mod_jk.dsp mod_jk.c
shachor 00/05/01 05:31:42
Modified: src/native/apache2.0 mod_jk.c
Added: src/native/apache2.0 mod_jk.dsp
Log:
Adding a project file for Win32 and making sure that mod_jk works with
jni.
Revision Changes Path
1.3 +48 -38 jakarta-tomcat/src/native/apache2.0/mod_jk.c
Index: mod_jk.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/native/apache2.0/mod_jk.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mod_jk.c 2000/04/25 00:30:59 1.2
+++ mod_jk.c 2000/05/01 12:31:42 1.3
@@ -103,6 +103,7 @@
jk_map_t *uri_to_context;
jk_uri_worker_map_t *uw_map;
+ int was_initialized;
server_rec *s;
} jk_server_conf_t;
@@ -506,6 +507,7 @@
c->log_level = -1;
c->log = NULL;
c->mountcopy = JK_FALSE;
+ c->was_initialized = JK_FALSE;
if(!map_alloc(&(c->uri_to_context))) {
jk_error_exit(APLOG_MARK, APLOG_EMERG, s, "Memory error");
@@ -580,7 +582,7 @@
if(map_read_properties(init_map, conf->worker_file)) {
if(wc_open(init_map, conf->log)) {
return;
- }
+ }
}
}
@@ -592,39 +594,48 @@
ap_pool_t *ptemp,
server_rec *s)
{
- char *p = getenv("WAS_BORN_BY_APACHE");
- jk_map_t *init_map = NULL;
- jk_server_conf_t *conf =
- (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
-
- fprintf(stdout, "jk_post_config %s\n", p ? p : "NULL"); fflush(stdout);
-
- if(conf->log_file && conf->log_level >= 0) {
- if(!jk_open_file_logger(&(conf->log), conf->log_file, conf->log_level)) {
- conf->log = NULL;
- } else {
- main_log = conf->log;
- }
- }
+ if(!s->is_virtual) {
+ char *p = getenv("WAS_BORN_BY_APACHE");
+ jk_map_t *init_map = NULL;
+ jk_server_conf_t *conf =
+ (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
+ if(!conf->was_initialized) {
+ fprintf(stdout, "jk_post_config %s %s %d %d %s\n",
+ s->server_hostname,
+ s->server_admin,
+ s,
+ conf,
+ p ? p : "NULL"); fflush(stdout);
+
+ conf->was_initialized = JK_TRUE;
+ if(conf->log_file && conf->log_level >= 0) {
+ if(!jk_open_file_logger(&(conf->log), conf->log_file, conf->log_level)) {
+ conf->log = NULL;
+ } else {
+ main_log = conf->log;
+ }
+ }
- if(!uri_worker_map_alloc(&(conf->uw_map), conf->uri_to_context, conf->log)) {
- jk_error_exit(APLOG_MARK, APLOG_EMERG, s, "Memory error");
- }
+ if(!uri_worker_map_alloc(&(conf->uw_map), conf->uri_to_context, conf->log)) {
+ jk_error_exit(APLOG_MARK, APLOG_EMERG, s, "Memory error");
+ }
- if(map_alloc(&init_map)) {
- if(map_read_properties(init_map, conf->worker_file)) {
- if(!p) {
- putenv("WAS_BORN_BY_APACHE=true");
- return;
- } else {
- if(wc_open(init_map, conf->log)) {
- return;
- }
+ if(map_alloc(&init_map)) {
+ if(map_read_properties(init_map, conf->worker_file)) {
+ if(!p) {
+ putenv("WAS_BORN_BY_APACHE=true");
+ return;
+ } else {
+ if(wc_open(init_map, conf->log)) {
+ return;
+ }
+ }
+ }
}
+
+ jk_error_exit(APLOG_MARK, APLOG_EMERG, s, "Error while opening the workers");
}
}
-
- jk_error_exit(APLOG_MARK, APLOG_EMERG, s, "Error while opening the workers");
}
static int jk_translate(request_rec *r)
@@ -651,22 +662,22 @@
static void jk_register_hooks(void)
{
-#ifdef LINUX
- ap_hook_child_init(jk_child_init,
+#ifdef WIN32
+ ap_hook_post_config(jk_post_config,
NULL,
NULL,
- HOOK_MIDDLE);
+ AP_HOOK_MIDDLE);
#else
- ap_hook_post_config(jk_post_config,
- NULL,
- NULL,
- HOOK_MIDDLE);
+ ap_hook_child_init(jk_child_init,
+ NULL,
+ NULL,
+ AP_HOOK_MIDDLE);
#endif
ap_hook_translate_name(jk_translate,
NULL,
NULL,
- HOOK_FIRST);
+ AP_HOOK_FIRST);
}
static const handler_rec jk_handlers[] =
@@ -687,4 +698,3 @@
jk_handlers, /* handlers */
jk_register_hooks /* register hooks */
};
-
1.1 jakarta-tomcat/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 "../jk" /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 "../jk" /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.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# 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 /debug /machine:I386 /pdbtype:sept /libpath:"$(APACHE2_HOME)\src\lib\apr\Debug" /libpath:"$(APACHE2_HOME)\src\CoreD"
!ENDIF
# Begin Target
# Name "apache - Win32 Release"
# Name "apache - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\jk\jk_ajp12_worker.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_ajp23_worker.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_connect.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_jni_worker.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_lb_worker.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_map.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_msg_buff.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_pool.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_sockbuf.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_uri_worker_map.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_util.c
# End Source File
# Begin Source File
SOURCE=..\jk\jk_worker.c
# End Source File
# Begin Source File
SOURCE=.\mod_jk.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\jk\jk_ajp12_worker.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_ajp23_worker.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_connect.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_global.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_jni_worker.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_lb_worker.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_logger.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_map.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_msg_buff.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_pool.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_service.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_sockbuf.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_uri_worker_map.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_util.h
# End Source File
# Begin Source File
SOURCE=..\jk\jk_worker.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project