You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ja...@apache.org on 2008/09/08 09:22:39 UTC
svn commit: r693004 - in
/maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client:
DestinationRealmResolver.java FileExchange.java
Author: janb
Date: Mon Sep 8 00:22:39 2008
New Revision: 693004
URL: http://svn.apache.org/viewvc?rev=693004&view=rev
Log:
Change sense of host name matching test for resolving server host with destination host during realm resolution; introduce handling of connection failures.
Modified:
maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/DestinationRealmResolver.java
maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/FileExchange.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=693004&r1=693003&r2=693004&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 Mon Sep 8 00:22:39 2008
@@ -68,15 +68,12 @@
String protocol = s.getURL().getProtocol();
String host = s.getURL().getHost();
int port = s.getURL().getPort();
-
- //destination.host == server.host &&
- //destination.port == server.port &&
- //destination.isSecure && server.protocol == https || !destination.isSecure && server.protocol == http
+
if (((dest.isSecure() && "https".equalsIgnoreCase(protocol)) || (!dest.isSecure() && "http".equalsIgnoreCase(protocol)))
&&
(address.getPort() == port))
{
- if (address.getAddress().getHostAddress().equalsIgnoreCase(host) || address.getHostName().equalsIgnoreCase(host))
+ if (address.getHostName().equalsIgnoreCase(host) || address.getAddress().getHostAddress().equalsIgnoreCase(host))
{
server = s;
if (log.isDebugEnabled())
Modified: maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/FileExchange.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/FileExchange.java?rev=693004&r1=693003&r2=693004&view=diff
==============================================================================
--- maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/FileExchange.java (original)
+++ maven/sandbox/trunk/mercury/mercury-transport/mercury-transport-http/src/main/java/org/apache/maven/mercury/spi/http/client/FileExchange.java Mon Sep 8 00:22:39 2008
@@ -35,6 +35,9 @@
*/
public abstract class FileExchange extends HttpExchange
{
+
+
+
public static final String __BATCH_HEADER = "Jetty-Batch-Id";
public static final String __BATCH_SUPPORTED_HEADER = "Jetty-Batch-Supported";
public static final String __BATCH_COMMIT_HEADER = "Jetty-Batch-Commit";
@@ -95,4 +98,10 @@
{
onFileError( _url, new Exception( "Timeout occurred" ) );
}
+
+ protected void onConnectionFailed(Throwable ex)
+ {
+ onFileError(_url, new Exception(ex));
+ }
+
}