Author: remy.maucherat(a)jboss.com
Date: 2011-01-07 09:17:42 -0500 (Fri, 07 Jan 2011)
New Revision: 1638
Modified:
trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
trunk/java/org/apache/tomcat/util/http/Cookies.java
trunk/webapps/docs/changelog.xml
Log:
- Improve name only cookies.
- Fix APR getRemoteHost.
Modified: trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2011-01-07 13:59:04 UTC
(rev 1637)
+++ trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2011-01-07 14:17:42 UTC
(rev 1638)
@@ -1109,6 +1109,10 @@
try {
long sa = Address.get(Socket.APR_REMOTE, socket);
remoteHost = Address.getnameinfo(sa, 0);
+ if (remoteHost == null) {
+ remoteAddr = Address.getip(sa);
+ remoteHost = remoteAddr;
+ }
} catch (Exception e) {
log.warn(sm.getString("http11processor.socket.info"), e);
}
Modified: trunk/java/org/apache/tomcat/util/http/Cookies.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/Cookies.java 2011-01-07 13:59:04 UTC (rev
1637)
+++ trunk/java/org/apache/tomcat/util/http/Cookies.java 2011-01-07 14:17:42 UTC (rev
1638)
@@ -283,7 +283,7 @@
// cookie at the end of the cookie header, so if we
// are past the end of the header, but we have a name
// skip to the name-only part.
- if (pos < end && bytes[pos] == '=') {
+ if (pos < (end - 1) && bytes[pos] == '=') {
// Skip whitespace
do {
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2011-01-07 13:59:04 UTC (rev 1637)
+++ trunk/webapps/docs/changelog.xml 2011-01-07 14:17:42 UTC (rev 1638)
@@ -23,6 +23,12 @@
</subsection>
<subsection name="Coyote">
<changelog>
+ <fix>
+ <bug>49000</bug>: Improve name only cookie handling. (markt)
+ </fix>
+ <fix>
+ <bug>47319</bug>: Fix getRemoteHost() with APR when name cannot be
resolved. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
Show replies by date