notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r2306 - in development/main/transit/core/handler/src/main/net/dpml/transit: . host network
- From: niclas AT hedhman.org
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r2306 - in development/main/transit/core/handler/src/main/net/dpml/transit: . host network
- Date: Mon, 18 Apr 2005 14:29:42 -0400
Author: niclas AT hedhman.org
Date: Mon Apr 18 14:29:40 2005
New Revision: 2306
Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
development/main/transit/core/handler/src/main/net/dpml/transit/host/ClassicResourceHost.java
development/main/transit/core/handler/src/main/net/dpml/transit/network/DelegatingAuthenticator.java
development/main/transit/core/handler/src/main/net/dpml/transit/network/RequestIdentifier.java
Log:
Fixed a problem that disallowed offline use. InetAddress.getByName() (or
something) made DNS requests and throw exception if not resolved.
Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/SecuredTransitContext.java
Mon Apr 18 14:29:40 2005
@@ -709,7 +709,6 @@
throw new IllegalArgumentException( "Missing " +
PROXY_PROMPT_KEY + " in properties." );
}
- InetAddress host = InetAddress.getByName( proxy );
String portText = Util.getProperty( properties, PROXY_PORT_KEY, "0"
);
int port = Integer.parseInt( portText );
Properties system = System.getProperties();
@@ -720,7 +719,7 @@
{
system.put( "http.nonProxyHosts", excludes );
}
- RequestIdentifier id = new RequestIdentifier( host, port, protocol,
scheme, prompt );
+ RequestIdentifier id = new RequestIdentifier( proxy, port, protocol,
scheme, prompt );
return id;
}
Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/host/ClassicResourceHost.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/host/ClassicResourceHost.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/host/ClassicResourceHost.java
Mon Apr 18 14:29:40 2005
@@ -179,7 +179,7 @@
}
String protocol = base.getProtocol();
- InetAddress host = InetAddress.getByName( base.getHost() );
+ String host = base.getHost();
int port = base.getPort();
if( port == 0 )
{
@@ -502,7 +502,7 @@
* of trust as a http connection (i.e. none).
*/
private static final class NullTrustManager
- implements X509TrustManager
+ implements X509TrustManager
{
/**
* Empty certificate sequence.
Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/network/DelegatingAuthenticator.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/network/DelegatingAuthenticator.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/network/DelegatingAuthenticator.java
Mon Apr 18 14:29:40 2005
@@ -124,32 +124,25 @@
*/
protected PasswordAuthentication getPasswordAuthentication()
{
- try
+ String host = getRequestingHost();
+ String protocol = getRequestingProtocol();
+ String prompt = getRequestingPrompt();
+ String scheme = getRequestingScheme();
+ int port = getRequestingPort();
+ String addr = getRequestingSite().toString();
+ if( addr == null )
{
- String host = getRequestingHost();
- String protocol = getRequestingProtocol();
- String prompt = getRequestingPrompt();
- String scheme = getRequestingScheme();
- int port = getRequestingPort();
- InetAddress addr = getRequestingSite();
- if( addr == null )
- {
- addr = InetAddress.getByName( host );
- }
- RequestIdentifier id = new RequestIdentifier( addr, port,
protocol, scheme, prompt );
- synchronized( m_authenticators )
- {
- TransitAuthenticator auth = (TransitAuthenticator)
m_authenticators.get( id );
- if( auth == null )
- {
- return null;
- }
- return auth.resolvePasswordAuthentication( this );
- }
+ addr = host;
}
- catch( UnknownHostException e )
+ RequestIdentifier id = new RequestIdentifier( addr, port, protocol,
scheme, prompt );
+ synchronized( m_authenticators )
{
- return null;
+ TransitAuthenticator auth = (TransitAuthenticator)
m_authenticators.get( id );
+ if( auth == null )
+ {
+ return null;
+ }
+ return auth.resolvePasswordAuthentication( this );
}
}
}
Modified:
development/main/transit/core/handler/src/main/net/dpml/transit/network/RequestIdentifier.java
==============================================================================
---
development/main/transit/core/handler/src/main/net/dpml/transit/network/RequestIdentifier.java
(original)
+++
development/main/transit/core/handler/src/main/net/dpml/transit/network/RequestIdentifier.java
Mon Apr 18 14:29:40 2005
@@ -44,7 +44,7 @@
/**
* The internet address.
*/
- private final InetAddress m_address;
+ private final String m_address;
/**
* The port.
@@ -80,7 +80,7 @@
* @exception NullArgumentException if any of the address, protocol,
scheme
* or prompt arguments is null.
*/
- public RequestIdentifier( InetAddress address, int port, String protocol,
+ public RequestIdentifier( String address, int port, String protocol,
String scheme, String prompt )
throws NullArgumentException
{
- svn commit: r2306 - in development/main/transit/core/handler/src/main/net/dpml/transit: . host network, niclas, 04/18/2005
Archive powered by MHonArc 2.6.24.