hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1132915 - in /httpcomponents/httpclient/branches/4.1.x: ./ httpclient/ httpclient/src/main/java/org/apache/http/conn/scheme/ httpclient/src/main/java/org/apache/http/conn/ssl/ httpclient/src/main/java/org/apache/http/impl/conn/ httpclient/...
Date Tue, 07 Jun 2011 08:52:29 GMT
Author: olegk
Date: Tue Jun  7 08:52:29 2011
New Revision: 1132915

URL: http://svn.apache.org/viewvc?rev=1132915&view=rev
Log:
HTTPCLIENT-1098: Avoid expensive reverse DNS lookup on connect timeout excpetion 
Contributed by Thomas Boettcher <tboett at gmail.com>

Added:
    httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpInetSocketAddress.java
  (contents, props changed)
      - copied, changed from r1132905, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/HttpInetSocketAddress.java
Modified:
    httpcomponents/httpclient/branches/4.1.x/   (props changed)
    httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt
    httpcomponents/httpclient/branches/4.1.x/httpclient/   (props changed)
    httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/scheme/PlainSocketFactory.java
    httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
    httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
    httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/resources/test.keystore 
 (props changed)

Propchange: httpcomponents/httpclient/branches/4.1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun  7 08:52:29 2011
@@ -1,4 +1,4 @@
 /httpcomponents/httpclient/branches/4.0.x:950681-950688
 /httpcomponents/httpclient/branches/branch_4_1:755593-811107
 /httpcomponents/httpclient/branches/notice-plugin-test:1024348-1031454
-/httpcomponents/httpclient/trunk:1087358,1091140-1091141,1091904,1104207-1104211
+/httpcomponents/httpclient/trunk:1087358,1091140-1091141,1091904,1104207-1104211,1132902-1132903

Modified: httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt?rev=1132915&r1=1132914&r2=1132915&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/branches/4.1.x/RELEASE_NOTES.txt Tue Jun  7 08:52:29 2011
@@ -1,9 +1,14 @@
 Changes since 4.1.1
 
-* [HTTPCLIENT-1097] BrowserCompatHostnameVerifier and StrictHostnameVerifier should handle
wildcards in SSL certificates better.
+* [HTTPCLIENT-1098] Avoid expensive reverse DNS lookup on connect timeout exception. 
+  Contributed by Thomas Boettcher <tboett at gmail.com>
+
+* [HTTPCLIENT-1097] BrowserCompatHostnameVerifier and StrictHostnameVerifier should handle

+  wildcards in SSL certificates better.
   Contributed by Sebastian Bazley <sebb at apache.org>
 
-* [HTTPCLIENT-1092] If ClientPNames.VIRTUAL_HOST does not provide the port, derive it from
the current request.
+* [HTTPCLIENT-1092] If ClientPNames.VIRTUAL_HOST does not provide the port, derive it from
the 
+  current request.
   Contributed by Sebastian Bazley <sebb at apache.org>
 
 * [HTTPCLIENT-1087] NTLM proxy authentication fails on retry if the underlying connection
is closed

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun  7 08:52:29 2011
@@ -1,4 +1,4 @@
 /httpcomponents/httpclient/branches/4.0.x/httpclient:950681-950688
 /httpcomponents/httpclient/branches/branch_4_1/httpclient:755593-811107
 /httpcomponents/httpclient/branches/notice-plugin-test/httpclient:1024348-1031454
-/httpcomponents/httpclient/trunk/httpclient:1087358,1088000-1088004,1091140-1091141,1091904,1100531-1100533,1104207-1104211
+/httpcomponents/httpclient/trunk/httpclient:1087358,1088000-1088004,1091140-1091141,1091904,1100531-1100533,1104207-1104211,1132902-1132903

Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/scheme/PlainSocketFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/scheme/PlainSocketFactory.java?rev=1132915&r1=1132914&r2=1132915&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/scheme/PlainSocketFactory.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/scheme/PlainSocketFactory.java
Tue Jun  7 08:52:29 2011
@@ -122,8 +122,7 @@ public class PlainSocketFactory implemen
             sock.setSoTimeout(soTimeout);
             sock.connect(remoteAddress, connTimeout);
         } catch (SocketTimeoutException ex) {
-            throw new ConnectTimeoutException("Connect to " + remoteAddress.getHostName()
+ "/"
-                    + remoteAddress.getAddress() + " timed out");
+            throw new ConnectTimeoutException("Connect to " + remoteAddress + " timed out");
         }
         return sock;
     }

Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java?rev=1132915&r1=1132914&r2=1132915&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/ssl/SSLSocketFactory.java
Tue Jun  7 08:52:29 2011
@@ -374,8 +374,7 @@ public class SSLSocketFactory implements
             sock.setSoTimeout(soTimeout);
             sock.connect(remoteAddress, connTimeout);
         } catch (SocketTimeoutException ex) {
-            throw new ConnectTimeoutException("Connect to " + remoteAddress.getHostName()
+ "/"
-                    + remoteAddress.getAddress() + " timed out");
+            throw new ConnectTimeoutException("Connect to " + remoteAddress + " timed out");
         }
         SSLSocket sslsock;
         // Setup SSL layering if necessary

Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java?rev=1132915&r1=1132914&r2=1132915&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
Tue Jun  7 08:52:29 2011
@@ -136,7 +136,7 @@ public class DefaultClientConnectionOper
             Socket sock = sf.createSocket(params);
             conn.opening(sock, target);
 
-            InetSocketAddress remoteAddress = new InetSocketAddress(address, port);
+            InetSocketAddress remoteAddress = new HttpInetSocketAddress(target, address,
port);
             InetSocketAddress localAddress = null;
             if (local != null) {
                 localAddress = new InetSocketAddress(local, 0);

Copied: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpInetSocketAddress.java
(from r1132905, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/HttpInetSocketAddress.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpInetSocketAddress.java?p2=httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpInetSocketAddress.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/HttpInetSocketAddress.java&r1=1132905&r2=1132915&rev=1132915&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/conn/HttpInetSocketAddress.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpInetSocketAddress.java
Tue Jun  7 08:52:29 2011
@@ -24,7 +24,7 @@
  *
  */
 
-package org.apache.http.conn;
+package org.apache.http.impl.conn;
 
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
@@ -34,15 +34,13 @@ import org.apache.http.HttpHost;
 /**
  * Extended {@link InetSocketAddress} implementation that also provides access to the original
  * {@link HttpHost} used to resolve the address.
- * 
- * @since 4.2
  */
-public class HttpInetSocketAddress extends InetSocketAddress {
+class HttpInetSocketAddress extends InetSocketAddress {
 
     private static final long serialVersionUID = -6650701828361907957L;
 
     private final HttpHost host;
-    
+
     public HttpInetSocketAddress(final HttpHost host, final InetAddress addr, int port) {
         super(addr, port);
         if (host == null) {
@@ -60,5 +58,4 @@ public class HttpInetSocketAddress exten
         return this.host.getHostName() + ":" + getPort();
     }
 
-    
 }

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpInetSocketAddress.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpInetSocketAddress.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpInetSocketAddress.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Jun  7 08:52:29 2011
@@ -0,0 +1,4 @@
+/httpcomponents/httpclient/branches/4.0.x/httpclient/src/main/java/org/apache/http/conn/HttpInetSocketAddress.java:950681-950688
+/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/conn/HttpInetSocketAddress.java:1079518-1080165
+/httpcomponents/httpclient/branches/branch_4_1/httpclient/src/main/java/org/apache/http/conn/HttpInetSocketAddress.java:755593-811107
+/httpcomponents/httpclient/branches/notice-plugin-test/httpclient/src/main/java/org/apache/http/conn/HttpInetSocketAddress.java:1024348-1031454

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/HttpInetSocketAddress.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: httpcomponents/httpclient/branches/4.1.x/httpclient/src/test/resources/test.keystore
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun  7 08:52:29 2011
@@ -1,2 +1,2 @@
-/httpcomponents/httpclient/trunk/httpclient/src/test/resources/test.keystore:1087358
+/httpcomponents/httpclient/trunk/httpclient/src/test/resources/test.keystore:1087358,1132902-1132903
 /httpcomponents/httpcore/branches/ibm_compat_branch/httpcore-nio/src/test/resources/test.keystore:755687-758898



Mime
View raw message