Author: janb
Date: Fri Sep  5 19:17:33 2008
New Revision: 692606

URL: http://svn.apache.org/viewvc?rev=692606&view=rev
Log:
Do temporary fixup of matching Server host:port from url with HttpDestination 
InetSocketAddress on inbound security realm resolution. Better solution is to 
retain the exact host:port in HttpDestination so there is no DNS resolution 
necessary, and also no danger of the HttpDestination remembering an old IP 
address for a hostname that might resolve differently on each request.

Modified:
    
maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/DestinationRealmResolver.java

Modified: 
maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/DestinationRealmResolver.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/DestinationRealmResolver.java?rev=692606&r1=692605&r2=692606&view=diff
==============================================================================
--- 
maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/DestinationRealmResolver.java
 (original)
+++ 
maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/DestinationRealmResolver.java
 Fri Sep  5 19:17:33 2008
@@ -74,17 +74,18 @@
                //destination.isSecure && server.protocol == https || 
!destination.isSecure && server.protocol == http
                if (((dest.isSecure() && "https".equalsIgnoreCase(protocol)) || 
(!dest.isSecure() && "http".equalsIgnoreCase(protocol)))
                    &&
-                   (address.getPort() == port)
-                   &&
-                   (address.getHostName().equalsIgnoreCase(host)))
+                   (address.getPort() == port))
                {
-                   server = s;
-                   if (log.isDebugEnabled())
-                       log.debug("Matched server 
"+address.getHostName()+":"+address.getPort());
+                   if 
(address.getAddress().getHostAddress().equalsIgnoreCase(host) || 
address.getHostName().equalsIgnoreCase(host))
+                   {
+                       server = s;
+                       if (log.isDebugEnabled())
+                           log.debug("Matched server 
"+address.getHostName()+":"+address.getPort());
+                   }
                }
            }
        }
-       
+
        if (server == null || server.getServerCredentials() == null)
        {
            if (log.isDebugEnabled())


Reply via email to