tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shac...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/native/jk jk_ajp13.c jk_lb_worker.c jk_uri_worker_map.c
Date Mon, 29 May 2000 12:53:25 GMT
shachor     00/05/29 05:53:25

  Modified:    src/native/jk jk_ajp13.c jk_lb_worker.c jk_uri_worker_map.c
  Log:
  Add a few debug printings to enable remote debugging and support
  
  Revision  Changes    Path
  1.3       +53 -1     jakarta-tomcat/src/native/jk/jk_ajp13.c
  
  Index: jk_ajp13.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/jk/jk_ajp13.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_ajp13.c	2000/05/25 14:17:47	1.2
  +++ jk_ajp13.c	2000/05/29 12:53:24	1.3
  @@ -56,7 +56,7 @@
   /***************************************************************************
    * Description: Experimental bi-directionl protocol handler.               *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.2 $                                           *
  + * Version:     $Revision: 1.3 $                                           *
    ***************************************************************************/
   
   
  @@ -342,7 +342,12 @@
       unsigned char method;
       unsigned i;
   
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into ajp13_marshal_into_msgb\n");
  +
       if(!sc_for_req_method(s->method, &method)) { 
  +        jk_log(l, JK_LOG_ERROR, 
  +               "Error ajp13_marshal_into_msgb - No such method %s\n", s->method);
           return JK_FALSE;
       }
   
  @@ -356,6 +361,10 @@
          0 != jk_b_append_int(msg, (unsigned short)s->server_port) ||
          0 != jk_b_append_byte(msg, (unsigned char)(s->is_ssl)) ||
          0 != jk_b_append_int(msg, (unsigned short)(s->num_headers))) {
  +
  +        jk_log(l, JK_LOG_ERROR, 
  +               "Error ajp13_marshal_into_msgb - Error appending the message begining\n");
  +
           return JK_FALSE;
       }
   
  @@ -364,15 +373,21 @@
   
           if(sc_for_req_header(s->headers_names[i], &sc) ) {
               if(0 != jk_b_append_int(msg, sc)) {
  +                jk_log(l, JK_LOG_ERROR, 
  +                       "Error ajp13_marshal_into_msgb - Error appending the header name\n");
                   return JK_FALSE;
               }
           } else {
               if(0 != jk_b_append_string(msg, s->headers_names[i])) {
  +                jk_log(l, JK_LOG_ERROR, 
  +                       "Error ajp13_marshal_into_msgb - Error appending the header name\n");
                   return JK_FALSE;
               }
           }
           
           if(0 != jk_b_append_string(msg, s->headers_values[i])) {
  +            jk_log(l, JK_LOG_ERROR, 
  +                   "Error ajp13_marshal_into_msgb - Error appending the header value\n");
               return JK_FALSE;
           }
       }
  @@ -380,30 +395,45 @@
       if(s->remote_user) {
           if(0 != jk_b_append_byte(msg, SC_A_REMOTE_USER) ||
              0 != jk_b_append_string(msg, s->remote_user)) {
  +            jk_log(l, JK_LOG_ERROR, 
  +                   "Error ajp13_marshal_into_msgb - Error appending the remote user\n");
  +
               return JK_FALSE;
           }
       }
       if(s->auth_type) {
           if(0 != jk_b_append_byte(msg, SC_A_AUTH_TYPE) ||
              0 != jk_b_append_string(msg, s->auth_type)) {
  +            jk_log(l, JK_LOG_ERROR, 
  +                   "Error ajp13_marshal_into_msgb - Error appending the auth type\n");
  +
               return JK_FALSE;
           }
       }
       if(s->query_string) {
           if(0 != jk_b_append_byte(msg, SC_A_QUERY_STRING) ||
              0 != jk_b_append_string(msg, s->query_string)) {
  +            jk_log(l, JK_LOG_ERROR, 
  +                   "Error ajp13_marshal_into_msgb - Error appending the query string\n");
  +
               return JK_FALSE;
           }
       }
       if(s->jvm_route) {
           if(0 != jk_b_append_byte(msg, SC_A_JVM_ROUTE) ||
              0 != jk_b_append_string(msg, s->jvm_route)) {
  +            jk_log(l, JK_LOG_ERROR, 
  +                   "Error ajp13_marshal_into_msgb - Error appending the jvm route\n");
  +
               return JK_FALSE;
           }
       }
       if(s->ssl_cert_len) {
           if(0 != jk_b_append_byte(msg, SC_A_SSL_CERT) ||
              0 != jk_b_append_string(msg, s->ssl_cert)) {
  +            jk_log(l, JK_LOG_ERROR, 
  +                   "Error ajp13_marshal_into_msgb - Error appending the SSL certificates\n");
  +
               return JK_FALSE;
           }
       }
  @@ -411,20 +441,30 @@
       if(s->ssl_cipher) {
           if(0 != jk_b_append_byte(msg, SC_A_SSL_CIPHER) ||
              0 != jk_b_append_string(msg, s->ssl_cipher)) {
  +            jk_log(l, JK_LOG_ERROR, 
  +                   "Error ajp13_marshal_into_msgb - Error appending the SSL ciphers\n");
  +
               return JK_FALSE;
           }
       }
       if(s->ssl_session) {
           if(0 != jk_b_append_byte(msg, SC_A_SSL_SESSION) ||
              0 != jk_b_append_string(msg, s->ssl_session)) {
  +            jk_log(l, JK_LOG_ERROR, 
  +                   "Error ajp13_marshal_into_msgb - Error appending the SSL session\n");
  +
               return JK_FALSE;
           }
       }
   
       if(0 != jk_b_append_byte(msg, SC_A_ARE_DONE)) {
  +        jk_log(l, JK_LOG_ERROR, 
  +               "Error ajp13_marshal_into_msgb - Error appending the message end\n");
           return JK_FALSE;
       }
       
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "ajp13_marshal_into_msgb - Done\n");
       return JK_TRUE;
   }
   
  @@ -462,6 +502,9 @@
       d->status = jk_b_get_int(msg);
   
       if(!d->status) {
  +        jk_log(l, JK_LOG_ERROR, 
  +               "Error ajp13_unmarshal_response - Null status\n");
  +
           return JK_FALSE;
       }
   
  @@ -485,17 +528,26 @@
                       if(name < SC_RES_HEADERS_NUM) {
                           d->header_names[i] = (char *)long_res_header_for_sc(name);
                       } else {
  +                        jk_log(l, JK_LOG_ERROR, 
  +                               "Error ajp13_unmarshal_response - No such sc\n");
  +
                           return JK_FALSE;
                       }
                   } else {
                       d->header_names[i] = jk_b_get_string(msg);
                       if(!d->header_names[i]) {
  +                        jk_log(l, JK_LOG_ERROR, 
  +                               "Error ajp13_unmarshal_response - Null header name\n");
  +
                           return JK_FALSE;
                       }
                   }
   
                   d->header_values[i] = jk_b_get_string(msg);
                   if(!d->header_values[i]) {
  +                    jk_log(l, JK_LOG_ERROR, 
  +                           "Error ajp13_unmarshal_response - Null header value\n");
  +
                       return JK_FALSE;
                   }
               }
  
  
  
  1.2       +42 -8     jakarta-tomcat/src/native/jk/jk_lb_worker.c
  
  Index: jk_lb_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/jk/jk_lb_worker.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jk_lb_worker.c	2000/04/17 09:47:22	1.1
  +++ jk_lb_worker.c	2000/05/29 12:53:24	1.2
  @@ -58,7 +58,7 @@
    *              several workers.                                           *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
    * Based on:                                                               *
  - * Version:     $Revision: 1.1 $                                               *
  + * Version:     $Revision: 1.2 $                                               *
    ***************************************************************************/
   
   #include "jk_pool.h"
  @@ -297,6 +297,9 @@
                                jk_logger_t *l,
                                int *is_recoverable_error)
   {
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into jk_endpoint_t::service\n");
  +
       if(e && e->endpoint_private && s && is_recoverable_error)
{
           lb_endpoint_t *p = e->endpoint_private;
           jk_endpoint_t *end = NULL;
  @@ -362,12 +365,19 @@
               }
           }
       }
  +
  +    jk_log(l, JK_LOG_ERROR, 
  +           "In jk_endpoint_t::service: NULL Parameters\n");
  +
       return JK_FALSE;
   }
   
   static int JK_METHOD done(jk_endpoint_t **e,
                             jk_logger_t *l)
   {
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into jk_endpoint_t::done\n");
  +
       if(e && *e && (*e)->endpoint_private) {
           lb_endpoint_t *p = (*e)->endpoint_private;
   
  @@ -380,6 +390,9 @@
           return JK_TRUE;
       }
   
  +    jk_log(l, JK_LOG_ERROR, 
  +           "In jk_endpoint_t::done: NULL Parameters\n");
  +
       return JK_FALSE;
   }
   
  @@ -387,6 +400,9 @@
                                 jk_map_t *props,                            
                                 jk_logger_t *l)
   {
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into jk_worker_t::validate\n");
  +
       if(pThis && pThis->worker_private) {        
           lb_worker_t *p = pThis->worker_private;
           char **worker_names;
  @@ -423,6 +439,10 @@
   
               if(i != num_of_workers) {
                   close_workers(p, i, l);
  +                jk_log(l, JK_LOG_ERROR, 
  +                       "In jk_worker_t::validate: Failed to create worker %s\n",
  +                       p->lb_workers[i].name);
  +
               } else {
                   p->num_of_workers = num_of_workers;
                   return JK_TRUE;
  @@ -430,6 +450,9 @@
           }        
       }
   
  +    jk_log(l, JK_LOG_ERROR, 
  +           "In jk_worker_t::validate: NULL Parameters\n");
  +
       return JK_FALSE;
   }
   
  @@ -445,7 +468,8 @@
                                     jk_endpoint_t **pend,
                                     jk_logger_t *l)
   {
  -    jk_log(l, JK_LOG_DEBUG, "Into jk_worker_t::get_endpoint\n");
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into jk_worker_t::get_endpoint\n");
   
       if(pThis && pThis->worker_private && pend) {        
           lb_endpoint_t *p = (lb_endpoint_t *)malloc(sizeof(lb_endpoint_t));
  @@ -459,9 +483,11 @@
   
               return JK_TRUE;
           }
  -        jk_log(l, JK_LOG_ERROR, "In jk_worker_t::get_endpoint, malloc failed\n");
  +        jk_log(l, JK_LOG_ERROR, 
  +               "In jk_worker_t::get_endpoint, malloc failed\n");
       } else {
  -        jk_log(l, JK_LOG_ERROR, "In jk_worker_t::get_endpoint, NULL parameters\n");
  +        jk_log(l, JK_LOG_ERROR, 
  +               "In jk_worker_t::get_endpoint, NULL parameters\n");
       }
   
       return JK_FALSE;
  @@ -470,7 +496,9 @@
   static int JK_METHOD destroy(jk_worker_t **pThis,
                                jk_logger_t *l)
   {
  -    jk_log(l, JK_LOG_DEBUG, "Into jk_worker_t::destroy\n");
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into jk_worker_t::destroy\n");
  +
       if(pThis && *pThis && (*pThis)->worker_private) {
           lb_worker_t *private_data = (*pThis)->worker_private;
   
  @@ -484,7 +512,8 @@
           return JK_TRUE;
       }
   
  -    jk_log(l, JK_LOG_ERROR, "In jk_worker_t::destroy, NULL parameters\n");
  +    jk_log(l, JK_LOG_ERROR, 
  +           "In jk_worker_t::destroy, NULL parameters\n");
       return JK_FALSE;
   }
   
  @@ -492,6 +521,9 @@
                                   const char *name,
                                   jk_logger_t *l)
   {
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into lb_worker_factory\n");
  +
       if(NULL != name && NULL != w) {
           lb_worker_t *private_data = 
               (lb_worker_t *)malloc(sizeof(lb_worker_t));
  @@ -520,9 +552,11 @@
               jk_close_pool(&private_data->p);
               free(private_data);
           }
  -        jk_log(l, JK_LOG_ERROR, "In lb_worker_factory, malloc failed\n");
  +        jk_log(l, JK_LOG_ERROR, 
  +               "In lb_worker_factory, malloc failed\n");
       } else {
  -        jk_log(l, JK_LOG_ERROR, "In lb_worker_factory, NULL parameters\n");
  +        jk_log(l, JK_LOG_ERROR, 
  +               "In lb_worker_factory, NULL parameters\n");
       }
   
       return JK_FALSE;
  
  
  
  1.3       +27 -10    jakarta-tomcat/src/native/jk/jk_uri_worker_map.c
  
  Index: jk_uri_worker_map.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/jk/jk_uri_worker_map.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jk_uri_worker_map.c	2000/05/19 06:59:00	1.2
  +++ jk_uri_worker_map.c	2000/05/29 12:53:24	1.3
  @@ -65,7 +65,7 @@
    * servlet container.                                                      *
    *                                                                         *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.2 $                                               *
  + * Version:     $Revision: 1.3 $                                               *
    ***************************************************************************/
   
   #include "jk_pool.h"
  @@ -152,14 +152,18 @@
                            jk_map_t *init_data,
                            jk_logger_t *l)
   {
  -    jk_log(l, JK_LOG_DEBUG, "Into jk_uri_worker_map_t::uri_worker_map_alloc\n");    
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into jk_uri_worker_map_t::uri_worker_map_alloc\n");    
  +
       if(init_data && uw_map) {
           return uri_worker_map_open(*uw_map = (jk_uri_worker_map_t *)malloc(sizeof(jk_uri_worker_map_t)),
                                      init_data,
                                      l);
       }
   
  -    jk_log(l, JK_LOG_ERROR, "In jk_uri_worker_map_t::uri_worker_map_alloc, NULL parameters\n");
   
  +    jk_log(l, JK_LOG_ERROR, 
  +           "In jk_uri_worker_map_t::uri_worker_map_alloc, NULL parameters\n");    
  +
       return JK_FALSE;
   }
   
  @@ -168,14 +172,17 @@
   {
       int rc = JK_FALSE;
   
  -    jk_log(l, JK_LOG_DEBUG, "Into jk_uri_worker_map_t::uri_worker_map_free\n");    
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into jk_uri_worker_map_t::uri_worker_map_free\n");    
  +
       if(uw_map && *uw_map) {
           uri_worker_map_close(*uw_map, l);  
           free(*uw_map);
           *uw_map = NULL;
       }
       
  -    jk_log(l, JK_LOG_ERROR, "In jk_uri_worker_map_t::uri_worker_map_free, NULL parameters\n");
   
  +    jk_log(l, JK_LOG_ERROR, 
  +           "In jk_uri_worker_map_t::uri_worker_map_free, NULL parameters\n");    
       return rc;
   }
   
  @@ -185,7 +192,8 @@
   {
       int rc = JK_FALSE;
   
  -    jk_log(l, JK_LOG_DEBUG, "Into jk_uri_worker_map_t::uri_worker_map_open\n");    
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into jk_uri_worker_map_t::uri_worker_map_open\n");    
   
       if(uw_map) {
           int sz;
  @@ -305,7 +313,8 @@
           }
       }
       
  -    jk_log(l, JK_LOG_DEBUG, "jk_uri_worker_map_t::uri_worker_map_open, done\n"); 
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "jk_uri_worker_map_t::uri_worker_map_open, done\n"); 
       return rc;
   }
   
  @@ -314,12 +323,17 @@
   {
       int rc = JK_FALSE;
   
  -    jk_log(l, JK_LOG_DEBUG, "Into jk_uri_worker_map_t::uri_worker_map_close\n"); 
  +    jk_log(l, JK_LOG_DEBUG, 
  +           "Into jk_uri_worker_map_t::uri_worker_map_close\n"); 
  +
       if(uw_map) {
           jk_close_pool(&uw_map->p);
           rc = JK_TRUE;
       }
  -    jk_log(l, JK_LOG_ERROR, "jk_uri_worker_map_t::uri_worker_map_close, NULL parameter\n");

  +
  +    jk_log(l, JK_LOG_ERROR, 
  +           "jk_uri_worker_map_t::uri_worker_map_close, NULL parameter\n"); 
  +
       return rc;
   }
   
  @@ -389,8 +403,10 @@
           }
   
           if(-1 != best_match) {
  -            jk_log(l, JK_LOG_DEBUG, "jk_uri_worker_map_t::uri_worker_map_open, done with
%s\n",
  +            jk_log(l, JK_LOG_DEBUG, 
  +                   "jk_uri_worker_map_t::map_uri_to_worker, Found a match %s\n",
                      uw_map->maps[best_match].worker_name); 
  +
               return uw_map->maps[best_match].worker_name;
           } else {
               /*
  @@ -417,5 +433,6 @@
   
       jk_log(l, JK_LOG_DEBUG, 
              "jk_uri_worker_map_t::map_uri_to_worker, done without a match\n"); 
  +
       return NULL;
   }
  
  
  

Mime
View raw message