Hi, 

The load balancer worker fail to handle load balancing if the
application use sticky session managed by URL.
The load balancer look for a the parameter "jsessionid" in the URL, and
then can find the worker to contact for the request.
First, the JK_PATH_SESSION_IDENTIFIER in jk_global.h is set to
";jsessionid", but this should be set to "jsessionid".

In jk_lb_worker.c, the function "get_path_param" should return a the
parameter with a given name, but this function look in the URI
(jk_ws_service_t->req_uri), and not in the parameters
(jk_ws_service_t->query_string).
So this function always return NULL.

So here is a suggestion for the "get_path_param" function : 

static char *get_path_param(jk_ws_service_t *s,
                            const char *name,
                            jk_logger_t *l)
{

    char *id_start = NULL;

        if(s->query_string) {

                for(id_start = strstr(s->query_string, name) ; 
                        id_start ; 
                        id_start = strstr(id_start + 1, name)) {
                        if('=' == id_start[strlen(name)]) {
                                /*
                                 * Session path-cookie was found, get
it's value
                                 */
                                id_start += (1 + strlen(name));
                                if(strlen(id_start)) {
                                        char *id_end;
                                        id_start =
jk_pool_strdup(s->pool, id_start);
                                        /* 
                                         * The query string is not part
of req_uri, however
                                         * to be on the safe side lets
remove the trailing query 
                                         * string if appended...
                                         */
                                        if(id_end = strchr(id_start,
'?')) { 
                                                *id_end = '\0';
                                        }
                                        return id_start;
                                }
                        }
                }
        }
  
    return NULL;
}

and the JK_PATH_SESSION_IDENTIFIER must be change to "jsessionid" in
jk_global.h.

With those two changes, it works fine. I test it on Windows 2000 with
iis and Tomcat 3.2.1.

regards

Benoit.



Reply via email to