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

362 Commits

Author SHA1 Message Date
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
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
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
Jesse Wilson
c84d84d1ca Merge pull request #210 from narayank/master
Fix bad locking in SpdyConnection
2013-06-14 06:50:59 -07:00
Narayan Kamath
06e6beeb3d Fix bad locking in SpdyConnection
This caused an assertion error in SpdyStream#setSettings
where we assert that the lock on the associated
SpdyConnection is held.
2013-06-14 13:49:45 +01:00
Jesse Wilson
cc9e7c7da4 Merge pull request #209 from narayank/master
Ignore null header values.
2013-06-14 05:14:25 -07:00
Narayan Kamath
929a15a55d Ignore null header values.
Required for backwards compatibility. Null headers
throw an RTE (as they should) when they're set internally
or directly on the RawHeaders object.
2013-06-14 12:05:12 +01:00
Jesse Wilson
b48247968a Merge pull request #208 from narayank/master
Allow access to the underlying DiskLruCache.
2013-06-12 07:34:04 -07:00
Narayan Kamath
76eaa1b1bf Allow access to the underlying DiskLruCache.
This is needed to implement public android APIs
android.net.HttpResponseCache.{flush,size,maxSize,close}
as well android.net.HttpResponseCache.install.

install needs to inspect the underlying DiskLruCache because
it promises not to install a new cache if the file directory and
size are the same as the old cache.
2013-06-12 15:26:40 +01:00
Jesse Wilson
e401cacc5f Merge pull request #204 from narayank/master
Support querying & setting transport lists on connections.
2013-06-05 07:07:05 -07:00
Narayan Kamath
4910039a57 Support querying & setting transport lists on connections.
The list is specified via a magic request property
"X-Android-Transports" and can be queried via the request
property "X-Android-Selected-Transport".

System wide defaults / switches don't need any changes
to okhttp. They can be set as options on the OkHttpClient
used by the platform UrlStreamHandlers.
2013-06-05 10:34:09 +01:00
Jesse Wilson
95beef24f0 Merge pull request #201 from kruton/master
Add new classname for AOSP's SSLSocket change
2013-05-30 03:47:43 -07:00
Kenny Root
1192af61fd Add current AOSP class name for OpenSSLSocketImpl
AOSP moved OpenSSLSocketImpl to com.android.org.conscrypt.* so add that
as the first choice for unbundled apps.

Change-Id: I7bad6533dcb86ee1cac3b15f42dd386bd651eaed
2013-05-29 09:44:24 -07:00
Jake Wharton
1e6a33193f Merge pull request #199 from square/jw/null-chick
Null-check request entity since it might not be present.
2013-05-27 14:53:44 -07:00
Jake Wharton
f163915346 Null-check request entity since it might not be present.
Closes #198.
2013-05-27 14:53:16 -07:00
Craig Andrews
f9f55b15aa Add an implementation of URLStreamHandlerFactory 2013-05-26 19:31:31 -04:00
Jesse Wilson
26fc2ff7f9 Merge pull request #197 from square/jw/stay-dead
Correct specialized platform name to Java6.
2013-05-25 01:27:37 -07:00
Jake Wharton
f8d9ec7c31 Correct specialized platform name to Java6.
Also correct end-of-method fallback logic to not check for the presence of the MTU method, it will never be null when code is reached.
2013-05-25 01:21:41 -07:00
Jesse Wilson
f34c1fff7f Merge pull request #194 from candrews/patch-1
Use animal-sniffer to ensure only Java 1.5 is used
2013-05-22 09:58:50 -07:00
Craig
a6d07d9b68 Use animal-sniffer to ensure only Java 1.5 is used 2013-05-21 23:17:07 -04:00
Jake Wharton
5bb8d57ffb Fix comment color. 2013-05-13 17:16:16 -07:00
Jake Wharton
1482bc4032 [maven-release-plugin] prepare for next development iteration 2013-05-11 20:56:21 -07:00
Jake Wharton
34049c1c0f [maven-release-plugin] prepare release parent-1.0.2 parent-1.0.2 2013-05-11 20:56:12 -07:00
Jake Wharton
225a39f47d Prepare change log for 1.0.2. 2013-05-11 20:55:14 -07:00
Jesse Wilson
fcbb0abf55 Merge pull request #188 from square/jwilson/fix_razr_bug
Don't explode if NetworkInterface.getByInetAddress does.
2013-05-10 17:02:25 -07:00
jwilson
d7e24381a3 Don't explode if NetworkInterface.getByInetAddress does.
Certain Motorola RAZRs always throw a SocketException when
you call that method. We don't _really_ need a perfect MTU,
so for those devices just return the default MTU.
2013-05-10 19:53:12 -04:00
Jake Wharton
8f586ba7c5 Merge pull request #186 from square/pforhan/java5
Replace String.isEmpty() calls with Java 5 methods
2013-05-10 07:40:58 -07:00