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

1992 Commits

Author SHA1 Message Date
jwilson
f36bed41a8 [maven-release-plugin] prepare release parent-2.5.0 parent-2.5.0 2015-08-25 21:11:22 -04:00
Jesse Wilson
878fe21642 Merge pull request #1819 from square/jwilson_0825_okio_bump
Require Okio 1.6.0.
2015-08-25 21:04:34 -04:00
jwilson
035e3e512a Update changelog for 2.5.0. 2015-08-25 20:56:23 -04:00
jwilson
78d3d8e693 Require Okio 1.6.0. 2015-08-25 20:55:20 -04:00
Jesse Wilson
3435a805d0 Merge pull request #1817 from square/jwilson_0824_ebadf
Recover from Android 4.2.2 EBADF crashes.
2015-08-25 20:13:47 -04:00
jwilson
ebaaf10ec1 Recover from Android 4.2.2 EBADF crashes.
Originally submitted by @pguilbot.

See also https://github.com/square/okhttp/issues/1684
2015-08-24 22:43:38 -04:00
Jake Wharton
e364ccf27c Merge pull request #1799 from square/jwilson_0810_ise
Don't throw IllegalStateException after an IOException.
2015-08-10 00:25:25 -04:00
jwilson
dd8437b0a9 Don't throw IllegalStateException after an IOException.
We were a little too aggressive in checking our preconditions. If a previous
write failed, we don't want the following write to crash. (It'll throw an
IOException anyway.)
2015-08-10 00:08:29 -04:00
Jesse Wilson
ff60df839b Merge pull request #1789 from MichaelEvans/changing_scheme_fixes_default_ports
Changing the scheme will update the default port
2015-08-07 16:02:41 -04:00
Michael Evans
5bdcda6697 Changing the scheme will update the default port 2015-08-06 21:37:24 -04:00
Jesse Wilson
79b0a7cb91 Merge pull request #1794 from airbnb/airbnb/cancel-npe
Fixes #1787
2015-08-06 17:47:06 -04:00
Felipe Lima
f698a38d42 Fixes #1787 2015-08-06 13:59:34 -07:00
Jesse Wilson
e19b7913eb Merge pull request #1786 from square/jwilson_0803_default_user_agent
Make sure the default user agent is ASCII.
2015-08-03 01:32:13 -04:00
jwilson
0e7524da21 Make sure the default user agent is ASCII.
See https://github.com/square/okhttp/issues/891
2015-08-03 01:26:05 -04:00
Jake Wharton
bf69c55eb4 Merge pull request #1785 from square/jwilson_0803_strict_headers
Be strict on invalid characters in request headers.
2015-08-03 01:23:06 -04:00
jwilson
a57aa43c57 Be strict on invalid characters in request headers.
This includes potential security problems (newline characters) as well as
simple non-ASCII characters including international characters and emoji.

Closes https://github.com/square/okhttp/issues/891
2015-08-03 00:43:20 -04:00
Jake Wharton
7cf6363662 Merge pull request #1784 from square/jwilson_0802_use_httpurl_internally
Use HttpUrl internally.
2015-08-02 21:41:59 -04:00
jwilson
4c90a2e04a Use HttpUrl internally. 2015-08-02 21:01:26 -04:00
Jake Wharton
a52c510810 Merge pull request #1782 from square/jwilson_0801_fix_cancel
Make call canceling more reliable.
2015-08-02 01:12:07 -04:00
Jake Wharton
eb4a0f65e5 Merge pull request #1783 from square/jwilson_0801_ipv6_to_string
IPv6 canonical string.
2015-08-02 00:13:58 -04:00
jwilson
a8949b129d IPv6 canonical string.
Closes https://github.com/square/okhttp/issues/1636
2015-08-01 21:04:59 -07:00
jwilson
b42e73f497 Make call canceling more reliable.
We had a bug where the socket-being-connected wasn't being closed when the
application used Call.cancel(). The problem is that the SocketConnector model
assumes the Connection doesn't want a Socket instance until it's fully
connected.

This moves the SocketConnector code back into Connection, removes a lot of
nested try/catch blocks, and assigns a Socket instance as soon as its created.

This also likely fixes some bugs where sockets weren't being closed when
an IOException or RouteException was thrown during connection. Now we always
close at the top level of connect() unless the connection is successful.

https://github.com/square/okhttp/issues/1779
2015-08-01 16:54:13 -07:00
Jake Wharton
1e5f3a9679 Merge pull request #1781 from square/jwilson_0801_cache_filesystem
Expose internal APIs for pluggable file systems.
2015-08-01 15:13:10 -04:00
jwilson
a560f72193 Expose internal APIs for pluggable file systems.
We aren't yet ready to make FileSystem a public type, but I don't mind
making it _almost_ available via an internal API for those brave enough
to try that.

Also migrate all of our tests to use the in memory file system. It's simpler.

https://github.com/square/okhttp/issues/1459
2015-08-01 11:56:40 -07:00
Jesse Wilson
ad4b32868b Merge pull request #1765 from square/jw/make-mws-rule-just-a-mws-instance
Fold MockWebServerRule into MockWebServer.
2015-07-24 11:40:59 -07:00
Jake Wharton
8f5e344aba Fold MockWebServerRule into MockWebServer.
This avoid needing to duplicate the methods on the rule which historically was a subset of everything.

JUnit is now a required dependency.
2015-07-24 14:05:59 -04:00
Jesse Wilson
291870e5a2 Merge pull request #1760 from halizton/make_cache_init_public
make the DiskLruCache's initialize() public through the Cache interface
2015-07-22 00:53:38 -07:00
Lin Wang
6e6c3e939c Squashed commit of the following:
make the DiskLruCache's initialize() public through the Cache interface

The DiskLruCache’s cache does lazy initialization. The time spent in
initialization varies depending on the actual cache size and journal
file size.

On very low end device, the initialization time could be as long as
1000 ms once the cache reaches 100M for example on a 4.0 device. This
has significant performance impact on the very 1st cache hit.

So the proposed solution is to give the developer an opportunity to
explicitly do the initialization early on and in a back ground thread.
Without this change, the developer would have to call any method from
the Cache class to warm up the cache implicitly.
2015-07-22 00:27:09 -07:00
Jesse Wilson
58fc2bc9ce Merge pull request #1759 from square/jw/reuse-behavior-from-core
Use the same logic for permitting request body as client.
2015-07-21 22:46:59 -07:00
Jesse Wilson
64505fd325 Merge pull request #1758 from square/jw/only-disconnect-responses
Only disconnect response transfers with disconnect policy.
2015-07-21 22:46:18 -07:00
Jake Wharton
eeec4b8db8 Use the same logic for permitting request body as client. 2015-07-21 12:19:29 -04:00
Jake Wharton
dda7ce465d Only disconnect response transfers with disconnect policy. 2015-07-21 11:52:38 -04:00
Jake Wharton
e52e2b07da Merge pull request #1737 from mgp/patch-1
Use method start instead of play in example
2015-06-29 18:03:46 -04:00
Michael Parker
524361641c Use method start instead of play in example
Method play is deprecated in favor of start.
2015-06-29 14:13:27 -07:00
Jesse Wilson
70657bc5b9 Merge pull request #1731 from raskasa/master
Fix small typos in the ChangeLog
2015-06-27 10:06:12 -04:00
raskasa
c8c790a6c8 fix small types in the changelog 2015-06-26 21:49:09 -04:00
Jesse Wilson
d68430b8dd Merge pull request #1723 from square/jw/bump-okio
Bump Okio to 1.5.0.
2015-06-22 18:50:41 -04:00
Jake Wharton
7d59c083c1 Bump Okio to 1.5.0. 2015-06-22 10:32:11 -04:00
Jake Wharton
f0df400273 Merge pull request #1720 from square/jwilson_0621_sane_timeouts
Set default timeouts to ten seconds.
2015-06-21 20:55:40 -04:00
jwilson
0de14e992c Set default timeouts to ten seconds.
Closes https://github.com/square/okhttp/issues/1719
2015-06-21 18:00:33 -04:00
Jake Wharton
832038bdc2 Merge pull request #1718 from square/jwilson_0621_chunks
More tests on truncated response bodies.
2015-06-21 12:22:28 -04:00
jwilson
b28127c8a4 More tests on truncated response bodies.
Change the exception on a truncated chunked body.
2015-06-21 11:37:03 -04:00
Jesse Wilson
77fb83fc9f Merge pull request #1716 from square/jw/kill-halfway
Add socket policy to disconnect mid-response.
2015-06-21 11:36:15 -04:00
Jesse Wilson
cd3a9c3a7d Merge pull request #1715 from square/jw/mws-http-url
Add HttpUrl methods to MWS and update non-HUC usages.
2015-06-21 11:17:19 -04:00
Jake Wharton
4c50994029 Add HttpUrl methods to MWS and update non-HUC usages. 2015-06-21 03:40:34 -04:00
Jake Wharton
282b4184f7 Add socket policy to disconnect mid-response. 2015-06-21 03:37:47 -04:00
Jake Wharton
062435c45f Merge pull request #1714 from square/jwilson_0620_form_encoding
Fix FormEncodingBuilder to be consistent with browsers.
2015-06-20 23:15:59 -04:00
jwilson
33c52112cd Fix FormEncodingBuilder to be consistent with browsers.
Right now we're using the same encode set as the URL query; that's a mistake.
2015-06-20 20:08:24 -04:00
Jake Wharton
cf4b0192ad Merge pull request #1713 from square/jwilson_0620_test_1712
Test that conditional misses update the cache.
2015-06-20 11:33:53 -04:00
jwilson
3bee7aca20 Test that conditional misses update the cache.
Closes https://github.com/square/okhttp/issues/1712
2015-06-20 10:49:38 -04:00