hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1179597 - in /httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl: client/DefaultRequestDirector.java conn/AbstractPoolEntry.java
Date Thu, 06 Oct 2011 12:36:24 GMT
Author: olegk
Date: Thu Oct  6 12:36:24 2011
New Revision: 1179597

URL: http://svn.apache.org/viewvc?rev=1179597&view=rev
Log:
HTTPCLIENT-1120: AbstractPoolEntry to throw InterruptedIOException instead of plain IOException;
HttpRequest to be added to the execution context prior to attempting to open connection (in
case of a connect failure the retry handler can make use of the HttpRequest object bound to
the context)

Modified:
    httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
    httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java

Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java?rev=1179597&r1=1179596&r2=1179597&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java
Thu Oct  6 12:36:24 2011
@@ -563,6 +563,8 @@ public class DefaultRequestDirector impl
     private void tryConnect(
             final RoutedRequest req, final HttpContext context) throws HttpException, IOException
{
         HttpRoute route = req.getRoute();
+        HttpRequest wrapper = req.getRequest();
+        context.setAttribute(ExecutionContext.HTTP_REQUEST, wrapper);
 
         int connectCount = 0;
         for (;;) {

Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java?rev=1179597&r1=1179596&r2=1179597&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
(original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
Thu Oct  6 12:36:24 2011
@@ -27,6 +27,7 @@
 package org.apache.http.impl.conn;
 
 import java.io.IOException;
+import java.io.InterruptedIOException;
 
 import org.apache.http.HttpHost;
 import org.apache.http.params.HttpParams;
@@ -157,7 +158,7 @@ public abstract class AbstractPoolEntry 
         // If this tracker was reset while connecting,
         // fail early.
         if (localTracker == null) {
-            throw new IOException("Request aborted");
+            throw new InterruptedIOException("Request aborted");
         }
 
         if (proxy == null) {



Mime
View raw message