Merge: HttpEngine should not attempt to cache proxy CONNECT responses

Original AOSP/libcore commit from Brian Carlstrom:
This fixes an issue where a bad proxy repsonse that included a body
would turn into an IllegalStateException instead of an IOException.

Bug: 6754912

Change-Id: I204ad975820693d6add2780d7b77360463e33710
Merge pull request #20 from square/jwilson/connectcache

Merge: HttpEngine should not attempt to cache proxy CONNECT responses
Merge: Improve HttpResponseCache performance.

Original AOSP/libcore commit from Vladimir Marko:
Avoid writing to HttpResponseCache.CacheRequestImpl.cacheOut
one byte at a time via inefficient FilterOutputStream write.

(cherry-picked from 91cc423115fdfa682d9c4cd025dee06aaa145b3c.)

Bug: 6738383
Change-Id: Ia657d7417cc292746968809f6896a5e790f1394d
Merge: TLS + SNI + proxy => bug

Original AOSP/libcore commit from Brian Carlstrom;
The SNI at the TLS layer is the hostname of the proxy instead
of the hostname in the URL.
Merge pull request #22 from square/jwilson/urihost

Merge: TLS + SNI + proxy => bug
Merge: Tolerate cache files being removed from underneath DiskLruCache

Original AOSP/libcore commit by Brian Carlstrom:
Bug: 6777079
Change-Id: I2f950ab6d847dd63061aeb449fc5d46ab9e6c50a
Merge pull request #23 from square/jwilson/deleted

Merge: Tolerate cache files being removed from underneath DiskLruCache
Merge pull request #21 from square/jwilson/fast

Merge: Improve HttpResponseCache performance.
Merge: Fix HttpURLConnection CloseGuard warning due to lack of close on GZIPInputStream

Original AOSP/libcore commit by Brian Carlstrom:
java.lang.Throwable: Explicit termination method 'end' not called
  at dalvik.system.CloseGuard.open(CloseGuard.java:184)
  at java.util.zip.Inflater.<init>(Inflater.java:82)
  at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:96)
  at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:81)
  at libcore.net.http.HttpEngine.initContentStream(HttpEngine.java:523)
  at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:831)
  at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
  at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:486)
  at ...

Bug: 6602529
Change-Id: I9b49cbca561f8780d08844e566820087fdffc4d7
Merge pull request #24 from square/jwilson/closeguard

Merge: Fix HttpURLConnection CloseGuard warning due to lack of close on ...
Merge: HttpResponseCache should return 504, not 502.

Original AOSP/libcore commit from Elliott Hughes:
The RFC seems pretty clear on this issue.

Bug: http://code.google.com/p/android/issues/detail?id=28294
Change-Id: Ia9a979e1fbbd8b38b1607059c042e0fc9ca44270
Merge pull request #25 from square/jwilson/cache504

Merge: HttpResponseCache should return 504, not 502.
Merge: Performance improvements: DiskLruCache, HttpResponseCache.

Original AOSP/libcore commit from Vladimir Marko:
Add StrictLineReader for efficient reading of lines
consistent with Streams.readAsciiLine(). Use this to improve
DiskLruCache.readJournal() and initialization of
HttpResponseCache$Entry from InputStream.

(cherry-pick of e03b551079aae1204e505f1dc24f2b986ef82ec0.)

Bug: 6739304
Change-Id: If3083031f1368a9bbbd405c91553d7a205fd4e39
Disable SSL compression

Original AOSP/libcore commit from Brian Carlstrom:
Bug: 7079965
Change-Id: I8e060a827613e212bbcced66507fbf124bb04543
Merge pull request #27 from square/jwilson/crime

Disable SSL compression
Merge pull request #26 from square/jwilson/faster

Merge: Performance improvements: DiskLruCache, HttpResponseCache.
Fix checkstyle errors.
Merge pull request #28 from square/jw/checkstyle

Fix checkstyle errors.
Fix TLS requiresTunnel which was being computed incorrectly.

We were only returning 'true' once we were already in a tunnel.
This was bogus. In theory a TLS tunnel sending extra data could
be corrupted due to this bug.

Also migrate one of the TLS tunnel tests to use SslContextBuilder
instead of TestSSLContext.
Merge pull request #29 from square/jwilson/tunnel

Fix TLS requiresTunnel which was being computed incorrectly.