1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-27 04:22:07 +03:00
Commit Graph

386 Commits

Author SHA1 Message Date
Kristopher Wuollett
8035fda72f Added contentType/Encoding to HttpResponse's Entity.
Clients should expect that OkHttpClient HttpResponse Entity's contentType
and contentEncoding are not null when the headers are present.
2013-07-11 23:02:47 -07:00
Jake Wharton
4a13338569 Merge pull request #247 from square/jwilson/new_ioe
Don't use IOException APIs not in Gingerbread
2013-07-11 21:44:32 -07:00
jwilson
ef09f798a3 Don't use IOException APIs not in Gingerbread 2013-07-12 00:43:03 -04:00
Jesse Wilson
452afb381a Merge pull request #246 from kriswuollett/no_fin_on_closed_stream
Stopped sending final empty frame on stream initiated in sender half-closed state.
2013-07-11 21:36:30 -07:00
Kristopher Wuollett
63508d956a Stopped sending empty frame on stream initiated in sender half-closed state.
The SPDY protocol states the sender of FLAG_FIN must not send further frames
on that stream.  This change skips the sending of a final (empty) frame with
FLAG_FIN set when the stream is already half-closed because SYN_STREAM was
sent with FLAG_FIN set.
2013-07-11 16:03:33 -07:00
Jake Wharton
0b4b3c46be Merge pull request #245 from kriswuollett/checkstyle_platform_java
Removed trailing whitespace in Platform.
2013-07-11 13:29:00 -07:00
Kristopher Wuollett
6cb214f0f4 Removed trailing whitespace in Platform. 2013-07-11 13:03:14 -07:00
Jesse Wilson
142b707313 Merge pull request #244 from narayank/master
Catch SecurityExceptions from socket connects.
2013-07-11 05:28:10 -07:00
Narayan Kamath
d66810bf0e Catch SecurityExceptions from socket connects.
Versions of android prior to 4.3 would throw RTEs
if the underlying socket threw an EACCES error.

See change 50144 on the Android Open Source Project.
2013-07-11 11:39:24 +01:00
Jesse Wilson
9a63d68b04 Merge pull request #243 from kkocel/patch-1
Fixed Alcatel getByInetAddress bug.
2013-07-09 04:06:15 -07:00
Christopher Kocel
7e3e8bb8c5 Fixed Alcatel ``getByInetAddress`` bug.
Added catch for NullPointerException. I wish it was java7 when You could catch multiple exceptions ...
2013-07-09 10:45:34 +02:00
Jake Wharton
64e58d4ed0 Merge pull request #241 from square/jwilson/introduce_policy
Introduce a Policy interface between engine and connection.
2013-07-09 00:25:47 -07:00
jwilson
5f87fc19ab Introduce a Policy interface between engine and connection.
This breaks the direct dependency from HttpEngine to
HttpURLConnectionImpl. With this dependency broken, we
can start to use HttpEngine directly from Dispatcher and
Job.
2013-07-09 01:57:50 -04:00
Jesse Wilson
13f46339d9 Merge pull request #238 from square/jwilson/long_length
Support streaming request bodies longer than 2 GiB.
2013-07-08 22:55:41 -07:00
jwilson
c2da9cc645 Support streaming request bodies longer than 2 GiB.
This uses a new API only available in Java 1.7 and
better.
2013-07-09 01:54:15 -04:00
Jesse Wilson
cc59ecd578 Merge pull request #239 from square/jwilson/refactor_to_client
Push state from HttpURLConnectionImpl to OkHttpClient
2013-07-08 21:21:26 -07:00
jwilson
39b3b59f6f Push state from HttpURLConnectionImpl to OkHttpClient
We aren't going to use HttpURLConnectionImpl for
requests with the new API.

This is safe because we always do a shallow copy of
the OkHttpClient before using it to create a
HttpURLConnectionImpl.
2013-07-08 18:29:06 -04:00
Jesse Wilson
76d3637d47 Merge pull request #237 from square/jwilson/request_bodies
Add factory methods to create request bodies
2013-07-05 18:03:42 -07:00
jwilson
1bd4dd1a55 Add factory methods to create request bodies 2013-07-05 18:03:19 -07:00
Jake Wharton
eb3a162c77 Merge pull request #236 from square/jwilson/mediatype
Add a media type class to OkHttp.
2013-07-04 23:16:13 -07:00
Jake Wharton
6bf1eb07b0 Merge pull request #233 from square/jw/invalidation
Ensure cache entries are invalidated even for uncacheable POST-like requests.
2013-07-04 22:37:38 -07:00
Jake Wharton
c175767b7f Merge pull request #235 from square/jw/sdf-lazy-cache
Cache all non-standard date format instances lazily.
2013-07-04 22:36:19 -07:00
jwilson
c3652689c4 Add a media type class to OkHttp.
This allows us and our users to parse out the charset of
a content type, so we can cleanly create Readers and Strings
for content of any type.

This is similar to Guava's MediaType but with many differences.

* Guava's MediaType parses all parameters independently. We don't.
  We may later want to support this lazily for users like MimeCraft.

* Guava uses a custom Tokenizer; we use regular expressions.

* Guava includes a registry of common media types; we don't.

* Guava supports media queries and building media types; we don't.

Applications that need advanced features should probably use
Guava's MediaType class. My goal here was to get everything we
need in a small amount of code.
2013-07-04 14:26:50 -07:00
Jake Wharton
03902bc48f Cache all non-standard date format instances lazily. 2013-07-04 08:01:29 -07:00
Jesse Wilson
a08cb3235b Merge pull request #225 from square/jwilson/experimental
First step in an async HTTP API.
2013-07-04 07:51:33 -07:00
jwilson
c8e37ce19b First step in an async HTTP API.
This is very experimental right now but it sets us up
for a full asynchronous API. The current implementation
builds an async API over our existing synchronous API.
Future refactorings to the internals should promote the
async API throughout the codebase, particularly in SPDY.
That way we can have more requests in flight than threads
processing those requests.
2013-07-04 07:50:57 -07:00
Jake Wharton
1d33ae5968 Merge pull request #232 from square/jw/apache-thangs
Request entity tests for the Apache client shim.
2013-07-04 00:34:20 -07:00
Jake Wharton
b6a68e1add Merge pull request #234 from square/jw/header-prefix
Change custom headers to 'OkHttp-Foo-Bar' format.
2013-07-04 00:34:01 -07:00
Jake Wharton
3108f7c233 Ensure cache entries are invalidated even for uncacheable POST-like requests. 2013-07-04 00:32:53 -07:00
Jake Wharton
53e12cca33 Request entity tests for the Apache client shim. 2013-07-04 00:03:28 -07:00
Jesse Wilson
cee52c48aa Merge pull request #231 from square/jw/default-timeouts
Allow specifying default timeouts for connect and read per OkHttpClient.
2013-07-03 23:40:07 -07:00
Jake Wharton
4d506df096 Allow specifying default timeouts for connect and read per OkHttpClient. 2013-07-03 23:22:43 -07:00
Jake Wharton
27861c698b Change custom headers to 'OkHttp-Foo-Bar' format.
Provide a public but internal API for setting this to different values. For example, the Android OS will need to call this method with 'X-Android' as a value.
2013-07-03 22:09:52 -07:00
jwilson
ad5ac4a57f [maven-release-plugin] prepare for next development iteration 2013-06-23 20:01:05 -04:00
jwilson
d439855a9d [maven-release-plugin] prepare release parent-1.1.1 parent-1.1.1 2013-06-23 20:01:02 -04:00
Marcelo Cortes
5315a9376f Merge pull request #218 from square/jwilson/keep_alive_timeout
Make ConnectionPoolTest less flaky
2013-06-23 16:52:03 -07:00
jwilson
a39032cb0a Make ConnectionPoolTest less flaky
I was seeing flaky results in the debugger because pooled
connections were being evicted as the test ran.
2013-06-23 19:50:51 -04:00
jwilson
74b4d049d0 Prepare for the 1.1.1 release 2013-06-23 19:32:07 -04:00
Jesse Wilson
83c569277b Merge pull request #217 from square/jwilson/http_to_https_redirect_and_caching
Fix a bug in caching cross-protocol redirects.
2013-06-23 16:29:33 -07:00
jwilson
08ac8245dc Fix a bug in caching cross-protocol redirects. 2013-06-23 18:53:15 -04:00
jwilson
5516526004 [maven-release-plugin] prepare for next development iteration 2013-06-15 20:28:32 -04:00
jwilson
20f7eebbf5 [maven-release-plugin] prepare release parent-1.1.0 parent-1.1.0 2013-06-15 20:28:28 -04:00
jwilson
c24a62e325 Prepare for the 1.1.0 release 2013-06-15 20:25:38 -04:00
Marcelo Cortes
b49e7086bd Merge pull request #211 from square/jwilson/constant_hostname_verifier
Make OkHostnameVerifier a constant. This fixes connection reuse.
2013-06-15 08:35:47 -07:00
Marcelo Cortes
8a322f3539 Merge pull request #213 from square/jwilson/URLStreamHandlerFactory
Tweak the API for URLStreamHandlerFactory
2013-06-15 08:34:48 -07:00
Marcelo Cortes
ecfb20575c Merge pull request #212 from square/jwilson/dontwhitelist
Don't whitelist routes when recycling them
2013-06-15 08:31:45 -07:00
jwilson
07a97dc250 Tweak the API for URLStreamHandlerFactory
This follows up on candrews committed change.
2013-06-15 09:36:06 -04:00
Jesse Wilson
63099750f2 Merge pull request #192 from candrews/master
Add an implementation of URLStreamHandlerFactory
2013-06-15 06:23:14 -07:00
jwilson
550a4148d3 Don't whitelist routes when recycling them
We haven't gathered any additional evidence that the route
works or doesn't work at this point!
2013-06-15 09:15:05 -04:00
jwilson
812ba5ea63 Make OkHostnameVerifier a constant. This fixes connection reuse.
Previously HTTPS connection reuse was broken because the
hostname verifier is included as a route identifier, and
with a different hostname verifier on every request we weren't
reusing connections.
2013-06-15 09:03:38 -04:00