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

2857 Commits

Author SHA1 Message Date
jwilson
9dc1bbad24 [maven-release-plugin] prepare release parent-3.6.0 parent-3.6.0 2017-01-29 14:14:33 -05:00
jwilson
a3ffe6568b Update changelog for OkHttp 3.6.0. 2017-01-29 14:11:17 -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
Jake Wharton
158692870d Merge pull request #3142 from square/jwilson.0129.framed
Fix some classnames to use Http2 instead of Framed
2017-01-29 12:40:41 -05:00
jwilson
3931dc8df0 Fix some classnames to use Http2 instead of Framed 2017-01-29 12:09:31 -05:00
Jesse Wilson
f54130499a Merge pull request #3139 from yschimke/junit5_compat
junit 5 compatibility for MockWebServer
2017-01-28 14:09:54 -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
4de39f274d Merge pull request #3137 from 15characterlimi/test-disconnect-during-connect
HUC regression test: disconnect in the middle of connecting.
2017-01-27 14:25:20 -05:00
Tobias Thierer
92bf655259 HUC regression test: disconnect in the middle of connecting.
Prior to commit 084b06b48b (OkHttp 3.4.0),
a HttpURLConnection.disconnect() in the middle of connecting caused an
infinite loop. HUC does not claim to be thread safe, but concurrent
disconnect should generally be supported (it is supported by HttpEngine)
and this bug occurred even when the disconnect() happened in the same
thread, e.g. through the CookieJar.

The infinite loop prior to that CL occurred because
 - The loop in HttpURLConnectionImpl.java:418 did not check for the
   disconnected state,
 - {StreamAllocation,RetryAndFollowUpInterceptor}.recover() returns
   true for canceled StreamAllocations/calls, but
   StreamAllocation.newStream() immediately fails if already canceled.

This bug was specific to HUC and did not affect the Call API because
RetryAndFollowUpInterceptor's (and, in earlier OkHttp versions,
Call.getResponse()'s) infinite loop did check the canceled case
before proceeding.

The bug existed since at least OkHttp 2.7.5, likely introduced by
commit c358656c87 (OkHttp 2.7.0).

The new test asserts that a disconnect() while constructing the
cookie headers leads to the new connection being aborted. It would
also be permissible for the connection to succeed (as long as it
doesn't deadlock like it used to), but the stricter test seems
reasonable to ensure that any behavior change is deliberate.
A disconnect() while accessing the Cache FileSystem has the same
effect, but this is not covered by the added test because a
new FileSystem wrapper class that delegates all calls would
create code maintenance overhead.
2017-01-27 18:16:56 +00:00
Jesse Wilson
894dbfa98f Merge pull request #3134 from erikghonyan/credentials-charset
Add charset support for Credentials.basic
2017-01-26 09:31:19 -05:00
Erik Ghonyan
3682ee7872 Add charset support for Credentials.basic 2017-01-26 12:11:38 +04:00
Jesse Wilson
2e036f61a2 Merge pull request #3127 from square/dr.0121.severe-cache-init-recover
Recover from a severe cache initialization failure.
2017-01-21 20:07:46 -08:00
Dave Roberge
86c3233f9c Recover from a severe cache initialization failure.
Closes: https://github.com/square/okhttp/issues/3115
2017-01-21 09:24:00 -05:00
Jesse Wilson
71bd925cd2 Merge pull request #3120 from square/dr.0118.cache-init-recovery
Added test for cache initialization failure and recovery.
2017-01-20 13:40:56 -08:00
Jesse Wilson
614f71fc48 Merge pull request #3126 from square/jw/one-twenty-one
Add ALPN jars for JDK 1.8.0_121.
2017-01-20 13:39:48 -08:00
Jesse Wilson
0ed48903b0 Merge pull request #3125 from square/jw/socket
Use Socket instead of Closeable for compatibility.
2017-01-20 13:39:32 -08:00
Jake Wharton
14b6c8a7aa Add ALPN jars for JDK 1.8.0_121. 2017-01-20 12:27:41 -08:00
Jake Wharton
5af089a719 Use Socket instead of Closeable for compatibility.
Versions prior to Android 4.4 (Java 6) did not have Socket implementing Closeable.
2017-01-20 11:54:21 -08:00
Dave Roberge
6a9db2287c Added test for cache initialization failure and recovery.
https://github.com/square/okhttp/issues/3115
2017-01-18 09:25:00 -05:00
Jake Wharton
219776bd7e Merge pull request #3108 from square/jwilson.0115.intercept_host
Permit network interceptors to rewrite the host header.
2017-01-17 12:05:58 -08:00
jwilson
8864c5d687 Permit network interceptors to rewrite the host header.
This makes it possible to do domain fronting.

Closes https://github.com/square/okhttp/issues/3103
2017-01-16 11:12:04 -05:00
Jake Wharton
0d867ab9fc Merge pull request #3100 from square/jwilson.0110.drop_bogus_cookies
Drop cookies that contain ASCII NULL and other bad characters.
2017-01-11 00:44:16 -08:00
jwilson
c74831d620 Drop cookies that contain ASCII NULL and other bad characters.
Closes https://github.com/square/okhttp/issues/2939
2017-01-10 23:05:58 -05:00
Rob Bygrave
592d53b90d Website only: Update first example to use try with resources (#3096) 2017-01-08 22:49:49 -05:00
Rob Bygrave
64e84e382e Javadoc only: Update javadoc on Call to encourage closing the Response… (#3094)
* Javadoc only: Update javadoc on Call to encourage closing the Response (and underlying response body)

* website only: Update examples to encourage closing the Response (and underlying response body)
2017-01-08 21:10:26 -05:00
Jesse Wilson
21af010dca Merge pull request #3095 from rbygrave/websiteOnly
website only: Update examples to encourage closing the Response (and …
2017-01-08 21:09:03 -05:00
Rob Bygrave
be951db236 website only: Update examples to encourage closing the Response (and underlying response body) 2017-01-09 13:33:42 +13:00
Jesse Wilson
87b86a53c4 Add ProGuard config to README 2017-01-07 21:40:17 -05:00
Jesse Wilson
bdcd06f8ca Merge pull request #3091 from square/jwilson.0107.custom_cipher_siutes
Example on customizing cipher suites.
2017-01-07 21:33:20 -05:00
Jesse Wilson
87a3ec9177 Merge pull request #3092 from square/jwilson.0107.give_up_auth
Fix examples to give up if authentication fails.
2017-01-07 21:33:10 -05:00
Jesse Wilson
04496ebc77 Merge pull request #3080 from square/jwilson.0102.dedupe
Release duplicated multiplexed connections.
2017-01-07 18:46:04 -05:00
jwilson
cbe7baa474 Fix examples to give up if authentication fails.
Closes: https://github.com/square/okhttp/issues/2464
2017-01-07 18:45:32 -05:00
jwilson
bb0f81e1b8 Example on customizing cipher suites.
It's a disgusting amount of code unfortunately.

Closes: https://github.com/square/okhttp/issues/2698
2017-01-07 18:28:26 -05:00
Jesse Wilson
b336a03f68 Merge pull request #3089 from square/jwilson.0107.crawler_usability
Make the crawler a little better.
2017-01-07 17:34:58 -05:00
jwilson
ca76167504 Make the crawler a little better.
Name threads by their URLs. Don't follow all fragments of the same URL.
2017-01-07 15:07:46 -05:00
jwilson
98443a9ca8 Release duplicated multiplexed connections.
If we make concurrent requests to an HTTP/2 server, close all but
the first connection. Creating multiple connections and then later
releasing them is somewhat pessimistic; it's also much safer for
awkward cases like connect attempts being canceled.

Closes: https://github.com/square/okhttp/issues/373
2017-01-07 14:15:48 -05:00
Jesse Wilson
de8699b62d Merge pull request #3078 from square/jwilson.0102.guard_allocation_limit
Fix RealConnection to guard allocationLimit by connectionPool.
2017-01-02 14:58:20 -05:00
jwilson
8331b2d75a Fix RealConnection to guard allocationLimit by connectionPool.
I'm working towards making OkHttp limit itself to a single HTTP/2 connection
to a single host. In this work I found we're not sufficiently safe on
allocationLimit - connections are added to the pool when this is 0, and
the value is updated without any synchronization.

This change also reduces the visibility of some connection fields in
RealConnection and organizes the fields into two sets: those that are
immutable after connect and those that are guarded by connectionPool.

https://github.com/square/okhttp/issues/373
2017-01-02 12:36:51 -05: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
Jesse Wilson
90021dcaea Merge pull request #3057 from square/jwilson.1223.expect_continue
Support 'Expect: 100-continue' as a request header.
2016-12-27 19:06:20 -05:00
Jesse Wilson
1800cf3286 Merge pull request #3066 from yschimke/fix_CCCT_java_9
Fix CertificateChainCleanerTest for Java 9
2016-12-27 09:25:46 -05:00
Jesse Wilson
cd872fd838 Merge pull request #3069 from yschimke/java_9_test_failures
temporarily ignore failures with java 9
2016-12-27 09:23:59 -05:00
Jesse Wilson
77405870a7 Merge pull request #3068 from yschimke/alpn_8_112
version bump for JDK 8 (112)
2016-12-27 09:19:01 -05:00
Jesse Wilson
da597c4b1b Merge pull request #3067 from yschimke/sniffer_update_java_9
animal sniffer update for Java 9
2016-12-27 09:18:04 -05:00
Yuri Schimke
3a1f393576 temporarily ignore failures with java 9 2016-12-27 09:01:51 +00:00
Yuri Schimke
caec3c7118 fix CertificateChainCleanerTest for Java 9 2016-12-27 07:33:38 +00:00
Yuri Schimke
116f5d1492 animal sniffer update for Java 9 2016-12-27 07:31:56 +00:00
Yuri Schimke
d6589ead6d version bump for JDK 8 (112) 2016-12-27 07:25:02 +00:00