knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject knox git commit: KNOX-685] - Knox tests cleanup after Jetty 9 upgrade. Test slow hostname resolution of 0.0.0.0.
Date Wed, 09 Mar 2016 19:29:01 GMT
Repository: knox
Updated Branches:
  refs/heads/master df0fe7cef -> 8013ff479


KNOX-685] - Knox tests cleanup after Jetty 9 upgrade. Test slow hostname resolution of 0.0.0.0.


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/8013ff47
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/8013ff47
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/8013ff47

Branch: refs/heads/master
Commit: 8013ff479afd7c4df24b1af35746af6940fb332a
Parents: df0fe7c
Author: Kevin Minder <kminder@apache.org>
Authored: Wed Mar 9 14:28:51 2016 -0500
Committer: Kevin Minder <kminder@apache.org>
Committed: Wed Mar 9 14:28:51 2016 -0500

----------------------------------------------------------------------
 .../gateway/filter/rewrite/api/UrlRewriteServletFilter.java   | 1 +
 .../gateway/filter/rewrite/impl/UrlRewriteResponse.java       | 7 +++++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/8013ff47/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/api/UrlRewriteServletFilter.java
----------------------------------------------------------------------
diff --git a/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/api/UrlRewriteServletFilter.java
b/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/api/UrlRewriteServletFilter.java
index a9ed62b..f8f8f74 100644
--- a/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/api/UrlRewriteServletFilter.java
+++ b/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/api/UrlRewriteServletFilter.java
@@ -61,6 +61,7 @@ public class UrlRewriteServletFilter extends AbstractGatewayFilter {
     FilterConfig config = getConfig();
     UrlRewriteRequest rewriteRequest = new UrlRewriteRequest( config, request );
     UrlRewriteResponse rewriteResponse = new UrlRewriteResponse( config, rewriteRequest,
response );
+    LOG.debug("URL-REWRITE-SERVLET-FILTER:DO-FILTER: FILTER");
     chain.doFilter( rewriteRequest, rewriteResponse );
     LOG.debug("URL-REWRITE-SERVLET-FILTER:DO-FILTER: END");
   }

http://git-wip-us.apache.org/repos/asf/knox/blob/8013ff47/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/impl/UrlRewriteResponse.java
----------------------------------------------------------------------
diff --git a/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/impl/UrlRewriteResponse.java
b/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/impl/UrlRewriteResponse.java
index 5e4aae3..d07cc17 100644
--- a/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/impl/UrlRewriteResponse.java
+++ b/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/impl/UrlRewriteResponse.java
@@ -32,6 +32,7 @@ import org.apache.hadoop.gateway.util.urltemplate.Params;
 import org.apache.hadoop.gateway.util.urltemplate.Parser;
 import org.apache.hadoop.gateway.util.urltemplate.Template;
 import org.apache.commons.io.IOUtils;
+import org.apache.log4j.Logger;
 
 import javax.activation.MimeType;
 import javax.servlet.FilterConfig;
@@ -63,6 +64,8 @@ import static org.apache.hadoop.gateway.filter.rewrite.impl.UrlRewriteUtil.pickF
  */
 public class UrlRewriteResponse extends GatewayResponseWrapper implements Params, ResponseStreamer
{
 
+  private static Logger LOGGER = Logger.getLogger( UrlRewriteResponse.class );
+
   private static final UrlRewriteMessages LOG = MessagesFactory.get( UrlRewriteMessages.class
);
 
   // An 8K buffer better matches the underlying buffer sizes.
@@ -222,9 +225,13 @@ public class UrlRewriteResponse extends GatewayResponseWrapper implements
Params
   private String getRequestLocalHostName() {
     String hostName = request.getLocalName();
     try {
+      LOGGER.debug( "LOOKUP HOSTNAME FOR " + hostName );
       hostName = InetAddress.getByName( hostName ).getHostName();
+      LOGGER.debug( "FOUND HOSTNAME " + hostName );
     } catch( UnknownHostException e ) {
       // Ignore it and use the original hostname.
+      LOGGER.debug( "FAILED TO RESOLVE " + hostName );
+      e.printStackTrace();
     }
     return hostName;
   }


Mime
View raw message