1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-18 20:40:58 +03:00
Commit Graph

1722 Commits

Author SHA1 Message Date
Kirill Boyarshinov
cc94dea6d7 Throw SSLPeerUnverifiedException when host verification fails, instead of IOException 2015-02-10 10:30:40 +06:00
Jesse Wilson
eb5aeb0976 Merge pull request #1364 from raggi/support-custom-connectionspecs
ConnectionSpec: Allow custom specifications
2015-02-06 20:25:55 -05:00
James Tucker
fee2720913 ConnectionSpec: Allow custom specifications 2015-02-06 16:55:18 -08:00
Jake Wharton
b92c1b9db1 Wording tweak. 2015-01-31 14:47:13 -08:00
Jesse Wilson
31081fb82c Merge pull request #1357 from square/jw/do-not-round-timeouts
Do not allow timeouts less than 1ms.
2015-01-31 17:44:54 -05:00
Jake Wharton
58f6cf5130 Do not allow timeouts less than 1ms. 2015-01-31 14:37:12 -08:00
Jesse Wilson
c1a39c9ce6 Merge pull request #1355 from square/jwilson_0130_if_none_match
Send at most one condition.
2015-01-30 17:41:22 -05:00
jwilson
4db679b39e Send at most one condition.
Related to https://github.com/square/okhttp/issues/831
Closes: https://github.com/square/okhttp/issues/1354
2015-01-30 17:29:57 -05:00
Jesse Wilson
f84b4de480 Merge pull request #1353 from square/jwilson_0130_actually_async
Fix a major bug where threads weren't being created.
2015-01-30 13:27:05 -05:00
jwilson
24767e1387 Fix a major bug where threads weren't being created.
The LinkedBlockingQueue and core pool size of 0 do not interact well.
This prevents more threads from being created, harming overall
concurrency for async requests.
2015-01-30 13:26:44 -05:00
Jake Wharton
64193c7ded Merge pull request #1345 from brennantaylor/bt/config-mockwebserver-inetaddr
Allow user to configure what mockwebserver binds to
2015-01-28 10:17:09 -08:00
Jesse Wilson
3ee539edec Merge pull request #1347 from nfuller/PrivateCache
Private cache improvements
2015-01-26 10:27:01 -05:00
Neil Fuller
4048663140 Private cache improvements
Commit 112f020c41 changed
OkHttp's cache from being shared to private cache.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4
- permits caching of redirects for "private" responses.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3
"The s-maxage directive is always ignored by a private cache."
- the s-maxage check has been removed from the redirect caching
  checks too.
2015-01-26 09:50:52 +00:00
Brennan Taylor
c99ac2b462 Allow user to configure what mockwebserver binds to
Provide `start(InetSocketAddress)` and `start(InetAddress, port)` to
address #1342
2015-01-25 16:38:08 -08:00
Jesse Wilson
621d270207 Merge pull request #1341 from nfuller/OptConnectionSpec
Trivial optimization for comparing ConnectionSpecs
2015-01-21 22:56:11 -05:00
Neil Fuller
b16a4b2621 Trivial optimization for comparing ConnectionSpecs
ConnectionSpec instances will usually originate from
final statics, particularly ConnectionSpec.CLEARTEXT. This seems
like a no-brainer to avoid array comparisons.
2015-01-21 17:34:59 +00:00
Jesse Wilson
0a19746660 Merge pull request #1308 from nfuller/FixResponseCache
Fix ResponseCache handling for Android usecases
2015-01-18 13:47:33 -05:00
Jesse Wilson
e2f3a21849 Merge pull request #1330 from joschi/headers-map
Allow to create Headers from Map
2015-01-16 22:54:29 -05:00
Jesse Wilson
74001bbdb6 Merge pull request #1332 from jbornemann/update_http_default_cache_codes
Update http default cache codes
2015-01-16 22:52:54 -05:00
Jeff Bornemann
515ae8fef6 cache-by-default status codes now up to date 2015-01-16 17:07:47 -05:00
Jochen Schalanda
ab2dbb98dd Adapt to Square code style 2015-01-16 10:37:28 +01:00
Jochen Schalanda
dd0f2e9d1b Add method to create Headers from Map<String, String> 2015-01-15 16:08:32 +01:00
Jake Wharton
84d87a7e39 Merge pull request #1326 from nfuller/FixSocketCloseOnAndroid
Fix for MockWebServer on Android
2015-01-15 09:41:13 -05:00
Neil Fuller
0b69d29ba1 Fix for MockWebServer on Android
On Android L (and probably prior releases) it is necessary to
close a socket explicitly rather than relying on
InputStream/OutputStream to do it for you.

See bug here: https://code.google.com/p/android/issues/detail?id=97564
2015-01-15 10:37:00 +00:00
Jesse Wilson
c7803020b5 Merge pull request #1324 from nfuller/1208FollowUpFixes
Follow up fixes from pull request 1208
2015-01-14 15:24:54 -05:00
Neil Fuller
6e3fc45ebf Follow up fixes from pull request 1208
Based on comments made during the review.
2015-01-14 14:07:40 +00:00
Neil Fuller
3a65dcd37b Fix ResponseCache handling for Android usecases
Including the code in
okhttp-android-support/src/test/java/com/squareup/okhttp/android
provides easy verification of API or behavior changes that might
affect Android.

There are some small JavaApiConverter improvements.
2015-01-14 13:43:46 +00:00
Jake Wharton
1551f50f99 Merge pull request #1323 from square/jwilson_0113_clean_shutdown
Hurry up connection pool shutdown.
2015-01-13 18:42:14 -05:00
Jesse Wilson
e3d39f7ec0 Hurry up connection pool shutdown.
Closes https://github.com/square/okhttp/issues/1306
2015-01-13 18:33:37 -05:00
Jesse Wilson
14732f25ac Merge pull request #1317 from ajwhite/bugfix/delete-request-body
Bugfix - Optional DELETE RequestBody via Request.Builder
2015-01-13 18:17:23 -05:00
Jesse Wilson
2c3cd09a61 Merge pull request #1322 from nfuller/FixFallbackTlsExtensions
TLSv1 supports TLS extensions so they should be enabled
2015-01-13 18:15:02 -05:00
Jesse Wilson
6716888cb0 Merge pull request #1320 from nfuller/FixMockWebServerOnAndroid
Modify the way MockWebServer selects a host IP to bind to
2015-01-13 18:12:50 -05:00
Jesse Wilson
2f50252df4 Merge pull request #1312 from nfuller/PullOutAndroidSupport
Create a new maven artifact to hold things needed for Android embedding
2015-01-13 17:12:26 -05:00
Jesse Wilson
ef4e9b99d3 Merge pull request #1299 from nfuller/ConnectionRouteSelection2
Refactoring: Make RouteSelector independent of Connection
2015-01-13 17:09:54 -05:00
Jesse Wilson
bd83d72b95 Merge pull request #1208 from nfuller/CipherSuiteSocketDefaultRevert
Modify the cipher suite / TLS version selection behavior
2015-01-13 16:51:00 -05:00
Neil Fuller
285ac49b6a TLSv1 supports TLS extensions so they should be enabled
Follow up to:
https://github.com/square/okhttp/pull/1196.

Combined with an NPN bug (18705877) on Android this is the
reason why fallback connections started failing on Android
after the COMPATIBLE_TLS was changed to be TLSv1.

[The NPN bug means that once enabled on a socket from an
SSLContext then NPN must be configured for every subsequent
socket otherwise some of the NPN state will still be set,
but some will be missing, leading to negotiation issues].

The implication of this change is that the follow up request
after a handshake failure may now be HTTP/2 or SPDY
(or HTTP/1.1). Previous to this change they would always
have been HTTP/1.1.

Previous to pull 1196 they would also have been
HTTP/1.1 because COMPATIBLE_TLS was SSLv3.
2015-01-13 14:59:27 +00:00
Jake Wharton
6a959365c9 Merge pull request #1321 from nfuller/FixCallTestOnAndroid
Fix the user agent test so it works with a different user agent string
2015-01-13 09:01:43 -05:00
Jake Wharton
b9b06e13dd Merge pull request #1315 from square/jw/move-string-helpers
Move stringy test methods to test class.
2015-01-13 09:01:03 -05:00
Jake Wharton
62efd9184c Move stringy test methods to test class. 2015-01-13 08:54:02 -05:00
Neil Fuller
6a5a61a47a Fix the user agent test so it works with a different user agent string
The important thing is that the Version.userAgent() string is used and
not the exact string.
2015-01-13 13:48:26 +00:00
Neil Fuller
9877d1b4da Modify the way MockWebServer selects a host IP to bind to
On Android getByName(null) returns the first of
[IPv6 loopback, IPv4 loopback], binding the server to ::1.
The IPv6 loopback address returns "localhost". "localhost"
does not resolve to the IPv6 address.

Instead: explicitly select "localhost" ensuring
MockWebServer binds to an IP that can be looked up by name
and should also be a loopback address.
2015-01-13 13:44:20 +00:00
Jesse Wilson
7282664d97 Merge pull request #1316 from square/jw/skip
Empty sinks must still honor the contract by consuming the bytes.
2015-01-13 08:14:59 -05:00
Atticus White
e97bb77a0e adds optional request body for DELETE requests to ammend #610 2015-01-12 19:50:18 -05:00
Jake Wharton
f7de645ded Empty sinks must still honor the contract by consuming the bytes. 2015-01-12 18:25:33 -05:00
Jake Wharton
6910936dd3 Merge pull request #1313 from nfuller/FixDiskLruCacheAfterInit
Fix isClosed() when a cache has not been initialized
2015-01-12 06:25:24 -08:00
Neil Fuller
99f2bafe1c Fix isClosed() when a cache has not been initialized
isClosed() now means "has close() been called", after
commit ea565b2e30
it meant "has not been initialized or close() has been
called".

Introduced explicit closed state. Minor tweak to use
initialized state to determine whether cleanup will
do anything. Added a test.
2015-01-12 13:22:09 +00:00
Neil Fuller
c9b0262c40 Create a new maven artifact to hold things needed for Android embedding
okhttp-android-support contains classes needed for Android embedding and
not for normal OkHttp development. The classes here can be excluded from
okhttp-urlconnection, shrinking that artifact. More classes will be
added to this component to make Android maintenance easier.
2015-01-12 10:55:17 +00:00
Jake Wharton
78c493e337 Merge pull request #1310 from square/jw/lazy-cache
Lazily initialize the cache.
2015-01-11 13:32:58 -08:00
Jake Wharton
ea565b2e30 Lazily initialize the cache. 2015-01-11 13:28:13 -08:00
Jesse Wilson
510af4e491 Merge pull request #1307 from nfuller/IoExceptionOnResponseBody3
Source-incompatible: ResponseBody methods throw IOException
2015-01-09 11:04:52 -05:00