From: markt Date: Thu, 6 Jan 2011 17:02:27 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47319 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1fc2921ef2158e3e11ae3f3866ec898fb657f5b5;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47319 Don't return null for getRemoteHost() if the IP address cannot be resolved. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1055938 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/http11/Http11AprProcessor.java b/java/org/apache/coyote/http11/Http11AprProcessor.java index ba0a21270..3eca711bd 100644 --- a/java/org/apache/coyote/http11/Http11AprProcessor.java +++ b/java/org/apache/coyote/http11/Http11AprProcessor.java @@ -464,6 +464,9 @@ public class Http11AprProcessor extends AbstractHttp11Processor { try { long sa = Address.get(Socket.APR_REMOTE, socketRef); remoteHost = Address.getnameinfo(sa, 0); + if (remoteHost == null) { + remoteHost = Address.getip(sa); + } } catch (Exception e) { log.warn(sm.getString("http11processor.socket.info"), e); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index a84210452..f7a884fa8 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -188,6 +188,12 @@ + + 47319: Return the client's IP address rather than null + for calls to getRemoteHost() when the APR connector is + used with enableLookups="true" but the IP address + is not resolveable. (markt) + 50108: Add get/set methods for Connector property minSpareThreads. Patch provided by Eiji Takahashi. (markt)