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/include jk_map.h
Date Wed, 01 May 2002 23:10:17 GMT
costin      02/05/01 16:10:17

  Modified:    jk/native2/common jk_channel_jni.c jk_shm.c
                        jk_worker_ajp13.c
               jk/native2/include jk_map.h
  Log:
  Few fixes in error handling and checking for exceptions.
  
  Revision  Changes    Path
  1.12      +1 -2      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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- jk_channel_jni.c	1 May 2002 22:23:36 -0000	1.11
  +++ jk_channel_jni.c	1 May 2002 23:10:17 -0000	1.12
  @@ -309,8 +309,7 @@
           jk2_channel_jni_open( env, _this, endpoint );
           epData=(jk_ch_jni_ep_private_t *)endpoint->channelData;
       }
  -
  -    if( epData->jniJavaContext == NULL ) {
  +    if( epData == NULL || epData->jniJavaContext == NULL ) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,"channel_jni.send() no java context\n"
); 
           
           return JK_ERR;
  
  
  
  1.9       +16 -7     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- jk_shm.c	30 Apr 2002 01:01:03 -0000	1.8
  +++ jk_shm.c	1 May 2002 23:10:17 -0000	1.9
  @@ -175,6 +175,11 @@
           return JK_OK;
       }
   
  +    if( shm->size <= 0 ) {
  +        env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  +                      "shm.create(): No size %s\n", shm->fname);
  +        return JK_ERR;
  +    }
       /* make sure it's an absolute pathname */
       /*  fname = ap_server_root_relative(pconf, ap_scoreboard_fname); */
   
  @@ -189,13 +194,11 @@
                         "shm.create(): error removing shm %s %d %s\n",
                         shm->fname, rv, error );
           shm->privateData=NULL;
  -        return rv;
       } else {
           env->l->jkLog(env, env->l, JK_LOG_ERROR, 
                         "shm.create(): file removed ok\n");
       }
   
  -
       rv = apr_shm_create((apr_shm_t **)&shm->privateData,(apr_size_t)shm->size,
                           shm->fname, globalShmPool);
       
  @@ -232,7 +235,7 @@
   
       shm->head->slotSize = shm->slotSize;
       shm->head->slotMaxCount = shm->slotMaxCount;
  -    shm->head->lastSlot = 0;
  +    shm->head->lastSlot = 1;
       
       env->l->jkLog(env, env->l, JK_LOG_INFO, 
                     "shm.init() Initalized %s %p\n",
  @@ -312,6 +315,7 @@
   {
       jk_bean_t *bean=(jk_bean_t *)target;
       jk_shm_t *shm=(jk_shm_t *)bean->object;
  +    int rc;
   
       int code=msg->getByte(env, msg );
       
  @@ -330,8 +334,8 @@
       case SHM_ATTACH: {
           env->l->jkLog(env, env->l, JK_LOG_INFO, 
                         "shm.init()\n");
  -        shm->init(env, shm);
  -        return JK_OK;
  +        rc=shm->init(env, shm);
  +        return rc;
       }
       case SHM_DETACH: {
   
  @@ -342,12 +346,17 @@
           jk_shm_slot_t *slot;
           
           env->l->jkLog(env, env->l, JK_LOG_INFO, 
  -                      "shm.registerTomcat() %s %d\n",
  +                      "shm.writeSlot() %s %d\n",
                         instanceName, msg->len );
           if( msg->len > shm->slotSize ) {
               env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  -                          "shm.registerTomcat() Packet too large %d %d\n",
  +                          "shm.writeSlot() Packet too large %d %d\n",
                             shm->slotSize, msg->len );
  +            return JK_ERR;
  +        }
  +        if( shm->head == NULL ) {
  +            env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  +                          "shm.writeSlot() No head - shm was not initalized\n");
               return JK_ERR;
           }
           slot=shm->createSlot( env, shm, instanceName, 0 );
  
  
  
  1.11      +1 -1      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- jk_worker_ajp13.c	1 May 2002 22:23:36 -0000	1.10
  +++ jk_worker_ajp13.c	1 May 2002 23:10:17 -0000	1.11
  @@ -401,7 +401,7 @@
                     "ajp14.forwardST() After %d\n",err);
       
       
  -    return JK_OK;
  +    return err;
   }
        
   static int JK_METHOD
  
  
  
  1.13      +4 -2      jakarta-tomcat-connectors/jk/native2/include/jk_map.h
  
  Index: jk_map.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_map.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- jk_map.h	27 Apr 2002 00:50:43 -0000	1.12
  +++ jk_map.h	1 May 2002 23:10:17 -0000	1.13
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: Map object header file                                     *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.12 $                                           *
  + * Version:     $Revision: 1.13 $                                           *
    ***************************************************************************/
   
   #ifndef JK_MAP_H
  @@ -85,11 +85,13 @@
   
       void *(*get)(struct jk_env *env, struct jk_map *_this,
                    const char *name);
  -    
  +
  +    /** Set the value, overriding previous values */
       int (*put)(struct jk_env *env, struct jk_map *_this,
                  const char *name, void *value,
                  void **oldValue);
   
  +    /** Multi-value support */
       int (*add)(struct jk_env *env, struct jk_map *_this,
                  const char *name, void *value );
   
  
  
  

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