cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
jfclere 2004/07/06 08:56:42 Modified:jk/native2/common jk_endpoint.c jk_logger_win32.c jk_requtil.c jk/native2/server/apache2 mod_jk2.c Log: Use apr equivalent routine for snprintf, usleep and vsnprintf. Revision ChangesPath 1.29 +1 -1 jakarta-tomcat-connectors/jk/native2/common/jk_endpoint.c Index: jk_endpoint.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_endpoint.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- jk_endpoint.c 21 Mar 2004 09:43:09 - 1.28 +++ jk_endpoint.c 6 Jul 2004 15:56:41 - 1.29 @@ -43,7 +43,7 @@ if (wEnv-epStat == NULL) { if (wEnv-shm != NULL wEnv-childId = 0) { char shmName[128]; -snprintf(shmName, 128, epStat.%d, wEnv-childId); +apr_snprintf(shmName, 128, epStat.%d, wEnv-childId); wEnv-epStat = wEnv-shm-createSlot(env, wEnv-shm, shmName, 8096); 1.12 +1 -1 jakarta-tomcat-connectors/jk/native2/common/jk_logger_win32.c Index: jk_logger_win32.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_logger_win32.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- jk_logger_win32.c 21 Mar 2004 09:43:09 - 1.11 +++ jk_logger_win32.c 6 Jul 2004 15:56:41 - 1.12 @@ -128,7 +128,7 @@ } -rc = _vsnprintf(buf + used, HUGE_BUFFER_SIZE - used, fmt, args); +rc = apr_vsnprintf(buf + used, HUGE_BUFFER_SIZE - used, fmt, args); l-log(env, l, level, buf); } 1.34 +1 -1 jakarta-tomcat-connectors/jk/native2/common/jk_requtil.c Index: jk_requtil.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_requtil.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- jk_requtil.c 15 Jun 2004 20:37:10 - 1.33 +++ jk_requtil.c 6 Jul 2004 15:56:41 - 1.34 @@ -494,7 +494,7 @@ va_start(vargs, fmt); s-outPos = 0; /* Temp - we don't buffer */ ret = -vsnprintf(s-outBuf + s-outPos, s-outSize - s-outPos, fmt, vargs); +apr_vsnprintf(s-outBuf + s-outPos, s-outSize - s-outPos, fmt, vargs); va_end(vargs); s-write(env, s, s-outBuf, strlen(s-outBuf)); 1.85 +2 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.84 retrieving revision 1.85 diff -u -r1.84 -r1.85 --- mod_jk2.c 16 Jun 2004 15:42:03 - 1.84 +++ mod_jk2.c 6 Jul 2004 15:56:41 - 1.85 @@ -638,7 +638,7 @@ env-l-jkLog(env, env-l, JK_LOG_INFO, jk2_child_init() child %d not in scoreboard yet, spin %d\n, proc.pid, counter); - usleep(10); + apr_sleep((apr_interval_time_t)10); workerEnv-childId = find_child_by_pid(proc); } if (workerEnv-childId == -1) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
yoavs 2004/06/16 07:38:56 Modified:jk/native2/server/apache2 mod_jk2.c Log: Bugzilla 26231 done. Revision ChangesPath 1.83 +20 -5 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- mod_jk2.c 31 Mar 2004 14:22:04 - 1.82 +++ mod_jk2.c 16 Jun 2004 14:38:56 - 1.83 @@ -628,10 +628,25 @@ proc.pid); } else { -env-l-jkLog(env, env-l, JK_LOG_ERROR, - jk2_init() Can't find child %d in none of the %d scoreboard slots\n, - proc.pid, workerEnv-maxDaemons); -workerEnv-childId = -2; + /* + * try again several times, there's a + * race condition here where jk2_child_init gets + * called before make_child completes. + */ + int counter = 0; + while (counter++ 50 workerEnv-childId == -1) { + env-l-jkLog(env, env-l, JK_LOG_INFO, + jk2_child_init() child %d not in scoreboard yet, spin %d\n, + proc.pid, counter); + usleep(10); + workerEnv-childId = find_child_by_pid(proc); + } + if (workerEnv-childId == -1) { + env-l-jkLog(env, env-l, JK_LOG_ERROR, +jk2_init() Can't find child %d in any of the %d scoreboard slots\n, + proc.pid, max_daemons_limit); + workerEnv-childId = -2; + } } } else { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
keith 2004/06/16 08:42:03 Modified:jk/native2/server/apache2 mod_jk2.c Log: The patch that was just applied for a bug was against an older version and referred to a nonexistant variable. Revision ChangesPath 1.84 +2 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- mod_jk2.c 16 Jun 2004 14:38:56 - 1.83 +++ mod_jk2.c 16 Jun 2004 15:42:03 - 1.84 @@ -644,7 +644,7 @@ if (workerEnv-childId == -1) { env-l-jkLog(env, env-l, JK_LOG_ERROR, jk2_init() Can't find child %d in any of the %d scoreboard slots\n, - proc.pid, max_daemons_limit); + proc.pid, workerEnv-maxDaemons); workerEnv-childId = -2; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
I also tried this and everything worked nicely. NormW wrote: Good morning All. Just tried Jean's recent change to mod_jk2.c and _pleased_ to say JkUriSet now registers correctly the same as a [uri] section, and can access /admin with only a Location in the httpd.conf. I did note there were duplicate uri objects created (based on their name) if the same uri spec was in both files, but in any case this is a lot closer to theory than in the past. Thanks Jean. Norm - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 01, 2004 12:22 AM Subject: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jfclere 2004/03/31 06:22:04 Modified:jk/native2/server/apache2 mod_jk2.c Log: Fix handling of id added in jk2_create_dir_config(). I do not see why we need this id... May because jk2_merge_dir_config() was buggy. That fixes PR 18472 and 28916. Revision ChangesPath 1.82 +33 -16 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- mod_jk2.c 21 Mar 2004 09:44:30 - 1.81 +++ mod_jk2.c 31 Mar 2004 14:22:04 - 1.82 @@ -221,14 +221,25 @@ strcpy(tmp_full_url, s-server_hostname); strcat(tmp_full_url, uriEnv-uri); } + uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, uri, tmp_full_url); uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, path, cmd-path); + uriEnv-name = tmp_virtual; uriEnv-virtual = tmp_virtual; +} else { +/* + * The jk2_create_dir_config added an id to uri and path + * we have to correct it here. + */ + +uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, +uri, cmd-path); } + /* now lets actually add the parameter set in the Location block */ uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, (char *)name, (void *)val); @@ -293,40 +304,46 @@ jk_uriEnv_t *child = (jk_uriEnv_t *)childv; jk_uriEnv_t *parent = (jk_uriEnv_t *)parentv; jk_uriEnv_t *winner = NULL; -jk_uriEnv_t *loser = NULL; +char *hostchild; +char *hostparent; if (child == NULL || child-uri == NULL || child-workerName == NULL) { winner = parent; -loser = child; } else if (parent == NULL || parent-uri == NULL || parent-workerName == NULL) { winner = child; -loser = parent; /* interresting bit... so far they are equal ... */ } else if (strlen(parent-uri) strlen(child-uri)) { winner = parent; -loser = child; +} +else if (strlen(parent-uri) == strlen(child-uri)) { +/* Try the virtual host to decide */ +hostchild = child-mbean-getAttribute(workerEnv-globalEnv, child-mbean,host); +hostparent = parent-mbean-getAttribute(workerEnv-globalEnv, parent-mbean,host); +if (hostchild == NULL) +winner = parent; +if (hostparent == NULL) +winner = child; +if (winner == NULL) { +if (strlen(hostchild) strlen(hostparent)) +winner = child; +else +winner = parent; +} } else { winner = child; -loser = parent; } /* Do we merge loser into winner - i.e. inherit properties ? */ -/*if ( winner == child ) - fprintf(stderr, Going with the child\n); - else if ( winner == parent ) - fprintf(stderr, Going with the parent\n); - else - fprintf(stderr, Going with NULL\n); - */ -fprintf(stderr, Merging %s %s %s\n, -(winner == NULL || winner-uri == NULL) ? : winner-uri, +ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, NULL, + mod_jk2 Merging %s %s winner: %s\n, (child == NULL || child-uri == NULL) ? : child-uri, -(parent == NULL || parent-uri == NULL) ? : parent-uri); +(parent == NULL || parent-uri == NULL) ? : parent-uri, +(winner == child) ? parent : child ); return (void *)winner; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Good morning All. In considering the duplication issue mentioned previously, it would seem entirely possible that a specific uri could be given in both workers2.properties and via a JkUriSet entry... therefore shouldn't the JkUriSet function resolve the name to be used for a uri object and first check for a matching object before creating another one? If the object already exists then only 'non-key' properties such as 'info', 'servlet', 'worker' and so on, should be updated by JkUriSet on the existing obect. Thinking out loud. Norm Good morning All. Just tried Jean's recent change to mod_jk2.c and _pleased_ to say JkUriSet now registers correctly the same as a [uri] section, and can access /admin with only a Location in the httpd.conf. I did note there were duplicate uri objects created (based on their name) if the same uri spec was in both files, but in any case this is a lot closer to theory than in the past. Thanks Jean. Norm - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 01, 2004 12:22 AM Subject: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jfclere 2004/03/31 06:22:04 Modified:jk/native2/server/apache2 mod_jk2.c Log: Fix handling of id added in jk2_create_dir_config(). I do not see why we need this id... May because jk2_merge_dir_config() was buggy. That fixes PR 18472 and 28916. Revision ChangesPath 1.82 +33 -16 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- mod_jk2.c 21 Mar 2004 09:44:30 - 1.81 +++ mod_jk2.c 31 Mar 2004 14:22:04 - 1.82 @@ -221,14 +221,25 @@ strcpy(tmp_full_url, s-server_hostname); strcat(tmp_full_url, uriEnv-uri); } + uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, uri, tmp_full_url); uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, path, cmd-path); + uriEnv-name = tmp_virtual; uriEnv-virtual = tmp_virtual; +} else { +/* + * The jk2_create_dir_config added an id to uri and path + * we have to correct it here. + */ + +uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, +uri, cmd-path); } + /* now lets actually add the parameter set in the Location block */ uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, (char *)name, (void *)val); @@ -293,40 +304,46 @@ jk_uriEnv_t *child = (jk_uriEnv_t *)childv; jk_uriEnv_t *parent = (jk_uriEnv_t *)parentv; jk_uriEnv_t *winner = NULL; -jk_uriEnv_t *loser = NULL; +char *hostchild; +char *hostparent; if (child == NULL || child-uri == NULL || child-workerName == NULL) { winner = parent; -loser = child; } else if (parent == NULL || parent-uri == NULL || parent-workerName == NULL) { winner = child; -loser = parent; /* interresting bit... so far they are equal ... */ } else if (strlen(parent-uri) strlen(child-uri)) { winner = parent; -loser = child; +} +else if (strlen(parent-uri) == strlen(child-uri)) { +/* Try the virtual host to decide */ +hostchild = child-mbean-getAttribute(workerEnv-globalEnv, child-mbean,host); +hostparent = parent-mbean-getAttribute(workerEnv-globalEnv, parent-mbean,host); +if (hostchild == NULL) +winner = parent; +if (hostparent == NULL) +winner = child; +if (winner == NULL) { +if (strlen(hostchild) strlen(hostparent)) +winner = child; +else +winner = parent; +} } else { winner = child; -loser = parent; } /* Do we merge loser into winner - i.e. inherit properties ? */ -/*if ( winner == child ) - fprintf(stderr, Going with the child\n); - else if ( winner == parent ) - fprintf(stderr, Going with the parent\n); - else - fprintf(stderr, Going with NULL\n); - */ -fprintf(stderr, Merging %s %s %s\n, -(winner == NULL || winner-uri == NULL) ? : winner-uri, +ap_log_perror(APLOG_MARK, APLOG_DEBUG
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
jfclere 2004/03/31 06:22:04 Modified:jk/native2/server/apache2 mod_jk2.c Log: Fix handling of id added in jk2_create_dir_config(). I do not see why we need this id... May because jk2_merge_dir_config() was buggy. That fixes PR 18472 and 28916. Revision ChangesPath 1.82 +33 -16jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- mod_jk2.c 21 Mar 2004 09:44:30 - 1.81 +++ mod_jk2.c 31 Mar 2004 14:22:04 - 1.82 @@ -221,14 +221,25 @@ strcpy(tmp_full_url, s-server_hostname); strcat(tmp_full_url, uriEnv-uri); } + uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, uri, tmp_full_url); uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, path, cmd-path); + uriEnv-name = tmp_virtual; uriEnv-virtual = tmp_virtual; +} else { +/* + * The jk2_create_dir_config added an id to uri and path + * we have to correct it here. + */ + +uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, +uri, cmd-path); } + /* now lets actually add the parameter set in the Location block */ uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, (char *)name, (void *)val); @@ -293,40 +304,46 @@ jk_uriEnv_t *child = (jk_uriEnv_t *)childv; jk_uriEnv_t *parent = (jk_uriEnv_t *)parentv; jk_uriEnv_t *winner = NULL; -jk_uriEnv_t *loser = NULL; +char *hostchild; +char *hostparent; if (child == NULL || child-uri == NULL || child-workerName == NULL) { winner = parent; -loser = child; } else if (parent == NULL || parent-uri == NULL || parent-workerName == NULL) { winner = child; -loser = parent; /* interresting bit... so far they are equal ... */ } else if (strlen(parent-uri) strlen(child-uri)) { winner = parent; -loser = child; +} +else if (strlen(parent-uri) == strlen(child-uri)) { +/* Try the virtual host to decide */ +hostchild = child-mbean-getAttribute(workerEnv-globalEnv, child-mbean,host); +hostparent = parent-mbean-getAttribute(workerEnv-globalEnv, parent-mbean,host); +if (hostchild == NULL) +winner = parent; +if (hostparent == NULL) +winner = child; +if (winner == NULL) { +if (strlen(hostchild) strlen(hostparent)) +winner = child; +else +winner = parent; +} } else { winner = child; -loser = parent; } /* Do we merge loser into winner - i.e. inherit properties ? */ -/*if ( winner == child ) - fprintf(stderr, Going with the child\n); - else if ( winner == parent ) - fprintf(stderr, Going with the parent\n); - else - fprintf(stderr, Going with NULL\n); - */ -fprintf(stderr, Merging %s %s %s\n, -(winner == NULL || winner-uri == NULL) ? : winner-uri, +ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, NULL, + mod_jk2 Merging %s %s winner: %s\n, (child == NULL || child-uri == NULL) ? : child-uri, -(parent == NULL || parent-uri == NULL) ? : parent-uri); +(parent == NULL || parent-uri == NULL) ? : parent-uri, +(winner == child) ? parent : child ); return (void *)winner; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
[EMAIL PROTECTED] wrote: jfclere 2004/03/31 06:22:04 Modified:jk/native2/server/apache2 mod_jk2.c Log: Fix handling of id added in jk2_create_dir_config(). Please review I spent time to find why we added the id to path and uri but now I do not understand why we added it. I do not see why we need this id... May because jk2_merge_dir_config() was buggy. Now it uses the virtualhost length to decide between parent and child when the two uris have the same length. That fixes PR 18472 and 28916. Revision ChangesPath 1.82 +33 -16jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- mod_jk2.c 21 Mar 2004 09:44:30 - 1.81 +++ mod_jk2.c 31 Mar 2004 14:22:04 - 1.82 @@ -221,14 +221,25 @@ strcpy(tmp_full_url, s-server_hostname); strcat(tmp_full_url, uriEnv-uri); } + uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, uri, tmp_full_url); uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, path, cmd-path); + uriEnv-name = tmp_virtual; uriEnv-virtual = tmp_virtual; +} else { +/* + * The jk2_create_dir_config added an id to uri and path + * we have to correct it here. + */ + +uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, +uri, cmd-path); } + /* now lets actually add the parameter set in the Location block */ uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, (char *)name, (void *)val); @@ -293,40 +304,46 @@ jk_uriEnv_t *child = (jk_uriEnv_t *)childv; jk_uriEnv_t *parent = (jk_uriEnv_t *)parentv; jk_uriEnv_t *winner = NULL; -jk_uriEnv_t *loser = NULL; +char *hostchild; +char *hostparent; if (child == NULL || child-uri == NULL || child-workerName == NULL) { winner = parent; -loser = child; } else if (parent == NULL || parent-uri == NULL || parent-workerName == NULL) { winner = child; -loser = parent; /* interresting bit... so far they are equal ... */ } else if (strlen(parent-uri) strlen(child-uri)) { winner = parent; -loser = child; +} +else if (strlen(parent-uri) == strlen(child-uri)) { +/* Try the virtual host to decide */ +hostchild = child-mbean-getAttribute(workerEnv-globalEnv, child-mbean,host); +hostparent = parent-mbean-getAttribute(workerEnv-globalEnv, parent-mbean,host); +if (hostchild == NULL) +winner = parent; +if (hostparent == NULL) +winner = child; +if (winner == NULL) { +if (strlen(hostchild) strlen(hostparent)) +winner = child; +else +winner = parent; +} } else { winner = child; -loser = parent; } /* Do we merge loser into winner - i.e. inherit properties ? */ -/*if ( winner == child ) - fprintf(stderr, Going with the child\n); - else if ( winner == parent ) - fprintf(stderr, Going with the parent\n); - else - fprintf(stderr, Going with NULL\n); - */ -fprintf(stderr, Merging %s %s %s\n, -(winner == NULL || winner-uri == NULL) ? : winner-uri, +ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, NULL, + mod_jk2 Merging %s %s winner: %s\n, (child == NULL || child-uri == NULL) ? : child-uri, -(parent == NULL || parent-uri == NULL) ? : parent-uri); +(parent == NULL || parent-uri == NULL) ? : parent-uri, +(winner == child) ? parent : child ); return (void *)winner; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Good morning All. Just tried Jean's recent change to mod_jk2.c and _pleased_ to say JkUriSet now registers correctly the same as a [uri] section, and can access /admin with only a Location in the httpd.conf. I did note there were duplicate uri objects created (based on their name) if the same uri spec was in both files, but in any case this is a lot closer to theory than in the past. Thanks Jean. Norm - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 01, 2004 12:22 AM Subject: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jfclere 2004/03/31 06:22:04 Modified:jk/native2/server/apache2 mod_jk2.c Log: Fix handling of id added in jk2_create_dir_config(). I do not see why we need this id... May because jk2_merge_dir_config() was buggy. That fixes PR 18472 and 28916. Revision ChangesPath 1.82 +33 -16 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -r1.81 -r1.82 --- mod_jk2.c 21 Mar 2004 09:44:30 - 1.81 +++ mod_jk2.c 31 Mar 2004 14:22:04 - 1.82 @@ -221,14 +221,25 @@ strcpy(tmp_full_url, s-server_hostname); strcat(tmp_full_url, uriEnv-uri); } + uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, uri, tmp_full_url); uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, path, cmd-path); + uriEnv-name = tmp_virtual; uriEnv-virtual = tmp_virtual; +} else { +/* + * The jk2_create_dir_config added an id to uri and path + * we have to correct it here. + */ + +uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, +uri, cmd-path); } + /* now lets actually add the parameter set in the Location block */ uriEnv-mbean-setAttribute(workerEnv-globalEnv, uriEnv-mbean, (char *)name, (void *)val); @@ -293,40 +304,46 @@ jk_uriEnv_t *child = (jk_uriEnv_t *)childv; jk_uriEnv_t *parent = (jk_uriEnv_t *)parentv; jk_uriEnv_t *winner = NULL; -jk_uriEnv_t *loser = NULL; +char *hostchild; +char *hostparent; if (child == NULL || child-uri == NULL || child-workerName == NULL) { winner = parent; -loser = child; } else if (parent == NULL || parent-uri == NULL || parent-workerName == NULL) { winner = child; -loser = parent; /* interresting bit... so far they are equal ... */ } else if (strlen(parent-uri) strlen(child-uri)) { winner = parent; -loser = child; +} +else if (strlen(parent-uri) == strlen(child-uri)) { +/* Try the virtual host to decide */ +hostchild = child-mbean-getAttribute(workerEnv-globalEnv, child-mbean,host); +hostparent = parent-mbean-getAttribute(workerEnv-globalEnv, parent-mbean,host); +if (hostchild == NULL) +winner = parent; +if (hostparent == NULL) +winner = child; +if (winner == NULL) { +if (strlen(hostchild) strlen(hostparent)) +winner = child; +else +winner = parent; +} } else { winner = child; -loser = parent; } /* Do we merge loser into winner - i.e. inherit properties ? */ -/*if ( winner == child ) - fprintf(stderr, Going with the child\n); - else if ( winner == parent ) - fprintf(stderr, Going with the parent\n); - else - fprintf(stderr, Going with NULL\n); - */ -fprintf(stderr, Merging %s %s %s\n, -(winner == NULL || winner-uri == NULL) ? : winner-uri, +ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, NULL, + mod_jk2 Merging %s %s winner: %s\n, (child == NULL || child-uri == NULL) ? : child-uri, -(parent == NULL || parent-uri == NULL) ? : parent-uri); +(parent == NULL || parent-uri == NULL) ? : parent-uri, +(winner == child) ? parent : child ); return (void *)winner; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
NormW wrote: Good morning All. Just tried Jean's recent change to mod_jk2.c and _pleased_ to say JkUriSet now registers correctly the same as a [uri] section, and can access /admin with only a Location in the httpd.conf. I did note there were duplicate uri objects created (based on their name) if the same uri spec was in both files, but in any case this is a lot closer to theory than in the past. Thanks Jean. Norm This code update will need many testings, and if no problem are found, I suggest a quick 2.0.5 release. Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
hgomez 2004/03/17 08:47:48 Modified:jk/native2/server/apache2 mod_jk2.c Log: Remove unused vars (thanks gcc -wall) Revision ChangesPath 1.80 +1 -8 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- mod_jk2.c 15 Mar 2004 14:16:24 - 1.79 +++ mod_jk2.c 17 Mar 2004 16:47:48 - 1.80 @@ -91,8 +91,6 @@ const char *name, char *value) { server_rec *s = cmd-server; -jk_uriEnv_t *serverEnv=(jk_uriEnv_t *) -ap_get_module_config(s-module_config, jk2_module); jk_env_t *env=workerEnv-globalEnv; int rc; @@ -114,8 +112,6 @@ const char *name, char *property, char *value) { server_rec *s = cmd-server; -jk_uriEnv_t *serverEnv=(jk_uriEnv_t *) -ap_get_module_config(s-module_config, jk2_module); jk_env_t *env=workerEnv-globalEnv; int rc; jk_bean_t *mbean; @@ -432,7 +428,6 @@ void *basev, void *overridesv) { -jk_uriEnv_t *base = (jk_uriEnv_t *) basev; jk_uriEnv_t *overrides = (jk_uriEnv_t *)overridesv; ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p, @@ -629,10 +624,8 @@ */ static int jk2_handler(request_rec *r) { -jk_logger_t *l=NULL; int rc; jk_worker_t *worker=NULL; -jk_endpoint_t *end = NULL; jk_uriEnv_t *uriEnv; jk_env_t *env; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2004/03/15 03:59:01 Modified:jk/native2/server/apache2 mod_jk2.c Log: Removed the childGeneration checking. Since the childId uses pid instead scoreboard slot that cored the server. Revision ChangesPath 1.78 +5 -21 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.77 retrieving revision 1.78 diff -u -r1.77 -r1.78 --- mod_jk2.c 13 Mar 2004 08:49:26 - 1.77 +++ mod_jk2.c 15 Mar 2004 11:59:01 - 1.78 @@ -472,9 +472,10 @@ jk_workerEnv_t *workerEnv, server_rec *s ) { +ap_mpm_query(AP_MPMQ_MAX_DAEMONS, workerEnv-maxDaemons); + workerEnv-init(env, workerEnv ); workerEnv-server_name = (char *)ap_get_server_version(); -ap_mpm_query(AP_MPMQ_MAX_DAEMONS, workerEnv-maxDaemons); /* Should be done in post config instead (cf DAV2) */ /* ap_add_version_component(pconf, JK_EXPOSED_VERSION); */ @@ -609,33 +610,16 @@ jk2_init() Found child %d in scoreboard slot %d\n, proc.pid, workerEnv-childId); } -/* If the child slot was found in the scoreboard, increment the - * generation status. This will prevent initializing jk2 if something - * goes wrong. - */ -if (workerEnv-childId = 0) { -workerEnv-childGeneration = ap_scoreboard_image-parent[workerEnv-childId].generation; -++ap_scoreboard_image-parent[workerEnv-childId].generation; -} if(!workerEnv-was_initialized) { workerEnv-was_initialized = JK_TRUE; jk2_init( env, pconf, workerEnv, s ); -if (workerEnv-childId = 0) +if (workerEnv-childId 0) env-l-jkLog(env, env-l, JK_LOG_INFO, mod_jk2 child %d initialized\n, workerEnv-childId); -} -if (workerEnv-childGeneration) -env-l-jkLog(env, env-l, JK_LOG_ERROR, mod_jk2 child workerEnv in error state %d\n, - workerEnv-childGeneration); - -/* Restore the process generation */ -if (workerEnv-childId = 0) { -ap_scoreboard_image-parent[workerEnv-childId].generation = workerEnv-childGeneration; -} - +} } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
jfclere 2004/03/15 06:16:24 Modified:jk/native2/server/apache2 mod_jk2.c Log: It _is_ done in post config! Revision ChangesPath 1.79 +1 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -r1.78 -r1.79 --- mod_jk2.c 15 Mar 2004 11:59:01 - 1.78 +++ mod_jk2.c 15 Mar 2004 14:16:24 - 1.79 @@ -477,8 +477,6 @@ workerEnv-init(env, workerEnv ); workerEnv-server_name = (char *)ap_get_server_version(); -/* Should be done in post config instead (cf DAV2) */ -/* ap_add_version_component(pconf, JK_EXPOSED_VERSION); */ apr_pool_cleanup_register(pconf, NULL, jk2_shutdown, apr_pool_cleanup_null); return NULL; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2004/03/13 00:49:26 Modified:jk/native2/server/apache2 mod_jk2.c Log: Use the maxDaemon from workerEnv, and query the mpm on jk2_init. Also on single child mpm's use the pid for a child id. Revision ChangesPath 1.77 +10 -7 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- mod_jk2.c 12 Mar 2004 13:47:20 - 1.76 +++ mod_jk2.c 13 Mar 2004 08:49:26 - 1.77 @@ -474,6 +474,8 @@ workerEnv-init(env, workerEnv ); workerEnv-server_name = (char *)ap_get_server_version(); +ap_mpm_query(AP_MPMQ_MAX_DAEMONS, workerEnv-maxDaemons); + /* Should be done in post config instead (cf DAV2) */ /* ap_add_version_component(pconf, JK_EXPOSED_VERSION); */ apr_pool_cleanup_register(pconf, NULL, jk2_shutdown, apr_pool_cleanup_null); @@ -586,11 +588,12 @@ * and fix the mpm_winnt reporting 0 daemons. */ if (workerEnv-childId == -1) { -int max_daemons_limit; -ap_mpm_query(AP_MPMQ_MAX_DAEMONS, max_daemons_limit); - -if (max_daemons_limit == 0) { -workerEnv-childId = 0; +/* If the server max daemons are less then 2 + * this is the single child mpm. + * the WINNT mpm has a bug returning 0 instead 1 + */ +if (workerEnv-maxDaemons 2) { +workerEnv-childId = proc.pid; env-l-jkLog(env, env-l, JK_LOG_INFO, jk2_init() Setting scoreboard slot 0 for child %d\n, proc.pid); @@ -598,7 +601,7 @@ else { env-l-jkLog(env, env-l, JK_LOG_ERROR, jk2_init() Can't find child %d in none of the %d scoreboard slots\n, -proc.pid, max_daemons_limit); +proc.pid, workerEnv-maxDaemons); workerEnv-childId = -2; } } else { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
jfclere 2004/03/12 05:47:20 Modified:jk/native2/server/apache13 mod_jk2.c jk/native2/server/apache2 mod_jk2.c Log: Fix PR 27627: It was possible to core the httpd process. Note only Apache has been fixed but jk_dsapi_plugin.c and jk_isapi_plugin.c probably have the same problem. Revision ChangesPath 1.32 +11 -2 jakarta-tomcat-connectors/jk/native2/server/apache13/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache13/mod_jk2.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- mod_jk2.c 24 Feb 2004 08:44:42 - 1.31 +++ mod_jk2.c 12 Mar 2004 13:47:20 - 1.32 @@ -573,6 +573,8 @@ jk_uriMap_t *uriMap; char *name=NULL; int n; +const char *ptr; + if(r-proxyreq) { return DECLINED; } @@ -597,8 +599,15 @@ /* get_env() */ env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); +ptr = ap_get_server_name(r); +if ( strlen(ptr) 1024 - 12 ) { +/* That is probably an invalid request, DECLINED could display jsp source code. */ +env-l-jkLog(env, env-l, JK_LOG_DEBUG, + jk2_map_to_storage Host too big %s\n, ptr); +return HTTP_BAD_REQUEST; +} uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, - ap_get_server_name(r), + ptr, ap_get_server_port(r), r-uri); 1.76 +10 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- mod_jk2.c 10 Mar 2004 09:39:30 - 1.75 +++ mod_jk2.c 12 Mar 2004 13:47:20 - 1.76 @@ -810,6 +810,7 @@ { jk_uriEnv_t *uriEnv; jk_env_t *env; +const char *ptr; if (r-proxyreq || workerEnv==NULL) { return DECLINED; @@ -822,8 +823,15 @@ /* From something like [uri:/examples/STAR] in workers2.properties */ env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); +ptr = ap_get_server_name(r); +if ( strlen(ptr) 1024 - 12 ) { +/* That is probably an invalid request, DECLINED could display jsp source code. */ +env-l-jkLog(env, env-l, JK_LOG_DEBUG, + jk2_map_to_storage Host too big %s\n, ptr); +return HTTP_BAD_REQUEST; +} uriEnv=workerEnv-uriMap-mapUri(env, workerEnv-uriMap, -ap_get_server_name(r), +ptr, ap_get_server_port(r), r-uri); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
[EMAIL PROTECTED] wrote: jfclere 2004/03/12 05:47:20 Modified:jk/native2/server/apache13 mod_jk2.c jk/native2/server/apache2 mod_jk2.c Log: Fix PR 27627: It was possible to core the httpd process. Henri fixes the core... But I think we should return 400 otherwise jsp code could be displayed as text. Someone should take care of jk_dsapi_plugin.c and jk_isapi_plugin.c and do the same. Note only Apache has been fixed but jk_dsapi_plugin.c and jk_isapi_plugin.c probably have the same problem. Revision ChangesPath 1.32 +11 -2 jakarta-tomcat-connectors/jk/native2/server/apache13/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache13/mod_jk2.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- mod_jk2.c 24 Feb 2004 08:44:42 - 1.31 +++ mod_jk2.c 12 Mar 2004 13:47:20 - 1.32 @@ -573,6 +573,8 @@ jk_uriMap_t *uriMap; char *name=NULL; int n; +const char *ptr; + if(r-proxyreq) { return DECLINED; } @@ -597,8 +599,15 @@ /* get_env() */ env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); +ptr = ap_get_server_name(r); +if ( strlen(ptr) 1024 - 12 ) { +/* That is probably an invalid request, DECLINED could display jsp source code. */ +env-l-jkLog(env, env-l, JK_LOG_DEBUG, + jk2_map_to_storage Host too big %s\n, ptr); +return HTTP_BAD_REQUEST; +} uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, - ap_get_server_name(r), + ptr, ap_get_server_port(r), r-uri); 1.76 +10 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- mod_jk2.c 10 Mar 2004 09:39:30 - 1.75 +++ mod_jk2.c 12 Mar 2004 13:47:20 - 1.76 @@ -810,6 +810,7 @@ { jk_uriEnv_t *uriEnv; jk_env_t *env; +const char *ptr; if (r-proxyreq || workerEnv==NULL) { return DECLINED; @@ -822,8 +823,15 @@ /* From something like [uri:/examples/STAR] in workers2.properties */ env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); +ptr = ap_get_server_name(r); +if ( strlen(ptr) 1024 - 12 ) { +/* That is probably an invalid request, DECLINED could display jsp source code. */ +env-l-jkLog(env, env-l, JK_LOG_DEBUG, + jk2_map_to_storage Host too big %s\n, ptr); +return HTTP_BAD_REQUEST; +} uriEnv=workerEnv-uriMap-mapUri(env, workerEnv-uriMap, -ap_get_server_name(r), +ptr, ap_get_server_port(r), r-uri); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] signature.asc Description: OpenPGP digital signature
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
-Original Message- From: jean-frederic clere Henri fixes the core... But I think we should return 400 otherwise jsp code could be displayed as text. Someone should take care of jk_dsapi_plugin.c and jk_isapi_plugin.c and do the same. jk_isapi_plugin uses INTERNET_MAX_URL_LENGTH which is 32 + 4 + 2048 bytes long. Do we need to limit that to 1012 bytes? Is there any RFC saying what is the longest SERVER_NAME? MT. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Mladen Turk wrote: -Original Message- From: jean-frederic clere Henri fixes the core... But I think we should return 400 otherwise jsp code could be displayed as text. Someone should take care of jk_dsapi_plugin.c and jk_isapi_plugin.c and do the same. jk_isapi_plugin uses INTERNET_MAX_URL_LENGTH which is 32 + 4 + 2048 bytes long. Do we need to limit that to 1012 bytes? 1024 is the size we have in jk_uriMap.c (:1234567890\0 makes the 12). Is there any RFC saying what is the longest SERVER_NAME? I have looked in RFC2616 - There is nothing about the length. MT. signature.asc Description: OpenPGP digital signature
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
hgomez 2004/03/10 01:39:30 Modified:jk/native2/server/apache2 mod_jk2.c Log: Correct name, we should have mod_jk2 and not mod_jk :-) Thanks Guenter Revision ChangesPath 1.75 +19 -19jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.74 retrieving revision 1.75 diff -u -r1.74 -r1.75 --- mod_jk2.c 4 Mar 2004 14:08:49 - 1.74 +++ mod_jk2.c 10 Mar 2004 09:39:30 - 1.75 @@ -193,7 +193,7 @@ * Here we must now 'fix' the content of the object passed in. * Apache doesn't care what we do here as it has the reference to the unique object that has been * created. What we need to do is ensure that the data given to mod_jk2 is correct. Hopefully in the long run - * we can ignore some of the mod_jk details... + * we can ignore some of the mod_jk2 details... */ /* if applicable we will set the hostname etc variables. */ @@ -405,11 +405,11 @@ if( s-is_virtual ) { /* Virtual host */ ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p, - mod_jk Create config for virtual host %s, + mod_jk2 Create config for virtual host %s, s-server_hostname ); } else { ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p, - mod_jk Create config for default server %s, + mod_jk2 Create config for default server %s, s-server_hostname ); } @@ -436,7 +436,7 @@ jk_uriEnv_t *overrides = (jk_uriEnv_t *)overridesv; ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p, - mod_jk Merging workerEnv); + mod_jk2 Merging workerEnv); /* The 'mountcopy' option should be implemented in common. @@ -508,7 +508,7 @@ *mainPool=gPool; /* We have a global pool ! */ -apr_pool_userdata_get( data, mod_jk_init, gPool ); +apr_pool_userdata_get( data, mod_jk2_init, gPool ); if( data==NULL ) { return JK_OK; } else { @@ -540,14 +540,14 @@ if( rc == JK_OK gPool != NULL ) { /* This is the first step */ env-l-jkLog(env, env-l, JK_LOG_INFO, - mod_jk.post_config() first invocation\n); + mod_jk2.post_config() first invocation\n); -apr_pool_userdata_set( INITOK, mod_jk_init, NULL, gPool ); +apr_pool_userdata_set( INITOK, mod_jk2_init, NULL, gPool ); return OK; } env-l-jkLog(env, env-l, JK_LOG_INFO, - mod_jk.post_config() second invocation\n ); + mod_jk2.post_config() second invocation\n ); workerEnv-parentInit( env, workerEnv); return OK; @@ -621,11 +621,11 @@ jk2_init( env, pconf, workerEnv, s ); if (workerEnv-childId = 0) -env-l-jkLog(env, env-l, JK_LOG_INFO, mod_jk child %d initialized\n, +env-l-jkLog(env, env-l, JK_LOG_INFO, mod_jk2 child %d initialized\n, workerEnv-childId); } if (workerEnv-childGeneration) -env-l-jkLog(env, env-l, JK_LOG_ERROR, mod_jk child workerEnv in error state %d\n, +env-l-jkLog(env, env-l, JK_LOG_ERROR, mod_jk2 child workerEnv in error state %d\n, workerEnv-childGeneration); /* Restore the process generation */ @@ -674,7 +674,7 @@ /* Set up r-read_chunked flags for chunked encoding, if present */ if(rc = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)) { env-l-jkLog(env, env-l, JK_LOG_INFO, - mod_jk.handler() Can't setup client block %d\n, rc); + mod_jk2.handler() Can't setup client block %d\n, rc); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return rc; } @@ -684,21 +684,21 @@ if( worker==NULL uriEnv-workerName != NULL ) { worker=env-getByName( env, uriEnv-workerName); env-l-jkLog(env, env-l, JK_LOG_INFO, - mod_jk.handler() finding worker for %#lx %#lx %s\n, + mod_jk2.handler() finding worker for %#lx %#lx %s\n, worker, uriEnv, uriEnv-workerName); uriEnv-worker=worker; } if(worker==NULL || worker-mbean == NULL || worker-mbean-localName==NULL ) { env-l-jkLog(env, env-l, JK_LOG_ERROR, - mod_jk.handle() No worker for %s\n, r-uri); + mod_jk2.handle() No worker for %s\n, r-uri); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv,
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
jfclere 2004/03/04 04:01:48 Modified:jk/native2/server/apache2 mod_jk2.c Log: Now that is nearly ok. (need testing!). jk2_translate is needed for the JkUriSet directives. So I have put it back. Revision ChangesPath 1.73 +10 -56jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- mod_jk2.c 3 Mar 2004 17:55:31 - 1.72 +++ mod_jk2.c 4 Mar 2004 12:01:48 - 1.73 @@ -224,11 +224,6 @@ /* now lets actually add the parameter set in the Location block */ uriEnv-mbean-setAttribute( workerEnv-globalEnv, uriEnv-mbean, (char *)name, (void *)val ); -/* fprintf(stderr, JkUriSet %s %s dir=%s args=%s, */ -/* uriEnv-workerName, cmd-path, */ -/* cmd-directive-directive, */ -/* cmd-directive-args); */ - return NULL; } @@ -661,11 +656,11 @@ int rc1; uriEnv=ap_get_module_config( r-request_config, jk2_module ); -if (uriEnv==NULL) +if (uriEnv==NULL) uriEnv=ap_get_module_config( r-per_dir_config, jk2_module ); /* not for me, try next handler */ -if(uriEnv==NULL || !strcmp(r-handler,JK_HANDLER)) +if(uriEnv==NULL || strcmp(r-handler,JK_HANDLER)!=0) return DECLINED; /* If this is a proxy request, we'll notify an error */ @@ -777,17 +772,17 @@ return DECLINED; } - +/* For the JkUriSet */ uriEnv=ap_get_module_config( r-per_dir_config, jk2_module ); - -/* get_env() */ -env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); /* This has been mapped to a location by apache * In a previous ( experimental ) version we had a sub-map, * but that's too complex for now. */ if( uriEnv!= NULL uriEnv-workerName != NULL) { +/* get_env() */ +env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); + if( uriEnv-mbean-debug 0 ) env-l-jkLog(env, env-l, JK_LOG_DEBUG, PerDir mapping %s=%s\n,r-uri, uriEnv-workerName); @@ -805,49 +800,7 @@ return OK; } -/* One idea was to use SetHandler jakarta-servlet. This doesn't - allow the setting of the worker. Having a specific SetWorker directive - at location level is more powerfull. If anyone can figure any reson - to support SetHandler, we can add it back easily */ - -/* Check JkMount directives, if any */ -/* if( workerEnv-uriMap-size == 0 ) { */ -/* workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); */ -/* return DECLINED; */ -/* } */ - -/* XXX TODO: Split mapping, similar with tomcat. First step will - be a quick test ( the context mapper ), with no allocations. - If positive, we'll fill a ws_service_t and do the rewrite and - the real mapping. -*/ - -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, -ap_get_server_name(r), -ap_get_server_port(r), -r-uri); - -if( uriEnv== NULL || uriEnv-workerName == NULL) { -workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return DECLINED; -} -ap_set_module_config( r-request_config, jk2_module, uriEnv ); -r-handler=JK_HANDLER; - -/* This could be a sub-request, possibly from mod_dir */ -if(r-main){ -ap_set_module_config( r-main-request_config, jk2_module, uriEnv ); -r-main-handler=JK_HANDLER; -} - -if( uriEnv-mbean-debug 0 ) -env-l-jkLog(env, env-l, JK_LOG_DEBUG, - mod_jk.translate(): uriMap %s %s %#lx\n, - r-uri, uriEnv-workerName, uriEnv-worker); - -workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); - -return OK; +return DECLINED; } /* XXX Can we use type checker step to set our stuff ? */ @@ -894,7 +847,8 @@ /* Force the mpm to run before us and set the scoreboard image */ ap_hook_child_init(jk2_child_init, NULL, NULL, APR_HOOK_LAST); - + +ap_hook_translate_name(jk2_translate, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
jfclere 2004/03/04 06:08:49 Modified:jk/native2/server/apache2 mod_jk2.c Log: Don't call mapUri if translate has already filled uriEnv. Revision ChangesPath 1.74 +6 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- mod_jk2.c 4 Mar 2004 12:01:48 - 1.73 +++ mod_jk2.c 4 Mar 2004 14:08:49 - 1.74 @@ -815,6 +815,11 @@ return DECLINED; } +/* If already mapped by translate just returns OK */ +uriEnv = ap_get_module_config( r-request_config, jk2_module ); +if (uriEnv!=NULL uriEnv-workerName != NULL) +return OK; + /* From something like [uri:/examples/STAR] in workers2.properties */ env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); uriEnv=workerEnv-uriMap-mapUri(env, workerEnv-uriMap, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
hgomez 2004/03/03 01:15:48 Modified:jk/native2/server/apache2 mod_jk2.c Log: revert to use APR_HOOK_MIDDLE, as does jk. Revision ChangesPath 1.71 +2 -5 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -r1.70 -r1.71 --- mod_jk2.c 2 Mar 2004 15:11:31 - 1.70 +++ mod_jk2.c 3 Mar 2004 09:15:48 - 1.71 @@ -891,16 +891,13 @@ static void jk2_register_hooks(apr_pool_t *p) { -static const char * const aszPre[] = { mod_rewrite.c, NULL }; - ap_hook_handler(jk2_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_post_config(jk2_post_config, NULL, NULL, APR_HOOK_MIDDLE); /* Force the mpm to run before us and set the scoreboard image */ ap_hook_child_init(jk2_child_init, NULL, NULL, APR_HOOK_LAST); -/* jk2 is in FIRST pos but came after mod_rewrite */ -ap_hook_translate_name(jk2_translate, aszPre, NULL, APR_HOOK_FIRST); +ap_hook_translate_name(jk2_translate, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
jfclere 2004/03/03 09:55:32 Modified:jk/native2/server/apache2 mod_jk2.c Log: Remove jk2_translate... It is still not 100% OK: - LocationMatch does not work. - Some _not_found ends in Tomcat when using mod_dav. Revision ChangesPath 1.72 +27 -30jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- mod_jk2.c 3 Mar 2004 09:15:48 - 1.71 +++ mod_jk2.c 3 Mar 2004 17:55:31 - 1.72 @@ -42,7 +42,6 @@ */ static int dirCounter=0; - #define JK_HANDLER (jakarta-servlet2) #define JK_MAGIC_TYPE (application/x-jakarta-servlet2) @@ -662,9 +661,11 @@ int rc1; uriEnv=ap_get_module_config( r-request_config, jk2_module ); +if (uriEnv==NULL) + uriEnv=ap_get_module_config( r-per_dir_config, jk2_module ); /* not for me, try next handler */ -if(uriEnv==NULL || strcmp(r-handler,JK_HANDLER)) +if(uriEnv==NULL || !strcmp(r-handler,JK_HANDLER)) return DECLINED; /* If this is a proxy request, we'll notify an error */ @@ -854,38 +855,35 @@ /* bypass the directory_walk and file_walk for non-file requests */ static int jk2_map_to_storage(request_rec *r) { -jk_uriEnv_t *uriEnv=ap_get_module_config( r-request_config, jk2_module ); - -if( uriEnv != NULL ) { - -/* First find just the name of the file, no directory */ -r-filename = (char *)apr_filepath_name_get(r-uri); +jk_uriEnv_t *uriEnv; +jk_env_t *env; -/* Only if sub-request for a directory, most likely from mod_dir */ -if (r-main r-main-filename -!*apr_filepath_name_get(r-main-filename)){ - -/* The filename from the main request will be set to what should - * be picked up, aliases included. Tomcat will need to know about - * those aliases or things won't work for them. Normal files - * should be fine. */ - -/* Need absolute path to stat */ -if (apr_filepath_merge(r-filename, - r-main-filename, r-filename, - APR_FILEPATH_SECUREROOT | - APR_FILEPATH_TRUENAME, - r-pool) -!= APR_SUCCESS){ - return DECLINED; /* We should never get here, very bad */ -} +if (r-proxyreq || workerEnv==NULL) { +return DECLINED; +} + +/* From something like [uri:/examples/STAR] in workers2.properties */ +env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); +uriEnv=workerEnv-uriMap-mapUri(env, workerEnv-uriMap, +ap_get_server_name(r), +ap_get_server_port(r), +r-uri); -/* Stat the file so that mod_dir knows it's there */ -apr_stat(r-finfo, r-filename, APR_FINFO_TYPE, r-pool); +if (uriEnv!=NULL uriEnv-workerName != NULL) { +ap_set_module_config( r-request_config, jk2_module, uriEnv ); +r-handler=JK_HANDLER; +workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); + +/* This could be a sub-request, possibly from mod_dir */ +if(r-main){ +ap_set_module_config( r-main-request_config, jk2_module, uriEnv ); +r-main-handler=JK_HANDLER; } return OK; } + +workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return DECLINED; } @@ -897,7 +895,6 @@ /* Force the mpm to run before us and set the scoreboard image */ ap_hook_child_init(jk2_child_init, NULL, NULL, APR_HOOK_LAST); -ap_hook_translate_name(jk2_translate, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
[EMAIL PROTECTED] wrote: jfclere 2004/03/03 09:55:32 Modified:jk/native2/server/apache2 mod_jk2.c Log: Remove jk2_translate... It is still not 100% OK: - LocationMatch does not work. - Some _not_found ends in Tomcat when using mod_dav. That is still not OK. I will go on later. Sorry :-( Revision ChangesPath 1.72 +27 -30jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- mod_jk2.c 3 Mar 2004 09:15:48 - 1.71 +++ mod_jk2.c 3 Mar 2004 17:55:31 - 1.72 @@ -42,7 +42,6 @@ */ static int dirCounter=0; - #define JK_HANDLER (jakarta-servlet2) #define JK_MAGIC_TYPE (application/x-jakarta-servlet2) @@ -662,9 +661,11 @@ int rc1; uriEnv=ap_get_module_config( r-request_config, jk2_module ); +if (uriEnv==NULL) + uriEnv=ap_get_module_config( r-per_dir_config, jk2_module ); /* not for me, try next handler */ -if(uriEnv==NULL || strcmp(r-handler,JK_HANDLER)) +if(uriEnv==NULL || !strcmp(r-handler,JK_HANDLER)) return DECLINED; /* If this is a proxy request, we'll notify an error */ @@ -854,38 +855,35 @@ /* bypass the directory_walk and file_walk for non-file requests */ static int jk2_map_to_storage(request_rec *r) { -jk_uriEnv_t *uriEnv=ap_get_module_config( r-request_config, jk2_module ); - -if( uriEnv != NULL ) { - -/* First find just the name of the file, no directory */ -r-filename = (char *)apr_filepath_name_get(r-uri); +jk_uriEnv_t *uriEnv; +jk_env_t *env; -/* Only if sub-request for a directory, most likely from mod_dir */ -if (r-main r-main-filename -!*apr_filepath_name_get(r-main-filename)){ - -/* The filename from the main request will be set to what should - * be picked up, aliases included. Tomcat will need to know about - * those aliases or things won't work for them. Normal files - * should be fine. */ - -/* Need absolute path to stat */ -if (apr_filepath_merge(r-filename, - r-main-filename, r-filename, - APR_FILEPATH_SECUREROOT | - APR_FILEPATH_TRUENAME, - r-pool) -!= APR_SUCCESS){ - return DECLINED; /* We should never get here, very bad */ -} +if (r-proxyreq || workerEnv==NULL) { +return DECLINED; +} + +/* From something like [uri:/examples/STAR] in workers2.properties */ +env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); +uriEnv=workerEnv-uriMap-mapUri(env, workerEnv-uriMap, +ap_get_server_name(r), +ap_get_server_port(r), +r-uri); -/* Stat the file so that mod_dir knows it's there */ -apr_stat(r-finfo, r-filename, APR_FINFO_TYPE, r-pool); +if (uriEnv!=NULL uriEnv-workerName != NULL) { +ap_set_module_config( r-request_config, jk2_module, uriEnv ); +r-handler=JK_HANDLER; +workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); + +/* This could be a sub-request, possibly from mod_dir */ +if(r-main){ +ap_set_module_config( r-main-request_config, jk2_module, uriEnv ); +r-main-handler=JK_HANDLER; } return OK; } + +workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return DECLINED; } @@ -897,7 +895,6 @@ /* Force the mpm to run before us and set the scoreboard image */ ap_hook_child_init(jk2_child_init, NULL, NULL, APR_HOOK_LAST); -ap_hook_translate_name(jk2_translate, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] signature.asc Description: OpenPGP digital signature
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
hgomez 2004/03/02 07:11:31 Modified:jk/native2/server/apache2 mod_jk2.c Log: jk2 should came in FIRST pos but came after mod_rewrite Revision ChangesPath 1.70 +3 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- mod_jk2.c 27 Feb 2004 14:24:57 - 1.69 +++ mod_jk2.c 2 Mar 2004 15:11:31 - 1.70 @@ -899,7 +899,8 @@ /* Force the mpm to run before us and set the scoreboard image */ ap_hook_child_init(jk2_child_init, NULL, NULL, APR_HOOK_LAST); -ap_hook_translate_name(jk2_translate, aszPre, NULL, APR_HOOK_MIDDLE); +/* jk2 is in FIRST pos but came after mod_rewrite */ +ap_hook_translate_name(jk2_translate, aszPre, NULL, APR_HOOK_FIRST); ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
hgomez 2004/02/27 06:24:57 Modified:jk/native2/server/apache2 mod_jk2.c Log: Move translate to APR_HOOK_MIDDLE and make sure mod_rewrite will be before us Revision ChangesPath 1.69 +8 -4 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- mod_jk2.c 27 Feb 2004 08:34:18 - 1.68 +++ mod_jk2.c 27 Feb 2004 14:24:57 - 1.69 @@ -891,11 +891,15 @@ static void jk2_register_hooks(apr_pool_t *p) { +static const char * const aszPre[] = { mod_rewrite.c, NULL }; + ap_hook_handler(jk2_handler, NULL, NULL, APR_HOOK_MIDDLE); -ap_hook_post_config(jk2_post_config,NULL,NULL,APR_HOOK_MIDDLE); +ap_hook_post_config(jk2_post_config, NULL, NULL, APR_HOOK_MIDDLE); + /* Force the mpm to run before us and set the scoreboard image */ -ap_hook_child_init(jk2_child_init,NULL,NULL,APR_HOOK_LAST); -ap_hook_translate_name(jk2_translate,NULL,NULL,APR_HOOK_FIRST); /* use APR_HOOK_MIDDLE instead ? */ +ap_hook_child_init(jk2_child_init, NULL, NULL, APR_HOOK_LAST); + +ap_hook_translate_name(jk2_translate, aszPre, NULL, APR_HOOK_MIDDLE); ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c
hgomez 2004/02/09 04:01:22 Modified:jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c Log: Remove obsolete linefeeds from the logs, see the ap_log_* functions dont need trailing linefeeds. Thanks to Gunter Knauf Revision ChangesPath 1.65 +9 -9 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- mod_jk2.c 30 Sep 2003 13:42:02 - 1.64 +++ mod_jk2.c 9 Feb 2004 12:01:22 - 1.65 @@ -141,7 +141,7 @@ rc=workerEnv-config-setPropertyString( env, workerEnv-config, (char *)name, value ); if (rc!=JK_OK) { ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd-temp_pool, - mod_jk2: Unrecognized option %s %s\n, name, value); + mod_jk2: Unrecognized option %s %s, name, value); } return NULL; @@ -164,14 +164,14 @@ if( name == NULL || property==NULL || value==NULL ) { ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd-temp_pool, - mod_jk2: Null option in JkSet2\n); + mod_jk2: Null option in JkSet2); return NULL; } mbean=env-getBean( env, name ); if( mbean==NULL ) { ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd-temp_pool, - mod_jk2: Creating object %s\n, name ); + mod_jk2: Creating object %s, name ); mbean=env-createBean( env, workerEnv-config-pool, (char *)name ); } @@ -188,7 +188,7 @@ if (rc!=JK_OK) { ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd-temp_pool, - mod_jk2: Unrecognized option %s %s %s\n, name, property, value); + mod_jk2: Unrecognized option %s %s %s, name, property, value); } return NULL; @@ -266,7 +266,7 @@ /* now lets actually add the parameter set in the Location block */ uriEnv-mbean-setAttribute( workerEnv-globalEnv, uriEnv-mbean, (char *)name, (void *)val ); -/* fprintf(stderr, JkUriSet %s %s dir=%s args=%s\n, */ +/* fprintf(stderr, JkUriSet %s %s dir=%s args=%s, */ /* uriEnv-workerName, cmd-path, */ /* cmd-directive-directive, */ /* cmd-directive-args); */ @@ -452,11 +452,11 @@ if( s-is_virtual ) { /* Virtual host */ ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p, - mod_jk Create config for virtual host %s\n, + mod_jk Create config for virtual host %s, s-server_hostname ); } else { ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p, - mod_jk Create config for default server %s\n, + mod_jk Create config for default server %s, s-server_hostname ); } @@ -483,7 +483,7 @@ jk_uriEnv_t *overrides = (jk_uriEnv_t *)overridesv; ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p, - mod_jk Merging workerEnv\n); + mod_jk Merging workerEnv); /* The 'mountcopy' option should be implemented in common. 1.39 +2 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c Index: jk_service_apache2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- jk_service_apache2.c 2 Feb 2004 18:23:55 - 1.38 +++ jk_service_apache2.c 9 Feb 2004 12:01:22 - 1.39 @@ -311,7 +311,7 @@ */ if(ap_rflush(rr) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, - NULL, mod_jk: Error flushing \n ); + NULL, mod_jk: Error flushing ); return JK_ERR; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 2003/03/03 23:19:31 Modified:jk/native2/server/apache2 mod_jk2.c Log: Reduce verbosity. Revision ChangesPath 1.59 +3 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- mod_jk2.c 4 Feb 2003 07:41:41 - 1.58 +++ mod_jk2.c 4 Mar 2003 07:19:31 - 1.59 @@ -383,8 +383,8 @@ if (workerEnv) { env=workerEnv-globalEnv; -env-l-jkLog(env, env-l, JK_LOG_INFO, - mod_jk2 Shutting down\n); +/* env-l-jkLog(env, env-l, JK_LOG_INFO, */ +/* mod_jk2 Shutting down\n); */ workerEnv-close(env, workerEnv); workerEnv = NULL; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c jk_map_aprtable.c jk_logger_apache2.c jk_apache2.h
mturk 2003/02/03 23:41:42 Modified:jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c jk_map_aprtable.c jk_logger_apache2.c jk_apache2.h Log: Update license to 2003. Revision ChangesPath 1.58 +2 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- mod_jk2.c 23 Jan 2003 12:11:54 - 1.57 +++ mod_jk2.c 4 Feb 2003 07:41:41 - 1.58 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999-2002 The Apache Software Foundation. * + * Copyright (c) 1999-2003 The Apache Software Foundation. * * All rights reserved.* * * * = * 1.34 +2 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c Index: jk_service_apache2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- jk_service_apache2.c 9 Dec 2002 13:23:19 - 1.33 +++ jk_service_apache2.c 4 Feb 2003 07:41:41 - 1.34 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999-2002 The Apache Software Foundation. * + * Copyright (c) 1999-2003 The Apache Software Foundation. * * All rights reserved.* * * * = * 1.11 +1 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_map_aprtable.c Index: jk_map_aprtable.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_map_aprtable.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- jk_map_aprtable.c 14 May 2002 20:44:21 - 1.10 +++ jk_map_aprtable.c 4 Feb 2003 07:41:41 - 1.11 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999-2001 The Apache Software Foundation. * + * Copyright (c) 1999-2003 The Apache Software Foundation. * * All rights reserved.* * * * = * 1.28 +1 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_logger_apache2.c Index: jk_logger_apache2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_logger_apache2.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- jk_logger_apache2.c 8 Jul 2002 12:13:51 - 1.27 +++ jk_logger_apache2.c 4 Feb 2003 07:41:41 - 1.28 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999-2001 The Apache Software Foundation. * + * Copyright (c) 1999-2003 The Apache Software Foundation. * * All rights reserved.* * * * = * 1.11 +2 -2
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2003/01/23 04:11:54 Modified:jk/native2/server/apache2 mod_jk2.c Log: Report sucesfull scoreboard child id status as INFO instead of ERROR. Revision ChangesPath 1.57 +10 -10jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- mod_jk2.c 26 Oct 2002 14:47:33 - 1.56 +++ mod_jk2.c 23 Jan 2003 12:11:54 - 1.57 @@ -134,8 +134,8 @@ rc=workerEnv-config-setPropertyString( env, workerEnv-config, (char *)name, value ); if (rc!=JK_OK) { - ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd-temp_pool, - mod_jk2: Unrecognized option %s %s\n, name, value); +ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, cmd-temp_pool, + mod_jk2: Unrecognized option %s %s\n, name, value); } return NULL; @@ -525,13 +525,13 @@ if (max_daemons_limit == 0) { workerEnv-childId = 0; env-l-jkLog(env, env-l, JK_LOG_INFO, -jk2_init() Found child %d in scoreboard slot %d\n, -proc.pid, workerEnv-childId); +jk2_init() Setting scoreboard slot 0 for child %d\n, +proc.pid); } else { env-l-jkLog(env, env-l, JK_LOG_ERROR, -jk2_init() Can't find child %d in scoreboard\n, -proc.pid); +jk2_init() Can't find child %d in none of the %d scoreboard slots\n, +proc.pid, max_daemons_limit); workerEnv-childId = -2; } } else { @@ -553,9 +553,9 @@ jk2_init( env, pconf, workerEnv, s ); -if( workerEnv-childId = 0 ) -env-l-jkLog(env, env-l, JK_LOG_ERROR, mod_jk child init %d %d\n, - workerEnv-was_initialized, workerEnv-childId ); +if (workerEnv-childId = 0) +env-l-jkLog(env, env-l, JK_LOG_INFO, mod_jk child %d initialized\n, + workerEnv-childId); } if (workerEnv-childGeneration) env-l-jkLog(env, env-l, JK_LOG_ERROR, mod_jk child workerEnv in error state %d\n, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c
mturk 2002/10/26 05:38:45 Modified:jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c Log: Move the scoreboard and childId detection from service_apache2 to the mod_jk2. Also set the child_init hook as last, so that mpm has a chance to create the scoreboard. Revision ChangesPath 1.55 +92 -14jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- mod_jk2.c 9 Oct 2002 17:10:52 - 1.54 +++ mod_jk2.c 26 Oct 2002 12:38:45 - 1.55 -69,6 +69,7 #include jk_apache2.h #include scoreboard.h +#include ap_mpm.h #include util_script.h -248,6 +249,8 if( child-mbean-debug -1 ) { fprintf(stderr, mod_jk2:mergeDirConfig() Merged dir config %#lx %s %s %s %s\n, child, child-uri, parent-uri, child-workerName, parent-workerName); +fprintf(stderr, mod_jk2:mergeDirConfig() Merged dir config %#lx %s %s %s %s\n, +child, child-uri, parent-uri, child-workerName, parent-workerName); } } -311,7 +314,6 env-l-jkLog(env, env-l, JK_LOG_ERROR, Error creating workerEnv\n); return; } - workerEnv-initData-add( env, workerEnv-initData, serverRoot, workerEnv-pool-pstrdup( env, workerEnv-pool, ap_server_root)); env-l-jkLog(env, env-l, JK_LOG_INFO, Set serverRoot %s\n, ap_server_root); -329,16 +331,19 { jk_uriEnv_t *newUri; jk_bean_t *jkb; - + if( workerEnv==NULL ) { jk2_create_workerEnv(p, s ); } -if( s-is_virtual == 1 ) { +if( s-is_virtual ) { /* Virtual host */ -fprintf( stderr, Create config for virtual host\n); +ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p, + mod_jk Create config for virtual host %s\n, + s-server_hostname ); } else { -/* Default host */ -/* fprintf( stderr, Create config for main host\n); */ +ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p, + mod_jk Create config for default server %s\n, + s-server_hostname ); } jkb = workerEnv-globalEnv-createBean2( workerEnv-globalEnv, -363,7 +368,9 jk_uriEnv_t *base = (jk_uriEnv_t *) basev; jk_uriEnv_t *overrides = (jk_uriEnv_t *)overridesv; -fprintf(stderr, Merging workerEnv \n ); +ap_log_perror(APLOG_MARK, APLOG_DEBUG, 0, p, + mod_jk Merging workerEnv\n); + /* The 'mountcopy' option should be implemented in common. */ -375,6 +382,9 jk_env_t *env; if (workerEnv) { env=workerEnv-globalEnv; + +env-l-jkLog(env, env-l, JK_LOG_INFO, + mod_jk2 Shutting down\n); workerEnv-close(env, workerEnv); workerEnv = NULL; } -394,6 +404,10 static char * jk2_init(jk_env_t *env, apr_pool_t *pconf, jk_workerEnv_t *workerEnv, server_rec *s ) { +/* Ugly hack to get the childId - the index used in the scoreboard, + which we'll use in the jk scoreboard +*/ + workerEnv-init(env, workerEnv ); workerEnv-server_name = (char *)ap_get_server_version(); /* Should be done in post config instead (cf DAV2) */ -459,7 +473,12 rc=jk2_apache2_isValidating( plog, gPool ); env-setAprPool(env, gPool); - + +if (!ap_exists_scoreboard_image()) { +env-l-jkLog(env, env-l, JK_LOG_ERROR, +jk2_postconfig() No scoreboard image %d\n, getpid()); +} + if( rc == JK_OK gPool != NULL ) { /* This is the first step */ env-l-jkLog(env, env-l, JK_LOG_INFO, -472,6 +491,7 env-l-jkLog(env, env-l, JK_LOG_INFO, mod_jk.post_config() second invocation\n ); + workerEnv-parentInit( env, workerEnv); -488,6 +508,7 static void jk2_child_init(apr_pool_t *pconf, server_rec *s) { +apr_proc_t proc; jk_uriEnv_t *serverEnv=(jk_uriEnv_t *) ap_get_module_config(s-module_config, jk2_module); jk_env_t *env; -496,16 +517,71 workerEnv = serverEnv-workerEnv; env=workerEnv-globalEnv; + +if (!workerEnv-childProcessId) +workerEnv-childProcessId = getpid(); + +proc.pid = workerEnv-childProcessId; -if(!workerEnv-was_initialized) { +/* detect if scoreboard exists +*/ +if (!ap_exists_scoreboard_image()) { +
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2002/10/26 07:47:33 Modified:jk/native2/server/apache2 mod_jk2.c Log: Some cleanup of the previous patch, skipping some debug code. Revision ChangesPath 1.56 +2 -19 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- mod_jk2.c 26 Oct 2002 12:38:45 - 1.55 +++ mod_jk2.c 26 Oct 2002 14:47:33 - 1.56 -404,9 +404,6 static char * jk2_init(jk_env_t *env, apr_pool_t *pconf, jk_workerEnv_t *workerEnv, server_rec *s ) { -/* Ugly hack to get the childId - the index used in the scoreboard, - which we'll use in the jk scoreboard -*/ workerEnv-init(env, workerEnv ); workerEnv-server_name = (char *)ap_get_server_version(); -458,7 +455,6 server_rec *s) { apr_pool_t *gPool=NULL; -void *data=NULL; int rc; jk_env_t *env; -474,11 +470,6 env-setAprPool(env, gPool); -if (!ap_exists_scoreboard_image()) { -env-l-jkLog(env, env-l, JK_LOG_ERROR, -jk2_postconfig() No scoreboard image %d\n, getpid()); -} - if( rc == JK_OK gPool != NULL ) { /* This is the first step */ env-l-jkLog(env, env-l, JK_LOG_INFO, -490,16 +481,8 env-l-jkLog(env, env-l, JK_LOG_INFO, mod_jk.post_config() second invocation\n ); - - workerEnv-parentInit( env, workerEnv); - -/* if(!workerEnv-was_initialized) { */ -/* workerEnv-was_initialized = JK_OK; */ - -/* jk2_init( env, pconf, workerEnv, s ); */ -/* } */ return OK; } -565,7 +548,7 ++ap_scoreboard_image-parent[workerEnv-childId].generation; } -if(!workerEnv-was_initialized !workerEnv-childGeneration) { +if(!workerEnv-was_initialized) { workerEnv-was_initialized = JK_TRUE; jk2_init( env, pconf, workerEnv, s ); -- 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/server/apache2 mod_jk2.c
mturk 2002/10/09 10:10:52 Modified:jk/native2/server/apache2 mod_jk2.c Log: Skip the checking of default hostname and port. Using that scheme the same behaviour is on all web servers. Revision ChangesPath 1.54 +3 -7 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- mod_jk2.c 23 Sep 2002 17:40:17 - 1.53 +++ mod_jk2.c 9 Oct 2002 17:10:52 - 1.54 @@ -629,7 +629,6 @@ { jk_uriEnv_t *uriEnv; jk_env_t *env; -int port; if(r-proxyreq || workerEnv==NULL) { return DECLINED; @@ -679,12 +678,9 @@ the real mapping. */ -port = ap_get_server_port(r); -if (ap_is_default_port(port, r)) -port = 0; uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, -r-server-is_virtual ? ap_get_server_name(r) : NULL, -port, +ap_get_server_name(r), +ap_get_server_port(r), r-uri); if( uriEnv== NULL || uriEnv-workerName == NULL) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2002/09/23 10:40:17 Modified:jk/native2/server/apache2 mod_jk2.c Log: Supply the hostname if not virtual and port if not default to the uriMap Revision ChangesPath 1.53 +10 -5 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- mod_jk2.c 22 Sep 2002 09:35:46 - 1.52 +++ mod_jk2.c 23 Sep 2002 17:40:17 - 1.53 @@ -629,7 +629,8 @@ { jk_uriEnv_t *uriEnv; jk_env_t *env; - +int port; + if(r-proxyreq || workerEnv==NULL) { return DECLINED; } @@ -677,10 +678,14 @@ If positive, we'll fill a ws_service_t and do the rewrite and the real mapping. */ - + +port = ap_get_server_port(r); +if (ap_is_default_port(port, r)) +port = 0; uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, -r-server-is_virtual ? r-hostname : NULL, -r-uri ); +r-server-is_virtual ? ap_get_server_name(r) : NULL, +port, +r-uri); if( uriEnv== NULL || uriEnv-workerName == NULL) { workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Sunday, September 22, 2002 4:51 AM /* As per Servlet spec, do exact match first */ match=jk2_uriMap_exactMap( env, uriMap, ctxEnv-exactMatch, uri, uriLen, reverse ); -if( match != NULL ) { +if( match != NULL +(( match-virtual==NULL hostEnv-virtual==NULL ) || + ( hostEnv-virtual!=NULL strcasecmp(match-virtual,hostEnv-virtual)==0 )) + ) { Each uri shoud allready be in the right ctxEnv (look at uriMap init phase). Each vhost is a separate context with it's own match tables. Don't think this is the correct patch. + uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, -r-server-is_virtual ? r-server-server_hostname : NULL, + apr_psprintf(r-pool,%s:%d,r-hostname,r-server-port), r-uri ); Using r-hostname is correct, but not appending the :port Should be something like (from mod_proxy) this: if (r-hostname != NULL) return r-hostname; /* Set url to the first char after scheme:// */ if ((url = strchr(r-uri, ':')) == NULL || url[1] != '/' || url[2] != '/') return NULL; MT. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2002/09/22 02:35:46 Modified:jk/native2/server/apache2 mod_jk2.c Log: Cannot use the hostname:server_port cause the port is 0 for all host:80 requests. Also is_virtual is used for separating default and virtual hosts. In case of default server host the hostname provided to uriMap _MUST_ be NULL to be able to map the default uri:/ Revision ChangesPath 1.52 +2 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- mod_jk2.c 22 Sep 2002 02:50:42 - 1.51 +++ mod_jk2.c 22 Sep 2002 09:35:46 - 1.52 @@ -679,7 +679,7 @@ */ uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, -apr_psprintf(r-pool,%s:%d,r-hostname,r-server-port), +r-server-is_virtual ? r-hostname : NULL, r-uri ); if( uriEnv== NULL || uriEnv-workerName == NULL) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
I agree that my patch is buggy in the case of a request coming from 80 or 443, but if we want to support port bases V hosting, we need to pass it down, if not [uri:www.something.com:8080/somecontext] Definitely will not work (this not works now i.e).. so to pass the port as part of the hostname is needed when port is different from 80 and 443.. FOr the other 2 the is_virtual and the changes inside the mapper.. The initial idea was to do what isapi_redirector from jk does right now, in jk i_r.dll there are 2 types of mappings: 1) globals ( for all VS and Default ) and 2) particular ( for a concrete VS or Default ) This needs to do 2 passes for the mapper, one for the particular mappings with host+port ( if not 80 or 443 ) as vhost, and if none found other for the Global mappings with NULL as vhost.. that is what isapi does.. For the mapper, i was trying to need only one pass in the mapper, but after looking at the code, it was buggy, as VS request from a registered vhost, never will be mapped to anything outside of that vhost, so it's need to do the two passes.. So my grandtotal for my first commits after months is 2 bugs in 2 commits, nice startup, thanks Mladen.. ;) Saludos , Ignacio J. Ortega -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviado el: 22 de septiembre de 2002 11:36 Para: [EMAIL PROTECTED] Asunto: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c mturk 2002/09/22 02:35:46 Modified:jk/native2/server/apache2 mod_jk2.c Log: Cannot use the hostname:server_port cause the port is 0 for all host:80 requests. Also is_virtual is used for separating default and virtual hosts. In case of default server host the hostname provided to uriMap _MUST_ be NULL to be able to map the default uri:/ Revision ChangesPath 1.52 +2 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/ mod_jk2.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- mod_jk2.c 22 Sep 2002 02:50:42 - 1.51 +++ mod_jk2.c 22 Sep 2002 09:35:46 - 1.52 @@ -679,7 +679,7 @@ */ uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, - apr_psprintf(r-pool,%s:%d,r-hostname,r-server-port), +r-server-is_virtual ? r-hostname : NULL, r-uri ); if( uriEnv== NULL || uriEnv-workerName == NULL) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
-Original Message- From: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]] I agree that my patch is buggy in the case of a request coming from 80 or 443, but if we want to support port bases V hosting, we need to pass it down, if not [uri:www.something.com:8080/somecontext] Definitely will not work (this not works now i.e).. so to pass the port as part of the hostname is needed when port is different from 80 and 443.. I agree to that. I know that neither my patch is perfect, but... We can use the sheme://hostname[:port] parsing but that has to go in the server part of the connector. The apache will give you same r-hostname no matter what the port number is. I was thinking to make those vhost mappings more like uri mappings. Like: [uri:vhost1:*] Will map all the port numbers so we can even use the port 0 (default one). Or more selective [uri:vhost1:8080] Will map only the 8080 port of the vhost1 1) globals ( for all VS and Default ) and 2) particular ( for a concrete VS or Default ) This needs to do 2 passes for the mapper, one for the particular mappings with host+port ( if not 80 or 443 ) as vhost, and if none found other for the Global mappings with NULL as vhost.. that is what isapi does.. Yes, but this will need to change the init phase not the map phase. If we provide the hostname to the uriMap it has to map that vhost. Global mappings should explicitly be defined, not assumed, because you will not be able to differentiate default and virtual hosts. MT. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2002/09/21 02:45:27 Modified:jk/native2/server/apache2 mod_jk2.c Log: Fix the uriMap for VirtualHost, providing server name for virtual hosts. Thx. to Dimitry Letin for that. Revision ChangesPath 1.50 +4 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- mod_jk2.c 15 Aug 2002 11:23:04 - 1.49 +++ mod_jk2.c 21 Sep 2002 09:45:27 - 1.50 @@ -677,7 +677,9 @@ If positive, we'll fill a ws_service_t and do the rewrite and the real mapping. */ -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, +r-server-is_virtual ? r-server-server_hostname : NULL, +r-uri ); if( uriEnv== NULL || uriEnv-workerName == NULL) { workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviado el: 21 de septiembre de 2002 11:45 +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, +r-server-is_virtual ? r-server-server_hostname : NULL, +r-uri ); I think this should use r-hostname+r-server-port instead of r-server-server_hostname only, to match exactly what apache does..the check r-server-is_virtual is not correct also.. must be the mapper who do the work of guess which is the appropiate action for some uri instead of forcing the default host if not a virtual server.. Saludos , Ignacio J. Ortega -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
nacho 2002/09/21 19:50:42 Modified:jk/native2/common jk_uriEnv.c jk_uriMap.c jk/native2/server/apache2 mod_jk2.c Log: Bug#11364 - jk2 appears to forward all virtual host requests to Tomcat Reported by Simon Stewart Revision ChangesPath 1.26 +0 -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.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- jk_uriEnv.c 15 Aug 2002 09:24:03 - 1.25 +++ jk_uriEnv.c 22 Sep 2002 02:50:42 - 1.26 @@ -100,7 +100,6 @@ /* If it doesn't start with /, it must have a vhost */ if( *name != '/' ) { -/* char *portIdx=strchr( n, ':' ); */ uriEnv-virtual=uriEnv-pool-calloc( env, uriEnv-pool, slash - name + 2 ); strncpy( uriEnv-virtual, name, slash-name ); } 1.39 +14 -4 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.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- jk_uriMap.c 1 Sep 2002 20:32:07 - 1.38 +++ jk_uriMap.c 22 Sep 2002 02:50:42 - 1.39 @@ -355,7 +355,8 @@ if( uriMap-mbean-debug 5 ) env-l-jkLog(env, env-l, JK_LOG_DEBUG, uriMap.init() set default host\n); - +/* XXX Initializes vhosts from uris */ +jk2_uriMap_correctHosts(env,uriMap); /* Initialize the vhosts table */ for(i = 0 ; i uriMap-maps-size( env, uriMap-maps ) ; i++) { uriEnv=uriMap-maps-valueAt( env, uriMap-maps, i ); @@ -622,7 +623,10 @@ /* As per Servlet spec, do exact match first */ match=jk2_uriMap_exactMap( env, uriMap, ctxEnv-exactMatch, uri, uriLen, reverse ); -if( match != NULL ) { +if( match != NULL +(( match-virtual==NULL hostEnv-virtual==NULL ) || + ( hostEnv-virtual!=NULL strcasecmp(match-virtual,hostEnv-virtual)==0 )) + ) { /* restore */ if( url_rewrite ) *url_rewrite=origChar; if( uriMap-mbean-debug 0 ) @@ -634,7 +638,10 @@ /* Then prefix match */ match=jk2_uriMap_prefixMap( env, uriMap, ctxEnv-prefixMatch, uri, uriLen, reverse ); -if( match != NULL ) { +if( match != NULL +(( match-virtual==NULL hostEnv-virtual==NULL ) || + ( hostEnv-virtual!=NULL strcasecmp(match-virtual,hostEnv-virtual)==0 )) + ) { char c=uri[match-prefix_len]; /* XXX Filter prefix matches to allow only exact matches with an optional path_info or query string at end. @@ -658,7 +665,10 @@ if( suffix!=NULL ) { match=jk2_uriMap_suffixMap( env, uriMap, ctxEnv-suffixMatch, suffix, strlen( suffix ), reverse); -if( match != NULL ) { +if( match != NULL +(( match-virtual==NULL hostEnv-virtual==NULL ) || + ( hostEnv-virtual!=NULL strcasecmp(match-virtual,hostEnv-virtual)==0 )) + ) { /* restore */ if( url_rewrite ) *url_rewrite=origChar; if( uriMap-mbean-debug 0 ) 1.51 +4 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- mod_jk2.c 21 Sep 2002 09:45:27 - 1.50 +++ mod_jk2.c 22 Sep 2002 02:50:42 - 1.51 @@ -629,7 +629,7 @@ { jk_uriEnv_t *uriEnv; jk_env_t *env; - + if(r-proxyreq || workerEnv==NULL) { return DECLINED; } @@ -677,8 +677,9 @@ If positive, we'll fill a ws_service_t and do the rewrite and the real mapping. */ + uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap, -r-server-is_virtual ? r-server-server_hostname : NULL, +apr_psprintf(r-pool,%s:%d,r-hostname,r-server-port), r-uri ); if( uriEnv== NULL || uriEnv-workerName == NULL) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2002/08/15 02:27:18 Modified:jk/native2/server/apache2 mod_jk2.c Log: After succesfull call to the mapUri call the mapUri again with the reverse flag set. This will decline the 'reverse' mappings. Revision ChangesPath 1.48 +9 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- mod_jk2.c 9 Aug 2002 17:45:49 - 1.47 +++ mod_jk2.c 15 Aug 2002 09:27:18 - 1.48 @@ -677,13 +677,19 @@ If positive, we'll fill a ws_service_t and do the rewrite and the real mapping. */ -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri, 0 ); if( uriEnv== NULL || uriEnv-workerName == NULL) { workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return DECLINED; } - +else { +jk_uriEnv_t *rriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri, 1 ); +if (rriEnv != NULL rriEnv-workerName != NULL) { +workerEnv-globalEnv-releaseEnv(workerEnv-globalEnv, env ); +return DECLINED; +} +} ap_set_module_config( r-request_config, jk2_module, uriEnv ); r-handler=JK_HANDLER; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2002/08/15 04:23:04 Modified:jk/native2/server/apache2 mod_jk2.c Log: Remove the reverse flag from uriMap call. All the positive/negative mappings is now done inside the uriMap function itself. Revision ChangesPath 1.49 +1 -8 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- mod_jk2.c 15 Aug 2002 09:27:18 - 1.48 +++ mod_jk2.c 15 Aug 2002 11:23:04 - 1.49 @@ -677,18 +677,11 @@ If positive, we'll fill a ws_service_t and do the rewrite and the real mapping. */ -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri, 0 ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri ); if( uriEnv== NULL || uriEnv-workerName == NULL) { workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return DECLINED; -} -else { -jk_uriEnv_t *rriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,r-uri, 1 ); -if (rriEnv != NULL rriEnv-workerName != NULL) { -workerEnv-globalEnv-releaseEnv(workerEnv-globalEnv, env ); -return DECLINED; -} } ap_set_module_config( r-request_config, jk2_module, uriEnv ); r-handler=JK_HANDLER; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 2002/08/09 10:45:50 Modified:jk/native2/server/apache2 mod_jk2.c Log: Few cosmetic fixes. Remove old code ( uriEnv can't be null ). The uriEnv==null case was used to support SetHandler directive - which only sets jakarta-servlet handler but doesn't set any module-specific field We may add this later - for now using JkUriSet in a Location works fine. Revision ChangesPath 1.47 +8 -19 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- mod_jk2.c 24 Jul 2002 00:44:20 - 1.46 +++ mod_jk2.c 9 Aug 2002 17:45:49 - 1.47 @@ -524,7 +524,6 @@ jk_endpoint_t *end = NULL; jk_uriEnv_t *uriEnv; jk_env_t *env; -jk_workerEnv_t *workerEnv; jk_ws_service_t *s=NULL; jk_pool_t *rPool=NULL; @@ -541,8 +540,6 @@ return HTTP_INTERNAL_SERVER_ERROR; } -workerEnv = uriEnv-workerEnv; - /* Get an env instance */ env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); @@ -554,22 +551,14 @@ return rc; } -if( uriEnv == NULL ) { -/* SetHandler case - per_dir config should have the worker*/ -worker = workerEnv-defaultWorker; -env-l-jkLog(env, env-l, JK_LOG_INFO, - mod_jk.handler() Default worker for %s %s\n, - r-uri, worker-mbean-name); -} else { -worker=uriEnv-worker; +worker=uriEnv-worker; -if( worker==NULL uriEnv-workerName != NULL ) { -worker=env-getByName( env, uriEnv-workerName); -env-l-jkLog(env, env-l, JK_LOG_INFO, - mod_jk.handler() finding worker for %#lx %#lx %s\n, - worker, uriEnv, uriEnv-workerName); -uriEnv-worker=worker; -} +if( worker==NULL uriEnv-workerName != NULL ) { +worker=env-getByName( env, uriEnv-workerName); +env-l-jkLog(env, env-l, JK_LOG_INFO, + mod_jk.handler() finding worker for %#lx %#lx %s\n, + worker, uriEnv, uriEnv-workerName); +uriEnv-worker=worker; } if(worker==NULL || worker-mbean == NULL || worker-mbean-localName==NULL ) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
bojan 2002/07/23 17:44:20 Modified:jk/native2/server/apache2 mod_jk2.c Log: Kick out DIR_MAGIC_TYPE from jk2_handler() since it is never given to it anyway. This will have to be resolved later for mod_jk2. Make sure main request gets the appropriate info when the sub-request is made from mod_dir. This makes DirectoryIndex work (finally :-) for mod_jk2. Revision ChangesPath 1.46 +15 -17jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- mod_jk2.c 22 Jul 2002 23:18:38 - 1.45 +++ mod_jk2.c 24 Jul 2002 00:44:20 - 1.46 @@ -532,13 +532,8 @@ uriEnv=ap_get_module_config( r-request_config, jk2_module ); -/* We do DIR_MAGIC_TYPE here to make sure TC gets all requests, even - * if they are directory requests, in case there are no static files - * visible to Apache and/or DirectoryIndex was not used */ - /* not for me, try next handler */ -if((uriEnv==NULL || strcmp(r-handler,JK_HANDLER)) - strcmp(r-handler,DIR_MAGIC_TYPE)) +if(uriEnv==NULL || strcmp(r-handler,JK_HANDLER)) return DECLINED; /* If this is a proxy request, we'll notify an error */ @@ -546,17 +541,6 @@ return HTTP_INTERNAL_SERVER_ERROR; } -/* This is needed for DIR_MAGIC_TYPE. Not sure if this is good, bad or just - * plain ugly, but we really NEED to have uriEnv, otherwise everything else - * will blow up */ - -if(uriEnv == NULL){ -uriEnv = ap_get_module_config(r-server-module_config, jk2_module); - -if(uriEnv == NULL) /* We still have nothing, go out */ - return DECLINED; -} - workerEnv = uriEnv-workerEnv; /* Get an env instance */ @@ -678,6 +662,13 @@ ap_set_module_config( r-request_config, jk2_module, uriEnv ); r-handler=JK_HANDLER; workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); + +/* This could be a sub-request, possibly from mod_dir */ +if(r-main){ +ap_set_module_config( r-main-request_config, jk2_module, uriEnv ); +r-main-handler=JK_HANDLER; +} + return OK; } @@ -707,12 +698,19 @@ ap_set_module_config( r-request_config, jk2_module, uriEnv ); r-handler=JK_HANDLER; +/* This could be a sub-request, possibly from mod_dir */ +if(r-main){ +ap_set_module_config( r-main-request_config, jk2_module, uriEnv ); +r-main-handler=JK_HANDLER; +} + if( uriEnv-mbean-debug 0 ) env-l-jkLog(env, env-l, JK_LOG_DEBUG, mod_jk.translate(): uriMap %s %s %#lx\n, r-uri, uriEnv-workerName, uriEnv-worker); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); + return OK; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
bojan 2002/07/22 16:18:38 Modified:jk/native2/server/apache2 mod_jk2.c Log: Initial, most likely *BROKEN* code to handle default directory files. The code in jk2_map_to_storage() should be OK. Most critical stuff is in jk2_handler() function, the part of code that attempts to get uriEnv from r-server-module_config. Please review! Revision ChangesPath 1.45 +41 -23jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- mod_jk2.c 21 Jul 2002 06:52:29 - 1.44 +++ mod_jk2.c 22 Jul 2002 23:18:38 - 1.45 @@ -532,8 +532,13 @@ uriEnv=ap_get_module_config( r-request_config, jk2_module ); +/* We do DIR_MAGIC_TYPE here to make sure TC gets all requests, even + * if they are directory requests, in case there are no static files + * visible to Apache and/or DirectoryIndex was not used */ + /* not for me, try next handler */ -if(uriEnv==NULL || strcmp(r-handler,JK_HANDLER)!= 0 ) +if((uriEnv==NULL || strcmp(r-handler,JK_HANDLER)) + strcmp(r-handler,DIR_MAGIC_TYPE)) return DECLINED; /* If this is a proxy request, we'll notify an error */ @@ -541,6 +546,17 @@ return HTTP_INTERNAL_SERVER_ERROR; } +/* This is needed for DIR_MAGIC_TYPE. Not sure if this is good, bad or just + * plain ugly, but we really NEED to have uriEnv, otherwise everything else + * will blow up */ + +if(uriEnv == NULL){ +uriEnv = ap_get_module_config(r-server-module_config, jk2_module); + +if(uriEnv == NULL) /* We still have nothing, go out */ + return DECLINED; +} + workerEnv = uriEnv-workerEnv; /* Get an env instance */ @@ -708,30 +724,32 @@ jk_uriEnv_t *uriEnv=ap_get_module_config( r-request_config, jk2_module ); if( uriEnv != NULL ) { -char *uri_p=r-uri; + +/* First find just the name of the file, no directory */ +r-filename = (char *)apr_filename_of_pathname(r-uri); -/* This is old code which doesn't seem to work well with mod_dir -r-filename = (char *)apr_filename_of_pathname(r-uri); */ +/* Only if sub-request for a directory, most likely from mod_dir */ +if (r-main r-main-filename +!*apr_filename_of_pathname(r-main-filename)){ + +/* The filename from the main request will be set to what should + * be picked up, aliases included. Tomcat will need to know about + * those aliases or things won't work for them. Normal files + * should be fine. */ + +/* Need absolute path to stat */ +if (apr_filepath_merge(r-filename, + r-main-filename, r-filename, + APR_FILEPATH_SECUREROOT | + APR_FILEPATH_TRUENAME, + r-pool) +!= APR_SUCCESS){ + return DECLINED; /* We should never get here, very bad */ +} -/* if( uriEnv-mbean-debug 0 ) { */ -/* env-l-jkLog(env, env-l, JK_LOG_INFO, */ -/* mod_jk.map_to_storage(): map %s %s\n, */ -/* r-uri, r-filename); */ -/* } */ - -/* Absolute paths cannot be merged */ -while (*uri_p == '/') ++uri_p; - -/* Need absolute path to stat */ -if (apr_filepath_merge(r-filename, ap_document_root(r), uri_p, - APR_FILEPATH_SECUREROOT | APR_FILEPATH_TRUENAME, - r-pool) -!= APR_SUCCESS){ - return DECLINED; +/* Stat the file so that mod_dir knows it's there */ +apr_stat(r-finfo, r-filename, APR_FINFO_TYPE, r-pool); } - -/* Stat the file so that mod_dir knows it's there */ -apr_stat(r-finfo, r-filename, APR_FINFO_TYPE, r-pool); return OK; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Quoting [EMAIL PROTECTED]: On 22 Jul 2002, Bojan Smojver wrote: If there is no physical file, then nothing will get done by the patch at all (since r-finfo.filetype is 0). It won't affect mod_dir's old behaviour at all. I'm not sure how that changes things... My question was: if you have a precompiled index.jsp, there will be no file - only a servlet-map with uri=/index.jsp and the servlet name. DirectoryIndex will not find index.jsp, and will assume there is no index - and serve the dir. Which is wrong. Which is how it used to be in the old code anyway. And that means that DirectoryIndex should not be used if you don't have physical files in the right places (with the current patch level in mod_jk 1.2.x for Apache 2) or in virtual places (with the future code, that you're proposing, which will be capable of asking TC about such files). The indexes as defined by the servlet spec may be real files or virtual (mapped) resources. I guess I was aiming at this: - if all files are physical and local, then mod_dir and DirectoryIndex are fine and make sense If you can make sure that all paths are checked for both static and mapped resources - yes, you can use mod_dir. OK, if you want to write something along those lines, I have no problems with that. It's best of both worlds in that case. I'm guessing that you'd have to ask TC if there are files out there that match, right? Because this is not a real request (not in jk_map_to_storage() anyway), but 'what if', jk_handler() doesn't get called, so it would have to be done in some other way. - if all files are not physical and local, mod_dir and DirectoryIndex don't make sense and should not be used I don't think this is an issue we should discuss - this case is already solved, if no files on the apache machine there is nothing we can do but forward. The lb case is also not an issue - if there are local static files, apache can serve them - and dynamic resources are handled by tomcat lb. That sounds good to me. Bojan PS. Note that mod_jk 1.2.0 doesn't use DocumentRoot as the base for the request any more (that was clearly a bug). I fixed that this morning. I have not done any changes to mod_jk2. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Quoting [EMAIL PROTECTED]: You don't need to ask tomcat - jk should have all the mappings, and it can already map any URI. All it has to do is: - for each index: -- concatenate with the current uri -- do the jk mapping ( or internal redirect if you use Location instead of the internal mapper ). If a match is found - forward to tomcat. -- check if a file exists. If yes - serve it as static ( since we already checked all servlet mappings ). - if no match is found, use mod_dir to display the directory. But in the short term, I think we should just let tomcat deal with that, until we have the fix. Are you referring here to mod_jk2 only or both mod_jk 1.2.0 and mod_jk2? Bojan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Quoting [EMAIL PROTECTED]: Are you referring here to mod_jk2 only or both mod_jk 1.2.0 and mod_jk2? I think it could be done for jk2 ( but not easy ). I'm not sure about 1.2 - just forwarding and letting tomcat handle it is not the worse thing. How about I try to fix it properly in mod_jk 1.2.0 and let you guys do whatever you like in mod_jk2? Bojan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Quoting [EMAIL PROTECTED]: You don't need to ask tomcat - jk should have all the mappings, and it can already map any URI. All it has to do is: - for each index: -- concatenate with the current uri -- do the jk mapping ( or internal redirect if you use Location instead of the internal mapper ). If a match is found - forward to tomcat. -- check if a file exists. If yes - serve it as static ( since we already checked all servlet mappings ). - if no match is found, use mod_dir to display the directory. Just reading the algorithm and thinking about the implementation of it. Some of the things might present themselves as big problems here in relation to servlet mappings... An example configuration: DirectoryIndex index.jsp index.vm The order of events would be: 1. mod_dir does a sub request for index.jsp 2. jk_map_to_storage() receives the request 3. jk_map_to_storage() engages map_uri_to_worker() -- this would be new code 4. map_uri_to_worker() finds nothing because it has no mapping to anything that matches *.jsp Now, the next step is rather tricky and is the key to the whole thing. Does jk_map_to_storage(): a) assume that there is index.jsp in one of the mappings that match the URI minus the filename; jk_map_to_storage() could be very wrong about this - maybe there is a default file there, but not index.jsp - this would then result in a failed request b) continue processing with the next index file (in this case index.vm) and possibly miss both index.jsp and index.vm in one of the servlet mappings Keep in mind that these are sub-requests that don't actually result in the file being served. It's just mod_dir's way of checking what would happen if there was a file like that 'in the file system'. So, one cannot 'go back' and do all this again, unless mod_dir is changed to do this kind of thing twice (which is definitely a bad idea). I actually think that it is not possible to establish if there is such a file, unless mod_jk somehow knows about their exisitence. I'm not all that familir with mappings, but I reckon that isn't the case. And then, when everybody thought all was lost... ;-) If my old kludge is applied (with the correct test this time) to jk_handler(), things might be better. The kludge involved jk_handler() responding not just to JK_HANDLER requests but also to DIR_MAGIC_TYPE requests. Now, jk_handler() would find the mapping (since the request is for a directory, not a file) and the request would be served by Tomcat. Would this work? I think it might... Bojan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
- Original Message - From: Bojan Smojver [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Sunday, July 21, 2002 9:19 PM Subject: RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c Quoting [EMAIL PROTECTED]: You don't need to ask tomcat - jk should have all the mappings, and it can already map any URI. All it has to do is: - for each index: -- concatenate with the current uri -- do the jk mapping ( or internal redirect if you use Location instead of the internal mapper ). If a match is found - forward to tomcat. -- check if a file exists. If yes - serve it as static ( since we already checked all servlet mappings ). - if no match is found, use mod_dir to display the directory. Just reading the algorithm and thinking about the implementation of it. Some of the things might present themselves as big problems here in relation to servlet mappings... An example configuration: DirectoryIndex index.jsp index.vm The order of events would be: 1. mod_dir does a sub request for index.jsp 2. jk_map_to_storage() receives the request 3. jk_map_to_storage() engages map_uri_to_worker() -- this would be new code 4. map_uri_to_worker() finds nothing because it has no mapping to anything that matches *.jsp Now, the next step is rather tricky and is the key to the whole thing. Does jk_map_to_storage(): a) assume that there is index.jsp in one of the mappings that match the URI minus the filename; jk_map_to_storage() could be very wrong about this - maybe there is a default file there, but not index.jsp - this would then result in a failed request b) continue processing with the next index file (in this case index.vm) and possibly miss both index.jsp and index.vm in one of the servlet mappings Keep in mind that these are sub-requests that don't actually result in the file being served. It's just mod_dir's way of checking what would happen if there was a file like that 'in the file system'. So, one cannot 'go back' and do all this again, unless mod_dir is changed to do this kind of thing twice (which is definitely a bad idea). I actually think that it is not possible to establish if there is such a file, unless mod_jk somehow knows about their exisitence. I'm not all that familir with mappings, but I reckon that isn't the case. And then, when everybody thought all was lost... ;-) If my old kludge is applied (with the correct test this time) to jk_handler(), things might be better. The kludge involved jk_handler() responding not just to JK_HANDLER requests but also to DIR_MAGIC_TYPE requests. Now, jk_handler() would find the mapping (since the request is for a directory, not a file) and the request would be served by Tomcat. Would this work? I think it might... At the moment, the servlet-mapping issue is somewhat of a red-herring, since only 3.3.2-dev supports it (and even there, it is disabled by default). For now, mod_jk(2) might as well assume that the physical jsp/vm file is there, since Tomcat requires that it is. The real issue is that jk_map_to_storage was a kludgy attempt to bypass tree-walking by Apache (and save the time to do all of those stat calls). Your fix at least removes the kludgy part. ;-) I *really* don't like the idea of passing DIR_MAGIC_TYPE requests to Tomcat, since I tend to set up directories with only static content that only Apache knows about. Sending them to Tomcat just gives me very many 404 errors, so I'd be forced to use a branched copy of mod_jk. If you have: JkMount /myapp/*.jsp ajp13 JkMount /myapp/*.vm ajp13 Then jk_translate will grab the request for /myapp/index.jsp and set the handler. If the file is physically there, then jk_map_to_storage will stat it, and everyone is happy. Otherwise, jk_translate will grab the request for /myapp/index.vm and set the handler and do the same check for a physical file. In Apache 1.3.x, this is basically what happens except that the physical file test is done by Apache's tree-walk. Bojan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Quoting [EMAIL PROTECTED]: DirectoryIndex index.jsp index.vm The order of events would be: 1. mod_dir does a sub request for index.jsp 2. jk_map_to_storage() receives the request 3. jk_map_to_storage() engages map_uri_to_worker() -- this would be new code 4. map_uri_to_worker() finds nothing because it has no mapping to anything that matches *.jsp That's actually a problem - map_uri_to_worker would find a match ( using *.jsp extension mapping ). Sorry, I meant, but never wrote, that the problem would be if there was no explicit extension mapping. If there was, the match would be found and that wouldn't be one of the problem cases because we'd simulate r-finfo.filetype by setting it explicitly to APR_REG. Then mod_dir would engage the real request based on that with handler set to JK_HANDLER, which would then call Tomcat. Now, the next step is rather tricky and is the key to the whole thing. Does jk_map_to_storage(): a) assume that there is index.jsp in one of the mappings that match the URI minus the filename; jk_map_to_storage() could be very wrong about this - maybe there is a default file there, but not index.jsp - this would then result in a failed request If jk_map_to_storage finds an exact or prefix mapping - then the problem is solved, the request goes to tomcat. Well, yes, but at this stage we are not doing the request. mod_dir is just checking if the request should go there or not. And since the real request would be originated by mod_dir, which filename would mod_dir use: index.jsp or index.vm? That would be a real problem case, I think. If it finds an extension mapping - I have no idea. If it doesn't find any mapping - then it's not a request for tomcat and you can look for static files ( or let mod_dir do it ). So, one cannot 'go back' and do all this again, unless mod_dir is changed to do this kind of thing twice (which is definitely a bad idea). No, you don't need to go back. For each attempted index you make a subrequest and you need to determine if tomcat could handle it. You mean here like this? Following code from mod_dir: --- rr = ap_sub_req_lookup_uri(name_ptr, r, NULL); --- Wouldn't that just end up going through jk_map_to_storage() again? If my old kludge is applied (with the correct test this time) to jk_handler(), things might be better. The kludge involved jk_handler() responding not just to JK_HANDLER requests but also to DIR_MAGIC_TYPE requests. Now, jk_handler() would find the mapping (since the request is for a directory, not a file) and the request would be served by Tomcat. I think this would work and is the best short-term solution. If it is a DIR, let tomcat serve it for now. I can implement that easily. But there is one catch: static files would get checked first (through the code in jk_map_to_storage()) and if the match wasn't found (either because there is no DirecoryIndex or there were no physical files that Apache can find), the the raw directory would hit jk_handler(). Is that a problem? Bojan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Quoting Bill Barker [EMAIL PROTECTED]: I *really* don't like the idea of passing DIR_MAGIC_TYPE requests to Tomcat, since I tend to set up directories with only static content that only Apache knows about. Sending them to Tomcat just gives me very many 404 errors, so I'd be forced to use a branched copy of mod_jk. Actually, DIR_MAGIC_TYPE would *only* get involved if there was no match found through my current code jk_map_to_storage(), and that would not be the case if: - you defined DirectoryIndex - there is a physical file that Apache can stat Basically, static files would be preferred (I don't like the idea of involving Tomcat if I don't need to either). Does that eliminate the objection? Bojan PS. I have applied ap_is_directory() call in the latest version of the patch. Do you think I should have stuck with determining if the r-main-filename ends in a '/'? It would save some stat-ing, but on the other hand I'm not sure if file system directories are stored in Unix format or architecture dependent format (i.e. with '\' on Windows). I wanted to make sure I don't run into problems on Windows... If someone can verify that it'll be a '/', then I think I should remove that stat and just use the last character verification. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
My apologies everyone... Just ignore the part of my previous e-mail marked here with between the stars. It just plain stupid :-( ** Quoting Bojan Smojver [EMAIL PROTECTED]: Quoting [EMAIL PROTECTED]: DirectoryIndex index.jsp index.vm The order of events would be: 1. mod_dir does a sub request for index.jsp 2. jk_map_to_storage() receives the request 3. jk_map_to_storage() engages map_uri_to_worker() -- this would be new code 4. map_uri_to_worker() finds nothing because it has no mapping to anything that matches *.jsp That's actually a problem - map_uri_to_worker would find a match ( using *.jsp extension mapping ). Sorry, I meant, but never wrote, that the problem would be if there was no explicit extension mapping. If there was, the match would be found and that wouldn't be one of the problem cases because we'd simulate r-finfo.filetype by setting it explicitly to APR_REG. Then mod_dir would engage the real request based on that with handler set to JK_HANDLER, which would then call Tomcat. Now, the next step is rather tricky and is the key to the whole thing. Does jk_map_to_storage(): a) assume that there is index.jsp in one of the mappings that match the URI minus the filename; jk_map_to_storage() could be very wrong about this - maybe there is a default file there, but not index.jsp - this would then result in a failed request If jk_map_to_storage finds an exact or prefix mapping - then the problem is solved, the request goes to tomcat. Well, yes, but at this stage we are not doing the request. mod_dir is just checking if the request should go there or not. And since the real request would be originated by mod_dir, which filename would mod_dir use: index.jsp or index.vm? That would be a real problem case, I think. If it finds an extension mapping - I have no idea. If it doesn't find any mapping - then it's not a request for tomcat and you can look for static files ( or let mod_dir do it ). So, one cannot 'go back' and do all this again, unless mod_dir is changed to do this kind of thing twice (which is definitely a bad idea). No, you don't need to go back. For each attempted index you make a subrequest and you need to determine if tomcat could handle it. You mean here like this? Following code from mod_dir: --- rr = ap_sub_req_lookup_uri(name_ptr, r, NULL); --- Wouldn't that just end up going through jk_map_to_storage() again? ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2002/07/18 08:15:00 Modified:jk/native2/server/apache2 mod_jk2.c Log: Fix the bug 10789 caused by hook order. Revision ChangesPath 1.42 +3 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- mod_jk2.c 17 Jul 2002 22:43:58 - 1.41 +++ mod_jk2.c 18 Jul 2002 15:15:00 - 1.42 @@ -724,8 +724,8 @@ ap_hook_handler(jk2_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_post_config(jk2_post_config,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_child_init(jk2_child_init,NULL,NULL,APR_HOOK_MIDDLE); -ap_hook_translate_name(jk2_translate,NULL,NULL,APR_HOOK_FIRST); -ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE); +ap_hook_translate_name(jk2_translate,NULL,NULL,APR_HOOK_MIDDLE); +ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_FIRST); } module AP_MODULE_DECLARE_DATA jk2_module = -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[BUGS: 9913, 10789] Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
I've looked through Mark's excellent analysis of the problem (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10789) and I also played with changing the hook order for mod_jk 1.2.0. Are you sure this actually fixes the thing? My experience from 1.2.0 is similar to Mark's with 2.x - the handler never gets called because the r-handler is DIR_MAGIC_TYPE, not JK_HANDLER. So, I think Mark's code would be the real fix for both - giving Apache a hint that the handler is JK_HANDLER. My original 'fix' (more like a kludge) for 1.2.0 doesn't do that. It waits for the next round, accepts the DIR_MAGIC_TYPE call, where r-uri isn't the correct file (i.e. it is not /some/path/index.jsp), but rather a directory (/some/path/), which then causes havoc down the line in getServletPath(). Tomcat 3.3.x is smart and it corrects that for JSP's. I'm not sure if TC 4.x does that at all (I have seen at least one other report related to bug 9913 with TC 4.x where my 'fix' didn't actually fix the problem - some fix :-). Mladen, what's your take on all this? Do you have a setup handy to verify that the changing of hook ordering fixed the problem in mod_jk2? Mark, does the fix in mod_jk2 work in your environment? Bojan PS. Sorry guys, this one is *really* bugging me... Quoting [EMAIL PROTECTED]: mturk 2002/07/18 08:15:00 Modified:jk/native2/server/apache2 mod_jk2.c Log: Fix the bug 10789 caused by hook order. Revision ChangesPath 1.42 +3 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- mod_jk2.c 17 Jul 2002 22:43:58 - 1.41 +++ mod_jk2.c 18 Jul 2002 15:15:00 - 1.42 @@ -724,8 +724,8 @@ ap_hook_handler(jk2_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_post_config(jk2_post_config,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_child_init(jk2_child_init,NULL,NULL,APR_HOOK_MIDDLE); -ap_hook_translate_name(jk2_translate,NULL,NULL,APR_HOOK_FIRST); -ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_translate_name(jk2_translate,NULL,NULL,APR_HOOK_MIDDLE); +ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_FIRST); } module AP_MODULE_DECLARE_DATA jk2_module = -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [BUGS: 9913, 10789] Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
On Fri, 19 Jul 2002 13:57:22 +1000 (EST), Bojan Smojver wrote: : My experience from 1.2.0 is similar to Mark's with 2.x - the handler never gets : called because the r-handler is DIR_MAGIC_TYPE, not JK_HANDLER. So, I think : Mark's code would be the real fix for both - giving Apache a hint that the : handler is JK_HANDLER. : : ... : : Mladen, what's your take on all this? Do you have a setup handy to verify that : the changing of hook ordering fixed the problem in mod_jk2? : : Mark, does the fix in mod_jk2 work in your environment? I was just getting ready to post something saying the fix seems to break mod_jk2 altogether for me. For one thing, I think, if jk2_map_to_storage is invoked before jk2_translate then mod_jk2 is going to return DECLINED all the time. Which is what I am seeing. Nothing gets sent over to tomcat. For example: jk2_map_to_storage( ) ENTER Unparsed uri: /tomcat/examples request_rec:009D79A8 Return DECLINED jk2_map_to_storage( ) ENTER Unparsed uri: /tomcat/examples/ request_rec:009D79A8 Return DECLINED jk2_map_to_storage( ) ENTER Unparsed uri: /tomcat/examples/index.html request_rec:009D59A0 Return DECLINED jk2_map_to_storage( ) ENTER Unparsed uri: /tomcat/examples/index.jsp request_rec:009D59A0 Return DECLINED jk2_handler( )ENTER Unparsed uri: /tomcat/examples/ request_rec:009D79A8 uriEnv: Return DECLINED In jk2_map_to_storage the start of the code is: jk_uriEnv_t *uriEnv=ap_get_module_config( r-request_config, jk2_module ); if( uriEnv != NULL ) { but the only calls to ap_set_module_config( r-request_config, jk2_module, uriEnv ); are in jk2_translate. So, it seems to me that jk2_translate needs to be invoked before jk2_map_to_storage. Which is what I thought the original order was. But I have to confess I really do not understand APR_HOOK_MIDDLE, APR_HOOK_FIRST, etc.. Anyhow, the bottom line is that on my machine doing a clean and then rebuilding tomcat and mod_jk2 using the latest jakarta-tomcat-connectors from cvs, leaves me with mod_jk2 not sending anything on to tomcat. -- Mark Miesfeld [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [BUGS: 9913, 10789] Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
Quoting Mark Miesfeld [EMAIL PROTECTED]: I was just getting ready to post something saying the fix seems to break mod_jk2 altogether for me. Interesting. I haven't actually checked explicit calls to pages with reversed order and mod_jk 1.2.0, so I don't really know if that breaks it or not. Will test tonight (Sydney time). For one thing, I think, if jk2_map_to_storage is invoked before jk2_translate then mod_jk2 is going to return DECLINED all the time. Which is what I am seeing. Nothing gets sent over to tomcat. For example: jk2_map_to_storage( ) ENTER Unparsed uri: /tomcat/examples request_rec:009D79A8 Return DECLINED jk2_map_to_storage( ) ENTER Unparsed uri: /tomcat/examples/ request_rec:009D79A8 Return DECLINED jk2_map_to_storage( ) ENTER Unparsed uri: /tomcat/examples/index.html request_rec:009D59A0 Return DECLINED jk2_map_to_storage( ) ENTER Unparsed uri: /tomcat/examples/index.jsp request_rec:009D59A0 Return DECLINED jk2_handler( )ENTER Unparsed uri: /tomcat/examples/ request_rec:009D79A8 uriEnv: Return DECLINED In jk2_map_to_storage the start of the code is: jk_uriEnv_t *uriEnv=ap_get_module_config( r-request_config, jk2_module ); if( uriEnv != NULL ) { but the only calls to ap_set_module_config( r-request_config, jk2_module, uriEnv ); are in jk2_translate. So, it seems to me that jk2_translate needs to be invoked before jk2_map_to_storage. Which is what I thought the original order was. But I have to confess I really do not understand APR_HOOK_MIDDLE, APR_HOOK_FIRST, etc. I don't really understand Apache all that well, but the API documentation talks about 'Controlling hook calling order'. From 'Apache Hook Functions' document: ...all modules using HOOK_FIRST will run before the HOOK_MIDDLE which are before HOOK_LAST. If the order is unimportant, HOOK_MIDDLE is recommended. Anyhow, the bottom line is that on my machine doing a clean and then rebuilding tomcat and mod_jk2 using the latest jakarta-tomcat-connectors from cvs, leaves me with mod_jk2 not sending anything on to tomcat. OK. I'll try your solution with mod_jk 1.2.0 and mod_jk2 people might do the same. I don't really like my fix in 1.2.0 because it's just a cheap hack and it doesn't address the root cause of the problem The reason why it didn't work in mod_jk2 is the fact that the test was wrong. It should have been: --- if((uriEnv==NULL || strcmp(r-handler,JK_HANDLER)) strcmp(r-handler,DIR_MAGIC_TYPE))) return DECLINED; --- But even that probably wouldn't work with TC 4.x because getServletPath() would start returning strange things. I think your approach is much better. Bojan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
bojan 2002/07/17 15:43:59 Modified:jk/native2/server/apache2 mod_jk2.c Log: Revert the fix for default pages - it seems jk2 does things differently then jk1 (surprise). User confirms the fix does not work. Revision ChangesPath 1.41 +2 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- mod_jk2.c 17 Jul 2002 05:58:34 - 1.40 +++ mod_jk2.c 17 Jul 2002 22:43:58 - 1.41 @@ -533,8 +533,7 @@ uriEnv=ap_get_module_config( r-request_config, jk2_module ); /* not for me, try next handler */ -if(uriEnv==NULL || - (strcmp(r-handler,JK_HANDLER) strcmp(r-handler,DIR_MAGIC_TYPE))) +if(uriEnv==NULL || strcmp(r-handler,JK_HANDLER)!= 0 ) return DECLINED; /* If this is a proxy request, we'll notify an error */ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
bojan 2002/07/16 22:58:34 Modified:jk/native2/server/apache2 mod_jk2.c Log: Fix picking up default pages from Apache 2.x Revision ChangesPath 1.40 +3 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- mod_jk2.c 8 Jul 2002 13:31:23 - 1.39 +++ mod_jk2.c 17 Jul 2002 05:58:34 - 1.40 @@ -533,7 +533,8 @@ uriEnv=ap_get_module_config( r-request_config, jk2_module ); /* not for me, try next handler */ -if(uriEnv==NULL || strcmp(r-handler,JK_HANDLER)!= 0 ) +if(uriEnv==NULL || + (strcmp(r-handler,JK_HANDLER) strcmp(r-handler,DIR_MAGIC_TYPE))) return DECLINED; /* If this is a proxy request, we'll notify an error */ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2002/07/08 06:31:23 Modified:jk/native2/server/apache2 mod_jk2.c Log: no message Revision ChangesPath 1.39 +5 -5 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- mod_jk2.c 1 Jul 2002 15:46:20 - 1.38 +++ mod_jk2.c 8 Jul 2002 13:31:23 - 1.39 @@ -580,7 +580,7 @@ } if( uriEnv-mbean-debug 0 ) -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, mod_jk.handler() serving %s with %#lx %#lx %s\n, uriEnv-mbean-localName, worker, worker-mbean, worker-mbean-localName ); @@ -590,7 +590,7 @@ if( rPool == NULL ) { rPool=worker-mbean-pool-create( env, worker-mbean-pool, HUGE_POOL_SIZE ); if( uriEnv-mbean-debug 0 ) -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, mod_jk.handler(): new rpool %#lx\n, rPool ); } @@ -656,7 +656,7 @@ */ if( uriEnv!= NULL uriEnv-workerName != NULL) { if( uriEnv-mbean-debug 0 ) -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, PerDir mapping %s=%s\n,r-uri, uriEnv-workerName); ap_set_module_config( r-request_config, jk2_module, uriEnv ); @@ -692,7 +692,7 @@ r-handler=JK_HANDLER; if( uriEnv-mbean-debug 0 ) -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, mod_jk.translate(): uriMap %s %s %#lx\n, r-uri, uriEnv-workerName, uriEnv-worker); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
mturk 2002/07/01 08:46:20 Modified:jk/native2/server/apache2 mod_jk2.c Log: Register child_init pool cleanup function jk2_shutdown Revision ChangesPath 1.38 +13 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- mod_jk2.c 19 Jun 2002 18:27:25 - 1.37 +++ mod_jk2.c 1 Jul 2002 15:46:20 - 1.38 @@ -370,6 +370,17 @@ return overrides; } +static apr_status_t jk2_shutdown(void *data) +{ +jk_env_t *env; +if (workerEnv) { +env=workerEnv-globalEnv; +workerEnv-close(env, workerEnv); +workerEnv = NULL; +} +return APR_SUCCESS; +} + /** Initialize jk, using worker.properties. We also use apache commands ( JkWorker, etc), but this use is @@ -387,6 +398,7 @@ workerEnv-server_name = (char *)ap_get_server_version(); /* Should be done in post config instead (cf DAV2) */ /* ap_add_version_component(pconf, JK_EXPOSED_VERSION); */ +apr_pool_cleanup_register(pconf, NULL, jk2_shutdown, apr_pool_cleanup_null); return NULL; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
nacho 2002/06/08 18:56:14 Modified:jk/native2/server/apache2 mod_jk2.c Log: * Fixing the build in win32 * Cosmetic changes Revision ChangesPath 1.35 +2 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- mod_jk2.c 7 Jun 2002 23:45:30 - 1.34 +++ mod_jk2.c 9 Jun 2002 01:56:14 - 1.35 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.34 $ * + * Version: $Revision: 1.35 $ * ***/ /* @@ -286,13 +286,12 @@ env-l=l; #ifdef WIN32 -env-soName=env-globalPool-calloc(env, env-globalPool, strlen(file_name)+1); +env-soName=env-globalPool-pstrdup(env, env-globalPool, file_name); if( env-soName == NULL ){ env-l-jkLog(env, env-l, JK_LOG_ERROR, Error creating env-soName\n); return; } -strcpy(env-soName,file_name); #else env-soName=NULL; #endif -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
hgomez 2002/06/03 04:24:25 Modified:jk/native2/server/apache2 mod_jk2.c Log: Others apache 2.0 modules use ap_add_version_component in post config phase (ie DAV2). Having it done in child init make it appears too late to be present in error.log. Revision ChangesPath 1.32 +6 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- mod_jk2.c 1 Jun 2002 15:40:09 - 1.31 +++ mod_jk2.c 3 Jun 2002 11:24:25 - 1.32 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.31 $ * + * Version: $Revision: 1.32 $ * ***/ /* @@ -412,7 +412,8 @@ { workerEnv-init(env, workerEnv ); workerEnv-server_name = (char *)ap_get_server_version(); -ap_add_version_component(pconf, JK_EXPOSED_VERSION); +/* Should be done in post config instead (cf DAV2) */ +/* ap_add_version_component(pconf, JK_EXPOSED_VERSION); */ return NULL; } @@ -464,6 +465,9 @@ if(s-is_virtual) return OK; + +/* Other apache 2.0 modules add version info at post_config */ +ap_add_version_component(pconf, JK_EXPOSED_VERSION); env=workerEnv-globalEnv; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 2002/06/01 08:40:09 Modified:jk/native2/common jk_vm_default.c jk/native2/server/apache2 mod_jk2.c Log: 2 fixes from Mladen Turk: eliminate double version and add support for another JVM layout style. Thanks. Revision ChangesPath 1.16 +1 -0 jakarta-tomcat-connectors/jk/native2/common/jk_vm_default.c Index: jk_vm_default.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_vm_default.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- jk_vm_default.c 24 May 2002 04:29:22 - 1.15 +++ jk_vm_default.c 1 Jun 2002 15:40:09 - 1.16 @@ -151,6 +151,7 @@ */ static const char *defaultVM_PATH[]={ ${JAVA_HOME}${fs}jre${fs}bin${fs}classic${fs}libjvm.${so}, +${JAVA_HOME}${fs}jre${fs}bin${fs}client${fs}jvm.${so}, ${JAVA_HOME}${fs}jre${fs}lib${fs}${arch}${fs}classic${fs}libjvm.${so}, ${JAVA_HOME}${fs}jre${fs}lib${fs}${arch}${fs}client${fs}libjvm.${so}, ${JAVA_HOME}${fs}jre${fs}bin${fs}classic${fs}jvm.${so}, 1.31 +1 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- mod_jk2.c 31 May 2002 22:27:17 - 1.30 +++ mod_jk2.c 1 Jun 2002 15:40:09 - 1.31 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.30 $ * + * Version: $Revision: 1.31 $ * ***/ /* @@ -464,8 +464,6 @@ if(s-is_virtual) return OK; - -ap_add_version_component(pconf, JK_EXPOSED_VERSION); env=workerEnv-globalEnv; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 2002/05/31 15:27:17 Modified:jk/native2/common jk_worker_status.c jk/native2/include jk_uriEnv.h jk/native2/server/apache2 mod_jk2.c Log: Remove debug. Fix a bug in merging the uriEnvs ( if Location is used ) and avoid duplicating the merge. Revision ChangesPath 1.28 +0 -2 jakarta-tomcat-connectors/jk/native2/common/jk_worker_status.c Index: jk_worker_status.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_status.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- jk_worker_status.c31 May 2002 18:21:00 - 1.27 +++ jk_worker_status.c31 May 2002 22:27:16 - 1.28 @@ -339,8 +339,6 @@ stat-totalTime=0; stat-maxTime=0; #endif -env-l-jkLog(env, env-l, JK_LOG_INFO, reset() %s %p %p %p %d %d %d %d\n, - JK_CHECK_NULL(slot-name), data, statArray, stat, i, j, stat-reqCnt, stat-errCnt ); } } } 1.15 +1 -0 jakarta-tomcat-connectors/jk/native2/include/jk_uriEnv.h Index: jk_uriEnv.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_uriEnv.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- jk_uriEnv.h 15 May 2002 19:32:42 - 1.14 +++ jk_uriEnv.h 31 May 2002 22:27:17 - 1.15 @@ -207,6 +207,7 @@ int envvars_in_use; struct jk_map *envvars; +int merged; /** XXX . */ /* int status; */ 1.30 +36 -18jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- mod_jk2.c 31 May 2002 18:29:48 - 1.29 +++ mod_jk2.c 31 May 2002 22:27:17 - 1.30 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.29 $ * + * Version: $Revision: 1.30 $ * ***/ /* @@ -233,19 +233,45 @@ } -static void *jk2_merge_dir_config(apr_pool_t *p, void *basev, void *addv) +static void *jk2_merge_dir_config(apr_pool_t *p, void *childv, void *parentv) { -jk_uriEnv_t *base =(jk_uriEnv_t *)basev; -jk_uriEnv_t *add = (jk_uriEnv_t *)addv; -jk_uriEnv_t *new = (jk_uriEnv_t *)apr_pcalloc(p,sizeof(jk_uriEnv_t)); - +jk_uriEnv_t *child =(jk_uriEnv_t *)childv; +jk_uriEnv_t *parent = (jk_uriEnv_t *)parentv; + +if( child-merged != JK_TRUE ) { +/* Merge options from parent. + */ +if( parent-mbean-debug 0 ) /* Inherit debugging */ +child-mbean-debug = parent-mbean-debug; + +if( child-workerName==NULL ) { +child-workerName=parent-workerName; +child-worker=parent-worker; +} +if( child-virtual==NULL ) { +child-virtual=parent-virtual; +child-aliases=parent-aliases; +} +if( child-contextPath==NULL ) { +child-contextPath=parent-contextPath; +child-ctxt_len=parent-ctxt_len; +} +/* XXX Shuld we merge env vars ? + */ + +/* When we merged to top - mark and stop duplicating the work + */ +if( parent-uri == NULL ) +child-merged=JK_TRUE; -if( base-mbean-debug 0 ) { -fprintf(stderr, mod_jk2:mergeDirConfig() Merged dir config %p %p %s %s\n, -base, new, base-uri, add-uri); + +if( child-mbean-debug -1 ) { +fprintf(stderr, mod_jk2:mergeDirConfig() Merged dir config %p %s %s %s %s\n, +child, child-uri, parent-uri, child-workerName, parent-workerName); +} } -return add; +return childv; } /** Basic initialization for jk2. @@ -571,8 +597,6 @@ mod_jk.handler() serving %s with %p %p %s\n, uriEnv-mbean-localName, worker, worker-mbean, worker-mbean-localName ); -fprintf( stderr, XXX 1 %p %p\n, worker, worker-rPoolCache ); - /* Get a pool for the request XXX move it
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
nacho 02/05/29 07:30:07 Modified:jk/native2/server/apache2 mod_jk2.c Log: * fixing the build for win32.. Thanks to Mladen Turk Revision ChangesPath 1.27 +3 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- mod_jk2.c 29 May 2002 00:13:00 - 1.26 +++ mod_jk2.c 29 May 2002 14:30:07 - 1.27 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.26 $ * + * Version: $Revision: 1.27 $ * ***/ /* @@ -293,7 +293,7 @@ if( env-soName == NULL ){ env-l-jkLog(env, env-l, JK_LOG_ERROR, Error creating env-soName\n); -return env; +return; } strcpy(env-soName,file_name); #else @@ -729,7 +729,7 @@ ULONG ulReason, // Reason why NT called this DLL LPVOID lpReserved) // Reserved parameter for future use { -GetModuleFileName( hInst, file_name, sizeof(file_name))); +GetModuleFileName( hInst, file_name, sizeof(file_name)); return TRUE; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/05/29 10:51:23 Modified:jk/native2 build.xml jk/native2/common jk_channel_un.c jk_config.c jk_env.c jk_shm.c jk_worker_status.c jk/native2/include jk_env.h jk/native2/jni jk_jni_aprImpl.c jk/native2/server/apache2 mod_jk2.c Log: A bunch of changes - mostly to get around the shm behavior on HPUX. On some HPUX-es ( and possibly other platforms ) the mmap will fail if the child is mapping the same file. The solution is to map in the parent and inherit it in the child. That's what we do - using the top apr pool to store a note with the shm pointer. I also added a command to jkstatus to allow reseting the endpoint counters ( for tunning you typically run few 1000s requests to 'warm up' the server, and then do the real tests - the jkstatus gives a very good info on how much time is spent on server - and how much is in jk versus tomcat ) Revision ChangesPath 1.31 +2 -18 jakarta-tomcat-connectors/jk/native2/build.xml Index: build.xml === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/build.xml,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- build.xml 23 May 2002 23:30:52 - 1.30 +++ build.xml 29 May 2002 17:51:23 - 1.31 @@ -214,23 +214,6 @@ defineset refid=jk2-defs/ -!-- -defineset id=jk2-defs - define name=_REENTRANT / - define name=CHUNK_SIZE value=4096 / - define name=USE_APACHE_MD5 / - define name=HAS_APR / - define name=HAVE_JNI / - - define name=HPUX11 if=hpux / - define name=WIN32 if=win32 / - define name=_WINDOWS if=win32 / - define name=_MBCS if=win32 / - define name=_USRDLL if=win32 / - define name=MOD_JK2_EXPORTS if=win32 / -/defineset --- - syslibset libs=libhttpd if=win32 / syslibset libs=libapr if=win32 / syslibset libs=libaprutil if=win32 / @@ -318,6 +301,7 @@ import fileName=gdi32.lib if=win32 / import fileName=winspool.lib if=win32 / import fileName=comdlg32.lib if=win32 /-- + linkOpt value=/libpath:quot;${apr.lib}quot; if=win32 / linkOpt value=/libpath:quot;${apr-util.lib}quot; if=win32 / linkOpt value=/libpath:quot;${apache2.home}/libquot; if=win32 / @@ -379,7 +363,7 @@ def name=XP_NETWARE if=netware info=Building for NetWare platform / def name=HAS_APR -info=JNI is no based on APR / +info=JNI is now based on APR / def name=HAVE_JNI / import fileName=${novellndk.home}/imports/clib.imp if=netware / 1.9 +0 -1 jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c Index: jk_channel_un.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_un.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- jk_channel_un.c 28 May 2002 22:40:25 - 1.8 +++ jk_channel_un.c 29 May 2002 17:51:23 - 1.9 @@ -214,7 +214,6 @@ */ } -fprintf(stderr, init %p %d %d\n, socketInfo, socketInfo-listenSocket, ch-serverSide ); return rc; } 1.23 +3 -3 jakarta-tomcat-connectors/jk/native2/common/jk_config.c Index: jk_config.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_config.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- jk_config.c 29 May 2002 00:10:17 - 1.22 +++ jk_config.c 29 May 2002 17:51:23 - 1.23 @@ -58,7 +58,7 @@ /*** * Description: General purpose config object * * Author: Gal Shachor [EMAIL PROTECTED] * - * Version: $Revision: 1.22 $ * + * Version: $Revision: 1.23 $ * ***/ #include jk_global.h @@ -519,14 +519,14 @@ if( cfg-file==NULL ) { env-l-jkLog(env, env-l, JK_LOG_ERROR, - config.update(): No config file ); + config.update(): No config file\n ); return JK_ERR; } rc=stat(cfg-file, statbuf); if (rc == -1) { env-l-jkLog(env, env-l, JK_LOG_ERROR, - config.update(): Can't find config file %s,
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
nacho 02/05/28 17:13:00 Modified:jk/native2/server/apache2 mod_jk2.c Log: * Getting soName for mod_jk2, now it's possible to log to native win32 logger from apache Revision ChangesPath 1.26 +28 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- mod_jk2.c 22 May 2002 23:44:23 - 1.25 +++ mod_jk2.c 29 May 2002 00:13:00 - 1.26 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.25 $ * + * Version: $Revision: 1.26 $ * ***/ /* @@ -82,6 +82,10 @@ #include util_script.h +#ifdef WIN32 +static char file_name[_MAX_PATH]; +#endif + /* * Jakarta (jk_) include files */ @@ -284,6 +288,17 @@ env-l=l; +#ifdef WIN32 +env-soName=env-globalPool-calloc(env, env-globalPool, strlen(file_name)+1); + +if( env-soName == NULL ){ +env-l-jkLog(env, env-l, JK_LOG_ERROR, Error creating env-soName\n); +return env; +} +strcpy(env-soName,file_name); +#else +env-soName=NULL; +#endif /* We should make it relative to JK_HOME or absolute path. ap_server_root_relative(cmd-pool,opt); */ @@ -708,3 +723,15 @@ jk2_register_hooks /* register hooks */ }; +#ifdef WIN32 + +BOOL WINAPI DllMain(HINSTANCE hInst,// Instance Handle of the DLL +ULONG ulReason, // Reason why NT called this DLL +LPVOID lpReserved) // Reserved parameter for future use +{ +GetModuleFileName( hInst, file_name, sizeof(file_name))); +return TRUE; +} + + +#endif \ No newline at end of file -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/05/22 16:44:23 Modified:jk/native2/server/apache2 mod_jk2.c Log: Remove printfs. I tested apache2 with Location JkSet group lb /Location, seem to work fine ( with Apache doing the mapping ). No time for ab tests now. Revision ChangesPath 1.25 +8 -11 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- mod_jk2.c 17 May 2002 00:31:55 - 1.24 +++ mod_jk2.c 22 May 2002 23:44:23 - 1.25 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.24 $ * + * Version: $Revision: 1.25 $ * ***/ /* @@ -236,14 +236,11 @@ jk_uriEnv_t *new = (jk_uriEnv_t *)apr_pcalloc(p,sizeof(jk_uriEnv_t)); -/* XXX */ -fprintf(stderr, XXX Merged dir config %p %p %s %s\n, -base, new, base-uri, add-uri); +if( base-mbean-debug 0 ) { +fprintf(stderr, mod_jk2:mergeDirConfig() Merged dir config %p %p %s %s\n, +base, new, base-uri, add-uri); +} -/* if( add-webapp == NULL ) { */ -/* add-webapp=base-webapp; */ -/* } */ - return add; } @@ -627,9 +624,9 @@ * but that's too complex for now. */ if( uriEnv!= NULL uriEnv-workerName != NULL) { -env-l-jkLog(env, env-l, JK_LOG_INFO, - PerDir mapping %s=%s\n, - r-uri, uriEnv-workerName); +if( uriEnv-mbean-debug 0 ) +env-l-jkLog(env, env-l, JK_LOG_INFO, + PerDir mapping %s=%s\n,r-uri, uriEnv-workerName); ap_set_module_config( r-request_config, jk2_module, uriEnv ); r-handler=JK_HANDLER; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c
costin 02/05/16 13:54:18 Modified:jk/native2/server/apache2 mod_jk2.c jk_service_apache2.c Log: We can't call find_by_pid in init() because the scoreboard may not be initialized or the process may not be registered. We can't call it in service() because linux will return the pid of the thread, which has nothing to do with the child id ( so it won't be found in the scoreboard ). We need the right pid to find the childId - it used to be available in connection_rec. We need the childId because there's no easy way to allocate a slot in the jk scoreboard ( or detect a slot is no longer used ). The current workaround is to get the pid in init(), which is called ( hopefully ) in the child main thread ( which is registered in the scoreboard ). And we find the child_num in service, when the scoreboard is supposed to be ok. ( we do the same for apache1.3 - since child_num is only available on the first connection ) Revision ChangesPath 1.23 +4 -9 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- mod_jk2.c 15 May 2002 19:46:46 - 1.22 +++ mod_jk2.c 16 May 2002 20:54:18 - 1.23 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.22 $ * + * Version: $Revision: 1.23 $ * ***/ /* @@ -78,6 +78,7 @@ #include http_protocol.h #include http_main.h #include http_log.h +#include scoreboard.h #include util_script.h @@ -324,7 +325,7 @@ fprintf( stderr, Create config for virtual host\n); } else { /* Default host */ -fprintf( stderr, Create config for main host\n); +/* fprintf( stderr, Create config for main host\n); */ } jkb = workerEnv-globalEnv-createBean2( workerEnv-globalEnv, @@ -369,11 +370,6 @@ static char * jk2_init(jk_env_t *env, apr_pool_t *pconf, jk_workerEnv_t *workerEnv, server_rec *s ) { -apr_proc_t proc; - -proc.pid=getpid(); -workerEnv-childId=find_child_by_pid( proc ); - workerEnv-init(env, workerEnv ); workerEnv-server_name = (char *)ap_get_server_version(); ap_add_version_component(pconf, JK_EXPOSED_VERSION); @@ -450,6 +446,7 @@ workerEnv-parentInit( env, workerEnv); + /* if(!workerEnv-was_initialized) { */ /* workerEnv-was_initialized = JK_OK; */ @@ -492,13 +489,11 @@ */ static int jk2_handler(request_rec *r) { -const char *worker_name; jk_logger_t *l=NULL; int rc; jk_worker_t *worker=NULL; jk_endpoint_t *end = NULL; jk_uriEnv_t *uriEnv; -jk_uriEnv_t *dirEnv; jk_env_t *env; jk_workerEnv_t *workerEnv; 1.21 +30 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c Index: jk_service_apache2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/jk_service_apache2.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- jk_service_apache2.c 15 May 2002 19:46:46 - 1.20 +++ jk_service_apache2.c 16 May 2002 20:54:18 - 1.21 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * Author: Gal Shachor [EMAIL PROTECTED] * Henri Gomez [EMAIL PROTECTED] - * Version: $Revision: 1.20 $ + * Version: $Revision: 1.21 $ */ #include apu_compat.h @@ -354,7 +354,36 @@ /* Common initialization */ /* XXX Probably not needed, we're duplicating */ jk2_requtil_initRequest(env, s); + +/* Ugly hack to get the childId - the index used in the scoreboard, + which we'll use in the jk scoreboard +*/ +if( workerEnv-childId == -1 ) +{ +apr_proc_t proc; +proc.pid=workerEnv-childProcessId; + +/* detect if scoreboard exists, the method will SIGFLT + since it doesn't check internally +
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/05/14 09:57:37 Modified:jk/native2/common jk_workerEnv.c jk/native2/include jk_workerEnv.h jk/native2/server/apache2 mod_jk2.c Log: Add a 'childId' in workerEnv. This will be used as an index in the jk scoreboard. Also added a mechanism to dump the requests/responses ( if the debug level for a uri is 10 ). Revision ChangesPath 1.40 +19 -12jakarta-tomcat-connectors/jk/native2/common/jk_workerEnv.c Index: jk_workerEnv.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_workerEnv.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- jk_workerEnv.c9 May 2002 23:47:31 - 1.39 +++ jk_workerEnv.c14 May 2002 16:57:37 - 1.40 @@ -59,7 +59,7 @@ * Description: Workers controller * * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.39 $ * + * Version: $Revision: 1.40 $ * ***/ #include jk_env.h @@ -136,8 +136,8 @@ env-l-jkLog(env, env-l, JK_LOG_DEBUG, destroy worker %s\n, wEnv-worker_map-nameAt(env, wEnv-worker_map, i)); -if( w-destroy !=NULL ) -w-destroy(env,w); +if( w-mbean-destroy !=NULL ) +w-mbean-destroy(env,w-mbean); } } env-l-jkLog(env, env-l, JK_LOG_DEBUG, @@ -176,10 +176,10 @@ if( w-mbean-state = JK_STATE_INIT ) return JK_OK; -if( w-init == NULL ) +if( w-mbean-init == NULL ) return JK_OK; -rc=w-init(env, w); +rc=w-mbean-init(env, w-mbean ); if( rc == JK_OK ) { w-mbean-state=JK_STATE_INIT; @@ -413,7 +413,7 @@ if( ep-worker-mbean-debug 0 ) env-l-jkLog(env, env-l, JK_LOG_INFO, - ajp14.processCallbacks() Waiting reply %s\n, + workerEnv.callbacks() %s\n, ep-worker-channel-mbean-name); msg-reset(env, msg); @@ -422,11 +422,14 @@ msg); if( rc!=JK_OK ) { env-l-jkLog(env, env-l, JK_LOG_ERROR, - ajp14.service() Error reading reply\n); -/* we just can't recover, unset recover flag */ + workerEnv.processCallbacks() Error reading reply\n); +/* We can recover */ return JK_ERR; } +if( ep-worker-mbean-debug 10 ) +ep-request-dump( env, msg, Received ); + /* ep-reply-dump(env, ep-reply, Received ); */ code = (int)msg-getByte(env, msg); rc=jk2_workerEnv_dispatch( env, wEnv, req, ep, code, msg ); @@ -449,7 +452,10 @@ * A possible work-around could be to store the uploaded * data to file and replay for it */ -ep-recoverable = JK_FALSE; +ep-recoverable = JK_FALSE; +if( ep-worker-mbean-debug 10 ) +ep-request-dump( env, ep-post, Apache-tomcat ); + rc = ep-worker-channel-send(env, ep-worker-channel, ep, ep-post ); if (rc 0) { env-l-jkLog(env, env-l, JK_LOG_ERROR, @@ -535,8 +541,8 @@ env-l-jkLog(env, env-l, JK_LOG_ERROR, workerEnv.addWorker() duplicated %s worker \n, w-mbean-name); -if( w-destroy != NULL ) -oldW-destroy(env, oldW); +if( w-mbean-destroy != NULL ) +oldW-mbean-destroy(env, oldW-mbean); } return JK_OK; @@ -694,7 +700,8 @@ wEnv-config-workerEnv = wEnv; wEnv-config-map = wEnv-initData; - +wEnv-childId=-1; + jkb=env-createBean2(env, wEnv-pool,shm, ); if( jkb==NULL ) { wEnv-shm=NULL; 1.19 +8 -1 jakarta-tomcat-connectors/jk/native2/include/jk_workerEnv.h Index: jk_workerEnv.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_workerEnv.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- jk_workerEnv.h8 May 2002 23:47:27 - 1.18 +++ jk_workerEnv.h14 May 2002 16:57:37 - 1.19 @@ -58,7 +58,7 @@ /*** * Description:
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
hgomez 02/05/13 03:22:00 Modified:jk/native2/server/apache2 mod_jk2.c Log: mod_jk2 wasn't (no more) reporting itself in list of module loaded Revision ChangesPath 1.19 +3 -1 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- mod_jk2.c 9 May 2002 21:13:12 - 1.18 +++ mod_jk2.c 13 May 2002 10:22:00 - 1.19 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.18 $ * + * Version: $Revision: 1.19 $ * ***/ /* @@ -425,6 +425,8 @@ if(s-is_virtual) return OK; + +ap_add_version_component(pconf, JK_EXPOSED_VERSION); env=workerEnv-globalEnv; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/05/03 11:44:03 Modified:jk/native2/common jk_channel_apr_socket.c jk_requtil.c jk/native2/include jk_service.h jk/native2/server/apache13 mod_jk2.c jk/native2/server/apache2 mod_jk2.c Log: Even less debugging. Replace 'send' with 'write' - JFC, do you remember why we used send ?? Revision ChangesPath 1.13 +8 -7 jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c Index: jk_channel_apr_socket.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_apr_socket.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_channel_apr_socket.c 3 May 2002 18:10:58 - 1.12 +++ jk_channel_apr_socket.c 3 May 2002 18:44:03 - 1.13 @@ -442,17 +442,18 @@ } #ifdef HAVE_UNIXSOCKETS while(sent len) { -this_time = send(unixsock, (char *)b + sent , len - sent, 0); +/* this_time = send(unixsock, (char *)b + sent , len - sent, 0); */ +this_time = write(unixsock, (char *)b + sent , len - sent); env-l-jkLog(env, env-l, JK_LOG_INFO, channel.apr:send() send() %d %d %s\n, this_time, errno, strerror( errno)); -if( errno != 0 ) { -env-l-jkLog(env, env-l, JK_LOG_ERROR, - channel.apr:send() send() %d %d %s\n, this_time, errno, - strerror( errno)); -return -2; -} +/* if( errno != 0 ) { */ +/* env-l-jkLog(env, env-l, JK_LOG_ERROR, */ +/* channel.apr:send() send() %d %d %s\n, this_time, errno, */ +/* strerror( errno)); */ +/* return -2; */ +/* } */ if(0 == this_time) { return -2; } 1.13 +13 -7 jakarta-tomcat-connectors/jk/native2/common/jk_requtil.c Index: jk_requtil.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_requtil.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_requtil.c 25 Apr 2002 19:22:19 - 1.12 +++ jk_requtil.c 3 May 2002 18:44:03 - 1.13 @@ -529,7 +529,12 @@ int i; int headerCount; int rc; +int debug=0; +if( s-uriEnv != NULL ) { +debug=s-uriEnv-debug; +} + rc=jk2_requtil_getMethodId(env, s-method, method); if (rc!=JK_OK) { env-l-jkLog(env, env-l, JK_LOG_ERROR, @@ -570,8 +575,9 @@ return JK_ERR; } } else { -env-l-jkLog(env, env-l, JK_LOG_INFO, - serialize.request() Add headerName %s\n, name); +if( debug 0 ) +env-l-jkLog(env, env-l, JK_LOG_INFO, + serialize.request() Add headerName %s\n, name); if (msg-appendString(env, msg, name)) { env-l-jkLog(env, env-l, JK_LOG_ERROR, serialize.request() Error serializing header name\n); @@ -579,9 +585,6 @@ } } -/* env-l-jkLog(env, env-l, JK_LOG_INFO, */ -/*serialize.request() Add headerValue %s\n, */ -/* s-headers_in-valueAt( env, s-headers_in, i)); */ if (msg-appendString(env, msg, s-headers_in-valueAt( env, s-headers_in, i))) { env-l-jkLog(env, env-l, JK_LOG_ERROR, @@ -695,9 +698,11 @@ handle.request() Error serializing end marker\n); return JK_ERR; } + -env-l-jkLog(env, env-l, JK_LOG_INFO, - serialize.request() serialized %s\n, s-req_uri); +if( debug 0 ) +env-l-jkLog(env, env-l, JK_LOG_INFO, + serialize.request() serialized %s\n, s-req_uri); /* msg-dump( env, msg, Dump: ); */ return JK_OK; @@ -1017,6 +1022,7 @@ s-ssl_cipher = NULL; s-ssl_session = NULL; s-jvm_route= NULL; +s-uriEnv = NULL; s-outBuf=NULL; s-jkprintf=jk2_requtil_printf; 1.13 +5 -1 jakarta-tomcat-connectors/jk/native2/include/jk_service.h Index: jk_service.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_service.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_service.h 24 Apr 2002 23:12:50 - 1.12 +++ jk_service.h 3 May 2002 18:44:03 -
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/04/19 15:30:46 Modified:jk/native2/server/apache2 mod_jk2.c Log: uriEnv may be null ( and we have workerEnv in a static variable ). Thanks Nacho:-) Revision ChangesPath 1.12 +2 -4 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- mod_jk2.c 18 Apr 2002 22:56:13 - 1.11 +++ mod_jk2.c 19 Apr 2002 22:30:46 - 1.12 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.11 $ * + * Version: $Revision: 1.12 $ * ***/ /* @@ -598,16 +598,14 @@ */ static int jk2_translate(request_rec *r) { -jk_workerEnv_t *workerEnv; jk_uriEnv_t *uriEnv; jk_env_t *env; -if(r-proxyreq) { +if(r-proxyreq || workerEnv==NULL) { return DECLINED; } uriEnv=ap_get_module_config( r-per_dir_config, jk2_module ); -workerEnv=uriEnv-workerEnv; /* get_env() */ env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/04/18 15:56:13 Modified:jk/native2/server/apache2 mod_jk2.c Log: Call init in child_init, post config is not the right point. Revision ChangesPath 1.11 +27 -22jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_jk2.c 15 Apr 2002 23:57:42 - 1.10 +++ mod_jk2.c 18 Apr 2002 22:56:13 - 1.11 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.10 $ * + * Version: $Revision: 1.11 $ * ***/ /* @@ -357,26 +357,6 @@ } -/** Standard apache callback, initialize jk. - */ -static void jk2_child_init(apr_pool_t *pconf, - server_rec *s) -{ -jk_uriEnv_t *serverEnv=(jk_uriEnv_t *) -ap_get_module_config(s-module_config, jk2_module); -jk_env_t *env; - -if( workerEnv==NULL ) -workerEnv = serverEnv-workerEnv; - -env=workerEnv-globalEnv; - -env-l-jkLog(env, env-l, JK_LOG_INFO, mod_jk child init\n ); - -/* jk2_init( pconf, conf, s ); - do we need jk2_child_init? For ajp14? */ -} - /** Initialize jk, using worker.properties. We also use apache commands ( JkWorker, etc), but this use is deprecated, as we'll try to concentrate all config in @@ -458,14 +438,39 @@ env-l-jkLog(env, env-l, JK_LOG_ERROR, mod_jk.post_config() second invocation\n ); + + +/* if(!workerEnv-was_initialized) { */ +/* workerEnv-was_initialized = JK_TRUE; */ + +/* jk2_init( env, pconf, workerEnv, s ); */ +/* } */ +return OK; +} + +/** Standard apache callback, initialize jk. + */ +static void jk2_child_init(apr_pool_t *pconf, + server_rec *s) +{ +jk_uriEnv_t *serverEnv=(jk_uriEnv_t *) +ap_get_module_config(s-module_config, jk2_module); +jk_env_t *env; + +if( workerEnv==NULL ) +workerEnv = serverEnv-workerEnv; + +env=workerEnv-globalEnv; + +env-l-jkLog(env, env-l, JK_LOG_INFO, mod_jk child init %d\n, workerEnv-was_initialized ); if(!workerEnv-was_initialized) { workerEnv-was_initialized = JK_TRUE; jk2_init( env, pconf, workerEnv, s ); } -return OK; } + /* = */ /* The JK module handlers*/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/04/15 16:57:42 Modified:jk/native2/server/apache2 mod_jk2.c Log: Fix stupid error - now the 2 config phases are corectly detected. The first step we call the setters - that would allow validation and warnings for invalid settings. The second step we call the real init(). Revision ChangesPath 1.10 +9 -6 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mod_jk2.c 11 Apr 2002 19:35:48 - 1.9 +++ mod_jk2.c 15 Apr 2002 23:57:42 - 1.10 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.9 $ * + * Version: $Revision: 1.10 $ * ***/ /* @@ -402,19 +402,21 @@ */ static int jk2_apache2_isValidating(apr_pool_t *gPool, apr_pool_t **mainPool) { apr_pool_t *tmpPool=NULL; -void *data=NULL; +char *data=NULL; int i; for( i=0; i10; i++ ) { tmpPool=apr_pool_get_parent( gPool ); if( tmpPool == NULL ) { +/* fprintf(stderr, XXX Found Root pool %p\n, gPool ); */ break; } gPool=tmpPool; } -if( tmpPool == NULL ) { +if( tmpPool != NULL ) { /* We can't detect the root pool */ +/* fprintf(stderr, XXX Can't find root pool\n ); */ return JK_FALSE; } if(mainPool != NULL ) @@ -446,19 +448,20 @@ rc=jk2_apache2_isValidating( plog, gPool ); -if( rc == JK_TRUE ) { +if( rc == JK_TRUE gPool != NULL ) { /* This is the first step */ -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_ERROR, mod_jk.post_config() first invocation\n); apr_pool_userdata_set( INITOK, mod_jk_init, NULL, gPool ); return OK; } -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_ERROR, mod_jk.post_config() second invocation\n ); if(!workerEnv-was_initialized) { workerEnv-was_initialized = JK_TRUE; + jk2_init( env, pconf, workerEnv, s ); } return OK; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/04/11 12:35:48 Modified:jk/native2/server/apache2 mod_jk2.c Log: Set server root. Fix stupid {} problem. Revision ChangesPath 1.9 +6 -3 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mod_jk2.c 5 Apr 2002 19:13:56 - 1.8 +++ mod_jk2.c 11 Apr 2002 19:35:48 - 1.9 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.8 $ * + * Version: $Revision: 1.9 $ * ***/ /* @@ -298,7 +298,9 @@ return; } -workerEnv-initData-add( env, workerEnv-initData, serverRoot, ap_server_root); +workerEnv-initData-add( env, workerEnv-initData, serverRoot, + workerEnv-pool-pstrdup( env, workerEnv-pool, ap_server_root)); +env-l-jkLog(env, env-l, JK_LOG_ERROR, Set serverRoot %s\n, ap_server_root); /* Local initialization */ workerEnv-_private = s; @@ -623,9 +625,10 @@ to support SetHandler, we can add it back easily */ /* Check JkMount directives, if any */ -if( workerEnv-uriMap-size == 0 ) +if( workerEnv-uriMap-size == 0 ) { workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return DECLINED; +} /* XXX TODO: Split mapping, similar with tomcat. First step will be a quick test ( the context mapper ), with no allocations. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/04/05 11:13:56 Modified:jk/native2/server/apache2 mod_jk2.c Log: Added a pre-defined serverRoot variable, to resolve paths. Right now the best way is to not use relative paths, but ${serverRoot}/logs/... or ${serverRoot}/conf/jk2.properties. Revision ChangesPath 1.8 +4 -2 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- mod_jk2.c 26 Mar 2002 03:04:54 - 1.7 +++ mod_jk2.c 5 Apr 2002 19:13:56 - 1.8 @@ -59,7 +59,7 @@ * Description: Apache 2 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.7 $ * + * Version: $Revision: 1.8 $ * ***/ /* @@ -292,12 +292,14 @@ jkb=env-createBean2( env, env-globalPool,workerEnv, ); workerEnv= jkb-object; env-alias( env, workerEnv: , workerEnv); - + if( workerEnv==NULL ) { env-l-jkLog(env, env-l, JK_LOG_ERROR, Error creating workerEnv\n); return; } +workerEnv-initData-add( env, workerEnv-initData, serverRoot, ap_server_root); + /* Local initialization */ workerEnv-_private = s; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/03/18 20:55:57 Modified:jk/native2/server/apache13 jk_service_apache13.c mod_jk2.c jk/native2/server/apache2 mod_jk2.c Log: Finally got the apache1.3 to start ( still has few problems, but it's close ). Cleaned up the code, removed all the tricks and apache specific code - the apache1.3 connector can be used as a base for iis/nes. The apache2.0 will remain a bit more complicated, i.e. will support location and other apache specific options. Revision ChangesPath 1.2 +1 -12 jakarta-tomcat-connectors/jk/native2/server/apache13/jk_service_apache13.c Index: jk_service_apache13.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache13/jk_service_apache13.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_service_apache13.c 25 Feb 2002 22:44:36 - 1.1 +++ jk_service_apache13.c 19 Mar 2002 04:55:57 - 1.2 @@ -483,17 +483,8 @@ } } -int jk2_service_apache13_factory(jk_env_t *env, - jk_pool_t *pool, - void **result, - char *type, - char *name) +int jk2_service_apache13_init(jk_env_t *env, jk_ws_service_t *s) { -jk_ws_service_t *s = *result; -if( s==NULL ) { -s=(jk_ws_service_t *)pool-calloc(env, pool, sizeof(jk_ws_service_t)); -} - if(s==NULL ) { return JK_FALSE; } @@ -504,7 +495,5 @@ s-init = jk2_init_ws_service; s-afterRequest = jk2_service_apache13_afterRequest; -*result=(void *)s; - return JK_TRUE; } 1.5 +91 -228 jakarta-tomcat-connectors/jk/native2/server/apache13/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache13/mod_jk2.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- mod_jk2.c 18 Mar 2002 18:47:18 - 1.4 +++ mod_jk2.c 19 Mar 2002 04:55:57 - 1.5 @@ -59,13 +59,12 @@ * Description: Apache 1.3 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.4 $ * + * Version: $Revision: 1.5 $ * ***/ /* * mod_jk: keeps all servlet/jakarta related ramblings together. */ -/* #include ap_config.h */ #include httpd.h #include http_config.h #include http_request.h @@ -74,8 +73,6 @@ #include http_main.h #include http_log.h #include util_script.h -/* #include util_date.h */ -/* #include http_conf_globals.h */ /* * Jakarta (jk_) include files @@ -90,170 +87,110 @@ #include jk_uriMap.h #include jk_requtil.h -/* #include jk_apache2.h */ - #define JK_HANDLER (jakarta-servlet2) #define JK_MAGIC_TYPE (application/x-jakarta-servlet2) module MODULE_VAR_EXPORT jk2_module; +int jk2_service_apache13_init(jk_env_t *env, jk_ws_service_t *s); -static jk_workerEnv_t *workerEnv; +/* In apache1.3 this is reset when the module is reloaded ( after + * config. No good way to discover if it's the first time or not. + */ +static jk_workerEnv_t *workerEnv; /* Options setters */ + /* * JkSet name value * - * Set jk options. Same as using workers.properties. - * Common properties: see workers.properties documentation + * Set jk options. Same as using workers.properties or a + * config application. + * + * Known properties: see workers.properties documentation + * + * XXX Shouldn't abuse it, there is no way to write back + * the properties. */ -static const char *jk2_set2(cmd_parms *cmd,void *per_dir, +static const char *jk2_set2(cmd_parms *cmd, void *per_dir, const char *name, char *value) { server_rec *s = cmd-server; jk_uriEnv_t *serverEnv=(jk_uriEnv_t *) ap_get_module_config(s-module_config, jk2_module); - -jk_workerEnv_t *workerEnv = serverEnv-workerEnv; -char *type=(char *)cmd-info; jk_env_t *env=workerEnv-globalEnv; int rc; -if( type==NULL || type[0]=='\0') { -/* Generic Jk2Set foo bar */ -workerEnv-config-setPropertyString( env, workerEnv-config, name, value ); -} else if( strcmp(type, env)==0) { -workerEnv-envvars_in_use = JK_TRUE; -
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
costin 02/02/28 16:45:58 Modified:jk/native2/common jk_registry.h jk_uriMap.c jk_worker_status.c jk/native2/include jk_uriEnv.h jk/native2/server/apache13 mod_jk2.c jk/native2/server/apache2 mod_jk2.c Added: jk/native2/common jk_uriEnv.c Log: Move the uriEnv code in a separate object. Fix jk2 for apache1.3 ( again, compiles - I haven't tested it yet ). Few more fixes. Revision ChangesPath 1.8 +8 -1 jakarta-tomcat-connectors/jk/native2/common/jk_registry.h Index: jk_registry.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_registry.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- jk_registry.h 21 Feb 2002 11:12:11 - 1.7 +++ jk_registry.h 1 Mar 2002 00:45:58 - 1.8 @@ -62,7 +62,7 @@ /*** * Description: Worker list* - * Version: $Revision: 1.7 $ * + * Version: $Revision: 1.8 $ * ***/ /** Static declarations for all 'hardcoded' modules. This is a hack, @@ -154,3 +154,10 @@ int JK_METHOD jk2_handler_response_factory(jk_env_t *env, jk_pool_t *pool, void **result, const char *type, const char *name); + +int JK_METHOD jk2_uriMap_factory(jk_env_t *env, jk_pool_t *pool, void **result, + const char *type, const char *name); + +int JK_METHOD jk2_uriEnv_factory(jk_env_t *env, jk_pool_t *pool, void **result, + const char *type, const char *name); + 1.16 +13 -146 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.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- jk_uriMap.c 28 Feb 2002 23:07:01 - 1.15 +++ jk_uriMap.c 1 Mar 2002 00:45:58 - 1.16 @@ -67,19 +67,13 @@ * servlet container. * * Author: Gal Shachor [EMAIL PROTECTED] - * Version: $Revision: 1.15 $ + * Version: $Revision: 1.16 $ */ #include jk_pool.h #include jk_env.h #include jk_uriMap.h - -int JK_METHOD jk2_uriMap_factory(jk_env_t *env, jk_pool_t *pool, void **result, - const char *type, const char *name); - -static int jk2_uriMap_init(jk_env_t *env, jk_uriMap_t *_this, - jk_workerEnv_t *workerEnv, - jk_map_t *init_data); +#include jk_registry.h static jk_uriEnv_t *jk2_uriMap_addMapping(jk_env_t *env, jk_uriMap_t *_this, const char *vhost, @@ -174,50 +168,21 @@ return JK_TRUE; } -/* XXX Move to uriEnv.c */ -static jk_uriEnv_t *jk2_uriEnv_setProperty(jk_env_t *env, - jk_uriEnv_t *uriEnv, - const char *nameParam, - const char *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 ); -if( strcmp(worker, name) == 0 ) { -uriEnv-workerName=val; -} - -} - - static jk_uriEnv_t *jk2_uriEnv_createUriEnv(jk_env_t *env, jk_uriMap_t *uriMap, -const char *vhost, -const char *path) +char *vhost, +char *path) { -jk_pool_t *uriPool; int err; jk_uriEnv_t *uriEnv; -jk_workerEnv_t *wEnv=uriMap-workerEnv; -/** Will be discarded/flushed on reload */ -/** XXX Group by webapp */ -uriPool=(jk_pool_t *)uriMap-pool-create( env, uriMap-pool, - HUGE_POOL_SIZE); +jk2_uriEnv_factory( env,
cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c
hgomez 02/02/22 02:04:34 Added: jk/native2/server/apache2 mod_jk2.c Log: Renaming mod_jk.c to mod_jk2.c to allow Apache directive IfModule mod_jk2.c /IfModule Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c Index: mod_jk2.c === /* = * * * * The Apache Software License, Version 1.1 * * * * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * * * * Redistribution and use in source and binary forms, with or without modi- * * fication, are permitted provided that the following conditions are met: * * * * 1. Redistributions of source code must retain the above copyright notice * *notice, this list of conditions and the following disclaimer. * * * * 2. Redistributions in binary form must reproduce the above copyright * *notice, this list of conditions and the following disclaimer in the * *documentation and/or other materials provided with the distribution. * * * * 3. The end-user documentation included with the redistribution, if any, * *must include the following acknowlegement: * * * * This product includes software developed by the Apache Software * *Foundation http://www.apache.org/. * * * *Alternately, this acknowlegement may appear in the software itself, if * *and wherever such third-party acknowlegements normally appear. * * * * 4. The names The Jakarta Project, Jk, and Apache Software * *Foundation must not be used to endorse or promote products derived * *from this software without prior written permission. For written * *permission, please contact [EMAIL PROTECTED].* * * * 5. Products derived from this software may not be called Apache nor may * *Apache appear in their names without prior written permission of the * *Apache Software Foundation.* * * * THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES * * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * * THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY * * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * * POSSIBILITY OF SUCH DAMAGE. * * * * = * * * * This software consists of voluntary contributions made by many indivi- * * duals on behalf of the Apache Software Foundation. For more information * * on the Apache Software Foundation, please see http://www.apache.org/. * * * * = */ /*** *