keith       01/09/17 18:31:18

  Modified:    jk/native/apache-1.3 mod_jk.c
               jk/native/apache-2.0 mod_jk.c
               jk/native/common jk_global.h
  Log:
  Enable mod_rewrite by passing Apache's r->uri to Tomcat,
  but encode it for spec compliance.
  
  Revision  Changes    Path
  1.17      +3 -24     jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- mod_jk.c  2001/09/14 22:31:36     1.16
  +++ mod_jk.c  2001/09/18 01:31:18     1.17
  @@ -458,28 +458,13 @@
       s->no_more_chunks = 0;
       s->query_string   = r->args;
   
  -    if (conf->options & JK_OPT_FWDUNPARSED) {
       /*
        * The 2.2 servlet spec errata says the uri from
        * HttpServletRequest.getRequestURI() should remain encoded.
        * [http://java.sun.com/products/servlet/errata_042700.html]
        *
  -     * we follow spec in that case but can't use mod_rewrite
        */
  -        s->req_uri      = r->unparsed_uri;
  -        if (s->req_uri != NULL) {
  -            char *query_str = strchr(s->req_uri, '?');
  -            if (query_str != NULL) {
  -                *query_str = 0;
  -            }
  -        }
  -    }
  -    else {
  -    /*
  -     * we don't follow spec but we can use mod_rewrite
  -     */
  -        s->req_uri      = r->uri;
  -    }
  +    s->req_uri      = ap_escape_uri(r->pool, r->uri);
   
       s->is_ssl       = JK_FALSE;
       s->ssl_cert     = NULL;
  @@ -867,8 +852,6 @@
    * JkOptions Directive Handling
    *
    *
  - * +ForwardUnparsed   => Forward URI as unparsed, spec compliant but broke 
mod_rewrite
  - * -ForwardUnparsed   => Forward URI normally, less spec compliant but mod_rewrite 
compatible
    * +ForwardSSLKeySize => Forward SSL Key Size, to follow 2.3 specs but may broke 
old TC 3.2
    * -ForwardSSLKeySize => Don't Forward SSL Key Size, will make mod_jk works with 
all TC release
    */
  @@ -893,9 +876,7 @@
               action = *(w++);
           }
   
  -        if (!strcasecmp(w, "ForwardUnparsedUri"))
  -            opt = JK_OPT_FWDUNPARSED;
  -        else if (!strcasecmp(w, "ForwardKeySize"))
  +        if (!strcasecmp(w, "ForwardKeySize"))
               opt = JK_OPT_FWDKEYSIZE;
           else
               return ap_pstrcat(cmd->pool, "JkOptions: Illegal option '", w, "'", 
NULL);
  @@ -1008,8 +989,6 @@
       /*
        * Options to tune mod_jk configuration
        * for now we understand :
  -     * +ForwardUnparsed   => Forward URI as unparsed, spec compliant but broke 
mod_rewrite
  -     * -ForwardUnparsed   => Forward URI normally, less spec compliant but 
mod_rewrite compatible
        * +ForwardSSLKeySize => Forward SSL Key Size, to follow 2.3 specs but may 
broke old TC 3.2
        * -ForwardSSLKeySize => Don't Forward SSL Key Size, will make mod_jk works 
with all TC release
        */
  
  
  
  1.25      +3 -24     jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- mod_jk.c  2001/09/14 22:32:19     1.24
  +++ mod_jk.c  2001/09/18 01:31:18     1.25
  @@ -440,28 +440,13 @@
       s->no_more_chunks = 0;
       s->query_string   = r->args;
   
  -    if (conf->options & JK_OPT_FWDUNPARSED) {
       /*
        * The 2.2 servlet spec errata says the uri from
        * HttpServletRequest.getRequestURI() should remain encoded.
        * [http://java.sun.com/products/servlet/errata_042700.html]
        *
  -     * we follow spec in that case but can't use mod_rewrite
        */
  -        s->req_uri      = r->unparsed_uri;
  -        if (s->req_uri != NULL) {
  -            char *query_str = strchr(s->req_uri, '?');
  -            if (query_str != NULL) {
  -                *query_str = 0;
  -            }
  -        }
  -    }
  -    else {
  -    /*
  -     * we don't follow spec but we can use mod_rewrite
  -     */
  -        s->req_uri      = r->uri;
  -    }
  +    s->req_uri      = ap_escape_uri(r->pool, r->uri);
   
       s->is_ssl       = JK_FALSE;
       s->ssl_cert     = NULL;
  @@ -866,8 +851,6 @@
    * JkOptions Directive Handling
    *
    *
  - * +ForwardUnparsed   => Forward URI as unparsed, spec compliant but broke 
mod_rewrite
  - * -ForwardUnparsed   => Forward URI normally, less spec compliant but mod_rewrite 
compatible
    * +ForwardSSLKeySize => Forward SSL Key Size, to follow 2.3 specs but may broke 
old TC 3.2
    * -ForwardSSLKeySize => Don't Forward SSL Key Size, will make mod_jk works with 
all TC release
    */
  @@ -892,9 +875,7 @@
               action = *(w++);
           }
   
  -        if (!strcasecmp(w, "ForwardUnparsedUri"))
  -            opt = JK_OPT_FWDUNPARSED;
  -        else if (!strcasecmp(w, "ForwardKeySize"))
  +        if (!strcasecmp(w, "ForwardKeySize"))
               opt = JK_OPT_FWDKEYSIZE;
           else
               return apr_pstrcat(cmd->pool, "JkOptions: Illegal option '", w, "'", 
NULL);
  @@ -1021,8 +1002,6 @@
       /*
        * Options to tune mod_jk configuration
        * for now we understand :
  -     * +ForwardUnparsed   => Forward URI as unparsed, spec compliant but broke 
mod_rewrite
  -     * -ForwardUnparsed   => Forward URI normally, less spec compliant but 
mod_rewrite compatible
        * +ForwardSSLKeySize => Forward SSL Key Size, to follow 2.3 specs but may 
broke old TC 3.2
        * -ForwardSSLKeySize => Don't Forward SSL Key Size, will make mod_jk works 
with all TC release
        */
  
  
  
  1.7       +1 -2      jakarta-tomcat-connectors/jk/native/common/jk_global.h
  
  Index: jk_global.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_global.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- jk_global.h       2001/09/14 17:45:15     1.6
  +++ jk_global.h       2001/09/18 01:31:18     1.7
  @@ -152,7 +152,6 @@
    * JK options
    */
   
  -#define JK_OPT_FWDUNPARSED 0x0001
   #define JK_OPT_FWDKEYSIZE  0x0002
   
   #ifdef __cplusplus
  
  
  

Reply via email to