History log of /external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
75a7afac9b6b5866cde46c3d3158227391175701 09-Feb-2015 Neil Fuller <nfuller@google.com> Reduce flakiness of OkHttp tests

Copy of the test changes from a pending upstream
pull-request:
https://github.com/square/okhttp/pull/1348

----

Android has been receiving reports of some tests being flaky
on what are probably lower-spec devices.

This introduces delays into tests where sockets are being
poisoned after the entire response body has been written to
them *and* where there are follow-up requests.

Bug: 18953235
Change-Id: Ic2d281a3faad6082819ef6d57b3489bcd6dbd474
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java
afcb40207ecf7fc935b40a76cd0c039d5e576441 02-Dec-2014 Neil Fuller <nfuller@google.com> am 0f102f51: Add further handling for when a CONNECT incorrectly returns a body.

* commit '0f102f51711ecc2ef9f25cbbad2148ee97bdb6cb':
Add further handling for when a CONNECT incorrectly returns a body.
0f102f51711ecc2ef9f25cbbad2148ee97bdb6cb 05-Nov-2014 Neil Fuller <nfuller@google.com> Add further handling for when a CONNECT incorrectly returns a body.

Before the change:
If a proxy returns a body and some of the body bytes have
already been buffered then an IOException is thrown.
If the body bytes have not been buffered then the handshake will
fail due to the presence of bytes where the Server HELLO is
expected, typically with some kind of SSLHandshakeException.

After the change:
The body bytes are consumed to ensure consistent behavior. The
handshake will then take place.

History:
This is an unusual case that would occasionally cause failures
on Android when a ResponseCache was installed. Android introduced
a patch to prevent CONNECT responses being cached. Since then,
OkHttp has changed the code and probably fixed the issue via
other means. The Android test remained and would sometimes
experience one exception, sometimes another, depending on the
state of the buffer.

If the presence of a body is a possibility it would be nice
to deal with it consistently and deterministically.

The motivation for this change is to make an Android test
equivalent to the one added here behave consistently and in a
way that doesn't involve connection fallback.

The only risk with this change is if a proxy is incorrectly
reporting the content length: this might lead to blocking on
the body read/skip (as OkHttp would probably do elsewhere if a
server mis-reports a content-length). This may make connections
to "bad" proxies slightly more reliable.

Bug: 6754912
Bug: 18575971

(cherry picked from commit 007b88ad6df622a2e5daacce604637d006ed6212)

Change-Id: Icf9e17a26dd2b1c4024935dfae3e87b2654a220e
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java
602d5e4cfdbd0bad91e7872837f95aff5b461595 03-Apr-2014 Jesse Wilson <jwilson@squareup.com> New disconnect strategy.

Support asynchronous disconnects by breaking the socket only, which
should cause the thread using that socket to trigger clean-up.

Upstream commit: https://github.com/square/okhttp/commit/9c302131491d05a4ca0209ef21770592c01f76fa

Bug: 18083851
(cherry picked from commit 87ed7244fb53ae2bac9f23c033bbd5f23ac269f8)

Change-Id: Ia16147cb84eb9e73af48a2771ef734fbb7baa8f5
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java
95d1a1316ee04d39d55102e65daaacb97f5d42f8 13-Oct-2014 Neil Fuller <nfuller@google.com> Fixing broken OkHttp CTS test

Bug: 17962997
Bug: 17750026
Change-Id: Icbc48a8c30857b3afb0175ac4b341626d4b3dfe8
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java
2ee29995b7bd1068991884a54ca14e9aeeff1a58 30-Jul-2014 Neil Fuller <nfuller@google.com> Fix transparent gzip for basic auth.

Externally reported Android bug:
https://code.google.com/p/android/issues/detail?id=74026

Thanks to mattpan91 for the report.

The issue was fixed in OkHttp 2.0. It has now been back-ported to 1.6.

This is a cherry pick from the okhttp_16 branch:
https://github.com/square/okhttp/commit/e8fee51087a062384f52e11400ff4a104a00a2b2

The merge was not entirely straightforward: Android is currently not quite
on 1.6; it is close and it was only the package for the files that differed
for existing files. There is an additional class (Job) that had to be patched
that the version Android has and 1.6 does not have. The class is probably not
used on Android.

The okhttp CTS tests pass, modulo some tests known to be flaky.

Bug: 16628050
Bug: https://code.google.com/p/android/issues/detail?id=74026

(cherry picked from commit f6af62d5c9bb5e15649a80ebae973463e8e2dc46)

Change-Id: I3172789a17384666eba732a7782573e08f06a48c
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java
1410c75d4b2334521208259b69c23aeefec072d7 17-Jul-2014 Lorenzo Colitti <lorenzo@google.com> Use the socket factory for direct connections as well.

Currently, the passed-in socket factory is only used for
connections to HTTP proxies. I think this was not the intent of
the original socket factory change, because the commit message
said that the "socket factory will be used for all non-proxy
connections and HTTP proxy connections". So use it for DIRECT
connections as well.

Also add a test to check that a socket factory is used if
specified.

Cherry-pick of https://github.com/square/okhttp/commit/7f763c1a18e342dc4e2840c68ca99c175c37eb93

(cherry picked from commit a83ddf194ffbae04ce536967efff0ec72df70e10)

Change-Id: Ie3d239d8683a51a2b6ab1dc9d443886d0746e68a
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java
78092f38ebd93018ead53a87b53118dc829cbb8a 01-Apr-2014 Neil Fuller <nfuller@google.com> Pull upstream fixes from OkHttp

This synced to commit b21b40e480cdcd09b618e399a349556de509d88d
/ master / 1st April 2014.

Notably this contains a fix for apps that bundle an older
copy of OkHttp or which call android.net.http.HttpResponseCache.get()
or android.net.http.HttpResponseCache.put().

See for details:
https://github.com/square/okhttp/pull/672

Change-Id: I90acd9f9946014e834ea203dbc62cdcf7bc80cc6
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java
c6bd683320121544811f481709b3fdbcbe9b3866 14-Mar-2014 Neil Fuller <nfuller@google.com> Upgrade OkHttp to newer code

This update includes changes up to
68affbd24d63620e1785ea847f1936760947b9ae / master /
14th March 2014.

Importantly, it contains a DiskLruCache fix which
broke several apps.
https://github.com/square/okhttp/issues/646

Change-Id: I8a489e6d0937a58fad10423154bad939ea4da868
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java
3c938a3f6b61ce5e2dba0d039b03fe73b89fd26c 19-Feb-2014 Neil Fuller <nfuller@google.com> Update okhttp to a more recent commit.

Updating to upstream commit : 7b106923e078ac2435e8c8ce9d615f9903106ed8
/ 7th Mar 2014 / main branch.

The following changes were made to Android-only code:
1) HttpsHandler has been changed to deal with the fix for:
https://github.com/square/okhttp/issues/184 (commit 5d7fdba).
2) Platform.java changed to accomodate changes in okhttp Platform
method signatures.
3) .mk file updates to reflect src directory changes.

The following changes were made to OkHttp code:
1) Removal of org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
annotation from okio/src/main/java/okio/DeflaterSink.java

Change-Id: I644a883482ac7ee7d029785f110a2ca00762419b
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/URLConnectionTest.java