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)

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1179594 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2011-10-06 12:34:21 +00:00
parent b1b85307a8
commit 62c57991f5
2 changed files with 4 additions and 1 deletions

View File

@ -610,6 +610,8 @@ public class DefaultRequestDirector implements RequestDirector {
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 (;;) {

View File

@ -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;
@ -158,7 +159,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) {