diff options
author | Brian Carlstrom <bdc@google.com> | 2011-01-02 16:19:22 -0800 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2011-01-30 16:17:33 -0800 |
commit | b91c5e936342afbdd58c88ac604d5dd505d0fe0c (patch) | |
tree | 325485cf535e2846b4ccfde030de4a9e98a8751d | |
parent | 9f7b511f4ac753992e9b726c41f7aec71092c15c (diff) | |
download | external_apache-http-b91c5e936342afbdd58c88ac604d5dd505d0fe0c.zip external_apache-http-b91c5e936342afbdd58c88ac604d5dd505d0fe0c.tar.gz external_apache-http-b91c5e936342afbdd58c88ac604d5dd505d0fe0c.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: 3405962
Bug: 3317717
git cherry-pick -e 843bcb6f4f65c0cdca327c6467813b88c52042f3
Change-Id: I443b4915f6473e07d74a37377dade6ac1f9f600c
-rw-r--r-- | src/org/apache/http/impl/client/DefaultRequestDirector.java | 13 |
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 511f8a0..a95c522 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 } } } |