summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2011-01-02 16:19:22 -0800
committerBrian Carlstrom <bdc@google.com>2011-01-02 16:19:22 -0800
commit843bcb6f4f65c0cdca327c6467813b88c52042f3 (patch)
treee50af9d13017d3633aa2f66408f5e7e8993099c5 /src
parent091f7ca4958c6f41c79808913c84ceea56d73b12 (diff)
downloadexternal_apache-http-843bcb6f4f65c0cdca327c6467813b88c52042f3.zip
external_apache-http-843bcb6f4f65c0cdca327c6467813b88c52042f3.tar.gz
external_apache-http-843bcb6f4f65c0cdca327c6467813b88c52042f3.tar.bz2
DefaultRequestDirector should ignore IOExceptions from stale connections
The DefaultRequestDirector was letting IOExceptions from closing stale connections affect new requests. However, it was very common to received "SSL shutdown failed" exceptions in this case, since an SSL "close notify" message could not be sent. Now these and other IOExceptions are ignored so the request can continue with a new socket. Bug: 3317717 Change-Id: I72f6f4a8f70aacb8b4c3e93c51e9808742d1a605
Diffstat (limited to 'src')
-rw-r--r--src/org/apache/http/impl/client/DefaultRequestDirector.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/org/apache/http/impl/client/DefaultRequestDirector.java b/src/org/apache/http/impl/client/DefaultRequestDirector.java
index 6df6246..b8f380b 100644
--- a/src/org/apache/http/impl/client/DefaultRequestDirector.java
+++ b/src/org/apache/http/impl/client/DefaultRequestDirector.java
@@ -334,7 +334,18 @@ public class DefaultRequestDirector implements RequestDirector {
this.log.debug("Stale connection check");
if (managedConn.isStale()) {
this.log.debug("Stale connection detected");
- managedConn.close();
+ // BEGIN android-changed
+ try {
+ managedConn.close();
+ } catch (IOException ignored) {
+ // SSLSocket's will throw IOException
+ // because they can't send a "close
+ // notify" protocol message to the
+ // server. Just supresss any
+ // exceptions related to closing the
+ // stale connection.
+ }
+ // END android-changed
}
}
}