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

273 Commits

Author SHA1 Message Date
Jake Wharton
58d0b230d1 Merge pull request #2 from io2013/jwilson/overview_examples
Overview for the OkHttp website.
2013-05-05 20:35:20 +00:00
jwilson
d9872fdd71 Overview for the OkHttp website. 2013-05-05 09:20:05 -04:00
Jake Wharton
112d3caac5 Merge branch 'master' of https://github.com/square/okhttp 2013-05-04 20:19:56 -07:00
Jesse Wilson
3516616852 Merge pull request #162 from square/jwilson/hostname_verifier
Include a hostname verifier rather than using the system default.
2013-05-04 15:40:34 -07:00
Jake Wharton
60e5bc0871 Merge pull request #165 from square/jwilson/guide_examples
Dependency-free examples for the OkHttp front page.
2013-05-04 15:15:34 -07:00
jwilson
954e8f5453 Dependency-free examples for the OkHttp front page.
I'm going to include code snippets from these.
2013-05-04 17:41:03 -04:00
jwilson
870ae218c7 Include a hostname verifier rather than using the system default.
On desktop Java the system default hostname verifier doesn't do
anything. Instead HttpURLConnection does its own hostname verification
and the pluggable verifier simply supplements that.

Android's hostname verifier does everything directly.

This change copies Android's hostname verifier into OkHttp. This way
we can do hostname verification on the desktop, which wasn't possible
previously. It also brings along Android's hostname verifier tests.
Two of these tests fail on desktop Java due to differences in support
for non-ASCII subject alt names. Without our own certificate parsing
we simply live with the difference.
2013-05-04 10:40:09 -04:00
Jesse Wilson
806caed202 Merge pull request #161 from square/jw/apache-readme
Give the Apache module its own readme.
2013-05-04 05:13:05 -07:00
Jesse Wilson
ab855b793a Merge pull request #159 from square/jw/readme-tweaks
Updates to readme.
2013-05-04 05:12:45 -07:00
Jesse Wilson
f1981176e0 Merge pull request #160 from square/jw/doc-fix
Minor doc fix.
2013-05-04 05:12:13 -07:00
Jake Wharton
19d3b1658b Give the Apache module its own readme. 2013-05-03 23:50:12 -07:00
Jake Wharton
58c42623d0 Minor doc fix. 2013-05-03 23:39:20 -07:00
Jake Wharton
8c3811dc20 Updates to readme. 2013-05-03 23:33:55 -07:00
Jake Wharton
8e86772ddb Merge remote-tracking branch 'origin/master' 2013-05-03 23:16:05 -07:00
Jake Wharton
3bbe04ad2f Merge pull request #156 from square/jwilson/transports
Permit the caller to disable transports.
2013-05-03 17:43:31 -07:00
jwilson
aee4bff804 Permit the caller to disable transports.
This is currently an underpowered API; in practice the only thing
you can do is disable spdy/3. In the future we may support more
transports (spdy/4, http/2.0) and I don't want to make that an
API change.
2013-05-03 19:36:09 -04:00
Jake Wharton
0ff5ce5a6d Update website to the latest design. 2013-05-01 00:19:38 -07:00
Jake Wharton
c3d3ee79f8 Link to color pallete. 2013-04-30 14:44:20 -07:00
Jason Holmes
9e00825a6c Merge pull request #1 from io2013/jw/website-skeleton
Add website skeleton.
2013-04-30 18:58:07 +00:00
Jake Wharton
03c351be3a Add website skeleton. 2013-04-30 11:55:09 -07:00
Jesse Wilson
46ea47b8f9 Merge pull request #158 from square/jw/checkstyle
Fix checkstyle.
2013-04-30 11:49:55 -07:00
Jake Wharton
4235e8738e Fix checkstyle. 2013-04-30 11:07:48 -07:00
Jesse Wilson
e950afe9a5 Merge pull request #157 from square/jwilson/no_interface
Don't explode if we can't find an interface for a local address.
2013-04-29 14:26:09 -07:00
jwilson
63c5a42ecd Don't explode if we can't find an interface for a local address.
We'll likely explode later when attempting to use the socket.
But that will fail with an IOException, unlike this which was
failing with a NullPointerException.
2013-04-29 17:20:54 -04:00
Jake Wharton
6abac65309 Merge pull request #155 from square/jwilson/auth
Non-static authenticators.
2013-04-27 22:48:26 -07:00
Jake Wharton
f38fec5b0c Merge pull request #153 from square/jwilson/recovery
Recover from failures while writing a POST body.
2013-04-27 22:48:08 -07:00
jwilson
cb7ade556c Non-static authenticators.
This avoids the problems of HttpURLConnection's authenticator
where multiple concurrent uses of HTTP require a single shared
authenticator.
2013-04-27 16:25:29 -04:00
jwilson
3344cf326e Recover from failures while writing a POST body.
This introduces failure recovery in the output stream. It means
we should be able to recover from any kind of failure that could
be triggered by aggressive connection pooling.

The recovery buffer is 8 KiB. I anticipate this should be more
than enough to detect that an HTTP post is going to a black hole.
2013-04-27 14:19:29 -04:00
Jake Wharton
01ca44b830 Merge pull request #152 from square/jwilson/mtu
Use an MTU-sized buffer for socket access.
2013-04-21 22:37:54 -07:00
jwilson
13d8b5f7bf Use an MTU-sized buffer for socket access.
Previously we attempted to avoid buffers in some situations
and create aggressive buffers in other situations. This was
a bad policy, and meant we had some subtle performance bugs.
The one that prompted this is that chunked uploads make
separate network writes for the chunk size, chunk, and newline
separators.

This avoids that problem and the corresponding complexity.
Unfortunately getting the MTU isn't a standard API until
Java 6 / Gingerbread. I tested my own networks and saw 1500
in use (for 3G and WiFi) and 1400 (for VPN over WiFi).
2013-04-21 23:10:35 -04:00
Jake Wharton
27b734266e Merge pull request #150 from square/jwilson/recover_flush_and_close
Recover from failed flushes and closes too.
2013-04-16 22:32:01 -07:00
jwilson
22e45daefd Recover from failed flushes and closes too. 2013-04-17 00:25:53 -04:00
Jake Wharton
4950e75a5b Merge pull request #148 from square/jwilson/sync_disklrucache
Update to the latest DiskLruCache.
2013-04-15 14:42:11 -07:00
jwilson
6ed0f2c2cb Update to the latest DiskLruCache.
Includes everything thru 8842981cbcfe20eb4721c0a2c867fa9a18233062
2013-04-15 17:39:52 -04:00
Jesse Wilson
56738401eb Merge pull request #147 from square/marcelo/fix_style
Fix style
2013-04-15 08:02:11 -07:00
Marcelo Cortes
242be7e578 Fix style 2013-04-15 09:42:22 -04:00
Jesse Wilson
1ef7e6913e Merge pull request #146 from square/jwilson/sync_idle_time
Synchronize access to idleStartTimeNs.
2013-04-11 15:24:40 -07:00
jwilson
12b35d6a62 Synchronize access to idleStartTimeNs.
See https://github.com/square/okhttp/issues/145
2013-04-11 14:53:27 -07:00
Marcelo Cortes
c8917a1b1f Merge pull request #144 from square/jwilson/copyright
Restore Apache copyright header to ConnectionPool.
2013-04-10 15:55:23 -07:00
jwilson
ba31ada6f3 Restore Apache copyright header to ConnectionPool.
This file was derived from AOSP's HttpConnectionPool.java, which
was derived from Apache Harmony's HttpConnectionManager.java.
2013-04-10 15:51:45 -07:00
Jake Wharton
94d9d88c90 Merge pull request #143 from square/marcelo/fix_copyright
Fixed copyrights
2013-04-10 15:49:02 -07:00
Marcelo Cortes
56c190404b Fixed copyrights 2013-04-10 15:27:02 -07:00
Marcelo Cortes
e4c41a5c39 Merge pull request #142 from square/marcelo/failed_routes
RouteSelector tries previously failed routes last #106
2013-04-10 15:20:23 -07:00
Marcelo Cortes
1ece746c81 RouteSelector tries previously failed routes last #106 2013-04-10 15:19:36 -07:00
Jake Wharton
9bed92fa26 Merge pull request #141 from square/jwilson/empty_header
Be more strict about outgoing request headers.
2013-04-09 13:04:57 -07:00
jwilson
923eb55473 Be more strict about outgoing request headers.
We now forbid empty header names, and '\0' characters in names
or values. This should improve the experience for SPDY users,
who will see the failure when they add the header rather than
when the request is made.
2013-04-09 12:53:51 -07:00
Jake Wharton
af61be6fd9 Merge pull request #140 from square/jwilson/empty_header
Allow empty header values
2013-04-09 11:16:08 -07:00
jwilson
d7ed3f8c44 Allow empty header values
This tracks an AOSP change by Brian Carlstrom.
Change-Id: I78bb07a93d527eda6aaee6e986be39a68e0a02f4
2013-04-09 08:17:30 -07:00
Jesse Wilson
ae4a84a73d Merge pull request #138 from square/jwilson/recoverystream
FaultRecoveringOutputStream.
2013-04-08 17:17:16 -07:00
jwilson
4e3da9d430 FaultRecoveringOutputStream.
This is the first step in a change that'll permit the underlying
socket stream to change out-from-under-you while you're uploading
POST data to a server.

It'll recover from failures writing the request body that occur
within the first N bytes, where N will be determined by the number
of bytes that can be written without positive confirmation.

See https://github.com/square/okhttp/issues/137
2013-04-08 13:00:02 -06:00