1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-17 08:42:25 +03:00
Commit Graph

2511 Commits

Author SHA1 Message Date
jwilson
b031042e67 [maven-release-plugin] prepare release parent-3.3.0 parent-3.3.0 2016-05-24 22:12:28 -04:00
jwilson
6b9eeb18d4 Update changelog for OkHttp 3.3.0. 2016-05-24 22:08:43 -04:00
Jesse Wilson
acbd4e4d13 Merge pull request #2571 from square/jwilson.0521.recover_from_refused_stream
Recover from REFUSED_STREAM errors in HTTP/2.
2016-05-24 21:40:23 -04:00
jwilson
c9290b7696 Recover from REFUSED_STREAM errors in HTTP/2.
This implements the following policy:

 - If a REFUSED_STREAM error is received, OkHttp will retry the same stream
   on the same socket 1x.
 - If any other error is received, or an additional REFUSED_STREAM error is
   received, OkHttp will retry on a different route if one exists.

We may want to follow up by going through HTTP/2 error codes and deciding
a per-code retry policy, but this should be good enough for now.

Closes: https://github.com/square/okhttp/issues/2543
2016-05-24 21:40:09 -04:00
Jesse Wilson
ed943ce136 Merge pull request #2574 from square/jwilson.0522.flush_on_window_updates
Flush streams if the window size is zero.
2016-05-22 23:15:10 -04:00
jwilson
1503e362f6 Flush streams if the window size is zero.
Otherwise we can deadlock, with OkHttp waiting for the server to send a larger
window and the server not knowing that there's a stream that even wants it.
2016-05-22 10:18:10 -04:00
Jesse Wilson
3f7a3344a4 Merge pull request #2572 from square/jwilson.0521.close_examples
Better documentation and examples on closing response bodies.
2016-05-21 22:23:48 -04:00
jwilson
3699d5c9fd Better documentation and examples on closing response bodies.
Also implement Closeable on Response to make it easier to do the right thing.
2016-05-21 21:29:42 -04:00
Jesse Wilson
0693302fca Merge pull request #2559 from square/jwilson_0514_bad_interceptor_check
Another approach to handling strange interceptor bodies.
2016-05-14 16:52:01 -04:00
jwilson
ec0301acb4 Another approach to handling strange interceptor bodies.
The previous approach Just Works if users have fancy or interesting interceptors
that genuinely need to swap the response body in an interceptor and keep the
original body.

One problem with that solution is that although it gives expert users a powerful
way to separate response bodies, it also allows normal users to accidentally leak
response bodies in their interceptors.

This is an alternate solution that forbids the expert use case and requires that
closing the response body stream also closes the underlying socket stream. It
throws an exception if that implicit contract is not honored.

I'm fine with either solution but think we should consider both.
2016-05-14 14:05:56 -04:00
jwilson
61c1dad837 Merge branch 'adennie-log-connect-failure'
* adennie-log-connect-failure:
  update Logging Interceptor to log connection failures
2016-05-14 13:21:36 -04:00
Andy Dennie
f1dea26fd6 update Logging Interceptor to log connection failures 2016-05-14 13:21:09 -04:00
Jake Wharton
03d4edcc2e Merge pull request #2555 from square/jwilson.0512.close_response_body
Don't crash when a stream hasn't been closed.
2016-05-13 15:14:36 -07:00
jwilson
a54adcef12 Don't crash when a stream hasn't been closed.
Closes: https://github.com/square/okhttp/issues/2409
2016-05-12 21:04:10 -04:00
Jake Wharton
276ef646cd Merge pull request #2544 from square/jwilson.0508.no_synthetic_headers
Promote sent and received timestamps to fields on Response.
2016-05-09 00:03:38 -04:00
jwilson
bab8943f2b Promote sent and received timestamps to fields on Response.
I'm currently keeping these as longs. That's easy an unambiguous, but it also
feels rather primitive.

This was more work than I expected, but it doesn't seem particularly risky.
It's also potentially more efficient, since there's fewer places where we're
converting from string to long and vice versa.

Closes: https://github.com/square/okhttp/issues/2035
2016-05-08 15:25:56 -04:00
Jesse Wilson
7067047312 Merge pull request #2539 from square/jwilson.0507.dispatcher_shutdown
Unblock waiting dispatchers on MockWebServer shutdown.
2016-05-08 09:59:53 -04:00
Jesse Wilson
3dc5ab2353 Merge pull request #2540 from square/jwilson.0507.logging
Make logging more consistent throughout OkHttp.
2016-05-08 09:59:24 -04:00
jwilson
4f24a30c12 Make logging more consistent throughout OkHttp.
Avoid using System.out.

Use the best logging implementation on the host platform. On Java this is
java.util.logging. On Android it's Android.util.Log.

Closes https://github.com/square/okhttp/issues/2505
2016-05-07 21:08:37 -04:00
jwilson
ae5c364051 Unblock waiting dispatchers on MockWebServer shutdown.
Closes https://github.com/square/okhttp/issues/2521
2016-05-07 18:56:30 -04:00
Jake Wharton
80ab4a3761 Merge pull request #2538 from square/jwilson.0507.fewer_pins
Pin fewer certificates in our sample.
2016-05-07 18:45:51 -04:00
jwilson
94bda42362 Pin fewer certificates in our sample.
Closes: https://github.com/square/okhttp/issues/2535
2016-05-07 18:21:50 -04:00
Jesse Wilson
4505c1b856 Merge pull request #2520 from yschimke/platform_cleanup
split out platform and test them based on active profile
2016-05-07 18:13:45 -04:00
Yuri Schimke
3c51907351 split out platform building now that there are 4 2016-05-05 14:34:06 +10:00
Jake Wharton
be605dd647 Merge pull request #2529 from square/jwilson_0502_okio
Upgrade to Okio 1.8.0.
2016-05-02 01:33:21 -04:00
jwilson
ba51f5bff8 Upgrade to Okio 1.8.0. 2016-05-02 00:48:15 -04:00
Jesse Wilson
312ebb36c6 Merge pull request #2528 from Mauin/update_junit
updates junit version to v4.12
2016-05-01 12:09:28 -04:00
Marvin Ramin
8f8018ce5d updates junit version to v4.12 2016-05-01 10:48:15 +02:00
Jesse Wilson
adc97d5537 Merge pull request #2523 from venilnoronha/issue-2522-fix
Setting default String locale to Locale.US
2016-04-28 22:41:10 -04:00
Venil Noronha
4b0c09eb6f Fixes #2522 - Format String using Locale.US. 2016-04-29 08:05:35 +05:30
jwilson
48ff30b428 Merge branch 'venilnoronha-issue-2513-fix'
* venilnoronha-issue-2513-fix:
  Fixes #2513 - NetworkSecurityPolicy based ConnectionSpec setup.
2016-04-26 23:42:09 -04:00
Venil Noronha
e3cd9b9f1c Fixes #2513 - NetworkSecurityPolicy based ConnectionSpec setup. 2016-04-26 23:41:58 -04:00
Jesse Wilson
209c6c5589 Merge pull request #2507 from yschimke/java8_new
build with new alpn-boot and jdk 8 in travis
2016-04-23 23:08:57 -04:00
Yuri Schimke
6f18cc346a build with new alpn-boot and jdk in travis 2016-04-23 08:43:56 -07:00
Jake Wharton
a44b5ecfff Merge pull request #2502 from square/jwilson_0421_moshi
Use Moshi in OkHttp.
2016-04-22 13:46:55 -04:00
jwilson
ad103f421e Use Moshi in OkHttp.
As discussed here: https://github.com/square/okhttp/pull/2492
2016-04-21 23:20:30 -10:00
Jesse Wilson
081c74433c Merge pull request #2494 from yschimke/alpn_java9_support
Java 9 support for ALPN without alpn-boot
2016-04-21 21:57:27 -10:00
Jesse Wilson
bd76ea26e4 Merge pull request #2495 from yschimke/sni_doc
document support for SNI in OpenJDK
2016-04-21 21:56:34 -10:00
Jesse Wilson
ba54110370 Merge pull request #2496 from yschimke/retain_frame_logger
retain logger instance to actually log things
2016-04-21 09:00:28 -10:00
Jesse Wilson
14cb6e3e67 Merge pull request #2499 from square/dr-Apr212016-redact-async-url
Redact the full url in AsyncCall thread name.
2016-04-21 07:59:59 -10:00
Dave Roberge
047b56833c Redact the full url in AsyncCall thread name.
We don't want to accidentally leak sensitive information that may be
embedded in the url.
2016-04-21 08:52:22 -04:00
Yuri Schimke
5cf91cf72e retain logger instance to actually log things 2016-04-20 20:53:19 -07:00
Yuri Schimke
c63be3ee65 document support for SNI 2016-04-20 18:30:47 -07:00
Yuri Schimke
d8552f091b Java 9 support for ALPN without alpn-boot 2016-04-20 18:16:28 -07:00
Jesse Wilson
b26ad3e01e Merge pull request #2493 from positron/patch-1
Fix CertificatePinner javadoc to use a Builder
2016-04-19 22:06:31 -10:00
Philip Jagielski
75c23ddb00 Fix CertificatePinner javadoc to use a Builder
The provided example wouldn't compile because OkHttpClient doesn't have
a `setCertificatePinner()` method.
2016-04-19 17:48:03 -05:00
Jesse Wilson
bd22589ee3 Merge pull request #2479 from square/jwilson_0412_nuanced_connect_recovery
Further constrain when we recover from failed routes.
2016-04-12 23:20:36 -04:00
jwilson
51e4e39842 Further constrain when we recover from failed routes.
Don't recover if we encounter a read timeout after sending the request, but
do recover if we encounter a timeout building a connection.

See https://github.com/square/okhttp/issues/2394
2016-04-12 22:37:04 -04:00
Jesse Wilson
c9ad163e92 Merge pull request #2473 from square/jwilson_0410_connection_preface
Don't start the reader thread until after the connection preface.
2016-04-10 15:02:18 -04:00
jwilson
8996934748 Don't start the reader thread until after the connection preface.
This is slightly more work than ideal because our tests don't bother with the
connection preface. That makes the tests both simpler, and further from reality.
The workaround is a package-private method to keep the tests working as they
are currently.

Closes https://github.com/square/okhttp/issues/2469
2016-04-10 12:51:38 -04:00