Author: rjung Date: Sun Mar 25 13:47:09 2012 New Revision: 1305035 URL: http://svn.apache.org/viewvc?rev=1305035&view=rev Log: Allow to set path parameter used when doing JkStripSession in HTTPD 1.3. This was available for HTTPD 2.x already since mod_jk 1.2.27.
Port of r702431 from mod_jk for HTTPD 2.x to 1.3. Modified: tomcat/jk/trunk/native/apache-1.3/mod_jk.c tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml Modified: tomcat/jk/trunk/native/apache-1.3/mod_jk.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-1.3/mod_jk.c?rev=1305035&r1=1305034&r2=1305035&view=diff ============================================================================== --- tomcat/jk/trunk/native/apache-1.3/mod_jk.c (original) +++ tomcat/jk/trunk/native/apache-1.3/mod_jk.c Sun Mar 25 13:47:09 2012 @@ -201,6 +201,7 @@ typedef struct int exclude_options; int strip_session; + char *strip_session_name; /* * Environment variables support */ @@ -1417,18 +1418,29 @@ static const char *jk_set_auto_alias(cmd /* * JkStripSession directive handling * - * JkStripSession On/Off + * JkStripSession On/Off [session path identifier] */ -static const char *jk_set_strip_session(cmd_parms * cmd, void *dummy, int flag) +static const char *jk_set_strip_session(cmd_parms * cmd, void *dummy, + const char *flag, const char *name) { server_rec *s = cmd->server; jk_server_conf_t *conf = (jk_server_conf_t *) ap_get_module_config(s->module_config, &jk_module); - /* Set up our value */ - conf->strip_session = flag ? JK_TRUE : JK_FALSE; + if (strcasecmp(flag, "on") && strcasecmp(flag, "off")) { + return "JkStripSession must be On or Off"; + } + else { + conf->strip_session = strcasecmp(flag, "off") ? JK_TRUE : JK_FALSE; + } + + /* Check for optional path value */ + if (name) + conf->strip_session_name = ap_pstrdup(cmd->pool, name); + else + conf->strip_session_name = ap_pstrdup(cmd->pool, JK_PATH_SESSION_IDENTIFIER); return NULL; } @@ -2236,7 +2248,7 @@ static const command_rec jk_cmds[] = { * JkStripSession specifies if mod_jk should strip the ;jsessionid * from the unmapped urls */ - {"JkStripSession", jk_set_strip_session, NULL, RSRC_CONF, FLAG, + {"JkStripSession", jk_set_strip_session, NULL, RSRC_CONF, TAKE12, "Should the server strip the jsessionid from unmapped URLs"}, /* @@ -2782,9 +2794,10 @@ static void *merge_jk_config(ap_pool * p } if (overrides->mount_file_reload == JK_UNSET) overrides->mount_file_reload = base->mount_file_reload; - if (overrides->strip_session == JK_UNSET) + if (overrides->strip_session == JK_UNSET) { overrides->strip_session = base->strip_session; - + overrides->strip_session_name = base->strip_session_name; + } return overrides; } @@ -3258,10 +3271,11 @@ static int jk_translate(request_rec * r) jk_log(conf->log, JK_LOG_DEBUG, "no match for %s found", r->uri); - if (conf->strip_session == JK_TRUE) { + if (conf->strip_session == JK_TRUE && + conf->strip_session_name) { char *jsessionid; if (r->uri) { - jsessionid = strstr(r->uri, JK_PATH_SESSION_IDENTIFIER); + jsessionid = strstr(r->uri, conf->strip_session_name); if (jsessionid) { if (JK_IS_DEBUG_LEVEL(conf->log)) jk_log(conf->log, JK_LOG_DEBUG, @@ -3271,7 +3285,7 @@ static int jk_translate(request_rec * r) } } if (r->filename) { - jsessionid = strstr(r->filename, JK_PATH_SESSION_IDENTIFIER); + jsessionid = strstr(r->filename, conf->strip_session_name); if (jsessionid) *jsessionid = '\0'; } Modified: tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml?rev=1305035&r1=1305034&r2=1305035&view=diff ============================================================================== --- tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml (original) +++ tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml Sun Mar 25 13:47:09 2012 @@ -51,6 +51,10 @@ <bug>46893</bug>: HTTPD 1.3: Apply fix to HTTPD 1.3. It was fixed for HTTPD 2.x already in version 1.2.30. (rjung) </fix> + <update> + HTTPD 1.3: Allow to set path parameter used when doing JkStripSession. + This was available for HTTPD 2.x already since mod_jk 1.2.27. (rjung) + </update> </changelog> </subsection> </section> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org