tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_channel_apr_socket.c jk_endpoint.c jk_env.c jk_logger_file.c jk_mutex_proc.c jk_mutex_thread.c jk_pool_apr.c jk_registry.c jk_shm.c jk_vm_default.c jk_worker_ajp13.c jk_worker_lb.c jk_worker_status.c
Date Thu, 30 Oct 2003 20:08:37 GMT
mturk       2003/10/30 12:08:37

  Modified:    jk/native2/common jk_channel_apr_socket.c jk_endpoint.c
                        jk_env.c jk_logger_file.c jk_mutex_proc.c
                        jk_mutex_thread.c jk_pool_apr.c jk_registry.c
                        jk_shm.c jk_vm_default.c jk_worker_ajp13.c
                        jk_worker_lb.c jk_worker_status.c
  Log:
  Remove all the HAS_APR, and presume it is used bz default.
  User apr_socket as socket.
  
  Revision  Changes    Path
  1.34      +7 -32     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.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- jk_channel_apr_socket.c	16 Oct 2003 08:41:06 -0000	1.33
  +++ jk_channel_apr_socket.c	30 Oct 2003 20:08:36 -0000	1.34
  @@ -68,18 +68,8 @@
   #include "jk_env.h"
   #include "jk_channel.h"
   #include "jk_global.h"
  -
  -#include <string.h>
   #include "jk_registry.h"
   
  -
  -#ifdef HAS_APR
  -#include "apr_network_io.h"
  -#include "apr_errno.h"
  -#include "apr_general.h"
  -#include "apr_version.h"
  -
  -
   #define DEFAULT_HOST "127.0.0.1"
   
   /** Information specific for the socket channel
  @@ -112,9 +102,9 @@
   
   
   static char *jk2_channel_apr_socket_getAttributeInfo[]={"host", "port", "keepalive", "timeout",
"nodelay", "graceful",
  -	                                                    "debug", "disabled", NULL };
  +                                                        "debug", "disabled", NULL };
   static char *jk2_channel_apr_socket_setAttributeInfo[]={"host", "port", "keepalive", "timeout",
"nodelay", "graceful",
  -	                                                    "debug", "disabled", NULL };
  +                                                        "debug", "disabled", NULL };
   
   static int JK_METHOD jk2_channel_apr_setProperty(jk_env_t *env,
                                                       jk_bean_t *mbean, 
  @@ -226,13 +216,13 @@
   static int JK_METHOD jk2_channel_apr_hasinput(jk_env_t *env,
                                                 jk_channel_t *ch,
                                                 jk_endpoint_t *endpoint,
  -											  int timeout)
  +                                              int timeout)
   
   {
  -	/*
  -	 * Should implements the APR select/poll for socket here
  -	 */
  -	return (JK_TRUE) ;
  +    /*
  +     * Should implements the APR select/poll for socket here
  +     */
  +    return (JK_TRUE) ;
   }
   
   
  @@ -568,18 +558,3 @@
   
       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.26      +0 -2      jakarta-tomcat-connectors/jk/native2/common/jk_endpoint.c
  
  Index: jk_endpoint.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_endpoint.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- jk_endpoint.c	26 Oct 2003 19:16:22 -0000	1.25
  +++ jk_endpoint.c	30 Oct 2003 20:08:36 -0000	1.26
  @@ -121,10 +121,8 @@
   
       ep->stats->reqCnt=0;
       ep->stats->errCnt=0;
  -#ifdef HAS_APR
       ep->stats->maxTime=0;
       ep->stats->totalTime=0;
  -#endif
   
       bean->state=JK_STATE_INIT;
   
  
  
  
  1.41      +0 -10     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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- jk_env.c	25 Sep 2003 15:23:23 -0000	1.40
  +++ jk_env.c	30 Oct 2003 20:08:36 -0000	1.41
  @@ -58,9 +58,6 @@
   #include "jk_global.h"
   #include "jk_env.h"
   #include "jk_objCache.h"
  -#ifdef HAS_APR
  -#include "apr_general.h"
  -#endif
   
   jk_env_t *jk_env_globalEnv;
   void *jkGlobalAprPool=NULL;
  @@ -76,7 +73,6 @@
   /* -------------------- Env management -------------------- */
   
   static void * JK_METHOD jk2_env_getAprPool( jk_env_t *env ) {
  -#ifdef HAS_APR
       /* We don't want to have to recreate the scoreboard after
        * restarts, so we'll create a global pool and never clean it.
        */
  @@ -91,9 +87,6 @@
           }
       }
       return jkGlobalAprPool;
  -#else
  -    return NULL;
  -#endif
   }
   
   void JK_METHOD jk2_env_setAprPool( jk_env_t *env, void *aprPool ) {
  @@ -523,7 +516,4 @@
       env->envCache->init( env, env->envCache, 64 );
       env->envCache->maxSize=-1;
   }
  -
  -
  -
   
  
  
  
  1.41      +7 -98     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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- jk_logger_file.c	25 Sep 2003 15:23:22 -0000	1.40
  +++ jk_logger_file.c	30 Oct 2003 20:08:36 -0000	1.41
  @@ -71,7 +71,7 @@
   
   #include "jk_registry.h"
   
  -#define LOG_FORMAT		    ("log_format")
  +#define LOG_FORMAT          ("log_format")
   
   #define HUGE_BUFFER_SIZE (8*1024)
   #define LOG_LINE_SIZE    (1024)
  @@ -91,8 +91,8 @@
   
   static void jk2_logger_file_setTimeStr(jk_env_t *env,char * str, int len)
   {
  -	time_t		t = time(NULL);
  -    struct tm 	*tms;
  +    time_t      t = time(NULL);
  +    struct tm   *tms;
   
       tms = gmtime(&t);
   
  @@ -163,9 +163,9 @@
       } else {
       
   #ifdef AS400
  -     	f = fopen(_this->name, "a+, o_ccsid=0");
  +        f = fopen(_this->name, "a+, o_ccsid=0");
   #else
  -     	f = fopen(_this->name, "a+");
  +        f = fopen(_this->name, "a+");
   #endif        
           
           if(f==NULL) {
  @@ -225,11 +225,9 @@
                             "Level %s %d \n", value, _this->level );
           }
       }
  -	return JK_OK;
  +    return JK_OK;
   }
   
  -#ifdef HAS_APR
  -
   static int JK_METHOD jk2_logger_file_jkVLog(jk_env_t *env, jk_logger_t *l,
                                     const char *file,
                                     int line,
  @@ -286,95 +284,6 @@
       
       return rc;
   }
  -
  -
  -#else
  -
  -static int JK_METHOD jk2_logger_file_jkVLog(jk_env_t *env, jk_logger_t *l,
  -                                  const char *file,
  -                                  int line,
  -                                  int level,
  -                                  const char *fmt,
  -                                  va_list args)
  -{
  -    int rc = 0;
  -    
  -    if( !file || !args) {
  -        return -1;
  -    }
  -
  -    if(l->logger_private==NULL ||
  -       l->level <= level) {
  -#ifdef NETWARE
  -/* On NetWare, this can get called on a thread that has a limited stack so */
  -/* we will allocate and free the temporary buffer in this function         */
  -        char *buf;
  -#else
  -        char buf[HUGE_BUFFER_SIZE];
  -#endif
  -        char *slevel;
  -        char *f = (char *)(file + strlen(file) - 1);
  -        int used = 0;
  -
  -        switch (level){
  -            case JK_LOG_INFO_LEVEL : 
  -                slevel=JK_LOG_INFO_VERB;
  -                break;
  -            case JK_LOG_ERROR_LEVEL : 
  -                slevel=JK_LOG_ERROR_VERB;
  -                break;
  -            case JK_LOG_EMERG_LEVEL : 
  -                slevel=JK_LOG_EMERG_VERB;
  -                break;
  -            case JK_LOG_DEBUG_LEVEL : 
  -            default:
  -                slevel=JK_LOG_DEBUG_VERB;
  -                break;
  -
  -        }
  -
  -        while(f != file && '\\' != *f && '/' != *f) {
  -            f--;
  -        }
  -        if(f != file) {
  -            f++;
  -        }
  -
  -#if defined(NETWARE) && !defined(__NOVELL_LIBC__) /* until we get a snprintf function
*/
  -        buf = (char *) malloc(HUGE_BUFFER_SIZE);
  -        if (NULL == buf)
  -           return -1;
  -
  -        jk2_logger_file_setTimeStr(buf, HUGE_BUFFER_SIZE);
  -        used = strlen(buf);
  -        if( level >= JK_LOG_DEBUG_LEVEL )
  -            used += sprintf(&buf[used], " (%5s) [%s (%d)]: ", slevel,  f, line);
  -#else 
  -        jk2_logger_file_setTimeStr(env, buf, HUGE_BUFFER_SIZE);
  -        used = strlen(buf);
  -        if( level >= JK_LOG_DEBUG_LEVEL )
  -            used += snprintf(&buf[used], HUGE_BUFFER_SIZE, " (%5s) [%s (%d)]: ", slevel,
 f, line);
  -#endif
  -        if(used < 0) {
  -            return -1; /* [V] not sure what to return... */
  -        }
  -    
  -#if defined(NETWARE) && !defined(__NOVELL_LIBC__) /* until we get a vsnprintf function
*/
  -        rc = vsprintf(buf + used, fmt, args);
  -#else 
  -        rc = vsnprintf(buf + used, HUGE_BUFFER_SIZE - used, fmt, args);
  -#endif
  -
  -        l->log(env, l , level, buf);
  -#if defined(NETWARE) && !defined(__NOVELL_LIBC__)
  -        free(buf);
  -#endif
  -    }
  -    
  -    return rc;
  -}
  -
  -#endif
   
   
   static int jk2_logger_file_jkLog(jk_env_t *env, jk_logger_t *l,
  
  
  
  1.5       +3 -16     jakarta-tomcat-connectors/jk/native2/common/jk_mutex_proc.c
  
  Index: jk_mutex_proc.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_mutex_proc.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jk_mutex_proc.c	4 Feb 2003 07:39:58 -0000	1.4
  +++ jk_mutex_proc.c	30 Oct 2003 20:08:36 -0000	1.5
  @@ -66,8 +66,6 @@
   #include "jk_pool.h"
   #include "jk_mutex.h"
   
  -#ifdef HAS_APR
  -
   #include "apr_proc_mutex.h"
   
   
  @@ -142,11 +140,11 @@
       char *value=(char *)valueP;
       
       if( strcmp( "file", name ) == 0 ) {
  -	mutex->fname=value;
  +    mutex->fname=value;
       } else if( strcmp( "mechanism", name ) == 0 ) {
  -	mutex->mechanism=atoi(value);
  +    mutex->mechanism=atoi(value);
       } else {
  -	return JK_ERR;
  +    return JK_ERR;
       }
       return JK_OK;   
   
  @@ -181,14 +179,3 @@
       
       return JK_OK;
   }
  -
  -#else
  -
  -int JK_METHOD jk2_mutex_proc_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.9       +0 -86     jakarta-tomcat-connectors/jk/native2/common/jk_mutex_thread.c
  
  Index: jk_mutex_thread.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_mutex_thread.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- jk_mutex_thread.c	5 Mar 2003 00:00:51 -0000	1.8
  +++ jk_mutex_thread.c	30 Oct 2003 20:08:36 -0000	1.9
  @@ -118,92 +118,6 @@
       return apr_thread_mutex_unlock( jkMutex->threadMutex );
   }
   
  -#elif defined( WIN32 )
  -/*-------------------- Windows - @deprecated, use APR if possible --------------------
*/
  -
  -#include <windows.h>
  -
  -static int JK_METHOD jk2_mutex_thread_init(jk_env_t *env, jk_bean_t  *mutexB)
  -{
  -    jk_mutex_t *jkMutex=mutexB->object;
  -    mutexB->state=JK_STATE_INIT;
  -    InitializeCriticalSection( & jkMutex->threadMutex );
  -    return JK_OK;
  -}
  -
  -static int JK_METHOD 
  -jk2_mutex_thread_destroy(jk_env_t *env, jk_bean_t  *mutexB)
  -{
  -    jk_mutex_t *jkMutex=mutexB->object;
  -
  -    mutexB->state=JK_STATE_NEW;
  -    if( jkMutex==NULL ) return JK_ERR;
  -    DeleteCriticalSection( & jkMutex->threadMutex );
  -    return JK_OK;
  -}
  -
  -static int JK_METHOD 
  -jk2_mutex_thread_lock(jk_env_t *env, jk_mutex_t  *jkMutex)
  -{
  -    EnterCriticalSection( &jkMutex->threadMutex );
  -    return JK_OK;
  -}
  -
  -static int JK_METHOD 
  -jk2_mutex_thread_tryLock(jk_env_t *env, jk_mutex_t  *jkMutex)
  -{
  -    return JK_OK;
  -}
  -
  -static int JK_METHOD 
  -jk2_mutex_thread_unLock(jk_env_t *env, jk_mutex_t  *jkMutex)
  -{
  -    LeaveCriticalSection( &jkMutex->threadMutex );
  -    return JK_OK;
  -}
  -
  -
  -#elif defined( _REENTRANT )
  -/*-------------------- PThread - @deprecated, use APR if possible --------------------
*/
  -
  -#include <pthread.h>
  -
  -static int JK_METHOD jk2_mutex_thread_init(jk_env_t *env, jk_bean_t  *mutexB)
  -{
  -    jk_mutex_t *jkMutex=mutexB->object;
  -    mutexB->state=JK_STATE_INIT;
  -
  -    return pthread_mutex_init( &jkMutex->threadMutex, NULL );
  -}
  -
  -static int JK_METHOD 
  -jk2_mutex_thread_destroy(jk_env_t *env, jk_bean_t  *mutexB)
  -{
  -    jk_mutex_t *jkMutex=mutexB->object;
  -    mutexB->state=JK_STATE_NEW;
  -
  -    if( jkMutex==NULL ) return JK_ERR;
  -    return pthread_mutex_destroy( & jkMutex->threadMutex);
  -}
  -
  -static int JK_METHOD 
  -jk2_mutex_thread_lock(jk_env_t *env, jk_mutex_t  *jkMutex)
  -{
  -    return pthread_mutex_lock( & jkMutex->threadMutex );
  -}
  -
  -static int JK_METHOD 
  -jk2_mutex_thread_tryLock(jk_env_t *env, jk_mutex_t  *jkMutex)
  -{
  -    return JK_OK;
  -}
  -
  -static int JK_METHOD 
  -jk2_mutex_thread_unLock(jk_env_t *env, jk_mutex_t  *jkMutex)
  -{
  -    return pthread_mutex_unlock( & jkMutex->threadMutex );
  -}
  -
   #else /* All 3 cases we cover - apr and the 2 fallbacks */
   
   /*-------------------- No locking -------------------- */
  
  
  
  1.9       +0 -5      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- jk_pool_apr.c	15 Apr 2003 17:10:18 -0000	1.8
  +++ jk_pool_apr.c	30 Oct 2003 20:08:36 -0000	1.9
  @@ -61,8 +61,6 @@
    * @author Costin Manolache
    */
   
  -#ifdef HAS_APR
  -
   #include "apr_pools.h"
   #include "apr_strings.h"
   #include "apr_network_io.h"
  @@ -268,6 +266,3 @@
       
       return JK_OK;
   }
  -
  -
  -#endif
  
  
  
  1.31      +2 -3      jakarta-tomcat-connectors/jk/native2/common/jk_registry.c
  
  Index: jk_registry.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_registry.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- jk_registry.c	25 Sep 2003 15:23:22 -0000	1.30
  +++ jk_registry.c	30 Oct 2003 20:08:36 -0000	1.31
  @@ -125,10 +125,9 @@
   
     env->registerFactory( env, "channel.un", jk2_channel_un_factory );
   
  -  env->registerFactory( env, "channel.apr",jk2_channel_apr_socket_factory );
  +  env->registerFactory( env, "channel.socket",jk2_channel_apr_socket_factory );
   
     env->registerFactory( env, "shm", jk2_shm_factory );
  -  env->registerFactory( env, "channel.socket", jk2_channel_socket_factory );
   
     
     env->registerFactory( env, "handler.response", jk2_handler_response_factory );
  
  
  
  1.36      +0 -86     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.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- jk_shm.c	26 Oct 2003 19:16:22 -0000	1.35
  +++ jk_shm.c	30 Oct 2003 20:08:36 -0000	1.36
  @@ -220,90 +220,6 @@
       return JK_OK;
   }
   
  -#elif defined(HAVE_MMAP) && !defined(WIN32)
  -
  -static int JK_METHOD jk2_shm_destroy(jk_env_t *env, jk_shm_t *shm)
  -{
  -    caddr_t shmf=(caddr_t)shm->privateData;
  -
  -    munmap(shmf, shm->size);
  -
  -    return JK_OK;
  -}
  -
  -static int jk2_shm_create(jk_env_t *env, jk_shm_t *shm)
  -{
  -    int rc;
  -    struct stat filestat;
  -
  -    int fd = open(shm->fname, O_RDWR|O_CREAT, 0777);
  -    
  -    if (fd == -1) {
  -        env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  -                      "shm.create(): Can't open %s %d %s\n",
  -                      shm->fname, errno, strerror( errno ));
  -        return JK_ERR;
  -    }
  -
  -    rc=stat( shm->fname, &filestat);
  -    if ( rc == -1) {
  -        env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  -                      "shm.create(): Can't stat %s %d %s\n",
  -                      shm->fname, errno, strerror( errno ));
  -        return JK_ERR;
  -    }
  -
  -    if( shm->mbean->debug > 0 )
  -        env->l->jkLog(env, env->l, JK_LOG_DEBUG, 
  -                      "shm.create(): file open %s %d %d\n", shm->fname, shm->size,
filestat.st_size );
  -
  -    if (filestat.st_size < shm->size ) {
  -        char bytes[1024];
  -        int toWrite=shm->size - filestat.st_size;
  -        
  -        memset( bytes, 0, 1024 );        
  -        lseek(fd, 0, SEEK_END);
  -
  -        while( toWrite > 0 ) {
  -            int written;
  -            written=write(fd, bytes, 1024);
  -            if( written == -1 ) {
  -                env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  -                              "shm.create(): Can't write %s %d %s\n",
  -                              shm->fname, errno, strerror( errno ));
  -                return JK_ERR;
  -            }
  -            toWrite-=written;
  -        }
  -        
  -        rc=stat( shm->fname, &filestat);
  -        if ( rc == -1) {
  -            env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  -                          "shm.create(): Can't stat2 %s %d %s\n",
  -                          shm->fname, errno, strerror( errno ));
  -            return JK_ERR;
  -    }
  -    }
  -
  -    shm->privateData = mmap(NULL, filestat.st_size, PROT_READ | PROT_WRITE, MAP_SHARED,
fd, 0);
  -
  -    if (shm->privateData == (caddr_t)-1 ||
  -        shm->privateData == NULL ) {
  -            env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  -                          "shm.create(): Can't mmap %s %d %s\n",
  -                          shm->fname, errno, strerror( errno ));
  -
  -    close(fd);
  -        return JK_ERR;
  -    }
  -
  -    shm->image = (void *)shm->privateData;
  -    shm->head = (jk_shm_head_t *)shm->image;
  -    
  -    close(fd);
  -    
  -    return JK_OK;
  -}
   
   #else
   
  @@ -522,10 +438,8 @@
   
                   stat->reqCnt=0;
                   stat->errCnt=0;
  -#ifdef HAS_APR
                   stat->totalTime=0;
                   stat->maxTime=0;
  -#endif
               }
           }
       }    
  
  
  
  1.30      +5 -13     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.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- jk_vm_default.c	4 Feb 2003 07:39:58 -0000	1.29
  +++ jk_vm_default.c	30 Oct 2003 20:08:36 -0000	1.30
  @@ -91,9 +91,6 @@
   #include <bits/signum.h>
   #endif
   
  -#if !defined(WIN32) && !defined(NETWARE)
  -#include <dlfcn.h>
  -#endif
   #ifdef NETWARE
   #include <nwthread.h>
   #include <nwadv.h>
  @@ -103,6 +100,8 @@
   
   #ifdef APR_HAS_DSO
   #include "apr_dso.h"
  +#else
  +#error "You will need the APR's dso support for JNI"
   #endif
   
   
  @@ -179,7 +178,7 @@
   static void jk2_print_signals( sigset_t *sset) {
       int sig;
       for (sig = 1; sig < 20; sig++) 
  -	{ if (sigismember(sset, sig)) {printf( " %d", sig);} }
  +    { if (sigismember(sset, sig)) {printf( " %d", sig);} }
       printf( "\n");
   }
   #endif
  @@ -214,7 +213,6 @@
   static int jk2_vm_loadJvm(jk_env_t *env, jk_vm_t *jkvm)
   {
   
  -#if defined(HAS_APR) && defined(APR_HAS_DSO)
       apr_dso_handle_t *dsoHandle;
       apr_status_t rc;
       apr_pool_t *aprPool;
  @@ -266,12 +264,6 @@
                         jkvm->jvm_dll_path); 
       
       return JK_OK;
  -#else
  -    env->l->jkLog(env, env->l, JK_LOG_ERROR, 
  -                  "Can't load jvm, no apr support %s\n");
  -
  -    return JK_ERR;
  -#endif
       
   }
   
  @@ -527,7 +519,7 @@
       vm_args11.version = JNI_VERSION_1_2;
   
       if(0 != jni_get_default_java_vm_init_args(&vm_args11)) {
  -    	env->l->jkLog(env, env->l, JK_LOG_EMERG,
  +        env->l->jkLog(env, env->l, JK_LOG_EMERG,
                         "vm.detect() Fail-> can't get default vm init args\n"); 
           return JK_ERR;
       }
  @@ -597,7 +589,7 @@
           jkvm->jvm=(void *)jvm;
           return JK_OK;
       } else if( err!=0 ) {
  -    	env->l->jkLog(env, env->l, JK_LOG_EMERG,
  +        env->l->jkLog(env, env->l, JK_LOG_EMERG,
                         "Fail-> could not create JVM, code: %d \n", err); 
           return JK_ERR;
       }
  
  
  
  1.52      +42 -48    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.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- jk_worker_ajp13.c	16 Oct 2003 08:41:06 -0000	1.51
  +++ jk_worker_ajp13.c	30 Oct 2003 20:08:36 -0000	1.52
  @@ -192,7 +192,7 @@
   #define JK_AJP13_CPING              (unsigned char)10
   
   /* Container response to cping request */
  -#define JK_AJP13_CPONG				(unsigned char)9
  +#define JK_AJP13_CPONG              (unsigned char)9
   
   /* 
    * Build the ping cmd. Tomcat will get control and will be able 
  @@ -281,38 +281,38 @@
       jk_channel_t *channel=ae->worker->channel;
       jk_msg_t * msg=ae->reply;
   
  -	jk2_serialize_cping( env, msg, ae );
  -	err = ae->worker->channel->send( env, ae->worker->channel, ae, msg );
  +    jk2_serialize_cping( env, msg, ae );
  +    err = ae->worker->channel->send( env, ae->worker->channel, ae, msg );
   
  -	if (err != JK_OK) {
  +    if (err != JK_OK) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "ajp13.checkalive() can't send cping request to %s\n", 
                         ae->worker->mbean->name);
   
  -		return JK_ERR;
  -	}
  -	
  -	if (ae->worker->channel->hasinput(env, ae->worker->channel, ae, 
  -	                                  timeout) != JK_TRUE) {
  -	                                  
  +        return JK_ERR;
  +    }
  +    
  +    if (ae->worker->channel->hasinput(env, ae->worker->channel, ae, 
  +                                      timeout) != JK_TRUE) {
  +                                      
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "ajp13.checkalive() can't get cpong reply from %s in %d ms\n", 
                         ae->worker->mbean->name, timeout);
   
  -		return JK_ERR;
  -	}
  -	
  -	err = ae->worker->channel->recv( env, ae->worker->channel, ae, msg );
  +        return JK_ERR;
  +    }
  +    
  +    err = ae->worker->channel->recv( env, ae->worker->channel, ae, msg );
   
  -	if (err != JK_OK) {
  +    if (err != JK_OK) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "ajp13.checkalive() can't read cpong reply from %s\n", 
                         ae->worker->mbean->name);
   
  -		return JK_ERR;
  -	}
  -	
  -	return JK_OK;
  +        return JK_ERR;
  +    }
  +    
  +    return JK_OK;
   }
   
   /** Connect a channel, implementing the logging protocol if ajp13
  @@ -345,17 +345,15 @@
        */
       ae->worker->in_error_state=JK_FALSE;
   
  -#ifdef HAS_APR
       ae->stats->connectedTime=apr_time_now();
  -#endif
       
       /** XXX use a 'connected' field */
       if( ae->sd == -1 ) ae->sd=0;
       
  -	if (ae->worker->connect_timeout != 0 ) {
  -		if (jk2_check_alive(env, ae, ae->worker->connect_timeout) != JK_OK)
  -    		return JK_ERR;
  -	}
  +    if (ae->worker->connect_timeout != 0 ) {
  +        if (jk2_check_alive(env, ae, ae->worker->connect_timeout) != JK_OK)
  +            return JK_ERR;
  +    }
   
       /* Check if we must execute a logon after the physical connect */
       if (ae->worker->secret == NULL)
  @@ -369,10 +367,10 @@
       is a reconnect */
       msg=ae->reply;
   
  -	/* send a ping message to told container to take control (logon phase) */
  -	jk2_serialize_ping( env, msg, ae );
  -	err = ae->worker->channel->send( env, ae->worker->channel, ae, msg );
  -	
  +    /* send a ping message to told container to take control (logon phase) */
  +    jk2_serialize_ping( env, msg, ae );
  +    err = ae->worker->channel->send( env, ae->worker->channel, ae, msg );
  +    
       /* Move to 'slave' mode, listening to messages */
       err=ae->worker->workerEnv->processCallbacks( env, ae->worker->workerEnv,
                                                    ae, NULL);
  @@ -449,12 +447,12 @@
              need to delay - we can do that in paralel. ( not very sure this is
              very usefull, and it brakes the protocol ) ! */
   
  -	/* || s->is_chunked - this can't be done here. The original protocol sends the first
  -	   chunk of post data ( based on Content-Length ), and that's what the java side expects.
  -	   Sending this data for chunked would break other ajp13 serers.
  +    /* || s->is_chunked - this can't be done here. The original protocol sends the first
  +       chunk of post data ( based on Content-Length ), and that's what the java side expects.
  +       Sending this data for chunked would break other ajp13 serers.
   
  -	   Note that chunking will continue to work - using the normal read.
  -	*/
  +       Note that chunking will continue to work - using the normal read.
  +    */
           if (has_post_body  || s->left_bytes_to_send > 0) {
               /* We never sent any POST data and we check it we have to send at
                * least of block of data (max 8k). These data will be kept in reply
  @@ -552,9 +550,9 @@
       int err;
   
       if( ( e== NULL ) || ( s == NULL ) ) {
  -	env->l->jkLog(env, env->l, JK_LOG_ERROR,
  +    env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "ajp13.service() NullPointerException\n");
  -	return JK_ERR;
  +    return JK_ERR;
       }
       
       if( w->channel==NULL ) {
  @@ -580,20 +578,20 @@
       s->left_bytes_to_send = s->content_length;
       s->content_read=0;
   
  -	if (w->prepost_timeout != 0) {
  -		if (jk2_check_alive(env, e, e->worker->prepost_timeout) != JK_OK)
  -    		return JK_ERR;
  -	}
  -	
  +    if (w->prepost_timeout != 0) {
  +        if (jk2_check_alive(env, e, e->worker->prepost_timeout) != JK_OK)
  +            return JK_ERR;
  +    }
  +    
       /* 
        * We get here initial request (in reqmsg)
        */
       err=jk2_serialize_request13(env, e->request, s, e);
       if (err!=JK_OK) {
  -	s->is_recoverable_error = JK_FALSE;                
  -	env->l->jkLog(env, env->l, JK_LOG_ERROR,
  +    s->is_recoverable_error = JK_FALSE;                
  +    env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "ajp13.service(): error marshaling\n");
  -	return JK_ERR;
  +    return JK_ERR;
       }
   
       if( w->mbean->debug > 0 ) 
  @@ -768,14 +766,12 @@
           }
       }
   
  -#ifdef HAS_APR
       if( s->uriEnv!=NULL && s->uriEnv->timing == JK_TRUE ) {
           e->stats->startTime=s->startTime;
           e->stats->jkStartTime=e->stats->connectedTime=apr_time_now();
           if(e->stats->startTime==0)
               e->stats->startTime=e->stats->jkStartTime;
       }
  -#endif
       e->stats->workerId=w->mbean->id;
       
       err=jk2_worker_ajp13_service1( env, w, s, e );
  @@ -788,7 +784,6 @@
           e->stats->errCnt++;
       }
   
  -#ifdef HAS_APR
       if( s->uriEnv!=NULL && s->uriEnv->timing == JK_TRUE ) {
           apr_time_t reqTime;
   
  @@ -799,7 +794,6 @@
           if( e->stats->maxTime < reqTime )
               e->stats->maxTime=reqTime;
       }
  -#endif
       jk2_worker_ajp13_done( env, w, e);
       return err;
   }
  
  
  
  1.34      +2 -2      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.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- jk_worker_lb.c	8 Apr 2003 03:59:01 -0000	1.33
  +++ jk_worker_lb.c	30 Oct 2003 20:08:36 -0000	1.34
  @@ -70,7 +70,7 @@
   #include "jk_env.h"
   #include "jk_requtil.h"
   
  -#ifdef HAS_APR
  +#if APR_HAS_THREADS
   #include "apr_thread_proc.h"
   #endif
   
  @@ -90,7 +90,7 @@
       int     attempts;
       int     recovery;
       int     timeout;
  -    int     sticky_session;	
  +    int     sticky_session; 
       time_t  error_time;
   
   } jk_worker_lb_private_t;
  
  
  
  1.45      +36 -50    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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- jk_worker_status.c	11 Apr 2003 20:13:00 -0000	1.44
  +++ jk_worker_status.c	30 Oct 2003 20:08:36 -0000	1.45
  @@ -88,6 +88,7 @@
       int totalErr=*totalErrP;
       unsigned long totalTime=*totalTimeP;
       unsigned long maxTime=*maxTimeP;
  +    char ctimeBuf[APR_CTIME_LEN];
       
       s->jkprintf(env, s, "<tr><td>%d</td><td>%d</td><td>%d</td>\n",
                   stat->workerId, stat->reqCnt, stat->errCnt );
  @@ -95,32 +96,28 @@
   
       totalReq+=stat->reqCnt;
       totalErr+=stat->errCnt;
  -#ifdef HAS_APR
  -    {
  -        char ctimeBuf[APR_CTIME_LEN];
  -        apr_ctime( ctimeBuf, stat->connectedTime );
  -        s->jkprintf(env, s, "<td>%s</td>\n", ctimeBuf );
  -        
  -        s->jkprintf(env, s, "<td>%ld</td>\n", (long)stat->totalTime );
  -        s->jkprintf(env, s, "<td>%ld</td>\n", (long)stat->maxTime );
  -        
  -        if( stat->reqCnt + stat->errCnt > 0 ) 
  -            s->jkprintf(env, s, "<td>%ld</td>\n",
  -                        (long)(stat->totalTime / ( stat->reqCnt + stat->errCnt
)) );
  -        else
  -            s->jkprintf(env, s, "<td>-</td>\n");
  -        
  -        s->jkprintf(env, s, "<td>%lu</td>\n", (long)stat->startTime );
  -        s->jkprintf(env, s, "<td>%ld</td>\n",
  -                    (long)(stat->jkStartTime - stat->startTime) );
  +
  +    apr_ctime( ctimeBuf, stat->connectedTime );
  +    s->jkprintf(env, s, "<td>%s</td>\n", ctimeBuf );
  +
  +    s->jkprintf(env, s, "<td>%ld</td>\n", (long)stat->totalTime );
  +    s->jkprintf(env, s, "<td>%ld</td>\n", (long)stat->maxTime );
  +
  +    if( stat->reqCnt + stat->errCnt > 0 ) 
           s->jkprintf(env, s, "<td>%ld</td>\n",
  -                    (long)(stat->endTime - stat->startTime) );
  -        
  -        totalTime += (long)stat->totalTime;
  -        if( maxTime < stat->maxTime )
  -            maxTime = (long)stat->maxTime;
  -    }
  -#endif
  +                    (long)(stat->totalTime / ( stat->reqCnt + stat->errCnt ))
);
  +    else
  +        s->jkprintf(env, s, "<td>-</td>\n");
  +
  +    s->jkprintf(env, s, "<td>%lu</td>\n", (long)stat->startTime );
  +    s->jkprintf(env, s, "<td>%ld</td>\n",
  +                (long)(stat->jkStartTime - stat->startTime) );
  +    s->jkprintf(env, s, "<td>%ld</td>\n",
  +                (long)(stat->endTime - stat->startTime) );
  +
  +    totalTime += (long)stat->totalTime;
  +    if( maxTime < stat->maxTime )
  +        maxTime = (long)stat->maxTime;
       s->jkprintf(env, s, "</tr>\n");
   
       *maxTimeP=maxTime;
  @@ -173,12 +170,10 @@
       s->jkprintf(env, s, "<table border>\n");
   
       s->jkprintf(env, s, "<tr><th>Worker</th><th>Req</th><th>Err</th>");
  -    s->jkprintf(env, s,"<th>LastReq</th>\n" );
  -    
  -#ifdef HAS_APR
  +    s->jkprintf(env, s,"<th>LastReq</th>\n" );    
       s->jkprintf(env, s, "<th>ConnectionTime</th><th>TotalTime</th><th>MaxTime</th><th>AvgTime</th>"
);
       s->jkprintf(env, s, "<th>ReqStart</th><th>+jk</th><th>+end</th>"
);
  -#endif
  +
       for( i=0; i < env->_objects->size( env, env->_objects ); i++ ) {
           char *name=env->_objects->nameAt( env, env->_objects, i );
           jk_bean_t *mbean=env->_objects->valueAt( env, env->_objects, i );
  @@ -244,11 +239,8 @@
               
               s->jkprintf(env, s, "<tr><th>Worker</th><th>Req</th><th>Err</th>");
               s->jkprintf(env, s,"<th>LastReq</th>\n" );
  -            
  -#ifdef HAS_APR
               s->jkprintf(env, s, "<th>ConnectionTime</th><th>TotalTime</th><th>MaxTime</th><th>AvgTime</th>"
);
               s->jkprintf(env, s, "<th>ReqStart</th><th>+jk</th><th>+end</th>"
);
  -#endif
               
               /* XXX Add info about number of slots */
               for( j=0; j<slot->structCnt ; j++ ) {
  @@ -349,10 +341,8 @@
   
                   stat->reqCnt=0;
                   stat->errCnt=0;
  -#ifdef HAS_APR
                   stat->totalTime=0;
                   stat->maxTime=0;
  -#endif
               }
           }
       }    
  @@ -507,6 +497,7 @@
               /* This is an endpoint slot */
               void *data=slot->data;
               char *name=JK_CHECK_NULL(slot->name);
  +            char ctimeBuf[APR_CTIME_LEN];
   
               /* XXX Add info about number of slots */
               for( j=0; j<slot->structCnt ; j++ ) {
  @@ -520,22 +511,17 @@
                   s->jkprintf(env, s, "requests=%d\n", stat->reqCnt);
                   s->jkprintf(env, s, "errors=%d\n", stat->errCnt);
                   s->jkprintf(env, s, "lastRequest=%s\n", JK_CHECK_NULL(stat->active));

  -#ifdef HAS_APR
  -                {
  -                    char ctimeBuf[APR_CTIME_LEN];
  -                    apr_ctime( ctimeBuf, stat->connectedTime );
  -                    s->jkprintf(env, s, "lastConnectionTime=%s\n", ctimeBuf);
  -                    
  -                    s->jkprintf(env, s, "totalTime=%ld\n", (long)stat->totalTime
);
  -                    s->jkprintf(env, s, "maxTime=%ld\n", (long)stat->maxTime ); 
  -
  -                    s->jkprintf(env, s, "requestStart=%lu\n", (long)stat->startTime);

  -                    s->jkprintf(env, s, "jkTime=%ld\n", 
  -                                (long)(stat->jkStartTime - stat->startTime) );
  -                    s->jkprintf(env, s, "requestEnd=%ld\n", 
  -                                (long)(stat->endTime - stat->startTime) );
  -                }
  -#endif
  +                apr_ctime( ctimeBuf, stat->connectedTime );
  +                s->jkprintf(env, s, "lastConnectionTime=%s\n", ctimeBuf);
  +
  +                s->jkprintf(env, s, "totalTime=%ld\n", (long)stat->totalTime );
  +                s->jkprintf(env, s, "maxTime=%ld\n", (long)stat->maxTime ); 
  +
  +                s->jkprintf(env, s, "requestStart=%lu\n", (long)stat->startTime);

  +                s->jkprintf(env, s, "jkTime=%ld\n", 
  +                            (long)(stat->jkStartTime - stat->startTime) );
  +                s->jkprintf(env, s, "requestEnd=%ld\n", 
  +                            (long)(stat->endTime - stat->startTime) );
                   s->jkprintf(env, s, "\n"); 
               }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message