Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse McConnell2013-01-29 16:48:33 -0500
committerJesse McConnell2013-01-29 16:48:33 -0500
commitc87cc4d4f09d06d44be1f056412a7baf7b2c758c (patch)
treec6eaff17a84c07d0a77388078ad636c90986926c
parentdd4a80288be67e548c2e30e5f36506de752a0da8 (diff)
downloadorg.eclipse.jetty.project-c87cc4d4f09d06d44be1f056412a7baf7b2c758c.tar.gz
org.eclipse.jetty.project-c87cc4d4f09d06d44be1f056412a7baf7b2c758c.tar.xz
org.eclipse.jetty.project-c87cc4d4f09d06d44be1f056412a7baf7b2c758c.zip
resolve compilation issues with statistics servlet post patch application
-rw-r--r--jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java
index 5f5c1b9f88..29dc04bf75 100644
--- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java
+++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/StatisticsServlet.java
@@ -22,6 +22,8 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -113,8 +115,16 @@ public class StatisticsServlet extends HttpServlet
private boolean isLoopbackAddress(String address)
{
- InetAddress address = InetAddress.getByName(address);
- return address.isLoopbackAddress();
+ try
+ {
+ InetAddress addr = InetAddress.getByName(address);
+ return addr.isLoopbackAddress();
+ }
+ catch (UnknownHostException e )
+ {
+ LOG.warn("Warning: attempt to access statistics servlet from " + address, e);
+ return false;
+ }
}
private void sendXmlResponse(HttpServletResponse response) throws IOException

Back to the top