tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk.c
Date Sun, 02 Dec 2001 02:09:45 GMT
costin      01/12/01 18:09:45

  Modified:    jk/native2/common jk_logger_file.c jk_uriMap.c
               jk/native2/include jk_logger.h
               jk/native2/server/apache2 mod_jk.c
  Log:
  More fixes, now it seems the startup sequence is ok.
  
  The support for urimappings.properties ( used right now only for IIS )
  is now available to all servers, and can be specified in workers.properties as well.
  
  ( next step is to have an easy way to specify and load multiple files ).
  
  Note that worker.properties settings can be replaced with JkWorker name value in
  httpd.conf ( i.e. you can do all the settings in httpd.conf, no need for a real
  worker.properties if you prefer to use a single file )
  
  Revision  Changes    Path
  1.3       +24 -18    jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c
  
  Index: jk_logger_file.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_logger_file.c	2001/12/02 01:01:42	1.2
  +++ jk_logger_file.c	2001/12/02 02:09:44	1.3
  @@ -59,7 +59,7 @@
    * Description: Utility functions (mainly configuration)                   *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
    * Author:      Henri Gomez <hgomez@slib.fr>                               *
  - * Version:     $Revision: 1.2 $                                           *
  + * Version:     $Revision: 1.3 $                                           *
    ***************************************************************************/
   
   #include "jk_util.h"
  @@ -103,20 +103,20 @@
                                 int level,
                                 const char *what)
   {
  +    FILE *f = (FILE *)l->logger_private;
  +
  +    if( f==NULL ) {
  +        /* This is usefull to debug what happens before logger is set.
  +           On apache you need -X option ( no detach, single process ) */
  +        printf("%s", what );
  +        return JK_TRUE;
  +    }
       if(l && l->level <= level && l->logger_private &&
what) {       
           unsigned sz = strlen(what);
           if(sz) {
  -            FILE *f = (FILE *)l->logger_private;
  -
  -            if( f==NULL ) {
  -                /* This is usefull to debug what happens before logger is set.
  -                   On apache you need -X option ( no detach, single process ) */
  -                printf("%s", what );
  -            } else { 
  -                fwrite(what, 1, sz, f);
  -                /* [V] Flush the dam' thing! */
  -                fflush(f);
  -            }
  +            fwrite(what, 1, sz, f);
  +            /* [V] Flush the dam' thing! */
  +            fflush(f);
           }
   
           return JK_TRUE;
  @@ -150,18 +150,24 @@
       char *file=map_getStrProp(properties,"logger","file",
                                 "name","mod_jk.log");
       int level;
  -    char *levelS=map_getIntProp(properties,"logger","file",
  +    char *levelS=map_getStrProp(properties,"logger","file",
                                   "level", "ERROR");
  -    char *logformat=map_getIntProp(properties,"logger","file",
  +    char *logformat=map_getStrProp(properties,"logger","file",
                                      "timeFormat", JK_TIME_FORMAT);
       FILE *f;
   
       _this->level = jk_logger_file_parseLogLevel(levelS);
  -
  +    if( _this->level == 0 )
  +        _this->jkLog( _this, JK_LOG_ERROR, "Level %s %d \n", levelS, _this->level
); */
  +    
  +    if( logformat==NULL ) {
  +        logformat=JK_TIME_FORMAT;
  +    }
       jk_logger_file_logFmt = logformat;
   
       f = fopen(file, "a+");
  -    if(!f) {
  +    if(f==NULL) {
  +        _this->jkLog(_this,JK_LOG_ERROR,"Can't open log file %s\n", file );
           return JK_FALSE;
       }
       _this->logger_private = f;
  @@ -193,7 +199,7 @@
           return -1;
       }
   
  -    if(l==NULL ||
  +    if(l->logger_private==NULL ||
          l->level <= level) {
   #ifdef NETWARE
   /* On NetWare, this can get called on a thread that has a limited stack so */
  @@ -267,7 +273,7 @@
   
       l->log = jk_logger_file_log;
       l->logger_private = NULL;
  -    l->open = jk_logger_file_open;
  +    l->open =jk_logger_file_open;
       l->jkLog = jk_logger_file_jkLog;
   
       *result=(void *)l;
  
  
  
  1.3       +19 -9     jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c
  
  Index: jk_uriMap.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_uriMap.c	2001/12/02 01:05:25	1.2
  +++ jk_uriMap.c	2001/12/02 02:09:44	1.3
  @@ -67,7 +67,7 @@
    * servlet container.                                                      *
    *                                                                         *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.2 $                                           *
  + * Version:     $Revision: 1.3 $                                           *
    ***************************************************************************/
   
   #include "jk_pool.h"
  @@ -188,13 +188,20 @@
       
       /* make sure we have space */
       err=uriMap_realloc(_this);
  +    if (err != JK_TRUE ) {
  +        l->jkLog(l, JK_LOG_ERROR,"Allocation error\n");
  +        return NULL;
  +    }
  +
       uwr = (jk_uriEnv_t *)jk_pool_alloc(&_this->p,
                                          sizeof(jk_uriEnv_t));
       
       uri = jk_pool_strdup(&_this->p, puri);
       worker = jk_pool_strdup(&_this->p, pworker);
   
  -    if (err || !uri || ! worker || ! uwr ) {
  +    if (uri==NULL ||
  +        worker==NULL ||
  +        uwr==NULL ) {
           l->jkLog(l, JK_LOG_ERROR,"Allocation error\n");
           return NULL;
       }
  @@ -325,13 +332,16 @@
       
       rc = JK_TRUE;
       for(i = 0; i < sz ; i++) {
  -        jk_uriEnv_t *uriEnv=_this->addMapping(_this,NULL,
  -                                              map_name_at(init_data, i),
  -                                              map_value_at(init_data, i));
  -        if ( uriEnv==NULL) {
  -            l->jkLog(l, JK_LOG_ERROR, "Parsing error %s\n",
  -                   map_name_at(init_data, i));
  -            rc=JK_FALSE;
  +        char *name=map_name_at(init_data, i);
  +        if( name!=NULL && name[0]=='/' ) {
  +            jk_uriEnv_t *uriEnv=_this->addMapping(_this,NULL,
  +                                                  name,
  +                                                  map_value_at(init_data, i));
  +            if ( uriEnv==NULL) {
  +                l->jkLog(l, JK_LOG_ERROR, "Parsing error %s\n",
  +                         map_name_at(init_data, i));
  +                rc=JK_FALSE;
  +            }
           }
       }
   
  
  
  
  1.2       +2 -2      jakarta-tomcat-connectors/jk/native2/include/jk_logger.h
  
  Index: jk_logger.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_logger.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jk_logger.h	2001/12/01 22:29:23	1.1
  +++ jk_logger.h	2001/12/02 02:09:45	1.2
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: Logger object definitions                                  *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.1 $                                           *
  + * Version:     $Revision: 1.2 $                                           *
    ***************************************************************************/
   
   #ifndef JK_LOGGER_H
  @@ -90,7 +90,7 @@
                                      const char *name,
                                      const char *def );
   
  -    void (JK_METHOD *open)( jk_logger_t *_this,
  +    int (JK_METHOD *open)( jk_logger_t *_this,
                               jk_map_t *properties );
   
       void (JK_METHOD *close)( jk_logger_t *_this );
  
  
  
  1.3       +1 -6      jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mod_jk.c	2001/12/02 01:06:52	1.2
  +++ mod_jk.c	2001/12/02 02:09:45	1.3
  @@ -60,7 +60,7 @@
    * Description: Apache 2 plugin for Jakarta/Tomcat                         *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
    *                 Henri Gomez <hgomez@slib.fr>                               *
  - * Version:     $Revision: 1.2 $                                           *
  + * Version:     $Revision: 1.3 $                                           *
    ***************************************************************************/
   
   /*
  @@ -1413,11 +1413,6 @@
       jk_logger_t *l=workerEnv->l;
       
       l->open( l, workerEnv->init_data );
  -
  -    if( err != JK_TRUE ) {
  -        l->jkLog( l, JK_LOG_ERROR,
  -                  "Can't open logger %s \n", workerEnv->log_file );
  -    }
   
       /* local initialization */
       workerEnv->virtual       = "*";     /* for now */
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message