You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2001/12/13 19:49:01 UTC

cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_ajp14_worker.c jk_channel_socket.c jk_handler_discovery.c jk_handler_logon.c jk_handler_response.c jk_lb_worker.c jk_logger_file.c jk_uriMap.c jk_workerEnv.c

costin      01/12/13 10:49:01

  Modified:    jk/native2/common jk_ajp14_worker.c jk_channel_socket.c
                        jk_handler_discovery.c jk_handler_logon.c
                        jk_handler_response.c jk_lb_worker.c
                        jk_logger_file.c jk_uriMap.c jk_workerEnv.c
  Log:
  Cosmetic changes on messsages and code, minor fixes.
  
  Revision  Changes    Path
  1.8       +20 -20    jakarta-tomcat-connectors/jk/native2/common/jk_ajp14_worker.c
  
  Index: jk_ajp14_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_ajp14_worker.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_ajp14_worker.c	2001/12/12 23:36:01	1.7
  +++ jk_ajp14_worker.c	2001/12/13 18:49:01	1.8
  @@ -82,7 +82,7 @@
                           jk_logger_t     *l, int *is_recoverable_error);
   
   static int JK_METHOD
  -jk_worker_ajp14_validate(jk_worker_t *pThis, jk_map_t    *props,
  +jk_worker_ajp14_validate(jk_worker_t *_this, jk_map_t    *props,
                            jk_workerEnv_t *we, jk_logger_t *l );
   
   static int JK_METHOD
  @@ -97,7 +97,7 @@
                        jk_workerEnv_t *we, jk_logger_t *l);
   
   static int JK_METHOD
  -jk_worker_ajp14_destroy(jk_worker_t **pThis, jk_logger_t *l);
  +jk_worker_ajp14_destroy(jk_worker_t **_this, jk_logger_t *l);
   
   
   #define AJP_DEF_RETRY_ATTEMPTS    (2)
  @@ -123,7 +123,7 @@
           return JK_FALSE;
       }
       w->pool = pool;
  -    w->name = (char *)pool->pstrdup(pool, name);
  +    w->name = NULL;
       
       w->proto= AJP14_PROTO;
   
  @@ -140,9 +140,6 @@
   
       *result = w;
   
  -    l->jkLog(l, JK_LOG_INFO, "ajp14.factory() Created %s %s\n",
  -             w->name, name);
  -
       return JK_TRUE;
   }
   
  @@ -167,8 +164,6 @@
       secret_key = map_getStrProp( props, "worker", aw->name, "secretkey", NULL );
       
       if ((!secret_key) || (!strlen(secret_key))) {
  -        l->jkLog(l, JK_LOG_INFO,
  -               "ajp14.validate() No secretkey, use AJP13\n");
           proto=AJP13_PROTO;
           aw->proto= AJP13_PROTO;
       }
  @@ -205,7 +200,8 @@
   	return err;
       }
   
  -    l->jkLog(l, JK_LOG_INFO, "ajp14.validate() %s\n", _this->name);
  +    l->jkLog(l, JK_LOG_INFO, "ajp14.validate() %s protocol=%s\n", _this->name,
  +             ((_this->secret==NULL) ? "ajp13" : "ajp14"));
       
       return JK_TRUE;
   }
  @@ -219,11 +215,11 @@
       l->jkLog(l, JK_LOG_INFO, "endpoint.close() %s\n", ae->worker->name);
   
       ae->reuse = JK_FALSE;
  -    ae->pool->reset( ae->pool );
  -    ae->pool->close( ae->pool );
  +    ae->worker->channel->close( ae->worker->channel, ae );
       ae->cPool->reset( ae->cPool );
       ae->cPool->close( ae->cPool );
  -    ae->worker->channel->close( ae->worker->channel, ae );
  +    ae->pool->reset( ae->pool );
  +    ae->pool->close( ae->pool );
   }
   
   /** Connect a channel, implementing the logging protocol if ajp14
  @@ -442,7 +438,7 @@
       *eP = NULL;
       l->jkLog(l, JK_LOG_INFO, "ajp14.done() close endpoint %s\n",
                w->name );
  -    
  +
       return JK_TRUE;
   }
   
  @@ -548,7 +544,8 @@
   
       if (_this->secret == NULL) {
           /* No extra initialization for AJP13 */
  -        l->jkLog(l, JK_LOG_INFO, "ajp14.init() ajp13 mode %s\n",_this->name);
  +        l->jkLog(l, JK_LOG_INFO, "ajp14.init() ajp1x worker name=%s\n",
  +                 _this->name);
           return JK_TRUE;
       }
   
  @@ -580,19 +577,19 @@
   
   
   static int JK_METHOD
  -jk_worker_ajp14_destroy(jk_worker_t **pThis, jk_logger_t *l)
  +jk_worker_ajp14_destroy(jk_worker_t **_thisP, jk_logger_t *l)
   {
  -    jk_worker_t *aw = *pThis;
  +    jk_worker_t *_this = *_thisP;
       int i;
       
       l->jkLog(l, JK_LOG_DEBUG, "ajp14.destroy()\n");
   
  -    if( aw->endpointCache != NULL ) {
  +    if( _this->endpointCache != NULL ) {
           
  -        for( i=0; i< aw->endpointCache->ep_cache_sz; i++ ) {
  +        for( i=0; i< _this->endpointCache->ep_cache_sz; i++ ) {
               jk_endpoint_t *e;
               
  -            e= aw->endpointCache->get( aw->endpointCache );
  +            e= _this->endpointCache->get( _this->endpointCache );
               
               if( e==NULL ) {
                   // we finished all endpoints in the cache
  @@ -601,11 +598,14 @@
               
               jk_close_endpoint(e, l);
           }
  -        aw->endpointCache->destroy( aw->endpointCache );
  +        _this->endpointCache->destroy( _this->endpointCache );
   
           l->jkLog(l, JK_LOG_DEBUG, "ajp14.destroy() closed %d cached endpoints\n",
                    i);
       }
   
  +    _this->pool->close( _this->pool );
  +
  +    *_thisP=NULL;
       return JK_TRUE;
   }
  
  
  
  1.8       +1 -0      jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c
  
  Index: jk_channel_socket.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_socket.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_channel_socket.c	2001/12/12 23:36:01	1.7
  +++ jk_channel_socket.c	2001/12/13 18:49:01	1.8
  @@ -77,6 +77,7 @@
   #include "jk_global.h"
   
   #include <string.h>
  +#include "jk_registry.h"
   
   #ifndef WIN32
   	#define closesocket			close
  
  
  
  1.8       +2 -1      jakarta-tomcat-connectors/jk/native2/common/jk_handler_discovery.c
  
  Index: jk_handler_discovery.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_handler_discovery.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_handler_discovery.c	2001/12/12 21:34:47	1.7
  +++ jk_handler_discovery.c	2001/12/13 18:49:01	1.8
  @@ -58,7 +58,7 @@
   /**
    * Description: AJP14 Discovery handler
    * Author:      Henri Gomez <hg...@slib.fr>
  - * Version:     $Revision: 1.7 $                                          
  + * Version:     $Revision: 1.8 $                                          
    */
   
   #include "jk_global.h"
  @@ -70,6 +70,7 @@
   #include "jk_handler.h"
   #include "jk_webapp.h"
   #include "jk_workerEnv.h"
  +#include "jk_registry.h"
   
   int JK_METHOD jk_handler_discovery_factory( jk_env_t *env, jk_pool_t *pool,
                                               void **result,
  
  
  
  1.7       +2 -1      jakarta-tomcat-connectors/jk/native2/common/jk_handler_logon.c
  
  Index: jk_handler_logon.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_handler_logon.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_handler_logon.c	2001/12/12 21:34:47	1.6
  +++ jk_handler_logon.c	2001/12/13 18:49:01	1.7
  @@ -58,7 +58,7 @@
   /**
    * Description: AJP14 Login handler
    * Author:      Henri Gomez <hg...@slib.fr>
  - * Version:     $Revision: 1.6 $                                          
  + * Version:     $Revision: 1.7 $                                          
    */
   
   #include "jk_global.h"
  @@ -69,6 +69,7 @@
   #include "jk_service.h"
   #include "jk_env.h"
   #include "jk_handler.h"
  +#include "jk_registry.h"
   
   /* Private definitions */
   
  
  
  
  1.7       +2 -0      jakarta-tomcat-connectors/jk/native2/common/jk_handler_response.c
  
  Index: jk_handler_response.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_handler_response.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_handler_response.c	2001/12/12 23:36:01	1.6
  +++ jk_handler_response.c	2001/12/13 18:49:01	1.7
  @@ -64,6 +64,8 @@
   #include "jk_handler.h"
   #include "jk_endpoint.h"
   
  +#include "jk_registry.h"
  +
   /*
    * Write a body chunk from the servlet container to the web server
    */
  
  
  
  1.8       +2 -3      jakarta-tomcat-connectors/jk/native2/common/jk_lb_worker.c
  
  Index: jk_lb_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_lb_worker.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_lb_worker.c	2001/12/12 21:51:33	1.7
  +++ jk_lb_worker.c	2001/12/13 18:49:01	1.8
  @@ -60,7 +60,7 @@
    *              several workers.                                           *
    * Author:      Gal Shachor <sh...@il.ibm.com>                           *
    * Based on:                                                               *
  - * Version:     $Revision: 1.7 $                                           *
  + * Version:     $Revision: 1.8 $                                           *
    ***************************************************************************/
   
   #include "jk_pool.h"
  @@ -507,8 +507,7 @@
       
       *result=_this;
   
  -    l->jkLog(l, JK_LOG_INFO, "lb_worker.factory() New lb worker %s\n",
  -             _this->name);
  +    l->jkLog(l, JK_LOG_INFO, "lb_worker.factory() New lb worker\n");
       
       /* name, pool will be set by workerEnv ( our factory ) */
       
  
  
  
  1.7       +3 -1      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_logger_file.c	2001/12/12 21:54:51	1.6
  +++ jk_logger_file.c	2001/12/13 18:49:01	1.7
  @@ -59,13 +59,15 @@
    * Description: Utility functions (mainly configuration)                   *
    * Author:      Gal Shachor <sh...@il.ibm.com>                           *
    * Author:      Henri Gomez <hg...@slib.fr>                               *
  - * Version:     $Revision: 1.6 $                                           *
  + * Version:     $Revision: 1.7 $                                           *
    ***************************************************************************/
   
   #include "jk_env.h"
   #include "jk_map.h"
   #include "jk_logger.h"
   #include <stdio.h>
  +
  +#include "jk_registry.h"
   
   #define LOG_FORMAT		    ("log_format")
   
  
  
  
  1.10      +44 -33    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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jk_uriMap.c	2001/12/12 23:36:01	1.9
  +++ jk_uriMap.c	2001/12/13 18:49:01	1.10
  @@ -67,7 +67,7 @@
    * servlet container.                                                      
    *                                                                         
    * Author:      Gal Shachor <sh...@il.ibm.com>                           
  - * Version:     $Revision: 1.9 $                                           
  + * Version:     $Revision: 1.10 $                                           
    */
   
   #include "jk_pool.h"
  @@ -198,11 +198,10 @@
       int err;
       char *asterisk;
   
  -    printf("XXX addMapping1 %s", puri); 
       /* make sure we have space */
       err=uriMap_realloc(_this);
       if (err != JK_TRUE ) {
  -        l->jkLog(l, JK_LOG_ERROR,"uriMa.addMappint() OutOfMemoryException\n");
  +        l->jkLog(l, JK_LOG_ERROR,"uriMap.addMappint() OutOfMemoryException\n");
           return NULL;
       }
   
  @@ -244,9 +243,11 @@
           uwr->prefix_len  =strlen( uwr->prefix );
           uwr->suffix      = NULL;
           uwr->match_type  = MATCH_TYPE_EXACT;
  -        l->jkLog(l, JK_LOG_INFO,
  -               "uriMap.addMapping() exact mapping %s=%s was added\n",
  -               uri, worker);
  +        if( _this->debug > 0 ) {
  +            l->jkLog(l, JK_LOG_INFO,
  +                     "uriMap.addMapping() exact mapping %s=%s was added\n",
  +                     uri, worker);
  +        }
           return uwr;
       }
   
  @@ -266,9 +267,11 @@
               uwr->prefix_len  =strlen( uwr->prefix );
               uwr->suffix      = asterisk + 3;
               uwr->match_type  = MATCH_TYPE_SUFFIX;
  -            l->jkLog(l, JK_LOG_INFO,
  -                   "uriMap.addMapping() suffix mapping %s.%s=%s was added\n",
  -                   uri, asterisk + 3, worker); 
  +            if( _this->debug > 0 ) {
  +                l->jkLog(l, JK_LOG_INFO,
  +                      "uriMap.addMapping() suffix mapping %s.%s=%s was added\n",
  +                         uri, asterisk + 3, worker);
  +            }
           } else if ('\0' != asterisk[2]) {
               /* general suffix rule /foo/bar/STARextraData */
               asterisk[1] = '\0';
  @@ -276,9 +279,11 @@
               uwr->prefix  = uri;
               uwr->prefix_len  =strlen( uwr->prefix );
               uwr->match_type = MATCH_TYPE_GENERAL_SUFFIX;
  -            l->jkLog(l, JK_LOG_INFO,
  -                   "uriMap.addMapping() general suffix mapping %s.%s=%s\n",
  -                   uri, asterisk + 2, worker);
  +            if( _this->debug > 0 ) {
  +                l->jkLog(l, JK_LOG_INFO,
  +                         "uriMap.addMapping() general suffix mapping %s.%s=%s\n",
  +                         uri, asterisk + 2, worker);
  +            }
           } else {
               /* context based /foo/bar/STAR  */
               asterisk[1]      = '\0';
  @@ -286,9 +291,11 @@
               uwr->prefix      = uri;
               uwr->prefix_len  =strlen( uwr->prefix );
               uwr->match_type  = MATCH_TYPE_CONTEXT;
  -            l->jkLog(l, JK_LOG_INFO,
  -                   "uriMap.addMapping() prefix mapping %s=%s\n",
  -                   uri, worker);
  +            if( _this->debug > 0 ) {
  +                l->jkLog(l, JK_LOG_INFO,
  +                         "uriMap.addMapping() prefix mapping %s=%s\n",
  +                         uri, worker);
  +            }
           }
       } else {
           /* Something like : JkMount /servlets/exampl* ajp13 */
  @@ -297,9 +304,11 @@
           uwr->prefix_len  =strlen( uwr->prefix );
           uwr->suffix      = NULL;
           uwr->match_type  = MATCH_TYPE_EXACT;
  -        l->jkLog(l, JK_LOG_INFO,
  -                   "uriMap.addMapping() prefix mapping2 %s=%s\n",
  -               uri, worker);
  +        if( _this->debug > 0 ) {
  +            l->jkLog(l, JK_LOG_INFO,
  +                     "uriMap.addMapping() prefix mapping2 %s=%s\n",
  +                     uri, worker);
  +        }
       }
   
       return uwr;
  @@ -319,12 +328,11 @@
                                              
       sz = map_size(init_data);
   
  +    _this->debug=map_getIntProp(init_data,"urimap", "default", "debug", 0 );
  +    
       for(i = 0; i < sz ; i++) {
           char *name=map_name_at(init_data, i);
  -        if( name==NULL || name[0]!='/' ) {
  -/*             l->jkLog(l, JK_LOG_DEBUG, "uriMap.init(): Ignoring %s\n", */
  -/*                      name); */
  -        } else {
  +        if( name!=NULL && name[0]=='/' ) {
               jk_uriEnv_t *uriEnv=_this->addMapping(_this,NULL,name,
                                                     map_value_at(init_data, i));
               if ( uriEnv==NULL) {
  @@ -334,18 +342,21 @@
               }
           }
       }
  -    
  -    l->jkLog(l, JK_LOG_INFO, "uriMap.init(): added %d rules out of %d\n",
  -             _this->size, sz );
  +
  +    if( _this->debug > 0 )  
  +        l->jkLog(l, JK_LOG_INFO, "uriMap.init(): rules=%d properties=\n",
  +                 _this->size, sz );
   
       /* Set uriEnv->worker ( can't be done earlier since we might not have
          the workers set up */
       for(i = 0 ; i < _this->size ; i++) {
           char *wname=_this->maps[i]->webapp->workerName;
           /* assert( wname != NULL ); */
  -        _this->maps[i]->webapp->worker= workerEnv->getWorkerForName( workerEnv, wname );
  +        _this->maps[i]->webapp->worker=
  +            workerEnv->getWorkerForName( workerEnv, wname );
           if( _this->maps[i]->webapp->worker==NULL ) {
  -            l->jkLog(l, JK_LOG_ERROR, "uriMap.init() map to invalid worker %s %s\n",
  +            l->jkLog(l, JK_LOG_ERROR,
  +                     "uriMap.init() map to invalid worker %s %s\n",
                        _this->maps[i]->uri, wname);
           }
       }
  @@ -357,8 +368,9 @@
   static void jk_uriMap_destroy(jk_uriMap_t *_this)
   {
       jk_logger_t *l=_this->workerEnv->l;
  -    
  -    l->jkLog(l, JK_LOG_DEBUG, "uriMap.destroy()\n"); 
  +
  +    if( _this->debug > 0 ) 
  +        l->jkLog(l, JK_LOG_INFO, "uriMap.destroy()\n"); 
   
       /* this can't be null ( or a NPE would have been generated */
       
  @@ -436,7 +448,7 @@
   	return NULL;
   
       if( _this->debug > 1 )
  -        l->jkLog(l, JK_LOG_DEBUG, "uriMap.mapUri() %s %s\n", vhost, uri);    
  +        l->jkLog(l, JK_LOG_INFO, "uriMap.mapUri() %s %s\n", vhost, uri);    
   
       if( '/' != uri[0]) {
           l->jkLog(l, JK_LOG_ERROR, "uriMap.mapUri() uri must start with /\n");
  @@ -449,7 +461,7 @@
           origChar=*url_rewrite;
           *url_rewrite = '\0';
           if( _this->debug > 0 )
  -            l->jkLog(l, JK_LOG_DEBUG, "uriMap.mapUri() rewrote uri %s \n",uri );
  +            l->jkLog(l, JK_LOG_INFO, "uriMap.mapUri() rewrote uri %s \n",uri );
       }
   
       uriLen=strlen( uri );
  @@ -540,7 +552,7 @@
       }
       
       if( _this->debug > 1 )
  -        l->jkLog(l, JK_LOG_DEBUG, "uriMap.mapUri() no match found\n"); 
  +        l->jkLog(l, JK_LOG_INFO, "uriMap.mapUri() no match found\n"); 
   
       return NULL;
   }
  @@ -573,7 +585,6 @@
       _this->maps = NULL;
       _this->debug= 1;
               
  -    /*     l->jkLog(l, JK_LOG_DEBUG, "uriMap.new()\n"); */
       return JK_TRUE;
   }
   
  
  
  
  1.8       +4 -6      jakarta-tomcat-connectors/jk/native2/common/jk_workerEnv.c
  
  Index: jk_workerEnv.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_workerEnv.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_workerEnv.c	2001/12/12 23:36:01	1.7
  +++ jk_workerEnv.c	2001/12/13 18:49:01	1.8
  @@ -59,7 +59,7 @@
    * Description: Workers controller                                         *
    * Author:      Gal Shachor <sh...@il.ibm.com>                           *
    * Author:      Henri Gomez <hg...@slib.fr>                               *
  - * Version:     $Revision: 1.7 $                                           *
  + * Version:     $Revision: 1.8 $                                           *
    ***************************************************************************/
   
   #include "jk_workerEnv.h" 
  @@ -240,8 +240,6 @@
           char *name=map_name_at( registry, i );
           if( strstr( name, "handler" ) == name ) {
               char *type=name+ strlen( "handler" ) +1;
  -            printf("XXX Found handler: %s %s\n", name, type );
  -
               localHandlers=(jk_map_t *)_this->env->getInstance(_this->env,
                                                                 _this->pool,
                                                                 "handler",
  @@ -255,8 +253,8 @@
                                            &_this->lastMessageId,
                                            handler->messageId );
                   _this->handlerTable[ handler->messageId ]=handler;
  -                _this->l->jkLog( _this->l, JK_LOG_INFO, "Registerd %s %d \n",
  -                                 handler->name, handler->messageId);
  +                /*_this->l->jkLog( _this->l, JK_LOG_INFO, "Registered %s %d\n",*/
  +                /*           handler->name, handler->messageId); */
               }
           }
       }
  @@ -414,8 +412,8 @@
           return NULL;
       }
   
  -    w->pool=workerPool;
       w->name=(char *)name;
  +    w->pool=workerPool;
       w->workerEnv=_this;
       
       err=w->validate(w, init_data, _this, l);
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>