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
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);
}
</subsection>
<subsection name="Coyote">
<changelog>
+ <fix>
+ <bug>47319</bug>: Return the client's IP address rather than null
+ for calls to <code>getRemoteHost()</code> when the APR connector is
+ used with <code>enableLookups="true"</code> but the IP address
+ is not resolveable. (markt)
+ </fix>
<add>
<bug>50108</bug>: Add get/set methods for Connector property
minSpareThreads. Patch provided by Eiji Takahashi. (markt)