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/native/common jk_ajp13_worker.c jk_ajp14.c jk_ajp14_worker.c jk_ajp_common.c jk_jni_worker.c jk_lb_worker.c
Date Fri, 26 Nov 2004 16:59:52 GMT
mturk       2004/11/26 08:59:52

  Modified:    jk/native/common jk_ajp13_worker.c jk_ajp14.c
                        jk_ajp14_worker.c jk_ajp_common.c jk_jni_worker.c
                        jk_lb_worker.c
  Log:
  Use calloc instead malloc for initalizing stucts, so we can use default zeros
  
  Revision  Changes    Path
  1.21      +4 -3      jakarta-tomcat-connectors/jk/native/common/jk_ajp13_worker.c
  
  Index: jk_ajp13_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp13_worker.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- jk_ajp13_worker.c	19 Nov 2004 12:58:18 -0000	1.20
  +++ jk_ajp13_worker.c	26 Nov 2004 16:59:51 -0000	1.21
  @@ -78,7 +78,7 @@
   int JK_METHOD ajp13_worker_factory(jk_worker_t **w,
                                      const char *name, jk_logger_t *l)
   {
  -    ajp_worker_t *aw = (ajp_worker_t *) malloc(sizeof(ajp_worker_t));
  +    ajp_worker_t *aw;
   
       JK_TRACE_ENTER(l);
       if (name == NULL || w == NULL) {
  @@ -86,7 +86,8 @@
           JK_TRACE_EXIT(l);
           return JK_FALSE;
       }
  -
  +    
  +    aw = (ajp_worker_t *) calloc(1, sizeof(ajp_worker_t));
       if (!aw) {
           jk_log(l, JK_LOG_ERROR,
                  "malloc of private_data failed\n");
  
  
  
  1.24      +6 -6      jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c
  
  Index: jk_ajp14.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- jk_ajp14.c	11 Nov 2004 17:43:01 -0000	1.23
  +++ jk_ajp14.c	26 Nov 2004 16:59:51 -0000	1.24
  @@ -417,7 +417,7 @@
       JK_TRACE_ENTER(l);
       jk_log(l, JK_LOG_DEBUG,
              "get virtual %s for virtual %s\n",
  -           vname, c->virtual);
  +           vname, c->virt);
   
       if (!vname) {
           jk_log(l, JK_LOG_ERROR,
  @@ -427,7 +427,7 @@
       }
   
       /* Check if we get the correct virtual host */
  -    if (c->virtual != NULL && vname != NULL && strcmp(c->virtual,
vname)) {
  +    if (c->virt != NULL && vname != NULL && strcmp(c->virt, vname))
{
           /* set the virtual name, better to add to a virtual list ? */
   
           if (context_set_virtual(c, vname) == JK_FALSE) {
  @@ -536,7 +536,7 @@
       /*
        * VIRTUAL HOST CSTRING
        */
  -    if (jk_b_append_string(msg, c->virtual)) {
  +    if (jk_b_append_string(msg, c->virt)) {
           jk_log(l, JK_LOG_ERROR,
                  "failed appending the virtual host string\n");
           JK_TRACE_EXIT(l);
  @@ -628,10 +628,10 @@
       }
   
       /* Check if we speak about the correct virtual */
  -    if (strcmp(c->virtual, vname)) {
  +    if (strcmp(c->virt, vname)) {
           jk_log(l, JK_LOG_ERROR,
                  "incorrect virtual %s instead of %s\n",
  -               vname, c->virtual);
  +               vname, c->virt);
           JK_TRACE_EXIT(l);
           return JK_FALSE;
       }
  
  
  
  1.24      +3 -2      jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.c
  
  Index: jk_ajp14_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- jk_ajp14_worker.c	19 Nov 2004 12:58:18 -0000	1.23
  +++ jk_ajp14_worker.c	26 Nov 2004 16:59:51 -0000	1.24
  @@ -380,7 +380,7 @@
   int JK_METHOD ajp14_worker_factory(jk_worker_t **w,
                                      const char *name, jk_logger_t *l)
   {
  -    ajp_worker_t *aw = (ajp_worker_t *) malloc(sizeof(ajp_worker_t));
  +    ajp_worker_t *aw;
   
       JK_TRACE_ENTER(l);
   
  @@ -390,6 +390,7 @@
           return JK_FALSE;
       }
   
  +    aw = (ajp_worker_t *) calloc(1, sizeof(ajp_worker_t));
       if (!aw) {
           jk_log(l, JK_LOG_ERROR,
                  "malloc of private data failed\n");
  
  
  
  1.65      +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c
  
  Index: jk_ajp_common.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- jk_ajp_common.c	19 Nov 2004 12:59:15 -0000	1.64
  +++ jk_ajp_common.c	26 Nov 2004 16:59:51 -0000	1.65
  @@ -1947,7 +1947,7 @@
               }
           }
   
  -        ae = (ajp_endpoint_t *) malloc(sizeof(ajp_endpoint_t));
  +        ae = (ajp_endpoint_t *) calloc(1, sizeof(ajp_endpoint_t));
           if (ae) {
               ae->sd = -1;
               ae->reuse = JK_FALSE;
  
  
  
  1.29      +4 -3      jakarta-tomcat-connectors/jk/native/common/jk_jni_worker.c
  
  Index: jk_jni_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_jni_worker.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- jk_jni_worker.c	19 Nov 2004 12:58:18 -0000	1.28
  +++ jk_jni_worker.c	26 Nov 2004 16:59:51 -0000	1.29
  @@ -554,7 +554,7 @@
                                     jk_endpoint_t **pend, jk_logger_t *l)
   {
       /* [V] This slow, needs replacement */
  -    jni_endpoint_t *p = (jni_endpoint_t *) malloc(sizeof(jni_endpoint_t));
  +    jni_endpoint_t *p;
   
       JK_TRACE_ENTER(l);
   
  @@ -563,7 +563,8 @@
           JK_TRACE_EXIT(l);
           return JK_FALSE;
       }
  -
  +    
  +    p = (jni_endpoint_t *) calloc(1, sizeof(jni_endpoint_t));
       if (p) {
           p->attached = JK_FALSE;
           p->env = NULL;
  
  
  
  1.32      +2 -2      jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c
  
  Index: jk_lb_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- jk_lb_worker.c	19 Nov 2004 15:30:44 -0000	1.31
  +++ jk_lb_worker.c	26 Nov 2004 16:59:51 -0000	1.32
  @@ -566,7 +566,7 @@
   
       if (NULL != name && NULL != w) {
           lb_worker_t *private_data =
  -            (lb_worker_t *) malloc(sizeof(lb_worker_t));
  +            (lb_worker_t *) calloc(1, sizeof(lb_worker_t));
   
           jk_open_pool(&private_data->p,
                           private_data->buf,
  
  
  

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