costin 01/07/03 14:56:50 Modified: jk/native/common jk_ajp14.c jk_service.h jk_worker.c Log: - in jk_ajp14, avoid a NPE - in jk_service, add a num_of_workers field to workers_env_t, and a first_worker. Both will be used to detect if we have a single worker ( or default worker ? ). I still need to deal with "lb" configurations, where in most cases "lb" is the default worker. The idea is that we'll not need to map uri->worker in 99% of the cases ( assuming the server is configured to do that ), most people either use a single worker or a lb ( but all tomcat requests go to lb ). Special configurations are still possible ( for example "/foo" context to go to JNI worker, "/bar" to a certain tomcat instance ). This is more related with simplifying the manual configuration, using SetHandler - if the special JkMount directive is used we can of course specify a particular worker. Revision Changes Path 1.13 +5 -2 jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c Index: jk_ajp14.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_ajp14.c 2001/07/02 21:14:22 1.12 +++ jk_ajp14.c 2001/07/03 21:56:47 1.13 @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil-*- */ /* ========================================================================= * * * * The Apache Software License, Version 1.1 * @@ -58,7 +59,7 @@ /*************************************************************************** * Description: Next generation bi-directional protocol handler. * * Author: Henri Gomez <[EMAIL PROTECTED]> * - * Version: $Revision: 1.12 $ * + * Version: $Revision: 1.13 $ * ***************************************************************************/ @@ -423,7 +424,9 @@ } /* Check if we get the correct virtual host */ - if (strcmp(c->virtual, vname)) { + if (c->virtual != NULL && + vname != NULL && + strcmp(c->virtual, vname)) { /* set the virtual name, better to add to a virtual list ? */ if (context_set_virtual(c, vname) == JK_FALSE) { 1.7 +5 -1 jakarta-tomcat-connectors/jk/native/common/jk_service.h Index: jk_service.h =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_service.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_service.h 2001/07/02 21:11:47 1.6 +++ jk_service.h 2001/07/03 21:56:48 1.7 @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil-*- */ /* ========================================================================= * * * * The Apache Software License, Version 1.1 * @@ -62,7 +63,7 @@ * Author: Gal Shachor <[EMAIL PROTECTED]> * * Author: Dan Milstein <[EMAIL PROTECTED]> * * Author: Henri Gomez <[EMAIL PROTECTED]> * - * Version: $Revision: 1.6 $ * + * Version: $Revision: 1.7 $ * ***************************************************************************/ #ifndef JK_SERVICE_H @@ -88,6 +89,9 @@ /* The URI to WORKER map, will be feeded by AJP14 autoconf feature */ jk_uri_worker_map_t *uri_to_worker; + + int num_of_workers; + char *first_worker; /* Web-Server we're running on (Apache/IIS/NES) */ char *server_name; 1.7 +5 -2 jakarta-tomcat-connectors/jk/native/common/jk_worker.c Index: jk_worker.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_worker.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_worker.c 2001/06/22 08:33:56 1.6 +++ jk_worker.c 2001/07/03 21:56:48 1.7 @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil-*- */ /* ========================================================================= * * * * The Apache Software License, Version 1.1 * @@ -59,7 +60,7 @@ * Description: Workers controller * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Author: Henri Gomez <[EMAIL PROTECTED]> * - * Version: $Revision: 1.6 $ * + * Version: $Revision: 1.7 $ * ***************************************************************************/ #define _PLACE_WORKER_LIST_HERE @@ -105,7 +106,9 @@ return JK_FALSE; } - jk_log(l, JK_LOG_DEBUG, "wc_open, done\n"); + we->num_of_workers=num_of_workers; + we->first_worker=worker_list[0]; + jk_log(l, JK_LOG_DEBUG, "wc_open, done %d\n", num_of_workers); return JK_TRUE; }