am ae89fd35: am e59c288f: am b91c5e93: DefaultRequestDirector should ignore IOExceptions from stale connections

* commit 'ae89fd35ba04735b80c5f79b9a31fa3c31519ee0':
  DefaultRequestDirector should ignore IOExceptions from stale connections
diff --git a/src/org/apache/http/impl/client/DefaultRequestDirector.java b/src/org/apache/http/impl/client/DefaultRequestDirector.java
index b8f380b..bfdddd6 100644
--- a/src/org/apache/http/impl/client/DefaultRequestDirector.java
+++ b/src/org/apache/http/impl/client/DefaultRequestDirector.java
@@ -67,6 +67,7 @@
 import org.apache.http.client.UserTokenHandler;
 import org.apache.http.client.methods.AbortableHttpRequest;
 import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.client.params.ClientPNames;
 import org.apache.http.client.params.HttpClientParams;
 import org.apache.http.client.protocol.ClientContext;
@@ -575,8 +576,21 @@
                 ClientPNames.DEFAULT_HOST);
         }
         if (target == null) {
-            throw new IllegalStateException
-                ("Target host must not be null, or set in parameters.");
+            // BEGIN android-changed
+            //     If the URI was malformed, make it obvious where there's no host component
+            String scheme = null;
+            String host = null;
+            String path = null;
+            URI uri;
+            if (request instanceof HttpUriRequest
+                    && (uri = ((HttpUriRequest) request).getURI()) != null) {
+                scheme = uri.getScheme();
+                host = uri.getHost();
+                path = uri.getPath();
+            }
+            throw new IllegalStateException( "Target host must not be null, or set in parameters."
+                    + " scheme=" + scheme + ", host=" + host + ", path=" + path);
+            // END android-changed
         }
 
         return this.routePlanner.determineRoute(target, request, context);