cvs commit: jakarta-tomcat-connectors/webapp/lib wa_main.c
pier01/08/04 11:25:57 Modified:webapp/apache-1.3 mod_webapp.c webapp/lib wa_main.c Log: Fix for bug #2933. CGI scripts are now functional even when mod_webapp is running (took me 3 days to figure out WHY, darn!) Revision ChangesPath 1.22 +10 -11jakarta-tomcat-connectors/webapp/apache-1.3/mod_webapp.c Index: mod_webapp.c === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/apache-1.3/mod_webapp.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- mod_webapp.c 2001/07/25 03:30:42 1.21 +++ mod_webapp.c 2001/08/04 18:25:57 1.22 @@ -57,7 +57,7 @@ /** * @author Pier Fumagalli mailto:[EMAIL PROTECTED] - * @version $Id: mod_webapp.c,v 1.21 2001/07/25 03:30:42 pier Exp $ + * @version $Id: mod_webapp.c,v 1.22 2001/08/04 18:25:57 pier Exp $ */ #include httpd.h @@ -86,6 +86,13 @@ /* MODULE AND LIBRARY INITIALIZATION AND DESTRUCTION */ /* * */ +/* Destroy the module and the WebApp Library */ +static void wam_shutdown(server_rec *s, pool *p) {//void *nil) { +if (!wam_initialized) return; +wa_shutdown(); +wam_initialized=wa_false; +} + /* Startup the module and the WebApp Library */ static void wam_startup(server_rec *s, pool *p) { if (!wam_initialized) return; @@ -93,20 +100,12 @@ wa_startup(); } -/* Destroy the module and the WebApp Library */ -static void wam_shutdown(void *nil) { -if (!wam_initialized) return; -wa_shutdown(); -wam_initialized=wa_false; -} - /* Initialize the module and the WebApp Library */ static const char *wam_init(pool *p) { const char *ret=NULL; -if(wam_initialized) return(NULL); +if(wam_initialized==wa_true) return(NULL); if ((ret=wa_init())!=NULL) return(ret); -ap_register_cleanup(p,NULL,wam_shutdown,NULL); wam_initialized=wa_true; return(NULL); } @@ -514,6 +513,6 @@ NULL, /* [10] logger */ NULL, /* [3] header parser */ wam_startup,/* child initializer */ -NULL, /* child exit/cleanup */ +wam_shutdown, /* child exit/cleanup */ NULL/* [1] post read_request handling */ }; 1.10 +4 -1 jakarta-tomcat-connectors/webapp/lib/wa_main.c Index: wa_main.c === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/wa_main.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- wa_main.c 2001/07/19 23:50:03 1.9 +++ wa_main.c 2001/08/04 18:25:57 1.10 @@ -55,7 +55,7 @@ * * * = */ -/* @version $Id: wa_main.c,v 1.9 2001/07/19 23:50:03 pier Exp $ */ +/* @version $Id: wa_main.c,v 1.10 2001/08/04 18:25:57 pier Exp $ */ #include wa.h /* The current APR memory pool. */ @@ -74,8 +74,11 @@ const char *wa_init(void) { int x=0; +wa_debug(WA_MARK,WebApp Library initializing); + /* Check the main APR pool. */ if (wa_pool==NULL) { +wa_debug(WA_MARK,Initializing APR); if (apr_initialize()!=APR_SUCCESS) return(Cannot initialize APR); if (apr_pool_create(wa_pool,NULL)!=APR_SUCCESS)
cvs commit: jakarta-tomcat-connectors/webapp/lib wa_main.c
pier01/07/19 16:50:03 Modified:webapp/lib wa_main.c Log: Better debugging output. Revision ChangesPath 1.9 +8 -4 jakarta-tomcat-connectors/webapp/lib/wa_main.c Index: wa_main.c === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/wa_main.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- wa_main.c 2001/07/13 01:15:36 1.8 +++ wa_main.c 2001/07/19 23:50:03 1.9 @@ -55,7 +55,7 @@ * * * = */ -/* @version $Id: wa_main.c,v 1.8 2001/07/13 01:15:36 pier Exp $ */ +/* @version $Id: wa_main.c,v 1.9 2001/07/19 23:50:03 pier Exp $ */ #include wa.h /* The current APR memory pool. */ @@ -189,6 +189,9 @@ /* Dump some debugging information. */ void wa_debug(const char *f, const int l, const char *fmt, ...) { #ifdef DEBUG +char hdr[128]; +char dta[640]; +char buf[768]; apr_time_t at; char st[128]; va_list ap; @@ -196,9 +199,10 @@ at=apr_time_now(); apr_ctime(st, at); va_start(ap,fmt); -fprintf(stderr,[%s] %d (%s:%d) ,st,getpid(),f,l); -vfprintf(stderr,fmt,ap); -fprintf(stderr,\n); +apr_snprintf(hdr,128,[%s] %d (%s:%d),st,getpid(),f,l); +apr_vsnprintf(dta,640,fmt,ap); +apr_snprintf(buf,728,%s %s\n,hdr,dta); +fprintf(stderr,%s,buf); fflush(stderr); va_end(ap); #endif /* ifdef DEBUG */
cvs commit: jakarta-tomcat-connectors/webapp/lib wa_main.c
pier01/07/12 18:15:39 Modified:webapp/lib wa_main.c Log: Removed forced debugging from library (moving to configure option --enable-debug) Revision ChangesPath 1.8 +1 -5 jakarta-tomcat-connectors/webapp/lib/wa_main.c Index: wa_main.c === RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/wa_main.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- wa_main.c 2001/07/09 22:02:09 1.7 +++ wa_main.c 2001/07/13 01:15:36 1.8 @@ -55,12 +55,8 @@ * * * = */ -/* @version $Id: wa_main.c,v 1.7 2001/07/09 22:02:09 pier Exp $ */ +/* @version $Id: wa_main.c,v 1.8 2001/07/13 01:15:36 pier Exp $ */ #include wa.h - -#ifndef DEBUG -#define DEBUG -#endif /* The current APR memory pool. */ apr_pool_t *wa_pool=NULL;