* Expose minimum outgoing web socket message compression size option in OkHttpClient.Builder
* Don't refer to implementation class in API doc
* Add non-negative check for webSocketMinimumDeflateSize
* Add tests for webSocketMinimumDeflateSize
* Rename option to minWebSocketMessageToCompress
Our original expectations were that KitKat devices would age out in
2020. It's been a garbage year and this expectations no longer hold.
We're extending support an extra year.
We continue to support OkHttp 3.12.x because later releases are not
usable on older devices and JVMs.
OkHttp 3.14.x has no such reason to receive support, and we'll stop
updating it on June 30, 2020. Users of OkHttp 3.14.x should upgrade
to the 4.x series. Android apps should accept Kotlin libraries; it's
the platform's future. And JVM apps are less constrained by binary
size. Here's the size of OkHttp + transitive dependencies, and those
of alternatives:
* OkHttp 4.4: 2.47 MiB including Kotlin stdlib (1.51 MiB)
* Apache HTTP Client 5.0: 1.78 MiB including slf4j-api (0.04 MiB)
* Jetty HTTP Client 9.4: 1.19 MiB
Theres a few TODOs outstanding around error cases, and I need to
run integration tests against real-world things. But the core
functionality works.
I used coverage to confirm the context takeover cases are exercised
with and without.
We attempt to minimize connection and reconnection work, but in this case we
were overly aggressive about retaining the same connection. In some deployments
services will share certificates but not DNS addresses; when redirecting
between such services we were incorrectly attempting to reuse the connection.
This would have resulted in 404s and other misdirected requests.
Closes: https://github.com/square/okhttp/issues/5859
* Allow for users who have disabled certificate checks in dev.
* Avoid repeated calls
* typo
* Lock is assumed at this point
* Stay safe
* rework
* spotless
* Fix
* Handle one more case
* Capture the exception
* Add test
* Comment
An old version of OkHttp web sockets supported streaming messages,
so a writer could transmit partial bytes of a message without
completing it.
When we promoted Web Sockets as a core feature we dropped support
for streaming a single message. But we still had the mechanism
that implemented it.
This PR removes that mechanism, which should make it easier to
implement compression.
Originally contributed via PR #4871. This differs from that contribution
in a few ways:
- Combined inflater and deflater into one test
- Always operate on a buffer in-place
- Support no context takeover in both reading and writing