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.h jk_ajp14_worker.c jk_ajp_common.c
Date Sun, 06 Feb 2005 13:45:11 GMT
mturk       2005/02/06 05:45:11

  Modified:    jk/native/common jk_ajp13_worker.c jk_ajp14.h
                        jk_ajp14_worker.c jk_ajp_common.c
  Log:
  Remove unneeded strdup's by changing some properties to const char..
  
  Revision  Changes    Path
  1.23      +2 -10     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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- jk_ajp13_worker.c	6 Feb 2005 09:37:59 -0000	1.22
  +++ jk_ajp13_worker.c	6 Feb 2005 13:45:11 -0000	1.23
  @@ -95,15 +95,7 @@
           return JK_FALSE;
       }
   
  -    aw->name = strdup(name);
  -
  -    if (!aw->name) {
  -        free(aw);
  -        jk_log(l, JK_LOG_ERROR, "malloc failed");
  -        JK_TRACE_EXIT(l);
  -        return JK_FALSE;
  -    }
  -
  +    aw->name = name;
       aw->proto = AJP13_PROTO;
       aw->login = NULL;
   
  
  
  
  1.16      +3 -3      jakarta-tomcat-connectors/jk/native/common/jk_ajp14.h
  
  Index: jk_ajp14.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- jk_ajp14.h	10 Nov 2004 16:36:48 -0000	1.15
  +++ jk_ajp14.h	6 Feb 2005 13:45:11 -0000	1.16
  @@ -216,7 +216,7 @@
       /*
        *  Pointer to web-server name
        */
  -    char *web_server_name;
  +    const char *web_server_name;
   
       /*
        * Pointer to servlet-engine name
  @@ -226,7 +226,7 @@
       /*
        * Pointer to secret key
        */
  -    char *secret_key;
  +    const char *secret_key;
   
       /*
        * Received entropy seed
  
  
  
  1.27      +2 -13     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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- jk_ajp14_worker.c	6 Feb 2005 13:30:34 -0000	1.26
  +++ jk_ajp14_worker.c	6 Feb 2005 13:45:11 -0000	1.27
  @@ -310,7 +310,7 @@
                                              JK_RETRIES);
   
       /* Set Secret Key (used at logon time) */
  -    aw->login->secret_key = strdup(jk_get_worker_secret_key(props, aw->name));
  +    aw->login->secret_key = jk_get_worker_secret_key(props, aw->name);
   
       if (aw->login->secret_key == NULL) {
           jk_log(l, JK_LOG_ERROR, "can't malloc secret_key");
  @@ -357,17 +357,6 @@
       JK_TRACE_ENTER(l);
   
       if (aw->login) {
  -
  -        if (aw->login->web_server_name) {
  -            free(aw->login->web_server_name);
  -            aw->login->web_server_name = NULL;
  -        }
  -
  -        if (aw->login->secret_key) {
  -            free(aw->login->secret_key);
  -            aw->login->secret_key = NULL;
  -        }
  -
           free(aw->login);
           aw->login = NULL;
       }
  
  
  
  1.75      +5 -1      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.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- jk_ajp_common.c	6 Feb 2005 13:30:34 -0000	1.74
  +++ jk_ajp_common.c	6 Feb 2005 13:45:11 -0000	1.75
  @@ -1899,6 +1899,10 @@
           }
   
           if (aw->login) {
  +             /* take care of removing previously allocated data */
  +            if (aw->login->servlet_engine_name)
  +                free(aw->login->servlet_engine_name);
  +
               free(aw->login);
               aw->login = NULL;
           }
  
  
  

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