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_ajp12_worker.c jk_service.h
Date Sat, 12 Feb 2005 11:34:00 GMT
mturk       2005/02/12 03:34:00

  Modified:    jk/native/common jk_ajp12_worker.c jk_service.h
  Log:
  Use const char* for all constant params passed to AJP.
  Also resolve AS400 constness issues.
  
  Revision  Changes    Path
  1.19      +12 -8     jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c
  
  Index: jk_ajp12_worker.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- jk_ajp12_worker.c	6 Feb 2005 13:30:34 -0000	1.18
  +++ jk_ajp12_worker.c	12 Feb 2005 11:33:59 -0000	1.19
  @@ -298,7 +298,7 @@
   }
   
   #ifdef AS400
  -static int ajpv12_sendasciistring(ajp12_endpoint_t * p, char *buffer)
  +static int ajpv12_sendasciistring(ajp12_endpoint_t * p, const char *buffer)
   {
       int bufferlen;
   
  @@ -311,19 +311,23 @@
   }
   #endif
   
  -#ifdef AS400
  -static int ajpv12_sendstring(ajp12_endpoint_t * p, char *buffer)
  -#else
   static int ajpv12_sendstring(ajp12_endpoint_t * p, const char *buffer)
  -#endif
   {
       int bufferlen;
   
       if (buffer && (bufferlen = strlen(buffer))) {
   #if defined(AS400) || defined(_OSD_POSIX)
  -        jk_xlate_to_ascii(buffer, bufferlen);
  -#endif
  +        char buf[2048];
  +        if (buflen < 2048) {
  +            memcpy(buf, buffer, bufferlen)
  +            jk_xlate_to_ascii(buf, bufferlen);
  +            return ajpv12_sendnbytes(p, buffer, bufferlen);
  +        }
  +        else
  +            return -1;
  +#else
           return ajpv12_sendnbytes(p, buffer, bufferlen);
  +#endif
       }
       else {
           return ajpv12_sendnbytes(p, NULL, 0);
  
  
  
  1.22      +10 -10    jakarta-tomcat-connectors/jk/native/common/jk_service.h
  
  Index: jk_service.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_service.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- jk_service.h	6 Feb 2005 13:30:34 -0000	1.21
  +++ jk_service.h	12 Feb 2005 11:33:59 -0000	1.22
  @@ -121,15 +121,15 @@
       /* 
        * CGI Environment needed by servlets
        */
  -    char *method;
  -    char *protocol;
  -    char *req_uri;
  -    char *remote_addr;
  -    char *remote_host;
  -    char *remote_user;
  -    char *auth_type;
  -    char *query_string;
  -    char *server_name;
  +    const char *method;
  +    const char *protocol;
  +    const char *req_uri;
  +    const char *remote_addr;
  +    const char *remote_host;
  +    const char *remote_user;
  +    const char *auth_type;
  +    const char *query_string;
  +    const char *server_name;
       unsigned server_port;
       char *server_software;
       unsigned content_length;        /* integer that represents the content  */
  
  
  

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