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
ttp/URLConnectionTest.java
|
342d21a7eb7d28ae132c43a4ab8353cbedff9e01 |
11-Dec-2014 |
Neil Fuller <nfuller@google.com> |
Fix DisconnectTest for devices with large socket buffers Similar to commit e3bfefb13c93006a2fbe22363572a314f6c18659 but for DisconnectTest. The buffer sizes are large on some devices so the expectation that they take a lot of time to stream data is invalid because they just write into the buffers. Bug: 18703696 Change-Id: I6127b044bf7fefc192f577d0b035deacbc54dd5f
ttp/DisconnectTest.java
|
dd6543e08d4d139de53b51753ceb2dffea93beac |
10-Dec-2014 |
Neil Fuller <nfuller@google.com> |
Merge "Avoid a reverse DNS-lookup for a numeric proxy address" into lmp-mr1-dev
|
2ed0095a4f0da2f0bbe75b9d139419ce75afaa25 |
02-Dec-2014 |
Neil Fuller <nfuller@google.com> |
Avoid a reverse DNS-lookup for a numeric proxy address When the proxy is specified as an IP address the RouteSelector would force a reverse-lookup. This can introduce extra latency when the DNS is slow or missing. It also then turns the name back into a set of IPs, which may result in the original IP address not being given priority. This is upstream commit: https://github.com/square/okhttp/commit/9acd5e7b54fb55f62a5dd16865c30787dfba4c8b Bug: 18567569 Bug: 18327075 (cherry picked from commit 797fdc6cc6bf16372e9464f189b535148f944ce9) Change-Id: I52b4049095acafd2367530532d8cad7d75b6809a
ttp/RouteSelectorTest.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
ttp/URLConnectionTest.java
|
466ef072d672d6c5cce3da222f76828427680e53 |
19-Nov-2014 |
Alex Klyubin <klyubin@google.com> |
am db7edbf1: am 200d28a2: am e82a7960: Fix a bug in OkHostnameVerifier wildcard handling. * commit 'db7edbf1f7713d5170a8132c0d1a3c43f90f55e5': Fix a bug in OkHostnameVerifier wildcard handling.
|
a03ec4ced2b11f9eae6cbeeedb1db2b1b29fafb1 |
19-Nov-2014 |
Alex Klyubin <klyubin@google.com> |
Fix a bug in OkHostnameVerifier wildcard handling. Wildcard domain name patterns of the form *.remainder are supposed to match domain names that exactly match the remainder. Due to a bug, the match was not exact but rather a prefix match: domain names starting with the remainder would match too. This CL fixes the issue. Bug: 18432707 Change-Id: I2639ff51cabcbd395d4f30a9c69f9895738e0acf
ls/HostnameVerifierTest.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
ttp/DisconnectTest.java
ttp/URLConnectionTest.java
|
95d1a1316ee04d39d55102e65daaacb97f5d42f8 |
13-Oct-2014 |
Neil Fuller <nfuller@google.com> |
Fixing broken OkHttp CTS test Bug: 17962997 Bug: 17750026 Change-Id: Icbc48a8c30857b3afb0175ac4b341626d4b3dfe8
ttp/URLConnectionTest.java
|
e3bfefb13c93006a2fbe22363572a314f6c18659 |
06-Oct-2014 |
Neil Fuller <nfuller@google.com> |
Fix OkHttp test failure for fast devices On a fast device the ThreadInterruptTest#interruptWritingRequestBody would consistently fail. The issue is probably a combination of socket buffering and the data volume chosen by the test. The test was written to assume that read-side throttling would prevent the writer from writing its data within 500 millis. After ~500 millis the write thread would be interrupted and the test would pass. On a fast device the test would write all the test data in ~ 125 millis and the test would fail. The interruption would then trigger on a later test (typically URLConnectionTest#authenticateWithGetAndTransparentGzip), breaking that test as well. If there is sufficient socket-level read/write buffering it is possible the data being written will just fill the socket buffers and the writer will terminate early. If the data to be written is increased from 2 to 10 MB the test passes. Bug: 17516838 Change-Id: I54b5de9527d9737e6c987b6a9c4f62578f4f8fb7
ttp/ThreadInterruptTest.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
ecordingOkAuthenticator.java
ttp/URLConnectionTest.java
|
7c7f22d80748dc444d5da3c5be11d7d81ef14a2b |
17-Jul-2014 |
Lorenzo Colitti <lorenzo@google.com> |
Allow callers to pass in a custom host resolver implementation. An HTTP client interacts with the network in two main ways: DNS lookups and connections to HTTP servers. OkHttp already abstracts the latter by allowing callers to pass in custom SocketFactory objects, but does not yet abstract the former. This change takes the existing internal Dns interface, which is currently used for testing, and turns it into a publicly accessible HostResolver interface. This allows callers to completely abstract all network interaction points. Examples of what this can be used for: 1. Use alternative DNS implementations with different performance / caching / ordering / parallelization / ... characteristics than standard InetAddress.getAllByName. 2. Resolve hosts using different DNS servers than the system resolvers, or even non-DNS protocols (e.g., MDNS or even NetBIOS/WINS) that are not supported by the system resolver. 3. Do DNS lookups on specific networks, similarly to what android_getaddrinfofornet does. Backport of upstream change: https://github.com/square/okhttp/commit/b19860c9297197a5055ac2ffd6edaedf693c1a85 Change-Id: I6e488acd938067e4c078c6ffe4d5eddb5f3951de
ttp/RouteSelectorTest.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
ttp/URLConnectionTest.java
|
3f968acf193178145e9d227f2f08b95e2d6a6c26 |
15-Apr-2014 |
Jake Wharton <jw@squareup.com> |
Allow specifying a socket factory for connections. This socket factory will be used for all non-proxy connections and HTTP proxy connections. This is a clean cherry-pick of: https://github.com/square/okhttp/commit/ff5390d6dcaf79ef09a3ef94dbb7e8ac39572a7f That was committed about two weeks after we pulled our current snapshot, so we would have picked this change up on the next sync with upstream. Bug: 11826069 (cherry picked from commit e5baca5e4c9de92820a38e60e289d07f1acaa2ef) Change-Id: Ica683022e6963a0a4f0c3fd1a33c1b843e307c1a
ttp/RouteSelectorTest.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
ttp/JavaApiConverterTest.java
ttp/ThreadInterruptTest.java
ttp/URLConnectionTest.java
|
4944713f5c5b141966ac82973d6a31a634e8e01e |
21-Mar-2014 |
Neil Fuller <nfuller@google.com> |
Pull upstream fixes from OkHttp This synced to commit bda555ad61ef55e9ad6e4a30d2e9cfde5fc216ca / master / 21st March 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/commit/6cf56de5d0701ff26aa6043c552e17c4665c1287 https://github.com/square/okhttp/commit/e2599be9e073f1be8e929597c358e2664ab0c9a9 Change-Id: I324ac76d8ee6a615c39dc8e19dc90169528ae072
ttp/HttpResponseCacheTest.java
ttp/JavaApiConverterTest.java
ttp/ResponseCacheAdapterTest.java
pdy/HpackDraft05Test.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
ttp/HttpResponseCacheTest.java
ttp/URLConnectionTest.java
pdy/MockSpdyPeer.java
pdy/SettingsTest.java
pdy/SpdyConnectionTest.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
itArrayTest.java
ecordingAuthenticator.java
ecordingHostnameVerifier.java
ecordingOkAuthenticator.java
ttp/CookiesTest.java
ttp/ExternalHttp2Example.java
ttp/ExternalSpdyExample.java
ttp/HeadersTest.java
ttp/HttpOverHttp20Draft09Test.java
ttp/HttpOverSpdy3Test.java
ttp/HttpOverSpdyTest.java
ttp/HttpResponseCacheTest.java
ttp/ResponseCacheAdapterTest.java
ttp/ResponseCacheTest.java
ttp/RouteSelectorTest.java
ttp/StatusLineTest.java
ttp/URLConnectionTest.java
ttp/URLEncodingTest.java
pdy/BaseTestHandler.java
pdy/HpackDraft05Test.java
pdy/Http20Draft09Test.java
pdy/HuffmanTest.java
pdy/MockSpdyPeer.java
pdy/SettingsTest.java
pdy/Spdy3Test.java
pdy/SpdyConnectionTest.java
ls/FakeSSLSession.java
ls/HostnameVerifierTest.java
|