cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
hgomez 2004/04/04 23:54:58 Modified:jk/native2/common jk_uriEnv.c Log: - Adds 'debug' and 'disabled' to the get and set properties functions. - Removes 'path' from the getAttrInfo list. Provided by NormW Revision ChangesPath 1.56 +34 -24jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- jk_uriEnv.c 21 Mar 2004 09:43:09 - 1.55 +++ jk_uriEnv.c 5 Apr 2004 06:54:58 - 1.56 @@ -182,12 +182,13 @@ static char *getAttInfo[] = { host, uri, group, context, inheritGlobals, -match_type, -servlet, timing, aliases, path, NULL +match_type, servlet, timing, aliases, debug, disabled, +NULL }; static char *setAttInfo[] = { host, uri, group, context, inheritGlobals, -servlet, timing, alias, path, NULL +servlet, timing, alias, path, debug, disabled, +NULL }; static char *matchTypes[] = { @@ -242,7 +243,12 @@ else if (strcmp(inheritGlobals, name) == 0) { return jk2_env_itoa(env, uriEnv-inherit_globals); } -return NULL; +else if (strcmp(name, debug) == 0) { +return jk2_env_itoa(env, bean-debug); +} +else if (strcmp(name, disabled) == 0) { +return jk2_env_itoa(env, bean-disabled); +}return NULL; } @@ -297,27 +303,31 @@ else if (strcmp(inheritGlobals, name) == 0) { uriEnv-inherit_globals = atoi(val); } -else { +else if (strcmp(worker, name) == 0) { /* OLD - DEPRECATED */ -if (strcmp(worker, name) == 0) { -uriEnv-workerName = val; -env-l-jkLog(env, env-l, JK_LOG_INFO, - uriEnv.setAttribute() the %s directive is deprecated. Use 'group' instead.\n, - name); -} -else if (strcmp(uri, name) == 0) { -jk2_uriEnv_parseName(env, uriEnv, val); -} -else if (strcmp(name, name) == 0) { -jk2_uriEnv_parseName(env, uriEnv, val); -} -else if (strcmp(vhost, name) == 0) { -if (val == NULL) -uriEnv-virtual = NULL; -else -uriEnv-virtual = -uriEnv-pool-pstrdup(env, uriEnv-pool, val); -} + + uriEnv-workerName = val; +env-l-jkLog(env, env-l, JK_LOG_INFO, + uriEnv.setAttribute() the %s directive is deprecated. Use 'group' instead.\n, + name); +} +else if (strcmp(uri, name) == 0) { +jk2_uriEnv_parseName(env, uriEnv, val); +} +else if (strcmp(name, name) == 0) { +jk2_uriEnv_parseName(env, uriEnv, val); +} +else if (strcmp(vhost, name) == 0) { +if (val == NULL) +uriEnv-virtual = NULL; + else +uriEnv-virtual = uriEnv-pool-pstrdup(env, uriEnv-pool, val); +} +else if (strcmp(name, debug) == 0) { +mbean-debug = atoi(val); +} +else if (strcmp(name, disabled) == 0) { +mbean-disabled = atoi(val); } return JK_OK; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c jk_uriMap.c
truk2004/02/27 11:10:07 Modified:jk/native2/common jk_uriEnv.c jk_uriMap.c Log: Use apache pcre functions when HAVE_AP_PCRE is defined. From Guenter Knauf. Revision ChangesPath 1.54 +16 -2 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- jk_uriEnv.c 24 Feb 2004 08:44:40 - 1.53 +++ jk_uriEnv.c 27 Feb 2004 19:10:07 - 1.54 @@ -28,10 +28,14 @@ #include jk_uriMap.h #include jk_registry.h +#ifdef HAS_AP_PCRE +#include httpd.h +#else #ifdef HAS_PCRE #include pcre.h #include pcreposix.h #endif +#endif /* return non-zero if pattern has any glob chars in it */ @@ -65,7 +69,7 @@ int pcre = 0; if (*name == '$') { -#ifdef HAS_PCRE +#if defined(HAS_PCRE) || defined(HAS_AP_PCRE) ++name; uriEnv-uri = uriEnv-pool-pstrdup(env, uriEnv-pool, name); uriEnv-match_type = MATCH_TYPE_REGEXP; @@ -73,8 +77,13 @@ uriEnv.parseName() parsing %s regexp\n, name); { +#ifdef HAS_AP_PCRE +regex_t *preg = ap_pregcomp((apr_pool_t *)uriEnv-pool-_private, uriEnv-uri, REG_EXTENDED); +if (!preg) { +#else regex_t *preg = (regex_t *)uriEnv-pool-calloc( env, uriEnv-pool, sizeof(regex_t)); if (regcomp(preg, uriEnv-uri, REG_EXTENDED)) { +#endif env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.parseName() error compiling regexp %s\n, uri); @@ -132,14 +141,19 @@ if (pcre) { ++uri; uriEnv-match_type = MATCH_TYPE_REGEXP; -#ifdef HAS_PCRE +#if defined(HAS_PCRE) || defined(HAS_AP_PCRE) uriEnv-uri = uriEnv-pool-pstrdup(env, uriEnv-pool, uri); env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.parseName() parsing regexp %s\n, uri); { +#ifdef HAS_AP_PCRE +regex_t *preg = ap_pregcomp((apr_pool_t *)uriEnv-pool-_private, uriEnv-uri, REG_EXTENDED); +if (!preg) { +#else regex_t *preg = (regex_t *)uriEnv-pool-calloc( env, uriEnv-pool, sizeof(regex_t)); if (regcomp(preg, uriEnv-uri, REG_EXTENDED)) { +#endif env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.parseName() error compiling regexp %s\n, uri); 1.68 +8 -2 jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c Index: jk_uriMap.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c,v retrieving revision 1.67 retrieving revision 1.68 diff -u -r1.67 -r1.68 --- jk_uriMap.c 24 Feb 2004 08:44:40 - 1.67 +++ jk_uriMap.c 27 Feb 2004 19:10:07 - 1.68 @@ -34,9 +34,15 @@ #include jk_uriMap.h #include jk_registry.h +#ifdef HAS_AP_PCRE +#include httpd.h +#define REGEXEC ap_regexec +#else #ifdef HAS_PCRE #include pcre.h #include pcreposix.h +#define REGEXEC regexec +#endif #endif static INLINE const char *jk2_findExtension(jk_env_t *env, const char *uri); @@ -304,7 +310,7 @@ return uriMap-vhosts-get(env, uriMap-vhosts, *); } -#ifdef HAS_PCRE +#if defined(HAS_PCRE) || defined(HAS_AP_PCRE) static jk_uriEnv_t *jk2_uriMap_regexpMap(jk_env_t *env, jk_uriMap_t *uriMap, jk_map_t *mapTable, const char *uri) { @@ -317,7 +323,7 @@ if (uwr-regexp) { regex_t *r = (regex_t *)uwr-regexp; regmatch_t regm[10]; -if (!regexec(r, uri, r-re_nsub + 1, regm, 0)) { +if (!REGEXEC(r, uri, r-re_nsub + 1, regm, 0)) { return uwr; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mmanders2004/01/26 16:49:36 Modified:jk/native2/common jk_uriEnv.c Log: When changing to MATCH_TYPE_SUFFIX (prefix = NULL) reset prefix_len to 0. Revision ChangesPath 1.52 +1 -0 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- jk_uriEnv.c 30 Oct 2003 20:10:17 - 1.51 +++ jk_uriEnv.c 27 Jan 2004 00:49:36 - 1.52 @@ -462,6 +462,7 @@ */ uriEnv-suffix = uri; uriEnv-prefix = NULL; +uriEnv-prefix_len = 0; uriEnv-suffix_len = strlen(uri); uriEnv-match_type = MATCH_TYPE_SUFFIX; if( uriEnv-mbean-debug 0 ) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2003/10/30 12:10:17 Modified:jk/native2/common jk_uriEnv.c Log: Fix the prefix mapping bug Revision ChangesPath 1.51 +2 -1 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- jk_uriEnv.c 25 Sep 2003 15:23:22 - 1.50 +++ jk_uriEnv.c 30 Oct 2003 20:10:17 - 1.51 @@ -445,6 +445,7 @@ if (uri[strlen(uri) - 1] == '*') { /* context based /context/prefix/ASTERISK */ +uri[strlen(uri) - 1] = '\0'; uriEnv-suffix = NULL; uriEnv-prefix = uri; uriEnv-prefix_len =strlen( uriEnv-prefix ); @@ -522,7 +523,7 @@ * so that global mappings are always present * on each vhost, instead of explicitly defined. */ -#if 0 +#if 1 uriEnv-inherit_globals = 1; #endif - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2003/03/15 03:16:55 Modified:jk/native2/common jk_uriEnv.c Log: Fix missing function type. Revision ChangesPath 1.45 +2 -2 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- jk_uriEnv.c 5 Mar 2003 00:00:23 - 1.44 +++ jk_uriEnv.c 15 Mar 2003 11:16:54 - 1.45 @@ -151,7 +151,7 @@ env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.parseName() error compiling regexp %s\n, uri); - return JK_ERR; +return JK_ERR; } uriEnv-regexp = preg; } @@ -284,7 +284,7 @@ } -static int jk2_uriEnv_beanInit(jk_env_t *env, jk_bean_t *bean) +static int JK_METHOD jk2_uriEnv_beanInit(jk_env_t *env, jk_bean_t *bean) { jk_uriEnv_t *uriEnv=bean-object; int res=JK_OK; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2003/03/15 04:34:39 Modified:jk/native2/common jk_uriEnv.c Log: Make the regular expression uri maps finally working. Revision ChangesPath 1.46 +17 -0 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- jk_uriEnv.c 15 Mar 2003 11:16:54 - 1.45 +++ jk_uriEnv.c 15 Mar 2003 12:34:39 - 1.46 @@ -90,13 +90,30 @@ int pcre = 0; if (*name == '$') { +#ifdef HAS_PCRE ++name; uriEnv-uri = uriEnv-pool-pstrdup(env, uriEnv-pool, name); uriEnv-match_type = MATCH_TYPE_REGEXP; env-l-jkLog(env, env-l, JK_LOG_INFO, uriEnv.parseName() parsing %s regexp\n, name); +{ +regex_t *preg = (regex_t *)uriEnv-pool-calloc( env, uriEnv-pool, sizeof(regex_t)); +if (regcomp(preg, uriEnv-uri, REG_EXTENDED)) { +env-l-jkLog(env, env-l, JK_LOG_DEBUG, + uriEnv.parseName() error compiling regexp %s\n, + uri); +return JK_ERR; +} +uriEnv-regexp = preg; +} return JK_OK; +#else +env-l-jkLog(env, env-l, JK_LOG_INFO, +uriEnv.parseName() parsing regexp %s not supported\n, +uri); +return JK_ERR; +#endif } strcpy(host, name); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
costin 2003/03/04 16:00:24 Modified:jk/native2/common jk_uriEnv.c Log: Add a normal init method. Adding uris at runtime is not as important ( and it will only work for the slower config ), but for consistency. Revision ChangesPath 1.44 +24 -2 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- jk_uriEnv.c 1 Mar 2003 05:49:58 - 1.43 +++ jk_uriEnv.c 5 Mar 2003 00:00:23 - 1.44 @@ -284,6 +284,22 @@ } +static int jk2_uriEnv_beanInit(jk_env_t *env, jk_bean_t *bean) +{ +jk_uriEnv_t *uriEnv=bean-object; +int res=JK_OK; + +if( bean-state == JK_STATE_INIT ) return JK_OK; + +if( uriEnv-init ) { +res=uriEnv-init( env, uriEnv ); +} +if( res==JK_OK ) { +bean-state=JK_STATE_INIT; +} +return res; +} + static int jk2_uriEnv_init(jk_env_t *env, jk_uriEnv_t *uriEnv) { /*int err; */ @@ -299,12 +315,16 @@ if( uriEnv-workerName == NULL ) { /* The default worker */ uriEnv-workerName=uriEnv-uriMap-workerEnv-defaultWorker-mbean-name;; +wname=uriEnv-workerName; uriEnv-worker=uriEnv-uriMap-workerEnv-defaultWorker; if( uriEnv-mbean-debug 0 ) env-l-jkLog(env, env-l, JK_LOG_DEBUG, - uriEnv.init() map %s %s\n, - uriEnv-uri, uriEnv-uriMap-workerEnv-defaultWorker-mbean-name); + uriEnv.init() map %s %s %s\n, + uriEnv-uri, uriEnv-uriMap-workerEnv-defaultWorker-mbean-name, uriEnv-workerName); +if( uriEnv-workerName == NULL ) { +uriEnv-workerName=lb:lb; +} } /* No further init - will be called by uriMap.init() */ @@ -467,6 +487,7 @@ uriEnv-mbean-name, uriEnv-virtual, uriEnv-uri, uriEnv-match_type, uriEnv-contextPath, uriEnv-prefix, uriEnv-suffix ); +uriEnv-mbean-state=JK_STATE_INIT; return JK_OK; } @@ -487,6 +508,7 @@ jk2_map_default_create(env, uriEnv-properties, uriPool); +result-init = jk2_uriEnv_beanInit; uriEnv-init = jk2_uriEnv_init; result-setAttribute = jk2_uriEnv_setAttribute; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
costin 2002/11/12 16:21:20 Modified:jk/native2/common jk_uriEnv.c Log: Remove the deprecated message for path. It is used by the 'native' apache2 mapper. Revision ChangesPath 1.41 +12 -15jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- jk_uriEnv.c 22 Oct 2002 10:11:44 - 1.40 +++ jk_uriEnv.c 13 Nov 2002 00:21:20 - 1.41 -226,22 +226,26 uriEnv-aliases-put(env, uriEnv-aliases, val, uriEnv, NULL); } } +else if (strcmp(path, name) == 0) { +/** This is called from Location in jk2, it has the same effect + *as using the constructor. + */ +if (val == NULL) +uriEnv-uri = NULL; +else +uriEnv-uri = uriEnv-pool-pstrdup(env, uriEnv-pool, val); +} else if (strcmp(inheritGlobals, name) == 0) { uriEnv-inherit_globals = atoi(val); } else { /* OLD - DEPRECATED */ -int d = 1; if (strcmp(worker, name) == 0) { -d = 1; uriEnv-workerName = val; +env-l-jkLog(env, env-l, JK_LOG_INFO, +uriEnv.setAttribute() the %s directive is deprecated. Use 'group' instead.\n, +name); } -else if (strcmp(path, name) == 0) { -if (val == NULL) -uriEnv-uri = NULL; -else -uriEnv-uri = uriEnv-pool-pstrdup(env, uriEnv-pool, val); -} else if (strcmp(uri, name) == 0) { jk2_uriEnv_parseName(env, uriEnv, val); } -254,13 +258,6 else uriEnv-virtual = uriEnv-pool-pstrdup(env, uriEnv-pool, val); } -else -d = 0; -if (d) -env-l-jkLog(env, env-l, JK_LOG_INFO, -uriEnv.setAttribute() the %s directive is depriciated\n, -name); - } return JK_OK; } -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2002/10/13 00:39:28 Modified:jk/native2/common jk_uriEnv.c Log: Add the inheritGlobals configuration directive to the uriEnv, alowing duplicating directives from globals. Revision ChangesPath 1.38 +11 -0 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- jk_uriEnv.c 4 Oct 2002 16:13:15 - 1.37 +++ jk_uriEnv.c 13 Oct 2002 07:39:28 - 1.38 @@ -180,6 +180,9 @@ uriEnv-aliases-put(env, uriEnv-aliases, val, uriEnv, NULL); } } +else if (strcmp(inheritGlobals, name) == 0) { +uriEnv-inherit_globals = atoi(val); +} else { /* OLD - DEPRECATED */ int d = 1; @@ -429,6 +432,14 @@ uriEnv-workerEnv-uriMap-addUriEnv(env, uriEnv-workerEnv-uriMap, uriEnv); uriEnv-uriMap = uriEnv-workerEnv-uriMap; + +/* ??? This may be turned on by default + * so that global mappings are always present + * on each vhost, instead of explicitly defined. + */ +#if 0 +uriEnv-inherit_globals = 1; +#endif return JK_OK; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2002/10/04 09:13:15 Modified:jk/native2/common jk_uriEnv.c Log: Compute the suffix_len for the extracted suffix. Revision ChangesPath 1.37 +2 -0 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- jk_uriEnv.c 3 Oct 2002 01:33:14 - 1.36 +++ jk_uriEnv.c 4 Oct 2002 16:13:15 - 1.37 @@ -335,6 +335,7 @@ uriEnv-prefix = uri; uriEnv-prefix_len =strlen( uriEnv-prefix ); uriEnv-suffix = asterisk + 3; +uriEnv-suffix_len = strlen(asterisk + 3); uriEnv-match_type = MATCH_TYPE_SUFFIX; if( uriEnv-mbean-debug 0 ) { env-l-jkLog(env, env-l, JK_LOG_DEBUG, @@ -345,6 +346,7 @@ /* general suffix rule /context/prefix/ASTERISKextraData */ asterisk[1] = '\0'; uriEnv-suffix = asterisk + 2; +uriEnv-suffix_len = strlen(asterisk + 2); uriEnv-prefix = uri; uriEnv-prefix_len =strlen( uriEnv-prefix ); uriEnv-match_type = MATCH_TYPE_GENERAL_SUFFIX; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2002/10/02 02:45:02 Modified:jk/native2/common jk_uriEnv.c Log: Remove the APR code from the uriEnv. Revision ChangesPath 1.34 +7 -52 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- jk_uriEnv.c 26 Sep 2002 12:29:17 - 1.33 +++ jk_uriEnv.c 2 Oct 2002 09:45:02 - 1.34 @@ -69,8 +69,6 @@ #include jk_uriMap.h #include jk_registry.h -#ifdef HAS_APR -#include apr_uri.h /** Parse the name: VHOST/PATH @@ -82,46 +80,6 @@ static int jk2_uriEnv_parseName( jk_env_t *env, jk_uriEnv_t *uriEnv, char *name) { - -apr_uri_t uri; -char s[1024]; - -/* If it uri starts with / then it is simple - * default host uri - */ -if (*name == '/') -strcpy(s, name); -else { -strcpy(s, http://;); -strcat(s, name); -} -env-l-jkLog(env, env-l, JK_LOG_DEBUG, - uriEnv.parseName() uri %s name %s real %s\n, - uriEnv-name, name, s); - -if (apr_uri_parse(uriEnv-pool-_private, s, uri) == APR_SUCCESS) { - -uriEnv-port = uri.port; -if (uri.hostname) { -if (!uriEnv-port) -uriEnv-virtual = uri.hostname; -else -uriEnv-virtual = apr_pstrcat(uriEnv-pool-_private, -uri.hostname, :, uri.port_str, NULL); -} -else -uriEnv-virtual = *; -uriEnv-uri = uri.path; -if (!uri.path) -uriEnv-match_type = MATCH_TYPE_HOST; -return JK_OK; -} -return JK_ERR; -} -#else -static int jk2_uriEnv_parseName( jk_env_t *env, jk_uriEnv_t *uriEnv, - char *name) -{ char *uri = NULL; char *colon; char host[1024]; @@ -162,7 +120,6 @@ return JK_OK; } -#endif /* HAS_APR */ static void * JK_METHOD jk2_uriEnv_getAttribute(jk_env_t *env, jk_bean_t *bean, @@ -397,18 +354,16 @@ } else { /* context based /context/prefix/ASTERISK */ asterisk[1] = '\0'; -#if 0 -asterisk[0] = '\0'; /* Remove the extra '/' */ -#endif + uriEnv-suffix = NULL; uriEnv-prefix = uri; uriEnv-prefix_len =strlen( uriEnv-prefix ); -uriEnv-match_type = MATCH_TYPE_PREFIX; -if( uriEnv-mbean-debug 0 ) { -env-l-jkLog(env, env-l, JK_LOG_DEBUG, - uriEnv.init() prefix mapping %s=%s\n, - uriEnv-prefix, uriEnv-workerName); -} +uriEnv-match_type = MATCH_TYPE_PREFIX; +if( uriEnv-mbean-debug 0 ) { +env-l-jkLog(env, env-l, JK_LOG_DEBUG, + uriEnv.init() prefix mapping %s=%s\n, + uriEnv-prefix, uriEnv-workerName); +} } } else { /* Something like : JkMount /servlets/exampl* ajp13 */ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2002/10/02 03:27:18 Modified:jk/native2/common jk_uriEnv.c Log: Add the context to the getAttribute, so we can display what is the context of particular uri in the jkstatus Revision ChangesPath 1.35 +7 -5 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- jk_uriEnv.c 2 Oct 2002 09:45:02 - 1.34 +++ jk_uriEnv.c 2 Oct 2002 10:27:17 - 1.35 @@ -104,10 +104,10 @@ uriEnv-virtual = uriEnv-pool-pstrdup(env, uriEnv-pool, host); return JK_OK; } -if (colon) { -*uri = '\0'; +*uri = '\0'; +if (colon) uriEnv-port = atoi(colon); -} + /* If it doesn't start with /, it must have a vhost */ if (strlen(host) uri != host) { uriEnv-virtual = uriEnv-pool-calloc( env, uriEnv-pool, strlen(host) + 1 ); @@ -133,7 +133,9 @@ return uriEnv-uri; } else if( strcmp( name, group )==0 ) { return uriEnv-workerName; -} +} else if( strcmp( name, context )==0 ) { +return uriEnv-contextPath; +} return NULL; } @@ -387,7 +389,7 @@ return JK_OK; } -static char *myAttInfo[]={ host, uri, group, NULL }; +static char *myAttInfo[]={ host, uri, group, context, NULL }; int JK_METHOD jk2_uriEnv_factory(jk_env_t *env, jk_pool_t *pool, jk_bean_t *result, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
hgomez 2002/09/26 02:26:20 Modified:jk/native2/common jk_uriEnv.c Log: First pass to try to fix jk2_uriEnv_parserName in non APR case Revision ChangesPath 1.31 +3 -0 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- jk_uriEnv.c 24 Sep 2002 07:58:22 - 1.30 +++ jk_uriEnv.c 26 Sep 2002 09:26:20 - 1.31 @@ -135,6 +135,9 @@ } else uri = strchr(host, '/'); + +uriEnv-uri = uri; + if (!uri) { /* That's a virtual host definition ( no actual mapping, just global * settings like aliases, etc -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2002/09/26 03:26:33 Modified:jk/native2/common jk_uriEnv.c Log: Fix non APR parseName Revision ChangesPath 1.32 +3 -4 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- jk_uriEnv.c 26 Sep 2002 09:26:20 - 1.31 +++ jk_uriEnv.c 26 Sep 2002 10:26:33 - 1.32 @@ -135,9 +135,7 @@ } else uri = strchr(host, '/'); - -uriEnv-uri = uri; - + if (!uri) { /* That's a virtual host definition ( no actual mapping, just global * settings like aliases, etc @@ -155,12 +153,13 @@ uriEnv-port = atoi(colon); } /* If it doesn't start with /, it must have a vhost */ -if (strlen(host)) { +if (strlen(host) uri != host) { uriEnv-virtual = uriEnv-pool-calloc( env, uriEnv-pool, strlen(host) + 1 ); strncpy(uriEnv-virtual, name, strlen(host)); } else uriEnv-virtual = *; + uriEnv-uri = uriEnv-pool-pstrdup(env, uriEnv-pool, path); return JK_OK; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
Ok it works now for both apache 1.3 and 2.0 for simple workers2.properties : [shm:] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=/var/run/jk2-ap13.shm size=1048576 [channel.socket:localhost:8009] debug=1 [ajp13:localhost:8009] channel=channel.socket:localhost:8009 debug=1 [status:status] [uri:/jkstatus/*] info=Display status information and checks the config file for changes. worker=status:status debug=1 [uri:/examples/*] worker=ajp13:localhost:8009 debug=1 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
OK will make the uri parser on my own. Not such a big deal. -Original Message- From: news [mailto:[EMAIL PROTECTED]] On Behalf Of Costin Manolache As I mentioned, I prefer doing this _after_ jk2.0 ( i.e. the first milestone), possibly in a branch. MT -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2002/09/24 00:52:09 Modified:jk/native2/common jk_uriEnv.c Log: Enable compiling withouth APR. Revision ChangesPath 1.29 +31 -26jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- jk_uriEnv.c 23 Sep 2002 22:15:04 - 1.28 +++ jk_uriEnv.c 24 Sep 2002 07:52:09 - 1.29 @@ -69,9 +69,8 @@ #include jk_uriMap.h #include jk_registry.h -#ifdef HAS_APR +#if HAS_APR #include apr_uri.h - /** Parse the name: VHOST/PATH @@ -119,45 +118,51 @@ } return JK_ERR; } - #else -/* Old version, deprecated - used only if APR is not available - */ static int jk2_uriEnv_parseName( jk_env_t *env, jk_uriEnv_t *uriEnv, char *name) { -char *n=name; -char *slash=strchr( name, '/' ); - -/* fprintf( stderr, XXX parseURI %s\n, name ); */ - -if( slash==NULL ) { +char *uri = NULL; +char *colon; +char host[1024]; +char path[1024]; + +strcpy(host, name); +colon = strchr(host, ':'); +if (colon != NULL) { +++colon; +uri = strchr(colon, '/'); +} +else +uri = strchr(host, '/'); +if (!uri) { /* That's a virtual host definition ( no actual mapping, just global * settings like aliases, etc */ -uriEnv-match_type= MATCH_TYPE_HOST; -if( name[0]=='\0' ) { -uriEnv-virtual=NULL; /* for the default host */ -} else { -uriEnv-virtual=name; -} + +uriEnv-match_type = MATCH_TYPE_HOST; +if (colon) +uriEnv-port = atoi(colon); +uriEnv-virtual = uriEnv-pool-pstrdup(env, uriEnv-pool, host); return JK_OK; } - +strcpy(path, uri); +if (colon) { +*uri = '\0'; +uriEnv-port = atoi(colon); +} /* If it doesn't start with /, it must have a vhost */ -if( *name != '/' ) { -uriEnv-virtual=uriEnv-pool-calloc( env, uriEnv-pool, slash - name + 2 ); -strncpy( uriEnv-virtual, name, slash-name ); +if (strlen(host)) { +uriEnv-virtual = uriEnv-pool-calloc( env, uriEnv-pool, strlen(host) + 1 ); +strncpy(uriEnv-virtual, name, strlen(host)); } +else +uriEnv-virtual = *; -n=slash; - -uriEnv-uri=uriEnv-pool-pstrdup(env, uriEnv-pool, n); - return JK_OK; } +#endif /* HAS_APR */ -#endif static void * JK_METHOD jk2_uriEnv_getAttribute(jk_env_t *env, jk_bean_t *bean, char *name ) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2002/09/24 00:58:22 Modified:jk/native2/common jk_uriEnv.c Log: Should be #ifdef HAS_APR not #if HAS_APR Revision ChangesPath 1.30 +1 -1 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- jk_uriEnv.c 24 Sep 2002 07:52:09 - 1.29 +++ jk_uriEnv.c 24 Sep 2002 07:58:22 - 1.30 @@ -69,7 +69,7 @@ #include jk_uriMap.h #include jk_registry.h -#if HAS_APR +#ifdef HAS_APR #include apr_uri.h /** Parse the name: VHOST/PATH -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2002/09/23 10:39:24 Modified:jk/native2/common jk_uriEnv.c Log: Rewrite the uriEnv using the apr_uri_t. Revision ChangesPath 1.27 +105 -83 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- jk_uriEnv.c 22 Sep 2002 02:50:42 - 1.26 +++ jk_uriEnv.c 23 Sep 2002 17:39:24 - 1.27 @@ -69,6 +69,7 @@ #include jk_uriMap.h #include jk_registry.h +#include apr_uri.h /** Parse the name: VHOST/PATH @@ -80,35 +81,41 @@ static int jk2_uriEnv_parseName( jk_env_t *env, jk_uriEnv_t *uriEnv, char *name) { -char *n=name; -char *slash=strchr( name, '/' ); - -/* fprintf( stderr, XXX parseURI %s\n, name ); */ + +apr_uri_t uri; +char s[1024]; + +/* If it uri starts with / then it is simple + * default host uri + */ +if (*name == '/') +strcpy(s, name); +else { +strcpy(s, http://;); +strcat(s, name); +} +env-l-jkLog(env, env-l, JK_LOG_DEBUG, + uriEnv.parseName() uri %s name %s real %s\n, + uriEnv-name, name, s); -if( slash==NULL ) { -/* That's a virtual host definition ( no actual mapping, just global - * settings like aliases, etc - */ -uriEnv-match_type= MATCH_TYPE_HOST; -if( name[0]=='\0' ) { -uriEnv-virtual=NULL; /* for the default host */ -} else { -uriEnv-virtual=name; +if (apr_uri_parse(uriEnv-pool-_private, s, uri) == APR_SUCCESS) { + +uriEnv-port = uri.port; +if (uri.hostname) { +if (!uriEnv-port) +uriEnv-virtual = uri.hostname; +else +uriEnv-virtual = apr_pstrcat(uriEnv-pool-_private, +uri.hostname, :, uri.port_str, NULL); } +else +uriEnv-virtual = *; +uriEnv-uri = uri.path; +if (!uri.path) +uriEnv-match_type = MATCH_TYPE_HOST; return JK_OK; } - -/* If it doesn't start with /, it must have a vhost */ -if( *name != '/' ) { -uriEnv-virtual=uriEnv-pool-calloc( env, uriEnv-pool, slash - name + 2 ); -strncpy( uriEnv-virtual, name, slash-name ); -} - -n=slash; - -uriEnv-uri=uriEnv-pool-pstrdup(env, uriEnv-pool, n); - -return JK_OK; +return JK_ERR; } static void * JK_METHOD jk2_uriEnv_getAttribute(jk_env_t *env, jk_bean_t *bean, @@ -134,59 +141,71 @@ jk_uriEnv_t *uriEnv=mbean-object; char *valueParam=valueP; -char *name=uriEnv-pool-pstrdup(env,uriEnv-pool, nameParam); -char *val=uriEnv-pool-pstrdup(env,uriEnv-pool, valueParam); +char *name = uriEnv-pool-pstrdup(env,uriEnv-pool, nameParam); +char *val = uriEnv-pool-pstrdup(env,uriEnv-pool, valueParam); -uriEnv-properties-add( env ,uriEnv-properties, - name, val ); +uriEnv-properties-add(env ,uriEnv-properties, +name, val); -if( strcmp(group, name) == 0 ) { -uriEnv-workerName=val; +if (strcmp(group, name) == 0) { +uriEnv-workerName = val; return JK_OK; -} else if( strcmp(context, name) == 0 ) { - +} +else if (strcmp(context, name) == 0) { uriEnv-contextPath=val; -uriEnv-ctxt_len=strlen( val ); +uriEnv-ctxt_len = strlen(val); -if( strcmp( val, uriEnv-uri ) == 0 ) { -uriEnv-match_type= MATCH_TYPE_CONTEXT; +if (strcmp(val, uriEnv-uri) == 0) { +uriEnv-match_type = MATCH_TYPE_CONTEXT; } return JK_OK; -} else if( strcmp(servlet, name) == 0 ) { +} +else if (strcmp(servlet, name) == 0) { uriEnv-servlet=val; -} else if( strcmp(timing, name) == 0 ) { -uriEnv-timing=atoi( val ); -} else if( strcmp(reverse, name) == 0 ) { -uriEnv-reverse=atoi( val ); -} else if( strcmp(alias, name) == 0 ) { -if( uriEnv-match_type == MATCH_TYPE_HOST ) { -if( uriEnv-aliases==NULL ) { -jk2_map_default_create( env, uriEnv-aliases, mbean-pool ); +} +else if (strcmp(timing, name) == 0) { +uriEnv-timing = atoi(val); +} +else if (strcmp(alias, name) == 0) { +if (uriEnv-match_type == MATCH_TYPE_HOST) { +if (uriEnv-aliases == NULL) { +jk2_map_default_create(env,
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
costin 2002/09/23 15:15:04 Modified:jk/native2/common jk_uriEnv.c Log: Revert ( actually use ifdefs ) the change, so it compiles again in 1.3. Revision ChangesPath 1.28 +41 -0 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- jk_uriEnv.c 23 Sep 2002 17:39:24 - 1.27 +++ jk_uriEnv.c 23 Sep 2002 22:15:04 - 1.28 @@ -69,7 +69,9 @@ #include jk_uriMap.h #include jk_registry.h +#ifdef HAS_APR #include apr_uri.h + /** Parse the name: VHOST/PATH @@ -117,6 +119,45 @@ } return JK_ERR; } + +#else +/* Old version, deprecated - used only if APR is not available + */ +static int jk2_uriEnv_parseName( jk_env_t *env, jk_uriEnv_t *uriEnv, + char *name) +{ +char *n=name; +char *slash=strchr( name, '/' ); + +/* fprintf( stderr, XXX parseURI %s\n, name ); */ + +if( slash==NULL ) { +/* That's a virtual host definition ( no actual mapping, just global + * settings like aliases, etc + */ +uriEnv-match_type= MATCH_TYPE_HOST; +if( name[0]=='\0' ) { +uriEnv-virtual=NULL; /* for the default host */ +} else { +uriEnv-virtual=name; +} +return JK_OK; +} + +/* If it doesn't start with /, it must have a vhost */ +if( *name != '/' ) { +uriEnv-virtual=uriEnv-pool-calloc( env, uriEnv-pool, slash - name + 2 ); +strncpy( uriEnv-virtual, name, slash-name ); +} + +n=slash; + +uriEnv-uri=uriEnv-pool-pstrdup(env, uriEnv-pool, n); + +return JK_OK; +} + +#endif static void * JK_METHOD jk2_uriEnv_getAttribute(jk_env_t *env, jk_bean_t *bean, char *name ) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2002/08/15 02:24:03 Modified:jk/native2/common jk_uriEnv.c Log: Add the reverse mapping option to the uri meaning that the mapping will be 'reversed' or NOT mapped if the actuall mapping is acomplished. Revision ChangesPath 1.25 +2 -0 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- jk_uriEnv.c 8 Jul 2002 13:36:29 - 1.24 +++ jk_uriEnv.c 15 Aug 2002 09:24:03 - 1.25 @@ -157,6 +157,8 @@ uriEnv-servlet=val; } else if( strcmp(timing, name) == 0 ) { uriEnv-timing=atoi( val ); +} else if( strcmp(reverse, name) == 0 ) { +uriEnv-reverse=atoi( val ); } else if( strcmp(alias, name) == 0 ) { if( uriEnv-match_type == MATCH_TYPE_HOST ) { if( uriEnv-aliases==NULL ) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
mturk 2002/07/08 06:36:29 Modified:jk/native2/common jk_uriEnv.c Log: no message Revision ChangesPath 1.24 +9 -9 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- jk_uriEnv.c 10 Jun 2002 21:55:06 - 1.23 +++ jk_uriEnv.c 8 Jul 2002 13:36:29 - 1.24 @@ -260,16 +260,16 @@ } if( uriEnv-mbean-debug 0 ) { if( uriEnv-match_type == MATCH_TYPE_CONTEXT ) { -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.init() context mapping %s=%s \n, uriEnv-prefix, uriEnv-workerName); } else if( uriEnv-match_type == MATCH_TYPE_HOST ) { -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.init() host mapping %s=%s \n, uriEnv-virtual, uriEnv-workerName); } else { -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.init() exact mapping %s=%s \n, uriEnv-prefix, uriEnv-workerName); } @@ -297,7 +297,7 @@ uriEnv-match_type = MATCH_TYPE_CONTEXT_PATH; if( uriEnv-mbean-debug 0 ) { -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, Into jk_uri_worker_map_t::uri_worker_map_open, general context path rule %s * %s - %s was added\n, uri, asterisk + 2, uriEnv-workerName); @@ -311,7 +311,7 @@ uriEnv-suffix = asterisk + 3; uriEnv-match_type = MATCH_TYPE_SUFFIX; if( uriEnv-mbean-debug 0 ) { -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.init() suffix mapping %s .%s=%s was added\n, uriEnv-prefix, uriEnv-suffix, uriEnv-workerName); } @@ -323,7 +323,7 @@ uriEnv-prefix_len =strlen( uriEnv-prefix ); uriEnv-match_type = MATCH_TYPE_GENERAL_SUFFIX; if( uriEnv-mbean-debug 0 ) { -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.init() general suffix mapping %s.%s=%s\n, uri, asterisk + 2, uriEnv-workerName); } @@ -336,7 +336,7 @@ uriEnv-prefix_len =strlen( uriEnv-prefix ); uriEnv-match_type = MATCH_TYPE_PREFIX; if( uriEnv-mbean-debug 0 ) { -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.init() prefix mapping %s=%s\n, uriEnv-prefix, uriEnv-workerName); } @@ -349,13 +349,13 @@ uriEnv-suffix = NULL; uriEnv-match_type = MATCH_TYPE_PREFIX; if( uriEnv-mbean-debug 0 ) { -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriEnv.init() prefix mapping2 %s=%s\n, uri, uriEnv-workerName); } } if( uriEnv-mbean-debug 0 ) -env-l-jkLog( env, env-l, JK_LOG_INFO, +env-l-jkLog( env, env-l, JK_LOG_DEBUG, uriEnv.init() %s host=%s uri=%s type=%d ctx=%s prefix=%s suffix=%s\n, uriEnv-mbean-name, uriEnv-virtual, uriEnv-uri, uriEnv-match_type, uriEnv-contextPath, uriEnv-prefix, uriEnv-suffix ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
costin 02/05/14 10:18:42 Modified:jk/native2/common jk_uriEnv.c Log: Stupid bug - there is a reason for java requiring boolean on each if and not allowing 'int 0' as a boolean. Explicit ifs are verbose but safe. Revision ChangesPath 1.18 +2 -2 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- jk_uriEnv.c 9 May 2002 21:12:15 - 1.17 +++ jk_uriEnv.c 14 May 2002 17:18:42 - 1.18 @@ -120,9 +120,9 @@ if( strcmp( name, host )==0 ) { return (uriEnv-virtual==NULL) ? * : uriEnv-virtual; -} else if( strcmp( name, uri ) ) { +} else if( strcmp( name, uri )==0 ) { return uriEnv-uri; -} else if( strcmp( name, group ) ) { +} else if( strcmp( name, group )==0 ) { return uriEnv-workerName; } return NULL; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
costin 02/05/03 10:43:59 Modified:jk/native2/common jk_uriEnv.c Log: Rename 'worker' to 'group' in the config. This will hopefully reduce the confusion. Revision ChangesPath 1.15 +9 -6 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- jk_uriEnv.c 1 May 2002 17:23:14 - 1.14 +++ jk_uriEnv.c 3 May 2002 17:43:59 - 1.15 @@ -126,7 +126,7 @@ return (uriEnv-virtual==NULL) ? * : uriEnv-virtual; } else if( strcmp( name, uri ) ) { return uriEnv-uri; -} else if( strcmp( name, worker ) ) { +} else if( strcmp( name, group ) ) { return uriEnv-workerName; } return NULL; @@ -223,10 +223,13 @@ if( uriEnv-workerName != NULL uriEnv-worker==NULL ) { uriEnv-worker= env-getByName( env, wname ); if( uriEnv-worker==NULL ) { -env-l-jkLog(env, env-l, JK_LOG_ERROR, - uriEnv.init() map to invalid worker %s %s\n, - uriEnv-uri, uriEnv-workerName); -/* XXX that's allways a 'lb' worker, create it */ +uriEnv-worker= env-getByName2( env, worker.lb, wname ); +if( uriEnv-worker==NULL ) { +env-l-jkLog(env, env-l, JK_LOG_ERROR, + uriEnv.init() map to invalid worker %s %s\n, + uriEnv-uri, uriEnv-workerName); +/* XXX that's allways a 'lb' worker, create it */ +} } } @@ -358,7 +361,7 @@ return JK_OK; } -static char *myAttInfo[]={ host, uri, worker, NULL }; +static char *myAttInfo[]={ host, uri, group, NULL }; int JK_METHOD jk2_uriEnv_factory(jk_env_t *env, jk_pool_t *pool, jk_bean_t *result, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c jk_uriMap.c
costin 02/05/01 10:23:14 Modified:jk/native2/common jk_uriEnv.c jk_uriMap.c Log: Reduce verbosity of messages. Fix a mapping bug for prefix mappings ( it is in jk1 too, but there you get around by using the 'general prefix mapping' - /examples* or by mapping both /examples and /examples/* ). ( the bug was that /examples/* did matched the ending / ). After I get the web.xml-jk converter I'll start watchdog-ing. ( I just added filter support ) Revision ChangesPath 1.14 +18 -16jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- jk_uriEnv.c 30 Apr 2002 06:44:57 - 1.13 +++ jk_uriEnv.c 1 May 2002 17:23:14 - 1.14 @@ -82,8 +82,8 @@ { char *n=name; char *slash=strchr( name, '/' ); - -fprintf( stderr, XXX parseURI %s\n, name ); + +/* fprintf( stderr, XXX parseURI %s\n, name ); */ if( slash==NULL ) { /* That's a virtual host definition ( no actual mapping, just global @@ -214,16 +214,17 @@ uriEnv-workerName=uriEnv-uriMap-workerEnv-defaultWorker-mbean-name;; uriEnv-worker=uriEnv-uriMap-workerEnv-defaultWorker; -env-l-jkLog(env, env-l, JK_LOG_DEBUG, - uriMap.init() map %s %s\n, - uriEnv-uri, uriEnv-uriMap-workerEnv-defaultWorker-mbean-name); +if( uriEnv-debug 0 ) +env-l-jkLog(env, env-l, JK_LOG_DEBUG, + uriEnv.init() map %s %s\n, + uriEnv-uri, uriEnv-uriMap-workerEnv-defaultWorker-mbean-name); } if( uriEnv-workerName != NULL uriEnv-worker==NULL ) { uriEnv-worker= env-getByName( env, wname ); if( uriEnv-worker==NULL ) { env-l-jkLog(env, env-l, JK_LOG_ERROR, - uriMap.init() map to invalid worker %s %s\n, + uriEnv.init() map to invalid worker %s %s\n, uriEnv-uri, uriEnv-workerName); /* XXX that's allways a 'lb' worker, create it */ } @@ -240,7 +241,7 @@ * not arrive here when using Apache. */ env-l-jkLog(env, env-l, JK_LOG_ERROR, - uriMap.addMapping() context must start with '/' in %s\n, + uriEnv.init() context must start with '/' in %s\n, uri); return JK_ERR; } @@ -261,16 +262,16 @@ if( uriEnv-debug 0 ) { if( uriEnv-match_type == MATCH_TYPE_CONTEXT ) { env-l-jkLog(env, env-l, JK_LOG_INFO, - uriMap.addMapping() context mapping %s=%s \n, + uriEnv.init() context mapping %s=%s \n, uriEnv-prefix, uriEnv-workerName); } else if( uriEnv-match_type == MATCH_TYPE_HOST ) { env-l-jkLog(env, env-l, JK_LOG_INFO, - uriMap.addMapping() host mapping %s=%s \n, + uriEnv.init() host mapping %s=%s \n, uriEnv-virtual, uriEnv-workerName); } else { env-l-jkLog(env, env-l, JK_LOG_INFO, - uriMap.addMapping() exact mapping %s=%s \n, + uriEnv.init() exact mapping %s=%s \n, uriEnv-prefix, uriEnv-workerName); } } @@ -312,7 +313,7 @@ uriEnv-match_type = MATCH_TYPE_SUFFIX; if( uriEnv-debug 0 ) { env-l-jkLog(env, env-l, JK_LOG_INFO, - uriMap.addMapping() suffix mapping %s .%s=%s was added\n, + uriEnv.init() suffix mapping %s .%s=%s was added\n, uriEnv-prefix, uriEnv-suffix, uriEnv-workerName); } } else if ('\0' != asterisk[2]) { @@ -324,19 +325,20 @@ uriEnv-match_type = MATCH_TYPE_GENERAL_SUFFIX; if( uriEnv-debug 0 ) { env-l-jkLog(env, env-l, JK_LOG_INFO, - uriMap.addMapping() general suffix mapping %s.%s=%s\n, + uriEnv.init() general suffix mapping %s.%s=%s\n, uri, asterisk + 2, uriEnv-workerName); } } else { -/* context based /context/prefix/ASTERISK */ +/* context based /context/prefix/ASTERISK */ asterisk[1] = '\0'; +asterisk[0] = '\0';
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
costin 02/04/29 23:44:57 Modified:jk/native2/common jk_uriEnv.c Log: A bit of reorganization to support the new maping. Note that the 'special' maps are recognized but not curently used in uriMap, we may add them later. Revision ChangesPath 1.13 +133 -55 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_uriEnv.c 29 Apr 2002 19:35:35 - 1.12 +++ jk_uriEnv.c 30 Apr 2002 06:44:57 - 1.13 @@ -69,41 +69,51 @@ #include jk_uriMap.h #include jk_registry.h -static int jk2_uriEnv_init(jk_env_t *env, jk_uriEnv_t *uriEnv); +/** Parse the name: + VHOST/PATH -static int jk2_uriEnv_parseUri( jk_env_t *env, jk_uriEnv_t *uriEnv, -char *name) +If VHOST is empty, we map to the default host. + +The PATH will be further split in CONTEXT/LOCALPATH during init ( after +we have all uris, including the context paths ). +*/ +static int jk2_uriEnv_parseName( jk_env_t *env, jk_uriEnv_t *uriEnv, + char *name) { char *n=name; -char *slash=strchr( n, '/' ); +char *slash=strchr( name, '/' ); +fprintf( stderr, XXX parseURI %s\n, name ); + if( slash==NULL ) { -env-l-jkLog( env, env-l, JK_LOG_ERROR, - uriEnv.parseUri(): At least a '/' must be included %s\n, name); -return JK_ERR; +/* That's a virtual host definition ( no actual mapping, just global + * settings like aliases, etc + */ +uriEnv-match_type= MATCH_TYPE_HOST; +if( name[0]=='\0' ) { +uriEnv-virtual=NULL; /* for the default host */ +} else { +uriEnv-virtual=name; +} +return JK_OK; } -/* Cut the uri. prefix, if any */ -if( (strncmp( name, uri., 4 ) == 0 )|| -(strncmp( name, uri:, 4 ) == 0 )) { -n=name+4; -} -/* Cut the */ -if( *n == '' ) n++; -/* If it doesn't start with /, it must be a vhost */ -if( *n != '/' ) { -char *portIdx=strchr( n, ':' ); -char *vhost=NULL; - -/* XXX Extract and set the vhost */ +/* If it doesn't start with /, it must have a vhost */ +if( *name != '/' ) { +jk_uriEnv_t *vhost; +// char *portIdx=strchr( n, ':' ); +uriEnv-virtual=uriEnv-pool-calloc( env, uriEnv-pool, slash - name + 2 ); +strncpy( uriEnv-virtual, name, slash-name ); } n=slash; uriEnv-uri=uriEnv-pool-pstrdup(env, uriEnv-pool, n); -jk2_uriEnv_init(env, uriEnv); -/* env-l-jkLog( env, env-l, JK_LOG_INFO, */ -/*uriEnv.parseUri() Setting path %s for %s\n, n, name); */ + +/* No further init - will be called by uriMap.init() */ +env-l-jkLog( env, env-l, JK_LOG_INFO, + uriEnv.parseUri() Parsing %s to host=%s uri=%s\n, name, + uriEnv-virtual, uriEnv-uri ); return JK_OK; } @@ -122,7 +132,7 @@ return NULL; } -static int JK_METHOD jk2_uriEnv_setProperty(jk_env_t *env, +static int JK_METHOD jk2_uriEnv_setAttribute(jk_env_t *env, jk_bean_t *mbean, char *nameParam, void *valueP) @@ -135,20 +145,50 @@ uriEnv-properties-add( env ,uriEnv-properties, name, val ); -if( strcmp(worker, name) == 0 ) { + +if( strcmp(group, name) == 0 ) { uriEnv-workerName=val; -} -if( strcmp(debug, name) == 0 ) { +return JK_OK; +} else if( strcmp(context, name) == 0 ) { +jk_bean_t *ctxMB; +jk_uriEnv_t *ctxEnv; +char *cname; + +uriEnv-contextPath=val; +uriEnv-ctxt_len=strlen( val ); + +if( strcmp( val, uriEnv-uri ) == 0 ) { +uriEnv-match_type= MATCH_TYPE_CONTEXT; +} +return JK_OK; +} else if( strcmp(servlet, name) == 0 ) { +uriEnv-servlet=val; +} else if( strcmp(alias, name) == 0 ) { +if( uriEnv-match_type == MATCH_TYPE_HOST ) { +if( uriEnv-aliases==NULL ) { +jk2_map_default_create( env, uriEnv-aliases, mbean-pool ); +} +uriEnv-aliases-put( env, uriEnv-aliases, val, uriEnv, NULL ); +} +} else if( strcmp(debug, name) == 0 ) { uriEnv-debug=atoi( val ); -} -if( strcmp(path, name) == 0 ) { +return JK_OK; +} + +
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
nacho 02/04/27 17:19:27 Modified:jk/native2/common jk_uriEnv.c Log: * Use uriEnv-workerName for logs Revision ChangesPath 1.10 +4 -4 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- jk_uriEnv.c 25 Apr 2002 19:22:19 - 1.9 +++ jk_uriEnv.c 28 Apr 2002 00:19:27 - 1.10 @@ -219,7 +219,7 @@ if( uriEnv-debug 0 ) { env-l-jkLog(env, env-l, JK_LOG_INFO, uriMap.addMapping() suffix mapping %s.%s=%s was added\n, - uri, asterisk + 3, uriEnv-worker); + uri, asterisk + 3, uriEnv-workerName); } } else if ('\0' != asterisk[2]) { /* general suffix rule /foo/bar/STARextraData */ @@ -231,7 +231,7 @@ if( uriEnv-debug 0 ) { env-l-jkLog(env, env-l, JK_LOG_INFO, uriMap.addMapping() general suffix mapping %s.%s=%s\n, - uri, asterisk + 2, uriEnv-worker); + uri, asterisk + 2, uriEnv-workerName); } } else { /* context based /foo/bar/STAR */ @@ -243,7 +243,7 @@ if( uriEnv-debug 0 ) { env-l-jkLog(env, env-l, JK_LOG_INFO, uriMap.addMapping() prefix mapping %s=%s\n, - uri, uriEnv-worker); + uri, uriEnv-workerName); } } } else { @@ -256,7 +256,7 @@ if( uriEnv-debug 0 ) { env-l-jkLog(env, env-l, JK_LOG_INFO, uriMap.addMapping() prefix mapping2 %s=%s\n, - uri, uriEnv-worker); + uri, uriEnv-workerName); } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c jk_worker_ajp13.c jk_worker_status.c
costin 02/03/27 10:58:58 Modified:jk/native2/common jk_uriEnv.c jk_worker_ajp13.c jk_worker_status.c Log: Added 'getters' for few common proprties. More will come in the future, for any information that is worth knowing. Modified worker_status to use the new API instead of accessing the fields directly. Now worker status displays 3 kind of information: - the original config ( what the user set in jk2.properties or otherwise ) - the processed config ( include 'default' or 'guessed' values, after $() substitution) - runtime status ( what getAttribute() returns ) We'll add some filters and probably change this to a txt form ( properties-like ) for easy parsing - this is not supposed to become a 'nice' interface, but to be used programatically and maybe wrapped in a nicer GUI. Revision ChangesPath 1.7 +11 -5 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jk_uriEnv.c 26 Mar 2002 03:03:01 - 1.6 +++ jk_uriEnv.c 27 Mar 2002 18:58:57 - 1.7 @@ -110,10 +110,14 @@ static void *jk2_uriEnv_getAttribute(jk_env_t *env, jk_bean_t *bean, char *name ) { -if( strcmp( name, worker ) ) { - -} else if( strcmp( name, reqCount ) ) { - +jk_uriEnv_t *uriEnv=(jk_uriEnv_t *)bean-object; + +if( strcmp( name, host )==0 ) { +return (uriEnv-virtual==NULL) ? * : uriEnv-virtual; +} else if( strcmp( name, uri ) ) { +return uriEnv-uri; +} else if( strcmp( name, worker ) ) { +return uriEnv-workerName; } return NULL; } @@ -259,6 +263,7 @@ return JK_TRUE; } +static char *myAttInfo[]={ host, uri, worker, NULL }; int JK_METHOD jk2_uriEnv_factory(jk_env_t *env, jk_pool_t *pool, jk_bean_t *result, @@ -284,7 +289,8 @@ result-getAttribute=jk2_uriEnv_getAttribute; uriEnv-mbean=result; result-object=uriEnv; - +result-getAttributeInfo=myAttInfo; + /* The name is a path */ if( strchr( name, '/' ) != NULL ) { jk2_uriEnv_setProperty( env, result, uri, (char *)name ); 1.6 +35 -0 jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c Index: jk_worker_ajp13.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- jk_worker_ajp13.c 26 Mar 2002 03:04:24 - 1.5 +++ jk_worker_ajp13.c 27 Mar 2002 18:58:57 - 1.6 @@ -85,7 +85,39 @@ #define AJP14_DEF_PORT (8011) /* Impl */ +static char *myAttInfo[]={ channelName, route, errorState, recovering, + epCount, NULL }; +static void *jk2_worker_ajp14_getAttribute(jk_env_t *env, jk_bean_t *bean, char *name ) { +jk_worker_t *worker=(jk_worker_t *)bean-object; + +if( strcmp( name, channelName )==0 ) { +if( worker-channel != NULL ) +return worker-channel-mbean-name; +else +return worker-channelName; +} else if (strcmp( name, route )==0 ) { +return worker-route; +} else if (strcmp( name, errorState )==0 ) { +if( worker-in_error_state ) +return Y; +else +return NULL; +} else if (strcmp( name, recovering )==0 ) { +if( worker-in_recovering ) +return Y; +else +return NULL; +} else if (strcmp( name, epCount )==0 ) { +char *result; +if( worker-endpointCache==NULL ) return 0; +result=env-tmpPool-calloc( env, env-tmpPool, 6 ); +sprintf( result, %d, worker-endpointCache-count ); +return result; +} else { +return NULL; +} +} /* * Initialize the worker. @@ -676,11 +708,14 @@ w-service = jk2_worker_ajp14_service; result-setAttribute= jk2_worker_ajp14_setAttribute; +result-getAttribute= jk2_worker_ajp14_getAttribute; result-object = w; w-mbean=result; w-workerEnv=env-getByName( env, workerEnv ); w-workerEnv-addWorker( env, w-workerEnv, w ); +result-getAttributeInfo=myAttInfo; + return JK_TRUE; } 1.13 +52 -118 jakarta-tomcat-connectors/jk/native2/common/jk_worker_status.c Index: jk_worker_status.c === RCS file:
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c jk_uriMap.c
costin 02/03/25 19:03:01 Modified:jk/native2/common jk_uriEnv.c jk_uriMap.c Log: Update, remove excessive debugging. Revision ChangesPath 1.6 +3 -5 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- jk_uriEnv.c 24 Mar 2002 19:24:26 - 1.5 +++ jk_uriEnv.c 26 Mar 2002 03:03:01 - 1.6 @@ -79,7 +79,7 @@ if( slash==NULL ) { env-l-jkLog( env, env-l, JK_LOG_ERROR, - At least a '/' must be included %s\n, name); + uriEnv.parseUri(): At least a '/' must be included %s\n, name); return JK_FALSE; } @@ -102,8 +102,8 @@ uriEnv-uri=uriEnv-pool-pstrdup(env, uriEnv-pool, n); jk2_uriEnv_init(env, uriEnv); -env-l-jkLog( env, env-l, JK_LOG_INFO, - Setting path %s for %s\n, n, name); +/* env-l-jkLog( env, env-l, JK_LOG_INFO, */ +/*uriEnv.parseUri() Setting path %s for %s\n, n, name); */ return JK_TRUE; } @@ -267,8 +267,6 @@ jk_pool_t *uriPool; int err; jk_uriEnv_t *uriEnv; - -env-l-jkLog(env, env-l, JK_LOG_INFO, uriEnv: Create URI %s %s \n, type, name ); uriPool=(jk_pool_t *)pool-create( env, pool, HUGE_POOL_SIZE); 1.20 +8 -6 jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c Index: jk_uriMap.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- jk_uriMap.c 23 Mar 2002 17:27:13 - 1.19 +++ jk_uriMap.c 26 Mar 2002 03:03:01 - 1.20 @@ -67,7 +67,7 @@ * servlet container. * * Author: Gal Shachor [EMAIL PROTECTED] - * Version: $Revision: 1.19 $ + * Version: $Revision: 1.20 $ */ #include jk_pool.h @@ -194,19 +194,21 @@ int err; jk_uriEnv_t *uriEnv; char *uriName; +jk_bean_t *jkb; uriName=(char *)uriMap-pool-calloc( env, uriMap-pool, (vhost==NULL ? 0 : strlen( vhost )) + (path==NULL ? 0 : strlen( path )) + + 10); -strcpy( uriName, uri: ); +strcpy( uriName, ); if( vhost != NULL ) strcat( uriName, vhost ); if( path != NULL ) strcat( uriName, path ); - -uriEnv=env-createInstance( env, uriMap-pool, uriEnv, uriName ); -if( uriEnv==NULL ) + +jkb=env-createBean2( env, uriMap-pool, uri, uriName ); +if( jkb==NULL || jkb-object==NULL ) return NULL; - +uriEnv=jkb-object; + uriEnv-workerEnv=uriMap-workerEnv; uriEnv-mbean-setAttribute( env, uriEnv-mbean, path, path ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_uriEnv.c
costin 02/03/18 10:43:53 Modified:jk/native2/common jk_uriEnv.c Log: Update to the new config. Started to add code to parse the uri name - and extract the vhost ( finally ) and components. Revision ChangesPath 1.2 +63 -9 jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c Index: jk_uriEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriEnv.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_uriEnv.c 1 Mar 2002 00:45:58 - 1.1 +++ jk_uriEnv.c 18 Mar 2002 18:43:53 - 1.2 @@ -69,11 +69,49 @@ #include jk_uriMap.h #include jk_registry.h +static int jk2_uriEnv_parseUri( jk_env_t *env, jk_uriEnv_t *uriEnv, +char *name) +{ +char *n=name; +char *slash=strchr( n, '/' ); + +if( slash==NULL ) { +env-l-jkLog( env, env-l, JK_LOG_ERROR, + At least a '/' must be included %s\n, name); +return JK_FALSE; +} + +/* Cut the uri. prefix, if any */ +if( strncmp( name, uri., 4 ) == 0 ) { +n=name+4; +} +/* Cut the */ +if( *n == '' ) n++; +/* If it doesn't start with /, it must be a vhost */ +if( *n != '/' ) { +char *portIdx=strchr( n, ':' ); +char *vhost=NULL; + +/* XXX Extract and set the vhost */ +} + +n=slash; + +uriEnv-uri=uriEnv-pool-pstrdup(env, uriEnv-pool, n); +jk2_uriEnv_init(env, uriEnv); +env-l-jkLog( env, env-l, JK_LOG_INFO, + Setting path %s for %s\n, n, name); +return JK_TRUE; +} + static int jk2_uriEnv_setProperty(jk_env_t *env, - jk_uriEnv_t *uriEnv, - const char *nameParam, - char *valueParam) + jk_bean_t *mbean, + char *nameParam, + void *valueP) { +jk_uriEnv_t *uriEnv=mbean-object; +char *valueParam=valueP; + char *name=uriEnv-pool-pstrdup(env,uriEnv-pool, nameParam); char *val=uriEnv-pool-pstrdup(env,uriEnv-pool, valueParam); @@ -85,12 +123,15 @@ if( strcmp(debug, name) == 0 ) { uriEnv-debug=atoi( val ); } -if( strcmp(uri, name) == 0 ) { +if( strcmp(path, name) == 0 ) { if( val==NULL ) uriEnv-uri=NULL; else uriEnv-uri=uriEnv-pool-pstrdup(env, uriEnv-pool, val); } +if( strcmp(uri, name) == 0 ) { +jk2_uriEnv_parseUri( env, uriEnv, val); +} if( strcmp(vhost, name) == 0 ) { if( val==NULL ) uriEnv-virtual=NULL; @@ -106,7 +147,7 @@ { int err; char *asterisk; -char *uri=uriEnv-uri; +char *uri=uriEnv-pool-pstrdup( env, uriEnv-pool, uriEnv-uri); if( uri==NULL ) return JK_FALSE; @@ -205,13 +246,16 @@ } -int JK_METHOD jk2_uriEnv_factory(jk_env_t *env, jk_pool_t *pool, void **result, +int JK_METHOD jk2_uriEnv_factory(jk_env_t *env, jk_pool_t *pool, + jk_bean_t *result, const char *type, const char *name) { jk_pool_t *uriPool; int err; jk_uriEnv_t *uriEnv; +env-l-jkLog(env, env-l, JK_LOG_INFO, uriEnv: Create URI %s %s \n, type, name ); + uriPool=(jk_pool_t *)pool-create( env, pool, HUGE_POOL_SIZE); @@ -222,10 +266,20 @@ jk2_map_default_create( env, uriEnv-properties, uriPool ); -uriEnv-setProperty=jk2_uriEnv_setProperty; -uriEnv-init=jk2_uriEnv_init; -*result=uriEnv; +uriEnv-init=jk2_uriEnv_init; + +result-setAttribute=jk2_uriEnv_setProperty; +uriEnv-mbean=result; +result-object=uriEnv; + +/* The name is a path */ +if( strchr( name, '/' ) != NULL ) { +jk2_uriEnv_setProperty( env, result, uri, name ); +} +uriEnv-workerEnv=env-getByName( env, workerEnv ); +uriEnv-workerEnv-uriMap-addUriEnv( env, uriEnv-workerEnv-uriMap, + uriEnv ); return JK_TRUE; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]