Author: markt Date: Mon Sep 10 19:58:37 2018 New Revision: 1840491 URL: http://svn.apache.org/viewvc?rev=1840491&view=rev Log: Make extract of session ID from path parameters more robust.
Modified: tomcat/jk/trunk/native/common/jk_lb_worker.c tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml Modified: tomcat/jk/trunk/native/common/jk_lb_worker.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_lb_worker.c?rev=1840491&r1=1840490&r2=1840491&view=diff ============================================================================== --- tomcat/jk/trunk/native/common/jk_lb_worker.c (original) +++ tomcat/jk/trunk/native/common/jk_lb_worker.c Mon Sep 10 19:58:37 2018 @@ -431,8 +431,7 @@ void jk_lb_push(lb_worker_t *p, int lock static char *get_path_param(jk_ws_service_t *s, const char *name) { char *id_start = NULL; - for (id_start = strstr(s->req_uri, name); - id_start; id_start = strstr(id_start + 1, name)) { + for (id_start = strstr(s->req_uri, name); id_start; id_start = strstr(id_start + 1, name)) { if (id_start[strlen(name)] == '=') { /* * Session path-cookie was found, get it's value @@ -455,6 +454,12 @@ static char *get_path_param(jk_ws_servic if ((id_end = strchr(id_start, ';')) != NULL) { *id_end = '\0'; } + /* + * Remove any trailing URI segments. + */ + if ((id_end = strchr(id_start, '/')) != NULL) { + *id_end = '\0'; + } return id_start; } } @@ -1766,7 +1771,7 @@ static int JK_METHOD validate(jk_worker_ jk_log(l, JK_LOG_DEBUG, "Balanced worker %s already configured (sequence=%d)", p->lb_workers[i].name, p->lb_workers[i].s->h.sequence); - } + } if (!wc_create_worker(p->lb_workers[i].name, 0, props, &(p->lb_workers[i].worker), Modified: tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml?rev=1840491&r1=1840490&r2=1840491&view=diff ============================================================================== --- tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml (original) +++ tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml Mon Sep 10 19:58:37 2018 @@ -52,6 +52,15 @@ Apache: Update the documentation to note additional limitations of the JkAutoAlias directive. (markt) </update> + <scode> + Common: Optimize path parameter handling. (rjung) + </scode> + <fix> + Improve path parameter parsing so that the session ID specified by the + <code>session_path</code> worker property for load-balanced workers can + be extracted from a path parameter in any segment of the URI, rather + than only from the final segment. (markt) + </fix> </changelog> </subsection> </section> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org