Re: VirtualHost inheritance (was Re: [Bug 43753] ...)

2007-11-02 Thread Rainer Jung
Mladen Turk schrieb:
> Rainer Jung wrote:
>> Hi,
>>
>> be careful:
> 
> OK :)
> 
>>
>> I also added an option JkMountCopyAll,
> 
> OK, but clone is called when there is no "JkMountCopy All" defined
> if (sconf && sconf->was_initialized == JK_TRUE && jk_mount_copy_all ==
> JK_FALSE) {
> clone_jk_config
> 
> So if there is *no* module directives and JkMountCopy All is not defined
> the clone_jk_config is still called (without mounts but with copied
> envvars).

Yes, at the moment I don't trust the state handling ...
I still need to check and fix that.

To not clone if JkMountCopyAll is set is OK, because then we
automatically use the same config struct, as the parent vhost. httpd
simply does not call our create structure in this case and instead
inhertis the full structure automatically.

We only want to clone (and empty the JkMounts), if we have an "empty"
vhost, but don't want to inherit the JkMounts (the latter being the
default).

>> which automatically puts a
>> JkMountCopy into every vhost and saves memory, because we then do not
>> clone but instead share the config struct (if no other jk directives are
>> in the vhost).
> 
> But they use different apr_pools with different lifetime, so that might
> be the problem later. Cloned configs although allocated don't register
> pool cleanup

OK. Needs fixing.

> Anyhow the envvar tables should be NULLed in clone, cause
> merge will later concatenate them for each vhost.

That's easy and most likely the point. Then we have the same question here:

- we shouldn't inherit JkEnvVars by default between vhosts
- we could have an option to inherit them (like JkEnvVarCopy) per vhost
and one to inherit them globally (JkEnvVarCopyAll).

Why is globally ineriting interesting in its own: if people use a lot of
vhosts (hundreds), with global inheritance of everything (mounts and
vars), they can automatically share the same jk config structure and
save quite some memory.

> Regards,
> Mladen.

Regards,

Rainer

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: VirtualHost inheritance (was Re: [Bug 43753] ...)

2007-11-02 Thread Mladen Turk

Rainer Jung wrote:

Hi,

be careful:


OK :)



I also added an option JkMountCopyAll,


OK, but clone is called when there is no "JkMountCopy All" defined
if (sconf && sconf->was_initialized == JK_TRUE && jk_mount_copy_all == 
JK_FALSE) {
clone_jk_config

So if there is *no* module directives and JkMountCopy All is not defined
the clone_jk_config is still called (without mounts but with copied
envvars).



which automatically puts a
JkMountCopy into every vhost and saves memory, because we then do not
clone but instead share the config struct (if no other jk directives are
in the vhost).


But they use different apr_pools with different lifetime, so that might
be the problem later. Cloned configs although allocated don't register
pool cleanup

Anyhow the envvar tables should be NULLed in clone, cause
merge will later concatenate them for each vhost.

Regards,
Mladen.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: VirtualHost inheritance (was Re: [Bug 43753] ...)

2007-11-02 Thread Rainer Jung
Hi,

be careful: I added clone after 1.2.25 exaxctly because of the problem,
that the Apache API doesn't call the config create callback for a vhost,
if the vhost contains no config directives for some module.

In our situation we have the following assumptions:

- we don't want to automatically inherit JkMounts between vhosts.
  That's documented and usually what you want. Content can be very
difficult between vhosts.
- we need a separate config structure for every vhost

This is why I introduced the clone. It's a copy without the mounts.

I also added an option JkMountCopyAll, which automatically puts a
JkMountCopy into every vhost and saves memory, because we then do not
clone but instead share the config struct (if no other jk directives are
in the vhost).

Although I thought I had it fixed and tested, Jean-Frederic found a bug
with was_initialized which lets me think, that I got the "we already
initialized this vhost" markers wrong. It is still open for me to do the
final cleanup (correct markers for initialized state and cloned state)
and I might have an hour today to do so.

Regards,

Rainer

Mladen Turk schrieb:
> Ian Ward Comfort wrote:
>>
>> I don't know if this is intended behavior, or a bug in mod_jk, or even
>> a bug in Apache, but something seems amiss.  Thoughts?
>>
> 
> Your patch won't work.
> The real problem is in the initialization for vhosts where
> when there is *any* Jk directive the create_jk_config is called
> while where there isn't the clone_jk_config is called.
> 
> clone_jk_config is bogus, and doesn't behave like it should
> (copy only the basic data and no mounts)
> 
> Regards,
> Mladen

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: VirtualHost inheritance (was Re: [Bug 43753] ...)

2007-11-02 Thread Mladen Turk

Ian Ward Comfort wrote:


clone_jk_config is bogus, and doesn't behave like it should
(copy only the basic data and no mounts)


Was this function introduced since 1.2.25? 


Yes, I was talking about trunk not 1.2.25

Regards,
Mladen

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 43647] - Content-Type changes unexpectedly from text/html to text/plain

2007-11-02 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43647





--- Additional Comments From [EMAIL PROTECTED]  2007-11-02 04:37 ---
The question is not silly at all. I think we are talking about:

http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/java/org/apache/jk/core/MsgContext.java?view=diff&r1=580814&r2=580815&pathrev=580815

which is a patch to the Tomcat AJP connector.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 41939] - NPE in Logging due to classloading

2007-11-02 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41939


[EMAIL PROTECTED] changed:

   What|Removed |Added

 CC||[EMAIL PROTECTED]




--- Additional Comments From [EMAIL PROTECTED]  2007-11-02 13:27 ---
I'm wary of the implications of the comments in this bug. Let me summarize to
make sure we're all on the same level. I'm coming from bug 40212, btw.

- To get per-app logging, one has to use the setup of comment #16 (one instance
of log4j and commons-logging per tomcat and per webapp).

- If you do this, you can get NPEs at the next startup because Tomcat clears
static fields during undeploy.

Can you explain to me how it can be possible that the instance N+1 of my webapp
can see anything from instance N? If that would happen, it would either mean 

a) that tomcat is handing me classes which are in the common classpath despite
them being overridden in my webapp
b) that I get references to classes which ought no to exist anymore

a) means that classes from tomcat leak into my webapp and b) means that classes
from instance N can leak into N+1. Neither must be possible.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Are Sticky Sessions really necessary?

2007-11-02 Thread Stephen Wick
The Tomcat 5.5 "Clustering/Session Replication Guide" says, "Make sure
that your loadbalancer is configured for sticky session mode."  However,
I don't see the term "Sticky" sessions anywhere in the Servlet 2.3 or
2.4 specifications.
 
Are sticky sessions really required for clustering to function properly
in Tomcat 5.5?  I thought that session replication would eliminate any
need to direct a client session to one node in a cluster.
 
If not, can we adjust the documentation to indicate that Sticky sessions
are optional, for the appropriate reason (I'm guessing the advent of
session replication in tomcat.)
 
I am asking this question because I am having trouble with Sticky
sessions in my load balancer, and I need to know whether or not I should
pursue fixing this feature.  If tomcat doesn't really require sticky
sessions, then I can leave my load balancer alone.  If tomcat does need
the feature to function properly, then I need to go to some additional
expense to resolve the issue with my load balancing appliance.
 
Thank you for your time and expertise.
 
Stephen Wick
Interactive Developer
Nicholson Kovac, Inc.
 
References
http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html


Re: Are Sticky Sessions really necessary?

2007-11-02 Thread Len Popp
You can indeed use session replication without sticky sessions, and
the session data will be copied to all the Tomcat servers. However it
may be inefficient. You probably have to use synchronous replication
to ensure the session data is consistent across the cluster, which
adds latency to the requests. And there could be a lot of extra
network traffic in the cluster if it's busy (which it is, otherwise
you wouldn't be doing load balancing).

(I haven't used session replication in a high-load situation. Maybe
someone else can tell us how well it works.)
-- 
Len

On 11/2/07, Stephen Wick <[EMAIL PROTECTED]> wrote:
> The Tomcat 5.5 "Clustering/Session Replication Guide" says, "Make sure
> that your loadbalancer is configured for sticky session mode."  However,
> I don't see the term "Sticky" sessions anywhere in the Servlet 2.3 or
> 2.4 specifications.
>
> Are sticky sessions really required for clustering to function properly
> in Tomcat 5.5?  I thought that session replication would eliminate any
> need to direct a client session to one node in a cluster.
>
> If not, can we adjust the documentation to indicate that Sticky sessions
> are optional, for the appropriate reason (I'm guessing the advent of
> session replication in tomcat.)
>
> I am asking this question because I am having trouble with Sticky
> sessions in my load balancer, and I need to know whether or not I should
> pursue fixing this feature.  If tomcat doesn't really require sticky
> sessions, then I can leave my load balancer alone.  If tomcat does need
> the feature to function properly, then I need to go to some additional
> expense to resolve the issue with my load balancing appliance.
>
> Thank you for your time and expertise.
>
> Stephen Wick
> Interactive Developer
> Nicholson Kovac, Inc.
>
> References
> http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r591502 - in /tomcat/connectors/trunk/jk/native/common: jk_map.c jk_map.h

2007-11-02 Thread rjung
Author: rjung
Date: Fri Nov  2 15:55:58 2007
New Revision: 591502

URL: http://svn.apache.org/viewvc?rev=591502&view=rev
Log:
Adding jk_map_copy().
Such a function existed in mod_jk.c. Since it's general purpose
we move it to jk_map.

Modified:
tomcat/connectors/trunk/jk/native/common/jk_map.c
tomcat/connectors/trunk/jk/native/common/jk_map.h

Modified: tomcat/connectors/trunk/jk/native/common/jk_map.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_map.c?rev=591502&r1=591501&r2=591502&view=diff
==
--- tomcat/connectors/trunk/jk/native/common/jk_map.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_map.c Fri Nov  2 15:55:58 2007
@@ -596,6 +596,24 @@
 }
 }
 
+int jk_map_copy(jk_map_t *src, jk_map_t *dst)
+{
+int sz = jk_map_size(src);
+int i;
+for (i = 0; i < sz; i++) {
+const char *name = jk_map_name_at(src, i);
+if (jk_map_get(dst, name, NULL) == NULL) {
+if (!jk_map_put(dst, name,
+jk_pool_strdup(&dst->p, jk_map_get_string(src, 
name, NULL)),
+NULL)) {
+return JK_FALSE;
+}
+}
+}
+return JK_TRUE;
+}
+
+
 static void trim_prp_comment(char *prp)
 {
 #if defined(AS400) && !defined(AS400_UTF8)

Modified: tomcat/connectors/trunk/jk/native/common/jk_map.h
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_map.h?rev=591502&r1=591501&r2=591502&view=diff
==
--- tomcat/connectors/trunk/jk/native/common/jk_map.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_map.h Fri Nov  2 15:55:58 2007
@@ -82,6 +82,8 @@
 
 void jk_map_dump(jk_map_t *m, jk_logger_t *l);
 
+int jk_map_copy(jk_map_t *src, jk_map_t *dst);
+
 /**
  *  Replace $(property) in value.
  *



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r591504 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c

2007-11-02 Thread rjung
Author: rjung
Date: Fri Nov  2 16:00:52 2007
New Revision: 591504

URL: http://svn.apache.org/viewvc?rev=591504&view=rev
Log:
Use new general purpose function jk_map_copy()
instead of httpd private copy_jk_map().

Modified:
tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=591504&r1=591503&r2=591504&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Fri Nov  2 16:00:52 
2007
@@ -2278,23 +2278,6 @@
 }
 
 
-static void copy_jk_map(ap_pool * p, server_rec * s, jk_map_t *src,
-jk_map_t *dst)
-{
-int sz = jk_map_size(src);
-int i;
-for (i = 0; i < sz; i++) {
-const char *name = jk_map_name_at(src, i);
-if (jk_map_get(dst, name, NULL) == NULL) {
-if (!jk_map_put (dst, name,
- ap_pstrdup(p, jk_map_get_string(src, name, NULL)),
-NULL)) {
-jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, "Memory error");
-}
-}
-}
-}
-
 static void *merge_jk_config(ap_pool * p, void *basev, void *overridesv)
 {
 jk_server_conf_t *base = (jk_server_conf_t *) basev;
@@ -2361,8 +2344,9 @@
 overrides->mount_file_reload = base->mount_file_reload;
 if (overrides->mountcopy == JK_TRUE ||
 (overrides->mountcopy == JK_UNSET && jk_mount_copy_all == JK_TRUE)) {
-copy_jk_map(p, overrides->s, base->uri_to_context,
-overrides->uri_to_context);
+if (jk_map_copy(base->uri_to_context, overrides->uri_to_context) == 
JK_FALSE) {
+jk_error_exit(APLOG_MARK, APLOG_EMERG, overrides->s, p, 
"Memory error");
+}
 if (!overrides->mount_file)
 overrides->mount_file = base->mount_file;
 if (!overrides->alias_dir)

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=591504&r1=591503&r2=591504&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Fri Nov  2 16:00:52 
2007
@@ -2398,25 +2398,6 @@
 }
 
 
-/** Utility - copy a map . XXX Should move to jk_map, it's generic code.
- */
-static void copy_jk_map(apr_pool_t * p, server_rec * s, jk_map_t *src,
-jk_map_t *dst)
-{
-int sz = jk_map_size(src);
-int i;
-for (i = 0; i < sz; i++) {
-const char *name = jk_map_name_at(src, i);
-if (jk_map_get(dst, name, NULL) == NULL) {
-if (!jk_map_put(dst, name,
-apr_pstrdup(p, jk_map_get_string(src, name, NULL)),
-NULL)) {
-jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, "Memory error");
-}
-}
-}
-}
-
 /** Standard apache callback, merge jk options specified in 
 context or .
  */
@@ -2486,8 +2467,9 @@
 overrides->mount_file_reload = base->mount_file_reload;
 if (overrides->mountcopy == JK_TRUE ||
 (overrides->mountcopy == JK_UNSET && jk_mount_copy_all == JK_TRUE)) {
-copy_jk_map(p, overrides->s, base->uri_to_context,
-overrides->uri_to_context);
+if (jk_map_copy(base->uri_to_context, overrides->uri_to_context) == 
JK_FALSE) {
+jk_error_exit(APLOG_MARK, APLOG_EMERG, overrides->s, p, 
"Memory error");
+}
 if (!overrides->mount_file)
 overrides->mount_file = base->mount_file;
 if (!overrides->alias_dir)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r591507 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c

2007-11-02 Thread rjung
Author: rjung
Date: Fri Nov  2 16:09:52 2007
New Revision: 591507

URL: http://svn.apache.org/viewvc?rev=591507&view=rev
Log:
Add utility function to mod_jk.c for merging
two tables.
Copy an entry from src to dst, if there is no
entry for the same key in dst.

Modified:
tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=591507&r1=591506&r2=591507&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Fri Nov  2 16:09:52 
2007
@@ -2278,6 +2278,26 @@
 }
 
 
+/*
+ * Utility - copy items from apr table src to dst,
+ * for keys that exist in src but not in dst.
+ */
+static void merge_apr_table(apr_table_t *src, apr_table_t *dst)
+{
+int i;
+const array_header *arr;
+const table_entry *elts;
+
+arr = ap_table_elts(src);
+elts = (const table_entry *)arr->elts;
+for (i = 0; i < arr->nelts; ++i) {
+if (!ap_table_get(dst, elts[i].key)) {
+ap_table_setn(dst, elts[i].key, elts[i].val);
+}
+}
+}
+
+
 static void *merge_jk_config(ap_pool * p, void *basev, void *overridesv)
 {
 jk_server_conf_t *base = (jk_server_conf_t *) basev;
@@ -2314,29 +2334,14 @@
 overrides->options |= (base->options & ~base->exclude_options);
 
 if (base->envvars_in_use) {
-int i;
-const array_header *arr;
-const table_entry *elts;
 
-arr = ap_table_elts(base->envvars);
-if (arr) {
+if (ap_table_elts(base->envvars)) {
 overrides->envvars_in_use = JK_TRUE;
-elts = (const table_entry *)arr->elts;
-for (i = 0; i < arr->nelts; ++i) {
-if (!ap_table_get(overrides->envvars, elts[i].key)) {
-ap_table_setn(overrides->envvars, elts[i].key, 
elts[i].val);
-}
-}
+merge_apr_table(base->envvars, overrides->envvars);
 }
-arr = ap_table_elts(base->envvars_def);
-if (arr) {
+if (ap_table_elts(base->envvars_def)) {
 overrides->envvars_in_use = JK_TRUE;
-elts = (const table_entry *)arr->elts;
-for (i = 0; i < arr->nelts; ++i) {
-if (!ap_table_get(overrides->envvars_def, elts[i].key)) {
-ap_table_setn(overrides->envvars_def, elts[i].key, 
elts[i].val);
-}
-}
+merge_apr_table(base->envvars_def, overrides->envvars_def);
 }
 }
 

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=591507&r1=591506&r2=591507&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Fri Nov  2 16:09:52 
2007
@@ -2398,6 +2398,26 @@
 }
 
 
+/*
+ * Utility - copy items from apr table src to dst,
+ * for keys that exist in src but not in dst.
+ */
+static void merge_apr_table(apr_table_t *src, apr_table_t *dst)
+{
+int i;
+const apr_array_header_t *arr;
+const apr_table_entry_t *elts;
+
+arr = apr_table_elts(src);
+elts = (const apr_table_entry_t *)arr->elts;
+for (i = 0; i < arr->nelts; ++i) {
+if (!apr_table_get(dst, elts[i].key)) {
+apr_table_setn(dst, elts[i].key, elts[i].val);
+}
+}
+}
+
+
 /** Standard apache callback, merge jk options specified in 
 context or .
  */
@@ -2437,29 +2457,13 @@
 overrides->options |= (base->options & ~base->exclude_options);
 
 if (base->envvars_in_use) {
-int i;
-const apr_array_header_t *arr;
-const apr_table_entry_t *elts;
-
-arr = apr_table_elts(base->envvars);
-if (arr) {
+if (apr_table_elts(base->envvars)) {
 overrides->envvars_in_use = JK_TRUE;
-elts = (const apr_table_entry_t *)arr->elts;
-for (i = 0; i < arr->nelts; ++i) {
-if (!apr_table_get(overrides->envvars, elts[i].key)) {
-apr_table_setn(overrides->envvars, elts[i].key, 
elts[i].val);
-}
-}
+merge_apr_table(base->envvars, overrides->envvars);
 }
-arr = apr_table_elts(base->envvars_def);
-if (arr) {
+if (apr_table_elts(base->envvars_def)) {
 overrides->envvars_in_use = JK_TRUE;
-elts = (const apr_table_entry_t *)arr->elts;
-for (i = 0; i < arr->nelts; ++i) {
-if (!apr_table_get(overrides->envvars_def, elts[i].key)) {
-apr_table_setn(overrides->envvars_d

svn commit: r591510 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c

2007-11-02 Thread rjung
Author: rjung
Date: Fri Nov  2 16:19:11 2007
New Revision: 591510

URL: http://svn.apache.org/viewvc?rev=591510&view=rev
Log:
Fix configuration initialization behaviour for virtual hosts,
which contain no JK directive.
HTTPD does not call create_jk_config or merge_jk_config for those hosts.
It simply uses the same config structure as for the surrounding host.
We don't want that, because by default we don't inherit JkMounts between vhosts.
So we need to create a new configuration structure for such vhosts.
We detect this situation by checking the server_rec we put into our
configuration structure against the server_rec of the vhost. Igf they don't 
match,
we found a shared configuration structure and replace it by a new one created 
with
create_jk_config and merged via merge_jk_config.

The function clone_jk_config introduced some weeks ago is not used any more
(less code duplication).

In case JkMountCopyAll was set, we actually don't need the configuration
structure created by ourselves for empty vhost, because then all config items 
are
really shared.

Modified:
tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=591510&r1=591509&r2=591510&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Fri Nov  2 16:19:11 
2007
@@ -2254,31 +2254,6 @@
 
 
 /*
- *  Clone jk config.
- */
-static void *clone_jk_config(ap_pool * p, server_rec *s)
-{
-jk_server_conf_t *src =
-(jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
-jk_server_conf_t *dst =
-(jk_server_conf_t *) ap_pcalloc(p, sizeof(jk_server_conf_t));
-
-memcpy(dst, src, sizeof(jk_server_conf_t));
-dst->was_initialized = JK_TRUE;
-dst->s = s;
-dst->mountcopy = 0;
-dst->mount_file = NULL;
-dst->alias_dir = NULL;
-dst->uri_to_context = NULL;
-if (!uri_worker_map_alloc(&(dst->uw_map), NULL, dst->log)) {
-jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, "Memory error");
-}
-
-return dst;
-}
-
-
-/*
  * Utility - copy items from apr table src to dst,
  * for keys that exist in src but not in dst.
  */
@@ -2511,11 +2486,21 @@
 for (; srv; srv = srv->next) {
 jk_server_conf_t *sconf = (jk_server_conf_t 
*)ap_get_module_config(srv->module_config,

&jk_module);
-if (sconf && sconf->was_initialized == JK_TRUE && jk_mount_copy_all == 
JK_FALSE) {
-ap_set_module_config(srv->module_config, &jk_module,
- clone_jk_config(p, srv));
+
+/*
+ * If a virtual server contains no JK directive, httpd shares
+ * the config structure. But we don't want to share some settings
+ * by default, especially the JkMount rules.
+ * Therefore we check, if this config structure really belongs to this
+ * vhost, otherwise we create a new one and merge.
+ */
+if (sconf && sconf->s != srv && jk_mount_copy_all == JK_FALSE) {
+jk_server_conf_t *srvconf = (jk_server_conf_t 
*)create_jk_config(p, srv);
+srvconf = (jk_server_conf_t *)merge_jk_config(p, sconf, srvconf);
+ap_set_module_config(srv->module_config, &jk_module, srvconf);
 }
-else if (sconf && sconf->was_initialized == JK_FALSE) {
+
+if (sconf && sconf->was_initialized == JK_FALSE) {
 sconf->was_initialized = JK_TRUE;
 open_jk_log(srv, p);
 sconf->options &= ~sconf->exclude_options;

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=591510&r1=591509&r2=591510&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Fri Nov  2 16:19:11 
2007
@@ -2373,31 +2373,6 @@
 }
 
 
-/** Clone jk config.
- */
-static void *clone_jk_config(apr_pool_t * p, server_rec *s)
-{
-jk_server_conf_t *src =
-(jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
-jk_server_conf_t *dst =
-(jk_server_conf_t *) apr_pcalloc(p, sizeof(jk_server_conf_t));
-
-memcpy(dst, src, sizeof(jk_server_conf_t));
-dst->was_initialized = JK_TRUE;
-dst->s = s;
-dst->mountcopy = 0;
-dst->mount_file = NULL;
-dst->alias_dir = NULL;
-dst->uri_to_context = NULL;
-if (!uri_worker_map_alloc(&(dst->uw_map), NULL, dst->log)) {
-jk_error_exit(APLOG_MARK, APLOG_EMERG, s,
-  s->process->pool, "Memory error");
-}
-
-return dst;

svn commit: r591512 - in /tomcat/connectors/trunk/jk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xdocs/miscellaneous/changelog.xml

2007-11-02 Thread rjung
Author: rjung
Date: Fri Nov  2 16:26:28 2007
New Revision: 591512

URL: http://svn.apache.org/viewvc?rev=591512&view=rev
Log:
Apache: Allow JkMount and JkUnMount patterns to start with '*' and '?' in 
addition to '/'.

Modified:
tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=591512&r1=591511&r2=591512&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Fri Nov  2 16:26:28 
2007
@@ -867,8 +867,8 @@
 return "JkMount can not have a path when defined in a location";
 }
 
-if (c[0] != '/')
-return "JkMount context should start with /";
+if (c[0] != '/' && c[0] != '?' && c[0] != '*')
+return "JkMount context should start with '/', '*' or '?'.";
 
 /*
  * Add the new worker to the alias map.
@@ -909,8 +909,8 @@
 else
 return "JkUnMount can not have a path when defined in a location";
 }
-if (c[0] != '/')
-return "JkUnMount context should start with /";
+if (c[0] != '/' && c[0] != '?' && c[0] != '*')
+return "JkUnMount context should start with '/', '*' or '?'.";
 uri = ap_pstrcat(cmd->temp_pool, "!", c, NULL);
 /*
  * Add the new worker to the alias map.

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=591512&r1=591511&r2=591512&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Fri Nov  2 16:26:28 
2007
@@ -895,8 +895,8 @@
 return "JkMount can not have a path when defined in a location";
 }
 
-if (c[0] != '/')
-return "JkMount context should start with /";
+if (c[0] != '/' && c[0] != '?' && c[0] != '*')
+return "JkMount context should start with '/', '*' or '?'.";
 
 /*
  * Add the new worker to the alias map.
@@ -938,8 +938,8 @@
 return "JkUnMount can not have a path when defined in a location";
 }
 
-if (c[0] != '/')
-return "JkUnMount context should start with /";
+if (c[0] != '/' && c[0] != '?' && c[0] != '*')
+return "JkUnMount context should start with '/', '*' or '?'.";
 
 uri = apr_pstrcat(cmd->temp_pool, "!", c, NULL);
 /*

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml?rev=591512&r1=591511&r2=591512&view=diff
==
--- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Fri Nov  2 
16:26:28 2007
@@ -43,6 +43,10 @@
   
   
 
+  
+Apache: Allow JkMount and JkUnMount patterns to start with '*' and '?'
+in addition to '/'. (rjung)
+  
   
 43684: Replace JkMountFile by JkMountFileReload in
 uriworkermap.properties docs. (rjung)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r591514 - /tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c

2007-11-02 Thread rjung
Author: rjung
Date: Fri Nov  2 16:36:49 2007
New Revision: 591514

URL: http://svn.apache.org/viewvc?rev=591514&view=rev
Log:
Fix porting error from httpd 2.0/2.2 module to 1.3 module.

Modified:
tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=591514&r1=591513&r2=591514&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Fri Nov  2 16:36:49 
2007
@@ -2257,7 +2257,7 @@
  * Utility - copy items from apr table src to dst,
  * for keys that exist in src but not in dst.
  */
-static void merge_apr_table(apr_table_t *src, apr_table_t *dst)
+static void merge_apr_table(table *src, table *dst)
 {
 int i;
 const array_header *arr;



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r591522 - /tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c

2007-11-02 Thread rjung
Author: rjung
Date: Fri Nov  2 17:27:55 2007
New Revision: 591522

URL: http://svn.apache.org/viewvc?rev=591522&view=rev
Log:
Complete allowing mount patterns beginning with "*"
or "?" in addition to "/".

Modified:
tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c

Modified: tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c?rev=591522&r1=591521&r2=591522&view=diff
==
--- tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c Fri Nov  2 
17:27:55 2007
@@ -363,7 +363,7 @@
 return JK_FALSE;
 }
 
-if (*uri == '/') {
+if (*uri == '/' || *uri == '*' || *uri == '?') {
 uwr->uri = uri;
 uwr->context = uri;
 uwr->worker_name = jk_pool_strdup(&uw_map->p, worker);
@@ -397,7 +397,7 @@
  * not arrive here when using Apache.
  */
 jk_log(l, JK_LOG_ERROR,
-   "invalid context '%s': does not begin with '/'",
+   "invalid context '%s': does not begin with '/', '*' or '?'",
uri);
 JK_TRACE_EXIT(l);
 return JK_FALSE;



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r591524 - in /tomcat/connectors/trunk/jk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c

2007-11-02 Thread rjung
Author: rjung
Date: Fri Nov  2 17:38:35 2007
New Revision: 591524

URL: http://svn.apache.org/viewvc?rev=591524&view=rev
Log:
We created a new server config structure, but we didn't use it :(

Modified:
tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=591524&r1=591523&r2=591524&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Fri Nov  2 17:38:35 
2007
@@ -2496,8 +2496,8 @@
  */
 if (sconf && sconf->s != srv && jk_mount_copy_all == JK_FALSE) {
 jk_server_conf_t *srvconf = (jk_server_conf_t 
*)create_jk_config(p, srv);
-srvconf = (jk_server_conf_t *)merge_jk_config(p, sconf, srvconf);
-ap_set_module_config(srv->module_config, &jk_module, srvconf);
+sconf = (jk_server_conf_t *)merge_jk_config(p, sconf, srvconf);
+ap_set_module_config(srv->module_config, &jk_module, sconf);
 }
 
 if (sconf && sconf->was_initialized == JK_FALSE) {

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=591524&r1=591523&r2=591524&view=diff
==
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Fri Nov  2 17:38:35 
2007
@@ -2784,8 +2784,8 @@
  */
 if (sconf && sconf->s != srv && jk_mount_copy_all == JK_FALSE) 
{
 jk_server_conf_t *srvconf = (jk_server_conf_t 
*)create_jk_config(pconf, srv);
-srvconf = (jk_server_conf_t *)merge_jk_config(pconf, 
sconf, srvconf);
-ap_set_module_config(srv->module_config, &jk_module, 
srvconf);
+sconf = (jk_server_conf_t *)merge_jk_config(pconf, sconf, 
srvconf);
+ap_set_module_config(srv->module_config, &jk_module, 
sconf);
 }
 
 if (sconf && sconf->was_initialized == JK_FALSE) {



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 42003] - Need to increase the maximum buffer size for HTTP header from 16k to 64k.

2007-11-02 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42003





--- Additional Comments From [EMAIL PROTECTED]  2007-11-02 19:17 ---
Please try combining

native\iis\jk_isapi_plugin.c(1977): char huge_buf[64 * 1024];

with the attribute max_packet_size first. See the description on the docs page

http://tomcat.apache.org/connectors-doc/reference/workers.html

especially for the related config parameter on the Tomcat side.

Please report your findings back.

Thanks!

Rainer

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Are Sticky Sessions really necessary?

2007-11-02 Thread Peter Rossbach

Hi,

It is not only ineffizient and a risk, Read 7.7.2 at the spec:

SRV.7.7.2 Distributed Environments
Within an application marked as distributable, all requests that are  
part of a session
must be handled by one Java Virtual Machine1 (“JVM”) at a time. The  
container
must be able to handle all objects placed into instances of the  
HttpSession class

using the setAttribute or putValue methods appropriately.


regards
Peter

Am 02.11.2007 um 22:37 schrieb Len Popp:


You can indeed use session replication without sticky sessions, and
the session data will be copied to all the Tomcat servers. However it
may be inefficient. You probably have to use synchronous replication
to ensure the session data is consistent across the cluster, which
adds latency to the requests. And there could be a lot of extra
network traffic in the cluster if it's busy (which it is, otherwise
you wouldn't be doing load balancing).

(I haven't used session replication in a high-load situation. Maybe
someone else can tell us how well it works.)
--
Len

On 11/2/07, Stephen Wick <[EMAIL PROTECTED]> wrote:
The Tomcat 5.5 "Clustering/Session Replication Guide" says, "Make  
sure
that your loadbalancer is configured for sticky session mode."   
However,

I don't see the term "Sticky" sessions anywhere in the Servlet 2.3 or
2.4 specifications.

Are sticky sessions really required for clustering to function  
properly
in Tomcat 5.5?  I thought that session replication would eliminate  
any

need to direct a client session to one node in a cluster.

If not, can we adjust the documentation to indicate that Sticky  
sessions

are optional, for the appropriate reason (I'm guessing the advent of
session replication in tomcat.)

I am asking this question because I am having trouble with Sticky
sessions in my load balancer, and I need to know whether or not I  
should

pursue fixing this feature.  If tomcat doesn't really require sticky
sessions, then I can leave my load balancer alone.  If tomcat does  
need
the feature to function properly, then I need to go to some  
additional

expense to resolve the issue with my load balancing appliance.

Thank you for your time and expertise.

Stephen Wick
Interactive Developer
Nicholson Kovac, Inc.

References
http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html



-
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]