Rather than immediately and violently closing the HTTP/2 stream,
we initiate the shutdown sequence for a graceful disconnect.
This fixes StreamAllocation to avoid creating new streams on
shutdown connections. That behavior is not well tested, however.
That will come by integrating dave-r12's PR:
See https://github.com/square/okhttp/pull/2889
Running the HPACK regression suite shows that in some cases we may
use the wrong dynamic index after the dynamic table has been resized.
This fixes the problem and simplifies the implementation to avoid
maps with Integer values, which were difficult to reason about and
easy to get out-of-sync with the main table.
Previously, we exposed this method and called it when receiving the
header table size setting from a remote peer. We concluded this was not
the intent of the spec and removed that code.
Previously we were misinterpretting which hosts this method applied to.
Suppose an Android app was configured to require TLS for bank.com and
not for any other address. The NetworkSecurityPolicy.isCleartextTrafficPermitted()
method would return false because cleartext traffic wasn't universally
permitted. And OkHttp would incorrectly forbid cleartext communication
to other hosts like puppies.com.
Closes: https://github.com/square/okhttp/issues/2640
These are currently being encoded in UTF-8, and the charset is not
otherwise specified, so the result is not necessarily going to
succeed at caching.
But this avoids crashing when the server returns an unexpected ETag.
Closes: https://github.com/square/okhttp/issues/2628
These three methods were delegating to delegate; their implementation
was duplicated across both subclasses of DelegatingHttpsURLConnection.
This change moves them into the base class in order to
- avoid duplication
- separate the responsibility of delegation (base class) from the
responsibility of change to behavior (subclasses).
Notes:
- Since these three methods are not available in Java 6, each of
these need a @IgnoreJRERequirement annotation to pass the
animal sniffer test. This appears like it should have been
necessary before but for some reason it used to pass without.
- This in turn requires a new dependency from okhttp-urlconnection
onto animal-sniffer-annotations. The dependency was added onto
version 1.11 of that library (consistent with okhttp itself);
okio depends on version 1.10, the latest version is 1.15.
BridgeInterceptor does some basic header management and implements gzip
on responses.
CacheInterceptor implements HTTP response caching.
ConnectInterceptor takes the StreamAllocation that's already allocated
and uses it to create an HttpStream.