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/common jk_channel_apr_socket.c jk_channel_jni.c jk_channel_socket.c jk_channel_un.c jk_config.c jk_env.c jk_logger_file.c jk_msg_ajp.c jk_uriEnv.c jk_uriMap.c jk_vm_default.c jk_workerEnv.c jk_worker_ajp13.c jk_worker_jni.c jk_worker_lb.c
Date Thu, 16 May 2002 21:03:45 GMT
costin      02/05/16 14:03:45

  Modified:    jk/native2/common jk_channel_apr_socket.c jk_channel_jni.c
                        jk_channel_socket.c jk_channel_un.c jk_config.c
                        jk_env.c jk_logger_file.c jk_msg_ajp.c jk_uriEnv.c
                        jk_uriMap.c jk_vm_default.c jk_workerEnv.c
                        jk_worker_ajp13.c jk_worker_jni.c jk_worker_lb.c
  Log:
  Cosmetic changes, remove warnings for unused vars and other
  minor things.
  
  Revision  Changes    Path
  1.18      +0 -5      jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c
  
  Index: jk_channel_apr_socket.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- jk_channel_apr_socket.c	15 May 2002 19:34:09 -0000	1.17
  +++ jk_channel_apr_socket.c	16 May 2002 21:03:44 -0000	1.18
  @@ -202,7 +202,6 @@
                                               jk_channel_t *ch,
                                               jk_endpoint_t *endpoint)
   {
  -    int err;
       jk_channel_apr_private_t *socketInfo=
           (jk_channel_apr_private_t *)(ch->_privatePtr);
   
  @@ -315,8 +314,6 @@
       char data[128];
   
       int  sent=0;
  -    int this_time;
  -    int unixsock;
   
       sock=endpoint->channelData;
   
  @@ -355,8 +352,6 @@
       apr_socket_t *sock;
       apr_size_t length;
       apr_status_t stat;
  -
  -    int sd;
       int rdlen;
   
       sock=endpoint->channelData;
  
  
  
  1.19      +1 -8      jakarta-tomcat-connectors/jk/native2/common/jk_channel_jni.c
  
  Index: jk_channel_jni.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_jni.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- jk_channel_jni.c	15 May 2002 19:34:09 -0000	1.18
  +++ jk_channel_jni.c	16 May 2002 21:03:44 -0000	1.19
  @@ -316,7 +316,7 @@
       int len;
       jbyte *nbuf;
       jbyteArray jbuf;
  -    int jlen;
  +    int jlen=0;
       jboolean iscopy=0;
       JNIEnv *jniEnv;
       jk_channel_jni_private_t *jniCh=_this->_privatePtr;
  @@ -384,11 +384,6 @@
           return JK_ERR;
       }
   
  -    if( len > jlen ) {
  -        /* XXX Reallocate the buffer */
  -        len=jlen;
  -    }
  -
       memcpy( nbuf, b, len );
   
   #ifdef JK_JNI_CRITICAL
  @@ -462,8 +457,6 @@
                                               struct jk_endpoint *endpoint,
                                               struct jk_ws_service *r )
   {
  -    JNIEnv *jniEnv;
  -    jint rc;
       jk_workerEnv_t *we=worker->workerEnv;
   
       if( worker->mbean->debug > 0 )
  
  
  
  1.27      +3 -2      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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- jk_channel_socket.c	15 May 2002 19:36:16 -0000	1.26
  +++ jk_channel_socket.c	16 May 2002 21:03:44 -0000	1.27
  @@ -186,8 +186,9 @@
                         "can't resolve %s:%d errno=%d\n", socketInfo->host, socketInfo->port,
errno );
       }
   
  -    env->l->jkLog(env, env->l, JK_LOG_INFO,
  -                  "channel_socket.init(): %s:%d \n", socketInfo->host, socketInfo->port
);
  +    if( ch->mbean->debug > 0 )
  +        env->l->jkLog(env, env->l, JK_LOG_INFO,
  +                      "channel_socket.init(): %s:%d \n", socketInfo->host, socketInfo->port
);
       
       return rc;
   }
  
  
  
  1.6       +22 -21    jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c
  
  Index: jk_channel_un.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jk_channel_un.c	14 May 2002 17:27:21 -0000	1.5
  +++ jk_channel_un.c	16 May 2002 21:03:44 -0000	1.6
  @@ -92,7 +92,7 @@
       char *file;
   } jk_channel_un_private_t;
   
  -static int JK_METHOD jk2_channel_un_close(jk_env_t *env, jk_channel_t *_this,
  +static int JK_METHOD jk2_channel_un_close(jk_env_t *env, jk_channel_t *ch,
                                             jk_endpoint_t *endpoint);
   
   static char *jk2_channel_un_multiValueInfo[]={"group",  NULL };
  @@ -122,15 +122,15 @@
   /** resolve the host IP ( jk_resolve ) and initialize the channel.
    */
   static int JK_METHOD jk2_channel_un_init(jk_env_t *env,
  -                                         jk_channel_t *_this)
  +                                         jk_channel_t *ch)
   {
       jk_channel_un_private_t *socketInfo=
  -        (jk_channel_un_private_t *)(_this->_privatePtr);
  +        (jk_channel_un_private_t *)(ch->_privatePtr);
       int rc=JK_OK;
   
       if( socketInfo->file==NULL ) {
  -        char *localName=_this->mbean->localName;
  -        jk_config_t *cfg=_this->workerEnv->config;
  +        char *localName=ch->mbean->localName;
  +        jk_config_t *cfg=ch->workerEnv->config;
           
           /* Set the 'name' property
            */
  @@ -140,7 +140,7 @@
           /*                 "channelUn.init(): use name %s\n", localName ); */
           
           if (localName[0]=='/') {
  -            _this->mbean->setAttribute( env, _this->mbean, "file", localName );
  +            ch->mbean->setAttribute( env, ch->mbean, "file", localName );
           } 
       }
       
  @@ -148,9 +148,10 @@
           memset(&socketInfo->unix_addr, 0, sizeof(struct sockaddr_un));
           socketInfo->unix_addr.sun_family = AF_UNIX;
           strcpy(socketInfo->unix_addr.sun_path,  socketInfo->file );
  -        
  -        env->l->jkLog(env, env->l, JK_LOG_INFO,
  -                      "channelUn.init(): create AF_UNIX  %s\n", socketInfo->file );
  +
  +        if( ch->mbean->debug > 0 )
  +            env->l->jkLog(env, env->l, JK_LOG_INFO,
  +                          "channelUn.init(): create AF_UNIX  %s\n", socketInfo->file
);
       } else {
           env->l->jkLog(env, env->l, JK_LOG_ERROR, "channelUn.init(): "
                         "can't init %s errno=%d\n", socketInfo->file, errno );
  @@ -162,12 +163,12 @@
   /** connect to Tomcat (jk_open_socket)
    */
   static int JK_METHOD jk2_channel_un_open(jk_env_t *env,
  -                                            jk_channel_t *_this,
  +                                            jk_channel_t *ch,
                                               jk_endpoint_t *endpoint)
   {
       int err;
       jk_channel_un_private_t *socketInfo=
  -        (jk_channel_un_private_t *)(_this->_privatePtr);
  +        (jk_channel_un_private_t *)(ch->_privatePtr);
       int unixsock;
   
       unixsock = socket(AF_UNIX, SOCK_STREAM, 0);
  @@ -178,7 +179,7 @@
               return JK_ERR;
       }
   
  -    if( _this->mbean->debug > 0 ) 
  +    if( ch->mbean->debug > 0 ) 
           env->l->jkLog(env, env->l, JK_LOG_INFO,
                         "channelUn.open(): create unix socket %s %d\n", socketInfo->file,
unixsock );
       
  @@ -190,7 +191,7 @@
                         errno, strerror( errno ) );
           return JK_ERR;
       }
  -    if( _this->mbean->debug > 0 ) 
  +    if( ch->mbean->debug > 0 ) 
           env->l->jkLog(env, env->l, JK_LOG_INFO,
                         "channelUn.open(): connect unix socket %d %s\n", unixsock, socketInfo->file
);
       /* store the channel information */
  @@ -201,7 +202,7 @@
   
   /** close the socket  ( was: jk2_close_socket )
   */
  -static int JK_METHOD jk2_channel_un_close(jk_env_t *env,jk_channel_t *_this,
  +static int JK_METHOD jk2_channel_un_close(jk_env_t *env,jk_channel_t *ch,
                                                jk_endpoint_t *endpoint)
   {
       close( endpoint->sd );
  @@ -220,7 +221,7 @@
    *             protocol.
    * @was: jk_tcp_socket_sendfull
    */
  -static int JK_METHOD jk2_channel_un_send(jk_env_t *env, jk_channel_t *_this,
  +static int JK_METHOD jk2_channel_un_send(jk_env_t *env, jk_channel_t *ch,
                                            jk_endpoint_t *endpoint,
                                            jk_msg_t *msg) 
   {
  @@ -245,7 +246,7 @@
           errno=0;
           this_time = write(unixsock, (char *)b + sent , len - sent);
   
  -        if( _this->mbean->debug > 0 ) 
  +        if( ch->mbean->debug > 0 ) 
               env->l->jkLog(env, env->l, JK_LOG_INFO,
                             "channel.apr:send() write() %d %d %s\n", this_time, errno,
                             strerror( errno));
  @@ -271,7 +272,7 @@
    * Was: tcp_socket_recvfull
    */
   static int JK_METHOD jk2_channel_un_readN( jk_env_t *env,
  -                                            jk_channel_t *_this,
  +                                            jk_channel_t *ch,
                                               jk_endpoint_t *endpoint,
                                               char *b, int len ) 
   {
  @@ -314,7 +315,7 @@
    *            >0: length of the received data.
    * Was: tcp_socket_recvfull
    */
  -static int JK_METHOD jk2_channel_un_recv( jk_env_t *env, jk_channel_t *_this,
  +static int JK_METHOD jk2_channel_un_recv( jk_env_t *env, jk_channel_t *ch,
                                                jk_endpoint_t *endpoint,
                                                jk_msg_t *msg )
   {
  @@ -323,7 +324,7 @@
       int rc=JK_OK;
       
   
  -    blen=jk2_channel_un_readN( env, _this, endpoint, msg->buf, hlen );
  +    blen=jk2_channel_un_readN( env, ch, endpoint, msg->buf, hlen );
       if( blen <= 0 ) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "channelUn.receive(): error receiving %d %d %s %p %d\n",
  @@ -338,7 +339,7 @@
           return JK_ERR;
       }
       
  -    rc= jk2_channel_un_readN( env, _this, endpoint, msg->buf + hlen, blen);
  +    rc= jk2_channel_un_readN( env, ch, endpoint, msg->buf + hlen, blen);
   
       if(rc < 0) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
  @@ -347,7 +348,7 @@
           return JK_ERR;
       }
   
  -    if( _this->mbean->debug > 0 ) 
  +    if( ch->mbean->debug > 0 ) 
           env->l->jkLog(env, env->l, JK_LOG_INFO,
                         "channelUn.receive(): Received len=%d type=%d\n",
                         blen, (int)msg->buf[hlen]);
  
  
  
  1.18      +5 -15     jakarta-tomcat-connectors/jk/native2/common/jk_config.c
  
  Index: jk_config.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_config.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- jk_config.c	14 May 2002 20:42:49 -0000	1.17
  +++ jk_config.c	16 May 2002 21:03:44 -0000	1.18
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: General purpose config object                                 *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.17 $                                           *
  + * Version:     $Revision: 1.18 $                                           *
    ***************************************************************************/
   
   #include "jk_global.h"
  @@ -74,7 +74,7 @@
   static void jk2_trim_prp_comment(char *prp);
   static int  jk2_trim(char *s);
   
  -static int JK_METHOD jk2_config_readFile(jk_env_t *env,
  +static int jk2_config_readFile(jk_env_t *env,
                                            jk_config_t *cfg,
                                            int *didReload, int firstTime);
   
  @@ -87,13 +87,7 @@
                                        jk_config_t *cfg,
                                        jk_workerEnv_t *wEnv,
                                        char *workerFile)
  -{
  -    struct stat statbuf;
  -    int err;
  -    jk_map_t *cfgData;
  -    int i;
  -    int j;
  -    
  +{   
       cfg->file=workerFile;
   
       return jk2_config_readFile( env, cfg, NULL, JK_TRUE );
  @@ -256,7 +250,6 @@
   
       if( multiValue ) {
           mbean->settings->add( env, mbean->settings, name, val );
  -        fprintf( stderr, "config.setProperty MULTI %s %s %s \n", mbean->name, name,
val ); 
       } else {
           mbean->settings->put( env, mbean->settings, name, val, NULL );
       }
  @@ -383,7 +376,6 @@
       /* Support windows-style 'sections' - for cleaner config
        */
       if( prp[0] == '[' ) {
  -        char *dummyProp;
           v=strchr(prp, ']' );
           *v='\0';
           jk2_trim( v );
  @@ -562,7 +554,6 @@
   static int jk2_config_processConfigData(jk_env_t *env, jk_config_t *cfg,
                                           jk_map_t *cfgData, int firstTime )
   {
  -    int rc;
       int i;
       int j;
       
  @@ -626,7 +617,6 @@
       int rc;
       int csOk;
       struct stat statbuf;
  -    time_t mtime;
       jk_map_t *cfgData;
   
       if( didReload!=NULL )
  @@ -703,10 +693,10 @@
   }
   
   
  -static int JK_METHOD jk2_config_update(jk_env_t *env,
  +static int jk2_config_update(jk_env_t *env,
                                          jk_config_t *cfg, int *didReload)
   {
  -    jk2_config_readFile( env, cfg, didReload, JK_FALSE );
  +	return jk2_config_readFile( env, cfg, didReload, JK_FALSE );
   }
   
   /** Set a property for this config object
  
  
  
  1.25      +3 -1      jakarta-tomcat-connectors/jk/native2/common/jk_env.c
  
  Index: jk_env.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_env.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- jk_env.c	9 May 2002 23:47:31 -0000	1.24
  +++ jk_env.c	16 May 2002 21:03:44 -0000	1.25
  @@ -181,6 +181,7 @@
   
       if( localName!=NULL ) 
           result=env->getBean2( env, type, localName );
  +
       if( result!=NULL )
           return result;
       
  @@ -230,11 +231,12 @@
   
       workerPool=pool->create(env, pool, HUGE_POOL_SIZE);
       
  +
       /** Generate a unique name if none is specified
        */
       if( localName==NULL ) {
           localName=workerPool->calloc( env, workerPool,  10 );
  -        sprintf( (char *)localName, "%d", env->id++ );
  +        sprintf( (char *)localName, "%d", jk_env_globalEnv->id++ );
       }
   
       name=workerPool->calloc( env, workerPool,  strlen( type ) + strlen( localName )
+ 2 );
  
  
  
  1.22      +16 -14    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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- jk_logger_file.c	27 Apr 2002 00:49:10 -0000	1.21
  +++ jk_logger_file.c	16 May 2002 21:03:44 -0000	1.22
  @@ -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.21 $                                           *
  + * Version:     $Revision: 1.22 $                                           *
    ***************************************************************************/
   
   #include "jk_env.h"
  @@ -203,6 +203,7 @@
                             "Level %s %d \n", value, _this->level );
           }
       }
  +	return JK_OK;
   }
   
   
  @@ -298,26 +299,27 @@
   }
   
   int JK_METHOD jk2_logger_file_factory(jk_env_t *env, jk_pool_t *pool, 
  -                            jk_bean_t *result,
  -                            const char *type, const char *name)
  +                                      jk_bean_t *result,
  +                                      const char *type, const char *name)
   {
  -    jk_logger_t *l = (jk_logger_t *)pool->alloc(env, pool, sizeof(jk_logger_t));
  +    jk_logger_t *log = (jk_logger_t *)pool->calloc(env, pool, sizeof(jk_logger_t));
   
  -    if(l==NULL ) {
  +    if(log==NULL ) {
  +        fprintf(stderr, "loggerFile.factory(): OutOfMemoryException\n"); 
           return JK_ERR;
       }
   
  -    l->log = jk2_logger_file_log;
  -    l->logger_private = NULL;
  -    l->init =jk2_logger_file_init;
  -    l->jkLog = jk2_logger_file_jkLog;
  -    l->jkVLog = jk2_logger_file_jkVLog;
  -    l->level=JK_LOG_ERROR_LEVEL;
  +    log->log = jk2_logger_file_log;
  +    log->logger_private = NULL;
  +    log->init =jk2_logger_file_init;
  +    log->jkLog = jk2_logger_file_jkLog;
  +    log->jkVLog = jk2_logger_file_jkVLog;
  +    log->level=JK_LOG_ERROR_LEVEL;
       jk2_logger_file_logFmt = JK_TIME_FORMAT;
       
  -
  -    result->object=l;
  -    l->mbean=result;
  +    result->object=log;
  +    log->mbean=result;
  +    
       result->setAttribute = jk2_logger_file_setProperty;
   
       return JK_OK;
  
  
  
  1.14      +4 -4      jakarta-tomcat-connectors/jk/native2/common/jk_msg_ajp.c
  
  Index: jk_msg_ajp.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_msg_ajp.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- jk_msg_ajp.c	14 May 2002 17:15:27 -0000	1.13
  +++ jk_msg_ajp.c	16 May 2002 21:03:44 -0000	1.14
  @@ -155,7 +155,7 @@
   
   
   static int jk2_msg_ajp_appendLong(jk_env_t *env, jk_msg_t *msg,
  -                                  unsigned long val)
  +                                  const unsigned long val)
   {
       int len=msg->len;
       
  @@ -175,7 +175,7 @@
   
   
   static int jk2_msg_ajp_appendInt(jk_env_t *env, jk_msg_t *msg, 
  -                                 unsigned short val) 
  +                                 const unsigned short val) 
   {
       int len=msg->len;
       if(len + 2 > msg->maxlen) {
  @@ -211,7 +211,7 @@
       int i;
       int size=map->size(env, map);
   
  -    rc=msg->appendInt( env, msg, size );
  +    rc=msg->appendInt( env, msg, (short)size );
       
       for( i=0; i< size; i++ ) {
           char *name=map->nameAt( env, map, i );
  @@ -276,7 +276,7 @@
   
   static int jk2_msg_ajp_appendBytes(jk_env_t *env, jk_msg_t  *msg,
                                      const unsigned char  *param,
  -                                   int len)
  +                                   const int len)
   {
       if (! len) {
           return JK_OK;
  
  
  
  1.20      +0 -4      jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c
  
  Index: jk_uriEnv.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- jk_uriEnv.c	15 May 2002 19:45:45 -0000	1.19
  +++ jk_uriEnv.c	16 May 2002 21:03:44 -0000	1.20
  @@ -100,7 +100,6 @@
       
       /* If it doesn't start with /, it must have a vhost */
       if( *name != '/' ) {
  -        jk_uriEnv_t *vhost;
           // char *portIdx=strchr( n, ':' );
           uriEnv->virtual=uriEnv->pool->calloc( env, uriEnv->pool, slash - name
+ 2 );
           strncpy( uriEnv->virtual, name, slash-name );
  @@ -146,9 +145,6 @@
           uriEnv->workerName=val;
           return JK_OK;
       } else if( strcmp("context", name) == 0 ) {
  -        jk_bean_t *ctxMB;
  -        jk_uriEnv_t *ctxEnv;
  -        char *cname;
           
           uriEnv->contextPath=val;
           uriEnv->ctxt_len=strlen( val );
  
  
  
  1.33      +0 -8      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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- jk_uriMap.c	9 May 2002 21:12:15 -0000	1.32
  +++ jk_uriMap.c	16 May 2002 21:03:44 -0000	1.33
  @@ -142,8 +142,6 @@
    */
   static int jk2_uriMap_addUriEnv( jk_env_t *env, jk_uriMap_t *uriMap, jk_uriEnv_t *uriEnv
)
   {
  -    int rc;
  -
       uriMap->maps->put( env, uriMap->maps, uriEnv->name, uriEnv, NULL );
       if( uriMap->mbean->debug > 0 ) 
           env->l->jkLog(env, env->l, JK_LOG_INFO,
  @@ -302,7 +300,6 @@
           ctxEnv=jk2_uriMap_prefixMap( env, uriMap, hostEnv->webapps, context, strlen(
context) );
           /* if not alredy created, create it */
           if( ctxEnv == NULL ) {
  -            char *cname;
               env->l->jkLog( env, env->l, JK_LOG_INFO,
                              "uriMap: creating context %s\n", vhost);
               mbean=env->getBean2( env, "uri", context );
  @@ -323,8 +320,6 @@
   static int jk2_uriMap_init(jk_env_t *env, jk_uriMap_t *uriMap)
   {
       int rc=JK_OK;
  -    int sz;
  -    int err;
       int i;
       jk_workerEnv_t *workerEnv=uriMap->workerEnv;
       jk_bean_t *mbean;
  @@ -542,7 +537,6 @@
                                         const char *vhost,
                                         const char *uri)
   {
  -    int i;
       int best_match = -1;
       int longest_match = 0;
       char * clean_uri = NULL;
  @@ -696,8 +690,6 @@
                                    const char *type, const char *name)
   {
       jk_uriMap_t *uriMap;
  -    jk_map_t *init_data;
  -    jk_bean_t *mbean;
   
       uriMap = (jk_uriMap_t *)pool->calloc(env, pool, sizeof(jk_uriMap_t));
       if(  ! uriMap) {
  
  
  
  1.13      +0 -2      jakarta-tomcat-connectors/jk/native2/common/jk_vm_default.c
  
  Index: jk_vm_default.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_vm_default.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_vm_default.c	10 May 2002 00:01:37 -0000	1.12
  +++ jk_vm_default.c	16 May 2002 21:03:45 -0000	1.13
  @@ -341,7 +341,6 @@
       char *jvm;
       jk_pool_t *p=props->pool;
       const char **current=defaultVM_PATH;
  -    char *libp;
       
       /* We need at least JAVA_HOME ( either env or in settings )
        */
  @@ -377,7 +376,6 @@
       JavaVMOption options[100];
       JavaVM *jvm;
       int optn = 0, err;
  -    char* tmp;
       
       /** Make sure we have the vm dll */
       if( jkvm->jvm_dll_path ==NULL ||
  
  
  
  1.43      +25 -33    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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- jk_workerEnv.c	15 May 2002 19:40:44 -0000	1.42
  +++ jk_workerEnv.c	16 May 2002 21:03:45 -0000	1.43
  @@ -59,7 +59,7 @@
    * Description: Workers controller                                         *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
    * Author:      Henri Gomez <hgomez@slib.fr>                               *
  - * Version:     $Revision: 1.42 $                                           *
  + * Version:     $Revision: 1.43 $                                           *
    ***************************************************************************/
   
   #include "jk_env.h"
  @@ -258,11 +258,10 @@
       /* XXX accessing private data... env most provide some method to get this */
       jk_map_t *registry=env->_registry;
       int size=registry->size( env, registry );
  -    int i,j;
  +    int i;
       
       for( i=0; i<size; i++ ) {
           jk_handler_t *handler;
  -        int rc;
   
           char *name= registry->nameAt( env, registry, i );
           if( strncmp( name, "handler.", 8 ) == 0 ) {
  @@ -299,6 +298,8 @@
       return JK_OK;
   }
   
  +/** Called from the parent, in a multi-process server.
  + */
   static int jk2_workerEnv_parentInit(jk_env_t *env, jk_workerEnv_t *wEnv)
   {
       char *configFile;
  @@ -312,6 +313,9 @@
                                            "${serverRoot}/conf/workers2.properties" );
           configFile=wEnv->config->file;
       }
  +
  +    if( wEnv->shm->mbean->disabled )
  +        wEnv->shm=NULL;
       
       if( wEnv->shm != NULL && ! wEnv->shm->mbean->disabled ) {
           wEnv->shm->init( env, wEnv->shm );
  @@ -319,20 +323,27 @@
       
       if( wEnv->shm != NULL && wEnv->shm->head != NULL ) {
           wEnv->shm->reset( env, wEnv->shm);
  -        env->l->jkLog(env, env->l, JK_LOG_ERROR, "workerEnv.init() Reset shm\n"
);
  +        if( wEnv->mbean->debug > 0 )
  +            env->l->jkLog(env, env->l, JK_LOG_ERROR, "workerEnv.init() Reset shm\n"
);
       }
  +	return JK_OK;
   }
   
  -
  +/** Normal child init
  + */
   static int jk2_workerEnv_init(jk_env_t *env, jk_workerEnv_t *wEnv)
   {
  -    int err;
  -    char *opt;
  -    int options;
       char *configFile;
   
       env->l->init( env, env->l );
   
  +    /* We need to pid here - Linux will return the pid of the thread if
  +       called after init(), and we'll not be able to locate the slot id
  +       This is part of the workarounds needed for Apache2's removal of
  +       child_num from connection.
  +    */
  +    wEnv->childProcessId=getpid();
  +    
       configFile=wEnv->config->file;
       if(  configFile == NULL ) {
           wEnv->config->setPropertyString( env, wEnv->config,
  @@ -367,15 +378,8 @@
       if( wEnv->shm != NULL && ! wEnv->shm->mbean->disabled ) {
           wEnv->shm->init( env, wEnv->shm );
       }
  -    
  -    if( wEnv->shm != NULL && wEnv->childId >= 0 ) {
  -        char shmName[128];
  -        snprintf( shmName, 128, "epStat.%d", wEnv->childId );
  -        
  -        wEnv->epStat=wEnv->shm->createSlot( env, wEnv->shm, shmName, 8096 );
  -        wEnv->epStat->structCnt=0;
  -        env->l->jkLog(env, env->l, JK_LOG_ERROR, "workerEnv.init() create slot
%s\n",  shmName );
  -    }
  +
  +    wEnv->epStat=NULL;
       
       wEnv->uriMap->init(env, wEnv->uriMap );
   
  @@ -523,14 +527,6 @@
       return JK_ERR;
   }
   
  -static jk_worker_t *jk2_workerEnv_releasePool(jk_env_t *env,
  -                                              jk_workerEnv_t *wEnv,
  -                                              const char *name, 
  -                                              jk_map_t *initData)
  -{
  -    
  -}
  -
   static int jk2_workerEnv_addChannel(jk_env_t *env, jk_workerEnv_t *wEnv,
                                       jk_channel_t *ch) 
   {
  @@ -541,7 +537,7 @@
       JK_ENTER_CS(&wEnv->cs, csOk);
       if( !csOk ) return JK_ERR;
   
  -    ch->id=wEnv->channel_map->size( env, wEnv->channel_map );
  +    ch->mbean->id=wEnv->channel_map->size( env, wEnv->channel_map );
       wEnv->channel_map->add(env, wEnv->channel_map, ch->mbean->name, ch);
   
       /* Automatically create the ajp13 worker to be used with this channel.
  @@ -574,7 +570,7 @@
           int pos=wEnv->endpointMap->size( env, wEnv->endpointMap );
           
           wEnv->endpointMap->add( env, wEnv->endpointMap, ep->mbean->localName,
ep );
  -        ep->id=pos;
  +        ep->mbean->id=pos;
   
           ep->mbean->init( env, ep->mbean );
       }
  @@ -595,7 +591,7 @@
   
       w->workerEnv=wEnv;
   
  -    w->id=wEnv->worker_map->size( env, wEnv->worker_map );
  +    w->mbean->id=wEnv->worker_map->size( env, wEnv->worker_map );
   
       w->rPoolCache= jk2_objCache_create( env, w->mbean->pool  );
   
  @@ -621,10 +617,8 @@
                                                  char *type, char *name) 
   {
       int err=JK_OK;
  -    jk_env_objectFactory_t fac;
       jk_worker_t *w = NULL;
       jk_worker_t *oldW = NULL;
  -    jk_pool_t *workerPool;
       jk_bean_t *jkb;
   
       /* First find if it already exists */
  @@ -655,8 +649,6 @@
                                       const char *type, const char *name)
   {
       jk_workerEnv_t *wEnv;
  -    int err;
  -    jk_pool_t *uriMapPool;
       jk_bean_t *jkb;
       int csOk;
   
  @@ -750,7 +742,7 @@
       wEnv->globalEnv=env;
   
       jkb=env->createBean2(env, wEnv->pool,"uriMap", "");
  -    if( jkb==NULL ) {
  +    if( jkb==NULL || jkb->object==NULL ) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "Error getting uriMap implementation\n");
           return JK_ERR;
  
  
  
  1.22      +1 -6      jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c
  
  Index: jk_worker_ajp13.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- jk_worker_ajp13.c	15 May 2002 19:41:26 -0000	1.21
  +++ jk_worker_ajp13.c	16 May 2002 21:03:45 -0000	1.22
  @@ -147,11 +147,6 @@
   {
       jk_worker_t *ajp14=(jk_worker_t *)mbean->object;
       char *value=(char *)valueP;
  -    int    port;
  -    char * host;
  -    int err;
  -    char * secret_key;
  -    char *channelType;
              
       if( strcmp( name, "secretkey" )==0 ) {
           ajp14->secret = value;
  @@ -567,7 +562,6 @@
                               jk_endpoint_t **eP)
   {
       jk_endpoint_t *e = NULL;
  -    jk_pool_t *endpointPool;
       jk_bean_t *jkb;
       int csOk;
       
  @@ -637,6 +631,7 @@
               e->stats->startTime=e->stats->jkStartTime;
       }
   #endif
  +    e->stats->workerId=w->mbean->id;
       
       err=jk2_worker_ajp14_service1( env, w, s, e );
   
  
  
  
  1.14      +0 -5      jakarta-tomcat-connectors/jk/native2/common/jk_worker_jni.c
  
  Index: jk_worker_jni.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_jni.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- jk_worker_jni.c	14 May 2002 17:27:21 -0000	1.13
  +++ jk_worker_jni.c	16 May 2002 21:03:45 -0000	1.14
  @@ -119,8 +119,6 @@
       char *value=valueP;
       jni_worker_data_t *jniWorker;
       int mem_config = 0;
  -    int rc;
  -    JNIEnv *jniEnv;
   
       if(! pThis || ! pThis->worker_private) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
  @@ -162,7 +160,6 @@
       jint rc = 0;
       char *str_config = NULL;
       jk_map_t *props=_this->workerEnv->initData;
  -    jk_bean_t *chB;
       jk_vm_t *vm=_this->workerEnv->vm;
       jclass jstringClass;
       jarray jargs;
  @@ -267,7 +264,6 @@
   {
       jk_worker_t *_this=bean->object;
       jni_worker_data_t *jniWorker;
  -    JNIEnv *jniEnv;
       jk_vm_t *vm=_this->workerEnv->vm;
   
       if(!_this  || ! _this->worker_private) {
  @@ -311,7 +307,6 @@
   {
       jk_worker_t *_this;
       jni_worker_data_t *jniData;
  -    jk_bean_t *jkb;
       
       if(name==NULL) {
           env->l->jkLog(env, env->l, JK_LOG_EMERG, 
  
  
  
  1.17      +7 -15     jakarta-tomcat-connectors/jk/native2/common/jk_worker_lb.c
  
  Index: jk_worker_lb.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_lb.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- jk_worker_lb.c	15 May 2002 19:45:45 -0000	1.16
  +++ jk_worker_lb.c	16 May 2002 21:03:45 -0000	1.17
  @@ -281,7 +281,6 @@
                                       jk_ws_service_t *s)
   {
       int attempt=0;
  -    int i;
       jk_workerEnv_t *wEnv=lb->workerEnv;
       
       if( s==NULL ) {
  @@ -403,7 +402,6 @@
   {
       int currentWorker=0;
       int i;
  -    int level;
       int num_of_workers=lb->lbWorkerMap->size( env, lb->lbWorkerMap);
   
       for(i = 0 ; i < num_of_workers ; i++) {
  @@ -445,11 +443,7 @@
   {
       jk_worker_t *lb=mbean->object;
       char *value=valueP;
  -    int err;
  -    char **worker_names;
  -    unsigned num_of_workers;
       unsigned i = 0;
  -    char *tmp;
       
       if( strcmp( name, "worker") == 0 ) {
           if( lb->lbWorkerMap->get( env, lb->lbWorkerMap, name) != NULL ) {
  @@ -458,9 +452,10 @@
           }
           value = lb->mbean->pool->pstrdup(env, lb->mbean->pool, value);
           lb->lbWorkerMap->add(env, lb->lbWorkerMap, value, "");
  -        
  -        env->l->jkLog(env, env->l, JK_LOG_INFO,
  -                      "lb_worker.setAttribute(): Adding to %s: %s\n", lb->mbean->localName,
value);
  +
  +        if( lb->mbean->debug > 0 )
  +            env->l->jkLog(env, env->l, JK_LOG_INFO,
  +                          "lb_worker.setAttribute(): Adding to %s: %s\n", lb->mbean->localName,
value);
   
           jk2_lb_refresh( env, lb );
           return JK_OK;
  @@ -480,9 +475,7 @@
   {
       jk_worker_t *lb=bean->object;
       int err;
  -    char **worker_names;
       int i = 0;
  -    char *tmp;
       int num_of_workers=lb->lbWorkerMap->size( env, lb->lbWorkerMap);
   
       err=jk2_lb_refresh(env, lb );
  @@ -491,10 +484,9 @@
   
       /*     if( lb->workerEnv->shm != NULL && lb->workerEnv->shm->head
!= NULL)  */
       /*         jk2_lb_updateWorkers(env, lb, lb->workerEnv->shm); */
  -
  -    env->l->jkLog(env, env->l, JK_LOG_INFO,
  -                  "lb.init() %s %d workers\n",
  -                  lb->mbean->name, num_of_workers );
  +    if( lb->mbean->debug > 0 )
  +        env->l->jkLog(env, env->l, JK_LOG_INFO, "lb.init() %s %d workers\n",
  +                      lb->mbean->name, num_of_workers );
       
       return JK_OK;
   }
  
  
  

--
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