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/jni jk_jni_aprImpl.c
Date Fri, 31 May 2002 19:19:45 GMT
costin      2002/05/31 12:19:45

  Modified:    jk/native2 build.xml
               jk/native2/common jk_shm.c jk_workerEnv.c
               jk/native2/jni jk_jni_aprImpl.c
  Log:
  Other fixes.
  
  Remove the locking when adding worker/channel/etc - it's better to
  sync on the thread making updates ( the original config is in the
  main thread , updates are syced in jk_config ).
  
  ( this avoids problems when a component adds another one )
  
  Revision  Changes    Path
  1.35      +1 -0      jakarta-tomcat-connectors/jk/native2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/build.xml,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- build.xml	30 May 2002 18:00:56 -0000	1.34
  +++ build.xml	31 May 2002 19:19:44 -0000	1.35
  @@ -378,6 +378,7 @@
   	   info="Building for NetWare platform" />
         <def name="HAS_APR"
   	   info="JNI is now based on APR" />
  +      <def name="_REENTRANT" />
         <def name="HAVE_JNI" />
              
         <import fileName="${novellndk.home}/imports/clib.imp" if="netware" />
  
  
  
  1.23      +6 -5      jakarta-tomcat-connectors/jk/native2/common/jk_shm.c
  
  Index: jk_shm.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_shm.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- jk_shm.c	30 May 2002 18:21:03 -0000	1.22
  +++ jk_shm.c	31 May 2002 19:19:45 -0000	1.23
  @@ -127,13 +127,14 @@
       if( shm->image!=NULL ) {
           shm->head = (jk_shm_head_t *)shm->image;
   
  -        env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  -                      "shm.create(): GLOBAL_SHM  %p\n", shm->image );
  -        fprintf( stderr, "GLOBAL SHM: %p\n", shm->image );
  +        if( shm->mbean->debug > 0 )
  +            env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  +                          "shm.create(): GLOBAL_SHM  %p\n", shm->image );
           return JK_OK;
       } else {
  -        env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  -                      "shm.create(): NO GLOBAL_SHM  %p\n", shm->image );
  +        if( shm->mbean->debug > 0 )
  +            env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  +                          "shm.create(): NO GLOBAL_SHM  %p\n", shm->image );
       }
       
   
  
  
  
  1.51      +6 -30     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.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- jk_workerEnv.c	31 May 2002 18:09:13 -0000	1.50
  +++ jk_workerEnv.c	31 May 2002 19:19:45 -0000	1.51
  @@ -59,7 +59,7 @@
    * Description: Workers controller                                         *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
    * Author:      Henri Gomez <hgomez@slib.fr>                               *
  - * Version:     $Revision: 1.50 $                                           *
  + * Version:     $Revision: 1.51 $                                           *
    ***************************************************************************/
   
   #include "jk_env.h"
  @@ -554,11 +554,7 @@
   {
       int err=JK_OK;
       jk_bean_t *jkb;
  -    int csOk;
       
  -    if( wEnv->cs != NULL ) 
  -        wEnv->cs->lock( env, wEnv->cs );
  -
       ch->mbean->id=wEnv->channel_map->size( env, wEnv->channel_map );
       wEnv->channel_map->add(env, wEnv->channel_map, ch->mbean->name, ch);
   
  @@ -568,37 +564,24 @@
       if( jkb == NULL ) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "workerEnv.addChannel(): Can't find ajp13 worker\n" );
  -        if( wEnv->cs != NULL ) 
  -            wEnv->cs->unLock( env, wEnv->cs );
           return JK_ERR;
       }
       ch->worker=jkb->object;
       ch->worker->channelName=ch->mbean->name;
       ch->worker->channel=ch;
               
  -    /* XXX Set additional parameters - use defaults otherwise */
  -    if( wEnv->cs != NULL ) 
  -        wEnv->cs->unLock( env, wEnv->cs );
  -
       return JK_OK;
   }
   
   static int jk2_workerEnv_addEndpoint(jk_env_t *env, jk_workerEnv_t *wEnv, jk_endpoint_t
*ep)
   {
  -    int csOk;
  +    int pos=wEnv->endpointMap->size( env, wEnv->endpointMap );
       
  -    if( wEnv->cs != NULL ) 
  -        wEnv->cs->lock( env, wEnv->cs );
  -    {
  -        int pos=wEnv->endpointMap->size( env, wEnv->endpointMap );
  -        
  -        wEnv->endpointMap->add( env, wEnv->endpointMap, ep->mbean->localName,
ep );
  -        ep->mbean->id=pos;
  +    wEnv->endpointMap->add( env, wEnv->endpointMap, ep->mbean->localName,
ep );
  +    ep->mbean->id=pos;
  +    
  +    ep->mbean->init( env, ep->mbean );
   
  -        ep->mbean->init( env, ep->mbean );
  -    }
  -    if( wEnv->cs != NULL ) 
  -        wEnv->cs->unLock( env, wEnv->cs );
       return JK_OK;
   }
   
  @@ -610,9 +593,6 @@
       jk_worker_t *oldW = NULL;
       int csOk;
       
  -    if( wEnv->cs != NULL ) 
  -        wEnv->cs->lock( env, wEnv->cs ); 
  -
       w->workerEnv=wEnv;
   
       w->mbean->id=wEnv->worker_map->size( env, wEnv->worker_map );
  @@ -622,8 +602,6 @@
       err=w->rPoolCache->init( env, w->rPoolCache,
                                1024 ); /* XXX make it unbound */
   
  -    fprintf( stderr, "XXXWE.addWorker 2 %p %p\n", w, w->rPoolCache );
  -
       wEnv->worker_map->put(env, wEnv->worker_map, w->mbean->name, w, (void
*)&oldW);
               
       if(oldW!=NULL) {
  @@ -634,8 +612,6 @@
               oldW->mbean->destroy(env, oldW->mbean);
       }
       
  -    if( wEnv->cs != NULL ) 
  -        wEnv->cs->unLock( env, wEnv->cs );
       return JK_OK;
   }
   
  
  
  
  1.30      +4 -4      jakarta-tomcat-connectors/jk/native2/jni/jk_jni_aprImpl.c
  
  Index: jk_jni_aprImpl.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/jni/jk_jni_aprImpl.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- jk_jni_aprImpl.c	30 May 2002 18:08:48 -0000	1.29
  +++ jk_jni_aprImpl.c	31 May 2002 19:19:45 -0000	1.30
  @@ -525,7 +525,7 @@
       int cnt=0;
       jint rc = 0;
       unsigned acc = 0;
  -    char *oldBuf;
  +    unsigned char *oldBuf;
   
       if( compCtx==NULL || data==NULL ) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,"jni.jkInvoke() NPE\n");
  @@ -555,9 +555,9 @@
           }
           
           oldBuf=ep->reply->buf;
  -        ep->reply->buf = nbuf;
  +        ep->reply->buf = (unsigned char *)nbuf;
       } else if ( arrayAccessMethod == JK_GET_REGION ) {
  -        (*jniEnv)->GetByteArrayRegion( jniEnv, data, off, len, ep->reply->buf
);
  +        (*jniEnv)->GetByteArrayRegion( jniEnv, data, off, len, (jbyte *)ep->reply->buf
);
       }
           
       
  @@ -605,7 +605,7 @@
               /*   env->l->jkLog(env, env->l, JK_LOG_INFO, */
               /*                "jkInvoke() release %d %d %p\n", */
               /*                ep->reply->pos, ep->reply->len , ep->reply->buf
); */
  -            (*jniEnv)->SetByteArrayRegion( jniEnv, data, 0, ep->reply->len + 4
, ep->reply->buf );
  +            (*jniEnv)->SetByteArrayRegion( jniEnv, data, 0, ep->reply->len + 4
, (jbyte *)ep->reply->buf );
               rc=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