This removes the Ping abstraction from our http2 package. This was written as
if it were a public API, but never exposed to any callers but tests. Removing
it makes it easier to lock down how pings are used.
This also removes the NullServer class, replacing it with a new SocketPolicy
on MockWebServer. The new SocketPolicy, STALL_SOCKET_AT_START, allows us to
do TLS and negotiate an HTTP/2 connection without actually building a proper
Http2Connection and without responding to pings.
The behavior in HTTP/2 connections is modeled after our behavior in web sockets.
We count outgoing pings, incoming pongs, and confirm that the pongs are keeping
up. If later we make this policy more sophisticated we can track the changes
in both places.
Closes: https://github.com/square/okhttp/issues/3261
There are several options for when to expect the pong response. I've
chosen to overload the ping interval. This seems reasonable because the
ping interval is the maximum amount of time that should elapse before
a connection failure is detected.
Closes: https://github.com/square/okhttp/issues/3227
* Add a failing test for handling 100 response when it was not requested
(#3628)
* Implement reading the correct response after unrequested 100-continue
* Update to new Gradle dependency configurations
Signed-off-by: shaishavgandhi05 <shaishgandhi@gmail.com>
* Add note for "api" usage
Signed-off-by: shaishavgandhi05 <shaishgandhi@gmail.com>
* Remove note on implementation vs. api depenedency
* Lookup the FQDN given the MockWebServer hostname to compare with the HttpUrl hostname. Issue #3546.
* Update MockWebServer to use the FQDN for its host name. Issue #3546.
This was fixed recently but we didn't update the corresponding test case. This
updates the test and adds a few more to confirm that HTTP/2 failure recovery
works as it should.
Closes: https://github.com/square/okhttp/issues/578
This changes RealWebSocket from using a shared ThreadPoolExecutor to
using a private ScheduledExecutorService. This make some of the code
simpler but it means that applications will hold 1 writer thread for
each websocket, even if it is mostly not writing.
Testing automatic pings is awkward. This refactors much of
RealWebSocketTest to make it more natural to reinitialize the
configuration.
Closes: https://github.com/square/okhttp/issues/2993