Fix a bug where the response cache could be corrupted.

When streaming a response, we copy data from our buffer to the cached file
on disk. Unfortunately we were copying N bytes from the front of the buffer
when we wanted N bytes from the back of the buffer.

Typically these are the same, but certain access patterns can cause them
to be different, corrpting the cached file on disk.

This was uncovered by migrating the cache tests from operating on
HttpURLConnection's API to our new API.
Merge pull request #1102 from square/jwilson_1025_fix_cache_bug

Fix a bug where the response cache could be corrupted.
Fix request cache-control to match spec.

Fixes https://github.com/square/okhttp/issues/1081
Merge pull request #1112 from square/jwilson_1101_cachepolicy

Fix request cache-control to match spec.
Change the cache to have non-shared semantics.

This means we'll cache responses that use an 'Authorization' header. This
means OkHttp's cache shouldn't be used on middleboxes that sit between
user agents and the origin server; in practice this is never a use case
for OkHttp.

Fixes https://github.com/square/okhttp/issues/1035
Merge pull request #1113 from square/jwilson_1101_not_shared

Change the cache to have non-shared semantics.
Don't close the SPDY peer too early.

This was occasionally causing tests to fail because the test was
observing the connection close.
Merge pull request #1116 from square/jwilson_1102_peer_close

Don't close the SPDY peer too early.
Attempt to improve MockWebServer reliability.

Use the same InetAddress when binding to a port as when offering the
MockWebServer's address.

Wait for the executors to all shutdown before returning from shutdown().
Merge pull request #1115 from square/jwilson_1102_mws_reliability

Attempt to improve MockWebServer reliability.
Don't skip the callback if a call is canceled.
Merge pull request #1117 from square/jwilson_1102_cancel

Don't skip the callback if a call is canceled.
Fix a typo in settings documentation.

Closes https://github.com/square/okhttp/issues/1105
Be consistent about host names in RouteSelector.

Use the host specified by the address, and not URI.getHost().

bug: 18023709
Change-Id: I2c39c2ce89049130dc00047c8de6f214159144c0
Fix a concurrency bug in SPDY settings.

We were making a copy of the streams HashMap so that we could
iterate it safely after releasing our lock. But we weren't
actually using that copy when iterating. Whoops!

Fixes https://github.com/square/okhttp/issues/1119
Merge pull request #1121 from square/jwilson_1103_routeselector

Be consistent about host names in RouteSelector.
Merge pull request #1122 from square/jwilson_1103_use_copy

Fix a concurrency bug in SPDY settings.
Merge pull request #1120 from square/jwilson_1103_settings_tpyo

Fix a typo in settings documentation.
Import DiskLruCache tests.

See https://github.com/JakeWharton/DiskLruCache/blob/master/src/test/java/com/jakewharton/disklrucache/DiskLruCacheTest.java
Merge pull request #1123 from square/jwilson_1103_import_disklrucache_tests

Import DiskLruCache tests.