commit | 62dc0a137d6a769540a80e23ff163f50bc51c343 | [log] [tgz] |
---|---|---|
author | Neil Fuller <nfuller@google.com> | Mon Nov 09 13:16:23 2015 +0000 |
committer | Neil Fuller <nfuller@google.com> | Mon Nov 09 14:31:35 2015 +0000 |
tree | 46ea58defddafd334df47b6b217d2b6de951e0a6 | |
parent | e0d02d710cd1bbcc1a9065ede7f6801f72abe5b7 [diff] |
DO NOT MERGE: Fix URLConnectionTest.writeTimeouts with large receive buffers This is upstream okhttp commit 8b19bc471f66ee45c5eed3df6817411d074aabe5. https://github.com/square/okhttp/commit/8b19bc471f66ee45c5eed3df6817411d074aabe5 back-ported to Android's version of OkHttp. From the upstream commit: The test relies on small client send / server receive buffers to force blocking and generate a timeout. The switch to make MockWebServer a @Rule (commit 785d9e94387f404f571775a49c3a9438508bb659) moved the MockWebServer.start() call earlier in the test execution. Setting the ServerSocketFactory became a no-op so the server receive buffer size was left as the default. The test became reliant on either: 1) The default server socket receive buffer being small enough (e.g. less than the data being transmitted). 2) The device being too slow to send the requested data in the time allowed. The test was recently made less reliable by: 1) The okio commit f30955cb15eb234f874dd55819686832c960765b, which made the segment size bigger (increasing throughput / transfer efficiency). 2) The OkHttp commit f30955cb15eb234f874dd55819686832c960765b, which reduced the amount of data being sent in the test from 16MB to 2MB. 3) Recent Android devices have large default buffer sizes. e.g. Nexus 5: 1MB, Nexus 5X: 6MB. Bug: 25459708 Change-Id: Icaa3255d86d228302931baca0432ea9a5be1e7f0
An HTTP & SPDY client for Android and Java applications. For more information see the website and the wiki.
Download the latest JAR or grab via Maven:
<dependency> <groupId>com.squareup.okhttp</groupId> <artifactId>okhttp</artifactId> <version>2.3.0</version> </dependency>
or Gradle:
compile 'com.squareup.okhttp:okhttp:2.3.0'
Snapshots of the development version are available in Sonatype's snapshots
repository.
A library for testing HTTP, HTTPS, HTTP/2.0, and SPDY clients.
MockWebServer coupling with OkHttp is essential for proper testing of SPDY and HTTP/2.0 so that code can be shared.
Download the latest JAR or grab via Maven:
<dependency> <groupId>com.squareup.okhttp</groupId> <artifactId>mockwebserver</artifactId> <version>2.3.0</version> <scope>test</scope> </dependency>
or Gradle:
testCompile 'com.squareup.okhttp:mockwebserver:2.3.0'
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.