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_env.c jk_pool_apr.c jk_shm.c jk_uriEnv.c jk_vm_default.c jk_workerEnv.c jk_worker_jni.c jk_worker_status.c
Date Thu, 16 May 2002 23:48:28 GMT
costin      02/05/16 16:48:28

  Modified:    jk/native2/common jk_channel_apr_socket.c jk_channel_jni.c
                        jk_env.c jk_pool_apr.c jk_shm.c jk_uriEnv.c
                        jk_vm_default.c jk_workerEnv.c jk_worker_jni.c
                        jk_worker_status.c
  Log:
  All files will compile now, with some generating empty factories
  if the feature is not enabled.
  
  Use 'lb' instead of 'worker.lb' and 'ajp13' instead of 'worker.ajp13'.
  ( it's better to use a simpler name, and it remove another confusing use
  of 'worker' name )
  
  Remove some of the workarounds and tricks - the code is now stable and
  well, it's better to fix the remaining bugs then to work around.
  
  Revision  Changes    Path
  1.19      +21 -4     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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- jk_channel_apr_socket.c	16 May 2002 21:03:44 -0000	1.18
  +++ jk_channel_apr_socket.c	16 May 2002 23:48:27 -0000	1.19
  @@ -62,10 +62,6 @@
    * @author: Costin Manolache
    * @author: Jean-Frederic Clere <jfrederic.clere@fujitsu-siemens.com>
    */
  -#include "apr_network_io.h"
  -#include "apr_errno.h"
  -#include "apr_general.h"
  -
   
   #include "jk_global.h"
   #include "jk_map.h"
  @@ -77,6 +73,11 @@
   #include "jk_registry.h"
   
   
  +#ifdef HAS_APR
  +#include "apr_network_io.h"
  +#include "apr_errno.h"
  +#include "apr_general.h"
  +
   
   #define DEFAULT_HOST "127.0.0.1"
   
  @@ -444,3 +445,19 @@
   
       return JK_OK;
   }
  +#else /* HAS_APR */
  +
  +int JK_METHOD jk2_channel_apr_socket_factory(jk_env_t *env,
  +                                             jk_pool_t *pool, 
  +                                             jk_bean_t *result,
  +                                             const char *type, const char *name)
  +{
  +
  +    result->disabled=1;
  +    result->object= NULL;
  +
  +    return JK_OK;
  +}
  +
  +
  +#endif
  
  
  
  1.20      +18 -0     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.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- jk_channel_jni.c	16 May 2002 21:03:44 -0000	1.19
  +++ jk_channel_jni.c	16 May 2002 23:48:27 -0000	1.20
  @@ -62,6 +62,12 @@
    * @author: Costin Manolache
    */
   
  +#include "jk_workerEnv.h"
  +#include "jk_env.h"
  +#include "jk_bean.h"
  +
  +#ifdef HAVE_JNI
  +
   #include "jk_map.h"
   #include "jk_env.h"
   #include "jk_channel.h"
  @@ -540,3 +546,15 @@
       
       return JK_OK;
   }
  +
  +#else
  +
  +int JK_METHOD jk2_channel_jni_factory(jk_env_t *env, jk_pool_t *pool, 
  +                                      jk_bean_t *result,
  +                                      const char *type, const char *name)
  +{
  +    result->disabled=1;
  +    return JK_OK;
  +}
  +
  +#endif
  
  
  
  1.26      +9 -8      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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- jk_env.c	16 May 2002 21:03:44 -0000	1.25
  +++ jk_env.c	16 May 2002 23:48:27 -0000	1.26
  @@ -164,9 +164,10 @@
           /* Funny pointer arithmetic. I hope I got it right */
           type=env->tmpPool->calloc( env, env->tmpPool, localName - objName + 2
);
           strncpy( type, objName, localName - objName );
  +        localName++;
       }
       
  -    return env->createBean2( env, pool, type, objName );
  +    return env->createBean2( env, pool, type, localName );
   }
   
   /** Create a component using type and local part ( pre-cooked ).
  @@ -199,14 +200,14 @@
           return NULL;
       }
   
  -    if( localName!=NULL && strncmp( localName, type, strlen( type )) == 0 ) {
  +    /* if( localName!=NULL && strncmp( localName, type, strlen( type )) == 0 )
{ */
           /* Common error, make it 'localName' */
  -        if( strcmp( type, localName ) == 0 ) {
  -            localName="";
  -        } else {
  -            localName= localName + strlen(type) + 1;
  -        }
  -    }
  +    /*         if( strcmp( type, localName ) == 0 ) { */
  +    /*             localName=""; */
  +    /*         } else { */
  +    /*             localName= localName + strlen(type) + 1; */
  +    /*         } */
  +    /*     } */
   
       if( env->debug > 0 ) {
           if( env->l != NULL ) {
  
  
  
  1.4       +3 -0      jakarta-tomcat-connectors/jk/native2/common/jk_pool_apr.c
  
  Index: jk_pool_apr.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_pool_apr.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_pool_apr.c	11 May 2002 17:29:28 -0000	1.3
  +++ jk_pool_apr.c	16 May 2002 23:48:27 -0000	1.4
  @@ -61,6 +61,8 @@
    * @author Costin Manolache
    */
   
  +#ifdef HAS_APR
  +
   #include "apr_pools.h"
   #include "apr_strings.h"
   #include "apr_network_io.h"
  @@ -210,3 +212,4 @@
   }
   
   
  +#endif
  
  
  
  1.17      +5 -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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- jk_shm.c	16 May 2002 21:02:44 -0000	1.16
  +++ jk_shm.c	16 May 2002 23:48:27 -0000	1.17
  @@ -80,6 +80,7 @@
   #include "apr_mmap.h"
   #include "apr_file_io.h"
   #include "apr_file_info.h"
  +#include "apr_general.h"
   static apr_pool_t *globalShmPool;
   
   #elif defined(HAVE_MMAP) && !defined(WIN32)
  @@ -100,7 +101,7 @@
   
   #ifdef APR_HAS_MMAP    
   
  -static int jk2_shm_destroy(jk_env_t *env, jk_shm_t *shm)
  +static int JK_METHOD jk2_shm_destroy(jk_env_t *env, jk_shm_t *shm)
   {
       apr_mmap_t *aprShm=(apr_mmap_t *)shm->privateData;
   
  @@ -115,7 +116,6 @@
       int rc;
       apr_file_t *file;
       apr_finfo_t finfo;
  -    apr_size_t size;
       apr_mmap_t *aprMmap;
   
       /* We don't want to have to recreate the scoreboard after
  @@ -156,7 +156,7 @@
   
       if( finfo.size < shm->size ) {
           char bytes[1024];
  -        int toWrite=shm->size-finfo.size;
  +        apr_size_t toWrite=shm->size-finfo.size;
           apr_off_t off=0;
           
           memset( bytes, 0, 1024 );        
  @@ -208,7 +208,7 @@
   
   #elif defined(HAVE_MMAP) && !defined(WIN32)
   
  -static int jk2_shm_destroy(jk_env_t *env, jk_shm_t *shm)
  +static int JK_METHOD jk2_shm_destroy(jk_env_t *env, jk_shm_t *shm)
   {
       caddr_t shmf=(caddr_t)shm->privateData;
   
  @@ -293,7 +293,7 @@
   
   #else
   
  -static int jk2_shm_destroy(jk_env_t *env, jk_shm_t *shm)
  +static int JK_METHOD jk2_shm_destroy(jk_env_t *env, jk_shm_t *shm)
   {
       return JK_OK;
   }
  
  
  
  1.21      +1 -1      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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- jk_uriEnv.c	16 May 2002 21:03:44 -0000	1.20
  +++ jk_uriEnv.c	16 May 2002 23:48:27 -0000	1.21
  @@ -219,7 +219,7 @@
       if( uriEnv->workerName != NULL && uriEnv->worker==NULL ) {
           uriEnv->worker= env->getByName( env, wname );
           if( uriEnv->worker==NULL ) {
  -            uriEnv->worker= env->getByName2( env, "worker.lb", wname );
  +            uriEnv->worker= env->getByName2( env, "lb", wname );
               if( uriEnv->worker==NULL ) {
                   env->l->jkLog(env, env->l, JK_LOG_ERROR,
                                 "uriEnv.init() map to invalid worker %s %s\n",
  
  
  
  1.14      +17 -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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- jk_vm_default.c	16 May 2002 21:03:45 -0000	1.13
  +++ jk_vm_default.c	16 May 2002 23:48:27 -0000	1.14
  @@ -74,6 +74,12 @@
    * @author: Costin Manolache
    */
   
  +#include "jk_workerEnv.h"
  +#include "jk_env.h"
  +#include "jk_bean.h"
  +
  +#ifdef HAVE_JNI
  +
   #include "jk_global.h"
   #include "jk_vm.h"
   #include "jk_config.h"
  @@ -500,8 +506,7 @@
   
   
   int JK_METHOD jk2_vm_factory(jk_env_t *env, jk_pool_t *pool,
  -                   jk_bean_t *result,
  -                   char *type, char *name)
  +                             jk_bean_t *result, char *type, char *name)
   {
       jk_vm_t *jkvm;
       jk_workerEnv_t *workerEnv;
  @@ -531,3 +536,13 @@
   }
   
   #endif /* Java2 */
  +
  +#else /* HAVE_JNI */
  +
  +int JK_METHOD jk2_vm_factory(jk_env_t *env, jk_pool_t *pool,
  +                             jk_bean_t *result, char *type, char *name)
  +{
  +    result->disabled=1;
  +    return JK_OK;
  +}
  +#endif
  
  
  
  1.44      +3 -3      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.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- jk_workerEnv.c	16 May 2002 21:03:45 -0000	1.43
  +++ jk_workerEnv.c	16 May 2002 23:48:27 -0000	1.44
  @@ -59,7 +59,7 @@
    * Description: Workers controller                                         *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
    * Author:      Henri Gomez <hgomez@slib.fr>                               *
  - * Version:     $Revision: 1.43 $                                           *
  + * Version:     $Revision: 1.44 $                                           *
    ***************************************************************************/
   
   #include "jk_env.h"
  @@ -355,10 +355,10 @@
       /* Set default worker. It'll be used for all uris that have no worker
        */
       if( wEnv->defaultWorker == NULL ) {
  -        jk_worker_t *w=wEnv->worker_map->get( env, wEnv->worker_map, "worker.lb:lb"
);
  +        jk_worker_t *w=wEnv->worker_map->get( env, wEnv->worker_map, "lb:lb" );
           
           if( w==NULL ) {
  -            jk_bean_t *jkb=env->createBean2(env, wEnv->pool, "worker.lb", "lb" );
  +            jk_bean_t *jkb=env->createBean2(env, wEnv->pool, "lb", "lb" );
               w=jkb->object;
               if( wEnv->mbean->debug > 0 )
                   env->l->jkLog(env, env->l, JK_LOG_ERROR, "workerEnv.init() create
default worker %s\n",  jkb->name );
  
  
  
  1.15      +16 -0     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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- jk_worker_jni.c	16 May 2002 21:03:45 -0000	1.14
  +++ jk_worker_jni.c	16 May 2002 23:48:27 -0000	1.15
  @@ -63,6 +63,11 @@
    * @author:  Gal Shachor <shachor@il.ibm.com>
    * @author: Costin Manolache
    */
  +#include "jk_workerEnv.h"
  +#include "jk_env.h"
  +#include "jk_bean.h"
  +
  +#ifdef HAVE_JNI
   
   #include "jk_vm.h"
   #include "jk_registry.h"
  @@ -348,4 +353,15 @@
       
       return JK_OK;
   }
  +#else
   
  +int JK_METHOD jk2_worker_jni_factory(jk_env_t *env, jk_pool_t *pool,
  +                                     jk_bean_t *result,
  +                                     const char *type, const char *name)
  +{
  +    result->disabled=1;
  +    
  +    return JK_OK;
  +}
  +     
  +#endif
  
  
  
  1.23      +1 -4      jakarta-tomcat-connectors/jk/native2/common/jk_worker_status.c
  
  Index: jk_worker_status.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_status.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- jk_worker_status.c	16 May 2002 21:00:04 -0000	1.22
  +++ jk_worker_status.c	16 May 2002 23:48:27 -0000	1.23
  @@ -172,7 +172,6 @@
           char *name=env->_objects->nameAt( env, env->_objects, i );
           jk_bean_t *mbean=env->_objects->valueAt( env, env->_objects, i );
           jk_endpoint_t *ep;
  -        int j;
   
           if( mbean==NULL ) 
               continue;
  @@ -203,7 +202,6 @@
       int needHeader=JK_TRUE;
       
       if( wenv->shm==NULL || wenv->shm->head==NULL) {
  -        jk2_worker_status_displayEndpointInfo( env, s, wenv );
           return;
       }
   
  @@ -379,7 +377,6 @@
                                                  jk_ws_service_t *s)
   {
       char *uri=s->req_uri;
  -    jk_map_t *queryMap;
       int didUpdate;
   
       if( w->mbean->debug > 0 ) 
  @@ -415,7 +412,7 @@
       /* Body */
       jk2_worker_status_displayRuntimeType(env, s, s->workerEnv, "ajp13" );
       jk2_worker_status_displayScoreboardInfo(env, s, s->workerEnv );
  -/*     jk2_worker_status_displayRuntimeType(env, s, s->workerEnv, "endpoint" ); */
  +    jk2_worker_status_displayEndpointInfo( env, s, s->workerEnv );
       jk2_worker_status_displayRuntimeType(env, s, s->workerEnv, "uri" );
       jk2_worker_status_displayConfigProperties(env, s, s->workerEnv );
       jk2_worker_status_displayActiveProperties(env, s, s->workerEnv );
  
  
  

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