billbarker 2004/07/14 20:37:01 Modified: jk/native/common jk_lb_worker.c Log: Fix the parsing of the Cookie so that PSJSESSIONID doesn't match. Also make the parsing a bit closer to RFC 2109 Reported By: Sandy McArthur <[EMAIL PROTECTED]> Revision Changes Path 1.18 +16 -8 jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c Index: jk_lb_worker.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_lb_worker.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- jk_lb_worker.c 24 Feb 2004 08:45:46 -0000 1.17 +++ jk_lb_worker.c 15 Jul 2004 03:37:00 -0000 1.18 @@ -122,15 +122,23 @@ for(id_start = strstr(s->headers_values[i], name) ; id_start ; id_start = strstr(id_start + 1, name)) { - if('=' == id_start[strlen(name)]) { - /* - * Session cookie was found, get it's value - */ - id_start += (1 + strlen(name)); - if(strlen(id_start)) { + if(id_start == s->headers_values[i] || + id_start[-1] == ';' || + id_start[-1] == ',' || + isspace(is_start[-1]) ) { + id_start += strlen(name); + while(*id_start && !isspace(*id_start)) + ++id_start; + if(*id_start == '=' && id_start[1]) { + /* + * Session cookie was found, get it's value + */ char *id_end; id_start = jk_pool_strdup(s->pool, id_start); - if(id_end = strchr(id_start, ';')) { + if((id_end = strchr(id_start, ';')) != NULL) { + *id_end = '\0'; + } + if((id_start = strchr(id_start, ',')) != NULL) { *id_end = '\0'; } return id_start;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]