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_socket.c jk_channel_un.c jk_handler_logon.c jk_logger_win32.c jk_requtil.c jk_worker_ajp13.c jk_worker_status.c
Date Fri, 31 May 2002 18:21:01 GMT
costin      2002/05/31 11:21:01

  Modified:    jk/native2/common jk_channel_socket.c jk_channel_un.c
                        jk_handler_logon.c jk_logger_win32.c jk_requtil.c
                        jk_worker_ajp13.c jk_worker_status.c
  Log:
  Various cosmetic changes ( reduce warnings about signed/unsigned ), explicit
  casts, etc.
  
  Moved the query parsing to requtil ( it has nothing to do in map ).
  
  Revision  Changes    Path
  1.31      +7 -7      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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- jk_channel_socket.c	30 May 2002 18:05:08 -0000	1.30
  +++ jk_channel_socket.c	31 May 2002 18:21:00 -0000	1.31
  @@ -342,7 +342,7 @@
                                               jk_endpoint_t *endpoint,
                                               jk_msg_t *msg) 
   {
  -    char *b;
  +    unsigned char *b;
       int len;
       int sd;
       int  sent=0;
  @@ -381,9 +381,9 @@
    * Was: tcp_socket_recvfull
    */
   static int JK_METHOD jk2_channel_socket_readN( jk_env_t *env,
  -                                              jk_channel_t *ch,
  -                                              jk_endpoint_t *endpoint,
  -                                              char *b, int len )
  +                                               jk_channel_t *ch,
  +                                               jk_endpoint_t *endpoint,
  +                                               unsigned char *b, int len )
   {
       int sd;
       int rdlen;
  @@ -421,7 +421,7 @@
   static int JK_METHOD jk2_channel_socket_readN2( jk_env_t *env,
                                                   jk_channel_t *ch,
                                                   jk_endpoint_t *endpoint,
  -                                                char *b, int minLen, int maxLen )
  +                                                unsigned char *b, int minLen, int maxLen
)
   {
       int sd;
       int rdlen;
  @@ -467,8 +467,8 @@
    * Was: tcp_socket_recvfull
    */
   static int JK_METHOD jk2_channel_socket_recv( jk_env_t *env, jk_channel_t *ch,
  -                                                  jk_endpoint_t *endpoint,
  -                                                  jk_msg_t *msg )
  +                                              jk_endpoint_t *endpoint,
  +                                              jk_msg_t *msg )
   {
       int hlen=msg->headerLength;
       int blen;
  
  
  
  1.11      +4 -4      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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- jk_channel_un.c	30 May 2002 18:05:08 -0000	1.10
  +++ jk_channel_un.c	31 May 2002 18:21:00 -0000	1.11
  @@ -312,7 +312,7 @@
                                            jk_endpoint_t *endpoint,
                                            jk_msg_t *msg) 
   {
  -    char *b;
  +    unsigned char *b;
       int len;
       int  sent=0;
       int this_time;
  @@ -359,9 +359,9 @@
    * Was: tcp_socket_recvfull
    */
   static int JK_METHOD jk2_channel_un_readN( jk_env_t *env,
  -                                            jk_channel_t *ch,
  -                                            jk_endpoint_t *endpoint,
  -                                            char *b, int len ) 
  +                                           jk_channel_t *ch,
  +                                           jk_endpoint_t *endpoint,
  +                                           unsigned char *b, int len ) 
   {
       int sd;
       int rdlen;
  
  
  
  1.18      +2 -2      jakarta-tomcat-connectors/jk/native2/common/jk_handler_logon.c
  
  Index: jk_handler_logon.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_handler_logon.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- jk_handler_logon.c	23 May 2002 14:54:07 -0000	1.17
  +++ jk_handler_logon.c	31 May 2002 18:21:00 -0000	1.18
  @@ -58,7 +58,7 @@
   /**
    * Description: AJP14 Login handler
    * Author:      Henri Gomez <hgomez@slib.fr>
  - * Version:     $Revision: 1.17 $                                          
  + * Version:     $Revision: 1.18 $                                          
    */
   
   #include "jk_global.h"
  @@ -140,7 +140,7 @@
           return JK_HANDLER_FATAL;
   
       /* COMPUTED-SEED */
  -    rc= msg->appendString( env, msg, (const unsigned char *)computedKey);
  +    rc= msg->appendString( env, msg, (const char *)computedKey);
       if( rc!=JK_OK ) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                    "handler.loginSecret() error serializing computed secret\n");
  
  
  
  1.5       +2 -1      jakarta-tomcat-connectors/jk/native2/common/jk_logger_win32.c
  
  Index: jk_logger_win32.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_logger_win32.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jk_logger_win32.c	31 May 2002 17:06:02 -0000	1.4
  +++ jk_logger_win32.c	31 May 2002 18:21:00 -0000	1.5
  @@ -239,4 +239,5 @@
       result->disabled=1;
       return JK_FALSE;
   }
  -#endif
  \ No newline at end of file
  +#endif
  +
  
  
  
  1.21      +31 -0     jakarta-tomcat-connectors/jk/native2/common/jk_requtil.c
  
  Index: jk_requtil.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_requtil.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- jk_requtil.c	23 May 2002 23:33:19 -0000	1.20
  +++ jk_requtil.c	31 May 2002 18:21:00 -0000	1.21
  @@ -735,6 +735,37 @@
                "handler.marshapPostHead() - error len=%d\n", len);
       return JK_ERR;	    
   }
  +/* -------------------- Query decoding -------------------- */
  +
  +/** Read a query string into the map
  + */
  +int jk2_requtil_queryRead(jk_env_t *env, jk_map_t *m, const char *query)
  +{
  +    char *sep;
  +    char *value;
  +    char *qry=m->pool->pstrdup( env, m->pool, query );
  +
  +    while( qry != NULL ) {
  +        sep=strchr( qry, '&');
  +        if( sep !=NULL ) { 
  +            *sep='\0';
  +            sep++;
  +        }
  +
  +        value = strchr(qry, '=');
  +        if(value==NULL) {
  +            value="";
  +        } else {
  +            *value = '\0';
  +            value++;
  +        }
  +        m->add( env, m, m->pool->pstrdup( env, m->pool, qry ),
  +                m->pool->pstrdup( env, m->pool, value ));
  +        qry=sep;
  +    }
  +    return JK_OK;
  +}
  +
   
   /* -------------------- Request encoding -------------------- */
   /* Moved from IIS adapter */
  
  
  
  1.27      +11 -8     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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- jk_worker_ajp13.c	30 May 2002 18:24:09 -0000	1.26
  +++ jk_worker_ajp13.c	31 May 2002 18:21:00 -0000	1.27
  @@ -577,13 +577,14 @@
           return JK_OK;
       }
   
  -    JK_ENTER_CS(&ajp13->cs, csOk);
  -    if( !csOk ) return JK_ERR;
  +    if( ajp13->cs != NULL ) 
  +        ajp13->cs->lock( env, ajp13->cs );
   
       {
           jkb=env->createBean2( env, ajp13->mbean->pool,  "endpoint", NULL );
           if( jkb==NULL ) {
  -            JK_LEAVE_CS( &ajp13->cs, csOk );
  +            if( ajp13->cs != NULL ) 
  +                ajp13->cs->unLock( env, ajp13->cs );
               return JK_ERR;
           }
       
  @@ -597,7 +598,8 @@
   
           ajp13->workerEnv->addEndpoint( env, ajp13->workerEnv, e );
       }
  -    JK_LEAVE_CS( &ajp13->cs, csOk );
  +    if( ajp13->cs != NULL ) 
  +        ajp13->cs->unLock( env, ajp13->cs );
           
       if( ajp13->mbean->debug > 0 )
           env->l->jkLog(env, env->l, JK_LOG_INFO,
  @@ -786,6 +788,7 @@
                                           const char *type, const char *name)
   {
       jk_worker_t *w=(jk_worker_t *)pool->calloc(env, pool, sizeof(jk_worker_t));
  +    jk_bean_t *jkb;
       int i;
   
       if (name == NULL || w == NULL) {
  @@ -797,10 +800,10 @@
       jk2_map_default_create(env, &w->groups, pool);
       jk2_map_default_create(env, &w->endpointMap, pool);
   
  -    JK_INIT_CS(&(w->cs), i);
  -    if (i!=JK_TRUE) {
  -        env->l->jkLog(env, env->l, JK_LOG_ERROR,
  -                      "objCache.create(): Can't init CS\n");
  +    jkb=env->createBean2(env, pool,"threadMutex", NULL);
  +    if( jkb != NULL ) {
  +        w->cs=jkb->object;
  +        jkb->init(env, jkb );
       }
       
       w->endpointCache= NULL;
  
  
  
  1.27      +7 -6      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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- jk_worker_status.c	29 May 2002 23:18:59 -0000	1.26
  +++ jk_worker_status.c	31 May 2002 18:21:00 -0000	1.27
  @@ -99,20 +99,20 @@
           apr_ctime( ctimeBuf, stat->connectedTime );
           s->jkprintf(env, s, "<td>%s</td>\n", ctimeBuf );
           
  -        s->jkprintf(env, s, "<td>%ld</td>\n", stat->totalTime );
  -        s->jkprintf(env, s, "<td>%ld</td>\n", stat->maxTime );
  +        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",
  -                        (stat->totalTime / ( stat->reqCnt + stat->errCnt )) );
  +                        (long)(stat->totalTime / ( stat->reqCnt + stat->errCnt
)) );
           else
               s->jkprintf(env, s, "<td>-</td>\n");
           
  -        s->jkprintf(env, s, "<td>%lu</td>\n", stat->startTime );
  +        s->jkprintf(env, s, "<td>%lu</td>\n", (long)stat->startTime );
           s->jkprintf(env, s, "<td>%ld</td>\n",
  -                    stat->jkStartTime - stat->startTime );
  +                    (long)(stat->jkStartTime - stat->startTime) );
           s->jkprintf(env, s, "<td>%ld</td>\n",
  -                    stat->endTime - stat->startTime );
  +                    (long)(stat->endTime - stat->startTime) );
           
           totalTime += stat->totalTime;
           if( maxTime < stat->maxTime )
  @@ -454,6 +454,7 @@
           */
           if( shm!=NULL && shm->head!=NULL )
               shm->head->lbVer++;
  +        s->jkprintf(env, s, "Updated config %d", shm->head->lbVer  );
       }
       
       s->jkprintf(env, s, "Status information for child %d", s->workerEnv->childId
 );
  
  
  

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