tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hgo...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_global.h
Date Fri, 14 Sep 2001 17:45:15 GMT
hgomez      01/09/14 10:45:15

  Modified:    jk/native/apache-1.3 mod_jk.c
               jk/native/common jk_global.h
  Log:
  Add JkSetOptions
  
  Revision  Changes    Path
  1.15      +111 -40   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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- mod_jk.c	2001/09/10 18:32:36	1.14
  +++ mod_jk.c	2001/09/14 17:45:14	1.15
  @@ -61,7 +61,7 @@
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
    *              Dan Milstein <danmil@shore.net>                            *
    *              Henri Gomez <hgomez@slib.fr>                               *
  - * Version:     $Revision: 1.14 $                                           *
  + * Version:     $Revision: 1.15 $                                           *
    ***************************************************************************/
   
   /*
  @@ -142,6 +142,11 @@
   	char *key_size_indicator;
   
       /*
  +     * Jk Options
  +     */
  +    int options;
  +
  +    /*
        * Environment variables support
        */
       int envvars_in_use;
  @@ -280,12 +285,12 @@
               }
           }
   
  -        if(p->read_body_started) {
  -            long rv;
  -            if ((rv = ap_get_client_block(p->r, b, len)) < 0) {
  -                *actually_read = 0;
  +        if(p->read_body_started) {
  +            long rv;
  +            if ((rv = ap_get_client_block(p->r, b, len)) < 0) {
  +                *actually_read = 0;
               } else {
  -                *actually_read = (unsigned) rv;
  +                *actually_read = (unsigned) rv;
               }
               return JK_TRUE;
           }
  @@ -460,23 +465,33 @@
       s->server_software = (char *)ap_get_server_version();
   
       s->method       = (char *)r->method;
  -    s->content_length = get_content_length(r);
  -    s->is_chunked   = r->read_chunked;
  +    s->content_length = get_content_length(r);
  +    s->is_chunked   = r->read_chunked;
       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]
  -	 */
  -	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;
  -		}
  -	}
  +     *
  +     * 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->is_ssl       = JK_FALSE;
       s->ssl_cert     = NULL;
  @@ -738,7 +753,6 @@
       
       /* Set up our value */
       conf->ssl_enable = flag ? JK_TRUE : JK_FALSE;
  -
       return NULL;
   }
   
  @@ -756,8 +770,7 @@
       jk_server_conf_t *conf =
           (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
   
  -    conf->https_indicator = indicator;
  -
  +    conf->https_indicator = ap_pstrdup(cmd->pool,indicator);
       return NULL;
   }
   
  @@ -774,9 +787,8 @@
       server_rec *s = cmd->server;
       jk_server_conf_t *conf =
           (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
  -
  -    conf->certs_indicator = indicator;
   
  +    conf->certs_indicator = ap_pstrdup(cmd->pool,indicator);
       return NULL;
   }
   
  @@ -793,9 +805,8 @@
       server_rec *s = cmd->server;
       jk_server_conf_t *conf =
           (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
  -
  -    conf->cipher_indicator = indicator;
   
  +    conf->cipher_indicator = ap_pstrdup(cmd->pool,indicator);
       return NULL;
   }
   
  @@ -813,8 +824,7 @@
       jk_server_conf_t *conf =
           (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
   
  -    conf->session_indicator = indicator;
  -
  +    conf->session_indicator = ap_pstrdup(cmd->pool,indicator);
       return NULL;
   }
   
  @@ -831,9 +841,58 @@
       server_rec *s = cmd->server;
       jk_server_conf_t *conf =
           (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
  +
  +    conf->key_size_indicator = ap_pstrdup(cmd->pool,indicator);
  +    return NULL;
  +}
  +
  +/*
  + * 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
  + */
  +
  +const char *jk_set_options(cmd_parms *cmd,
  +                           void *dummy,
  +                           const char *line)
  +{
  +    int  opt = 0; 
  +    char action;
  +    char *w;
  +
  +    server_rec *s = cmd->server;
  +    jk_server_conf_t *conf =
  +        (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
  +
  +    while (line[0] != 0) {
  +        w = ap_getword_conf(cmd->pool, &line);
  +        action = 0;
   
  -    conf->key_size_indicator = indicator;
  +        if (*w == '+' || *w == '-') {
  +            action = *(w++);
  +        }
   
  +        if (!strcasecmp(w, "ForwardUnparsedUri"))
  +            opt = JK_OPT_FWDUNPARSED;
  +        else if (!strcasecmp(w, "ForwardKeySize"))
  +            opt = JK_OPT_FWDKEYSIZE;
  +        else
  +            return ap_pstrcat(cmd->pool, "JkOptions: Illegal option '", w, "'", NULL);
  +
  +        if (action == '-') {
  +            conf->options &= ~opt;
  +        }
  +        else if (action == '+') {
  +            conf->options |=  opt;
  +        }
  +        else {            /* for now +Opt == Opt */
  +            conf->options |=  opt;
  +        }
  +    }
       return NULL;
   }
   
  @@ -929,6 +988,17 @@
       {"JkExtractSSL", jk_set_enable_ssl, NULL, RSRC_CONF, FLAG,
        "Turns on SSL processing and information gathering by mod_jk"},     
   
  +    /*
  +     * 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
  +     */
  +    {"JkOptions", jk_set_options, NULL, RSRC_CONF, RAW_ARGS,
  +     "Set one of more options to configure the mod_jk module"},
  +
   	/*
   	 * JkEnvVar let user defines envs var passed from WebServer to 
   	 * Servlet Engine
  @@ -950,17 +1020,17 @@
   {   
       /* Retrieve the worker name stored by jk_translate() */
       const char *worker_name = ap_table_get(r->notes, JK_WORKER_ID);
  -    int rc;
  +    int rc;
   
       if(r->proxyreq) {
           return HTTP_INTERNAL_SERVER_ERROR;
  -    }
  -
  +    }
  +
       
  -    /* Set up r->read_chunked flags for chunked encoding, if present */
  -    if(rc = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)) {
  -	return rc;
  -    }
  +    /* Set up r->read_chunked flags for chunked encoding, if present */
  +    if(rc = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)) {
  +	return rc;
  +    }
         
       if(worker_name) {
           jk_server_conf_t *conf =
  @@ -990,7 +1060,7 @@
                       int is_recoverable_error = JK_FALSE;
                       rc = end->service(end, &s, l, &is_recoverable_error);
                   
  -                    if (s.content_read < s.content_length ||
  +                    if (s.content_read < s.content_length ||
                           (s.is_chunked && ! s.no_more_chunks)) {
                           /*
                            * If the servlet engine didn't consume all of the
  @@ -1103,11 +1173,12 @@
       jk_server_conf_t *overrides = (jk_server_conf_t *)overridesv;
   
       if(base->ssl_enable) {
  -        overrides->ssl_enable       = base->ssl_enable;
  -        overrides->https_indicator  = base->https_indicator;
  -        overrides->certs_indicator  = base->certs_indicator;
  -        overrides->cipher_indicator = base->cipher_indicator;
  -        overrides->session_indicator = base->session_indicator;
  +        overrides->ssl_enable         = base->ssl_enable;
  +        overrides->https_indicator    = base->https_indicator;
  +        overrides->certs_indicator    = base->certs_indicator;
  +        overrides->cipher_indicator   = base->cipher_indicator;
  +        overrides->session_indicator  = base->session_indicator;
  +        overrides->key_size_indicator = base->key_size_indicator;
       }
       
       if(overrides->mountcopy) {
  
  
  
  1.6       +8 -1      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jk_global.h	2001/06/22 16:22:01	1.5
  +++ jk_global.h	2001/09/14 17:45:15	1.6
  @@ -59,7 +59,7 @@
    * Description: Global definitions and include files that should exist     *
    *              anywhere                                                   *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.5 $                                               *
  + * Version:     $Revision: 1.6 $                                               *
    ***************************************************************************/
   
   #ifndef JK_GLOBAL_H
  @@ -147,6 +147,13 @@
       #define FILE_SEPERATOR          ('/')
       #define PATH_ENV_VARIABLE       ("LD_LIBRARY_PATH")
   #endif
  +
  +/*
  + * JK options
  + */
  +
  +#define JK_OPT_FWDUNPARSED 0x0001
  +#define JK_OPT_FWDKEYSIZE  0x0002
   
   #ifdef __cplusplus
   }
  
  
  

Mime
View raw message