1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-15 20:56:41 +03:00

289 Commits

Author SHA1 Message Date
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
jwilson
5d70f5f7a7 Make HTTP/2's DISCONNECT_AT_END more graceful.
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
2016-11-01 20:58:10 -04:00
Jake Wharton
508eb90b3c Web socket API and implementation improvements.
* onFailure callback's exception type widened to Throwable. This allows runtime exceptions from other callbacks to be passed along.
* Ensure the connection is closed properly for all failures.
* Fix and document the threading inside RealWebSocket. This ensures the listener is always called on the same thread and replies always happen from the correct thread.
2016-09-19 23:53:55 -04:00
Jesse Wilson
7135628c64 Merge pull request #2852 from square/jw/web-sockets
Move WebSockets from separate artifact to main.
2016-09-14 14:58:30 -04:00
Jake Wharton
404f63a20c Implement Closeable on MockWebServer.
Enables use via try-with-resources.
2016-09-13 13:56:03 -04:00
Jake Wharton
039bcf92db Move WebSockets from separate artifact to main.
The factory method has moved to OkHttpClient and WebSocketCall has changed to an interface.
2016-09-13 12:29:19 -04:00
Yuri Schimke
45f9338ea8 client auth tests
Verify client auth support for JDK cases.
2016-08-21 07:15:52 +01:00
jwilson
3d43a8dba8 Rename FramedConnection to Http2Connection.
Also rename HttpStream to HttpCodec. This is the interface implemented
for both HTTP/1.1 and HTTP/2. The HTTP/2 codec creates a stream when
it is used.
2016-07-09 18:09:19 -04:00
jwilson
0c04821a25 Drop support for SPDY/3.
It's redundant with HTTP/2.
2016-07-09 17:19:04 -04:00
jwilson
f85cae7f0d [maven-release-plugin] prepare for next development iteration 2016-07-08 22:39:32 -04:00
jwilson
ee2b9a2917 [maven-release-plugin] prepare release parent-3.4.0 2016-07-08 22:39:28 -04:00
Yuri Schimke
8fe73c05d8 java 9 tests 2016-07-03 07:03:48 -07:00
jwilson
7e773f39f9 [maven-release-plugin] prepare for next development iteration 2016-07-02 23:18:34 -04:00
jwilson
9db491924a [maven-release-plugin] prepare release parent-3.4.0-RC1 2016-07-02 23:18:29 -04:00
jwilson
50ff1e140f Permit non-ASCII ETag headers.
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
2016-07-01 13:42:33 -04:00
jwilson
c5187583bb Add connection, cache, and platform subpackages. 2016-06-26 23:04:30 -04:00
Tobias Thierer
943b582a36 Reduce memory requirements for MockWebServerTest.disconnectHalfway().
MockWebServer.readRequest() was accumulating the request body (1 GByte)
into an unbounded buffer held in memory. This caused the test to fail
with an OutOfMemoryError on low-memory devices. Due to the OOME, not
even a stacktrace was available.

This CL introduces setBodyLimit() to limit the amount of data held in
memory. Note that this is similar to the call to setBodyLimit(0) that
already exists in URLConnectionTest.veryLargeFixedLengthRequest().
2016-06-21 17:51:54 +01:00
jwilson
7a807aff6f [maven-release-plugin] prepare for next development iteration 2016-05-28 14:11:55 -04:00