tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 36155] - tomcat chooses wrong host if using mod_jk
Date Sat, 03 Mar 2007 05:59:03 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36155>.
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=36155





------- Additional Comments From skoehler@upb.de  2007-03-02 21:59 -------
So the bug is in the class org.apache.tomcat.util.buf.MessageBytes.

The method setBytes doesn't clear the char-buffer. And the method setChars
doesn't clear the byte-buffer.

If useIPVHosts is enabled, then the parameter "host" of the
org.apache.tomcat.util.http.mapper.map()-method is a MessageBytes-Object of the
type T_BYTES. The method MessageBytes.toChars()-method is called. But this
method exists, if the charbuffer is already filled.

And in deed, the char-buffer is already filled. While the byte-buffer contains
the value "host1", the char-buffer may still contain the value "host2" because
the MessageBytes objects are reused. And instead of converting the
byte-buffer-value "host1" to chars, the old value "host2" is used. This resulted
in the bug.

So the following patch fixes the problem.


With your permission, i would like to clean up the class MessageBytes.
It really needs it - IMHO.


-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message