diff options
author | Brian Carlstrom <bdc@google.com> | 2010-08-18 13:39:09 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-08-18 13:39:09 -0700 |
commit | ca487d902d42621b5db886d13d2acb4c9500a44c (patch) | |
tree | 7b75c46004b807f9a00d6bd39a35f03add671a49 | |
parent | 301b1df2f0b25ef56a640840742c981623faf20f (diff) | |
parent | 166ed46d7e5312857b8a9b8d07c00373c596c1b3 (diff) | |
download | external_apache-http-ca487d902d42621b5db886d13d2acb4c9500a44c.zip external_apache-http-ca487d902d42621b5db886d13d2acb4c9500a44c.tar.gz external_apache-http-ca487d902d42621b5db886d13d2acb4c9500a44c.tar.bz2 |
am 166ed46d: Cherry picking changes from dalvik-dev
Merge commit '166ed46d7e5312857b8a9b8d07c00373c596c1b3' into gingerbread-plus-aosp
* commit '166ed46d7e5312857b8a9b8d07c00373c596c1b3':
Cherry picking changes from dalvik-dev
-rw-r--r-- | src/org/apache/http/conn/ssl/AbstractVerifier.java | 37 | ||||
-rw-r--r-- | src/org/apache/http/impl/client/DefaultHttpClient.java | 9 | ||||
-rw-r--r-- | src/org/apache/http/params/CoreProtocolPNames.java | 4 | ||||
-rw-r--r-- | src/org/apache/http/protocol/HTTP.java | 2 |
4 files changed, 11 insertions, 41 deletions
diff --git a/src/org/apache/http/conn/ssl/AbstractVerifier.java b/src/org/apache/http/conn/ssl/AbstractVerifier.java index 5195e58..e409db9 100644 --- a/src/org/apache/http/conn/ssl/AbstractVerifier.java +++ b/src/org/apache/http/conn/ssl/AbstractVerifier.java @@ -89,44 +89,7 @@ public abstract class AbstractVerifier implements X509HostnameVerifier { throw new NullPointerException("host to verify is null"); } - ssl.startHandshake(); SSLSession session = ssl.getSession(); - if(session == null) { - // In our experience this only happens under IBM 1.4.x when - // spurious (unrelated) certificates show up in the server' - // chain. Hopefully this will unearth the real problem: - InputStream in = ssl.getInputStream(); - in.available(); - /* - If you're looking at the 2 lines of code above because - you're running into a problem, you probably have two - options: - - #1. Clean up the certificate chain that your server - is presenting (e.g. edit "/etc/apache2/server.crt" - or wherever it is your server's certificate chain - is defined). - - OR - - #2. Upgrade to an IBM 1.5.x or greater JVM, or switch - to a non-IBM JVM. - */ - - // If ssl.getInputStream().available() didn't cause an - // exception, maybe at least now the session is available? - session = ssl.getSession(); - if(session == null) { - // If it's still null, probably a startHandshake() will - // unearth the real problem. - ssl.startHandshake(); - - // Okay, if we still haven't managed to cause an exception, - // might as well go for the NPE. Or maybe we're okay now? - session = ssl.getSession(); - } - } - Certificate[] certs = session.getPeerCertificates(); X509Certificate x509 = (X509Certificate) certs[0]; verify(host, x509); diff --git a/src/org/apache/http/impl/client/DefaultHttpClient.java b/src/org/apache/http/impl/client/DefaultHttpClient.java index f0b694e..7dcb2a2 100644 --- a/src/org/apache/http/impl/client/DefaultHttpClient.java +++ b/src/org/apache/http/impl/client/DefaultHttpClient.java @@ -131,8 +131,15 @@ public class DefaultHttpClient extends AbstractHttpClient { HttpVersion.HTTP_1_1); HttpProtocolParams.setContentCharset(params, HTTP.DEFAULT_CONTENT_CHARSET); + + /* + * Android note: Send each request body without first asking the server + * whether it will be accepted. Asking first slows down the common case + * and results in "417 expectation failed" errors when a HTTP/1.0 server + * is behind a proxy. http://b/2471595 + */ HttpProtocolParams.setUseExpectContinue(params, - true); + false); // android-changed // determine the release version from packaged version info final VersionInfo vi = VersionInfo.loadVersionInfo diff --git a/src/org/apache/http/params/CoreProtocolPNames.java b/src/org/apache/http/params/CoreProtocolPNames.java index a42c5de..a0a726d 100644 --- a/src/org/apache/http/params/CoreProtocolPNames.java +++ b/src/org/apache/http/params/CoreProtocolPNames.java @@ -94,8 +94,8 @@ public interface CoreProtocolPNames { /** * <p> - * Activates 'Expect: 100-Continue' handshake for the - * entity enclosing methods. The purpose of the 'Expect: 100-Continue' + * Activates 'Expect: 100-continue' handshake for the + * entity enclosing methods. The purpose of the 'Expect: 100-continue' * handshake to allow a client that is sending a request message with * a request body to determine if the origin server is willing to * accept the request (based on the request headers) before the client diff --git a/src/org/apache/http/protocol/HTTP.java b/src/org/apache/http/protocol/HTTP.java index de76ca6..9223955 100644 --- a/src/org/apache/http/protocol/HTTP.java +++ b/src/org/apache/http/protocol/HTTP.java @@ -60,7 +60,7 @@ public final class HTTP { public static final String SERVER_HEADER = "Server"; /** HTTP expectations */ - public static final String EXPECT_CONTINUE = "100-Continue"; + public static final String EXPECT_CONTINUE = "100-continue"; /** HTTP connection control */ public static final String CONN_CLOSE = "Close"; |