1
0
mirror of https://github.com/square/okhttp.git synced 2025-12-03 18:31:17 +03:00
Commit Graph

306 Commits

Author SHA1 Message Date
Yuri Schimke
c3c9592474 better mock test fix 2018-06-17 15:13:34 +01:00
Yuri Schimke
327de18c95 Fix tests for now 2018-06-16 12:26:45 +01:00
Yuri Schimke
d66238d256 Use header delay instead of body delay before status line (#4011)
* Use header delay instead of body delay before status line
2018-05-29 19:10:12 +01:00
Jesse Wilson
db18f0e404 Rename H2C to H2_PRIOR_KNOWLEDGE. (#3996)
The string h2c is used with cleartext upgrades. We're not doing those here,
so that identifier isn't appropriate.
2018-05-12 01:29:21 -07:00
Jaye Pitzeruse
9a6f88dc34 gh-1019: Implemented prior knowledge approach to h2c (#3873) 2018-02-26 23:55:10 +00:00
Jesse Wilson
e86eb0e48b [maven-release-plugin] prepare for next development iteration 2018-02-24 13:33:57 -05:00
Jesse Wilson
c0739a4199 [maven-release-plugin] prepare release parent-3.10.0 2018-02-24 13:33:52 -05:00
Jesse Wilson
af6198a1e9 Fail HTTP/2 connections if the pong is not received. (#3878)
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
2018-02-22 18:37:34 -05:00
Jesse Wilson
6c66d6c41b Fail web sockets if the pong is not received (#3870)
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
2018-02-20 15:02:29 -05:00
Yuri Schimke
14215b8b3f cleanup travis output (#3853) 2018-02-17 09:25:41 -05:00
Johan von Forstner
e5fa0b989e Handle 100 (Continue) HTTP response gracefully regardless of whether it was requested/expected (#3766)
* Add a failing test for handling 100 response when it was not requested
(#3628)
* Implement reading the correct response after unrequested 100-continue
2018-02-17 11:21:40 +00:00
Jesse Wilson
d0418379a7 Move MockWebServer's internal package to not collide with OkHttp's. (#3837)
Hoping this may prevent problems with the Java Platform Module System.
2018-02-09 06:20:57 +00:00
Yuri Schimke
d27531afa9 Use manifest entry for java 9 module name (#3743)
* Use manifest entry for java 9 module name

* add group

* specific names

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml

* Update pom.xml
2018-02-04 03:02:20 -05:00
Yuri Schimke
9cb3af2a03 Build Provider through the Platform (#3788) 2018-01-28 17:04:42 +00:00
Shaishav Gandhi
c22be89f4b Update to new Gradle dependency configurations (#3723)
* 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
2017-12-17 14:01:32 -05:00
Jesse Wilson
2bb2dc4340 [maven-release-plugin] prepare for next development iteration 2017-11-18 14:38:02 -05:00
Jesse Wilson
23b6f7556d [maven-release-plugin] prepare release parent-3.9.1 2017-11-18 14:37:50 -05:00
jwilson
51311219af [maven-release-plugin] prepare for next development iteration 2017-09-04 17:00:21 -04:00
jwilson
51663fd08f [maven-release-plugin] prepare release parent-3.9.0 2017-09-04 17:00:16 -04:00
Jesse Wilson
6f029dd3de Fix MockWebServer websockets to be thread safe. (#3567)
Closing the sink while another thread is writing the sink is a
potential source for races.

Closes: https://github.com/square/okhttp/issues/3138
2017-08-31 21:33:47 -04:00
Jesse Wilson
e5f50b5bc6 Fix MockWebServer handling of 'Expect: 100 Continue' (#3563)
Previously we'd skip the request body unless the socket policy was
EXPECT_CONTINUE.

Closes: https://github.com/square/okhttp/issues/3498
2017-08-30 22:03:09 -04:00
Jesse Wilson
207f5579d3 Omit the message from MockWebServer's HTTP/2 :status header (#3556)
This was a bug carried over from SPDY.

Closes: https://github.com/square/okhttp/issues/3484
2017-08-30 18:25:44 -04:00
Stuart Neivandt
c77023cd03 Test Failure in MockWebServerTest (#3547)
* 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.
2017-08-30 10:22:58 -04:00
Igor Fedorenko
cd22113332 Fix occasional hang with http2 goaway frames
Http2Connection was dropping headers of healthy streams
after GOAWAY frame.

Fixes #3422

Signed-off-by: Igor Fedorenko <ifedorenko@salesforce.com>
2017-08-14 10:43:14 -04:00
Jesse Wilson
13d81f8d1b Test event listeners on request body failures (#3511) 2017-08-07 16:55:54 -04:00
Jesse Wilson
ed7709dbe1 Correctly report response body stream failures with HTTP/2. (#3508) 2017-08-07 09:50:16 -04:00
Chris Cunniff
58e531da69 Add missing test for MockResponse setHeaders (#3443) 2017-07-03 15:06:00 -04:00
jwilson
304d2c9630 [maven-release-plugin] prepare for next development iteration 2017-05-13 10:58:15 -04:00
jwilson
cb981daecf [maven-release-plugin] prepare release parent-3.8.0 2017-05-13 10:58:04 -04:00
jwilson
6f8cdcca1d [maven-release-plugin] prepare for next development iteration 2017-04-15 21:53:08 -04:00
jwilson
e56f561e93 [maven-release-plugin] prepare release parent-3.7.0 2017-04-15 21:53:02 -04:00
Andreas Ahlenstorf
62cab6dd2d Expose request URL as HttpUrl 2017-03-07 17:16:02 +01:00
jwilson
9690110f81 [maven-release-plugin] prepare for next development iteration 2017-01-29 14:14:39 -05:00
jwilson
9dc1bbad24 [maven-release-plugin] prepare release parent-3.6.0 2017-01-29 14:14:33 -05:00
Jake Wharton
e172706b56 Merge pull request #3140 from square/jwilson.0128.fix_leaks
Fix a thread leak in MockWebServer's web socket tests.
2017-01-29 13:00:24 -05:00
jwilson
3931dc8df0 Fix some classnames to use Http2 instead of Framed 2017-01-29 12:09:31 -05:00
jwilson
a96c3a8007 Fix a thread leak in MockWebServer's web socket tests.
We were creating threads and not shutting them down as eagerly as we could have.
2017-01-28 14:07:59 -05:00
Yuri Schimke
5215762c9f review comments 2017-01-28 18:09:48 +00:00
Yuri Schimke
49e9294feb junit 5 compatibility 2017-01-28 15:39:43 +00:00
Jesse Wilson
5c7257d8d1 Merge pull request #3059 from square/jwilson.1224.confirm_http2_failures_are_decent
Confirm that HTTP/2 failure recovery is decent.
2016-12-27 20:05:05 -05:00
jwilson
a589b81703 Support 'Expect: 100-continue' as a request header.
This will stall reading the response body until the server returns
an intermediate '100 Continue' response.

Closes: https://github.com/square/okhttp/issues/675
2016-12-26 20:24:50 -05:00
jwilson
219f286fea Confirm that HTTP/2 failure recovery is decent.
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
2016-12-24 15:49:12 -05:00
jwilson
f88e012dab Confirm that OkHttp verifies IP address certificates.
Closes: https://github.com/square/okhttp/issues/3021
2016-12-07 22:00:59 -05:00
jwilson
29f69277ea [maven-release-plugin] prepare for next development iteration 2016-12-01 12:53:49 -05:00
jwilson
366bc4752b [maven-release-plugin] prepare release parent-3.5.0 2016-12-01 12:53:45 -05:00
jwilson
fa83afec25 Automatically ping the peer on a user-specified interval.
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
2016-11-29 09:14:35 -05:00
jwilson
68c0211cc2 Apply timeouts within individual frames. 2016-11-21 20:01:45 -05:00
jwilson
949439ae5b Rename NewWebSocket to WebSocket.
The synchronous WebSocket class is gone.
2016-11-19 15:16:58 -05:00
jwilson
40dddb9dcf Migrate MockWebServer to the async web sockets API. 2016-11-18 21:34:02 -05:00
jwilson
5bb4c0c293 Use Okio's hash methods. 2016-11-13 15:59:25 -05:00