• Home
  • History
  • Annotate
  • only in /libcore/luni/src/main/java/libcore/net/http/
History log of /libcore/luni/src/main/java/libcore/net/http/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a11b70d5ec690dbedd9087fb3b25d7d65d865eb4 16-Dec-2014 Narayan Kamath <narayan@google.com> Add a hidden API for detecting response charsets.

This is meant to be a partial replacement for apache's
EntityUtils.toString for internal callers. Providing a stand
in replacement seems like a bad idea because that API tries
to coerce all responses into strings, even those that are
binary.

I'm torn about EntityUtils. It was a useful "utility" in some
cases, but dangerous in others.

bug: 18027885
Change-Id: Ia02ffe86b5ef5caecbe86069967a549ff09335e5
esponseUtils.java
2503556d17b28c7b4e6e514540a77df1627857d0 30-Mar-2013 jwilson <jwilson@squareup.com> Switch to OkHttp as URL's preferred HTTP implementation.

Change-Id: Id724b75dd78b68ed00f5db4989c4070896996ec0
bstractHttpInputStream.java
bstractHttpOutputStream.java
hallenge.java
hunkedInputStream.java
hunkedOutputStream.java
ixedLengthInputStream.java
ixedLengthOutputStream.java
eaderParser.java
ttpConnection.java
ttpConnectionPool.java
ttpEngine.java
ttpHandler.java
ttpResponseCache.java
ttpURLConnectionImpl.java
ttpsHandler.java
ttpsURLConnectionImpl.java
awHeaders.java
equestHeaders.java
esponseHeaders.java
etryableOutputStream.java
nknownLengthHttpInputStream.java
19aa40c81c48ff98ccc7272f2a3c41479b806376 18-Dec-2012 Jeff Sharkey <jsharkey@android.com> Retry failed redirections when socket is recycled.

When an HTTP request fails, getResponse() attempts to retry once
if the socket was recycled from a previous request. This extends
that logic to retry failed redirects by marking the connection as
recycled.

http://code.google.com/p/android/issues/detail?id=41576

Change-Id: I5aea566a498e48d753d3893101d14cd4ab76db2b
ttpEngine.java
ttpURLConnectionImpl.java
cff1616012dc0d56c2da9af2b9b1183e76c7e044 04-Dec-2012 Elliott Hughes <enh@google.com> Add detail messages to all the easy IllegalArgumentException cases.

Noticed during my recent Matcher change.

Change-Id: I415d911b26d0ee548ca04d56bba7fc3d4e6b3f88
ttpURLConnectionImpl.java
4bedacd569fed2db56c518ed239412b3fe32245e 20-Sep-2012 Jesse Wilson <jwilson@squareup.com> Fix a bug in tunnel construction and 'Connection: close' headers.

Based on https://github.com/square/okhttp/pull/30
(git fetch git://github.com/square/okhttp.git && git cherry-pick -x b8c51dc5bdc89d5487cbc110d6fe40389de16480)

Bug: http://code.google.com/p/android/issues/detail?id=37221
Change-Id: I5bed33d9ab16002aa38c2f729fa14a2022485469
ttpEngine.java
f9d60aed414ae21811a6488f603333517f257b22 24-Sep-2012 Narayan Kamath <narayan@google.com> Strip content length in requests with "transparent" gzip handling.

We need to strip both the Content-Length and the Content-Encoding
for such requests. In such requests, it will be the length of the
compressed response. We hide the fact that compression is taking place
from clients, so we shouldn't give them the content length either.

Change-Id: I80713ab33143945c5e2656f478d83cc9e60226a8
ttpEngine.java
esponseHeaders.java
7695a9b3261bfee3a810e0829bd8082fe1fcb6a4 30-Aug-2012 Brian Carlstrom <bdc@google.com> Disable SSL compression

Bug: 7079965

Change-Id: I8e060a827613e212bbcced66507fbf124bb04543
ttpConnection.java
ac665275e161fab8ecd4225e73e159a9edf10501 23-Jul-2012 Vladimir Marko <vmarko@google.com> Performance improvements: DiskLruCache, HttpResponseCache.

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
ttpResponseCache.java
fddea0213028dd6d467f316584fac0f6e0745ce9 31-Jul-2012 Elliott Hughes <enh@google.com> HttpResponseCache should return 504, not 502.

The RFC seems pretty clear on this issue.

Bug: http://code.google.com/p/android/issues/detail?id=28294
Change-Id: Ia9a979e1fbbd8b38b1607059c042e0fc9ca44270
ttpEngine.java
c0e9010d03768a745d589e8093fc3d7a056c740b 27-Jul-2012 Brian Carlstrom <bdc@google.com> Merge "Fix HttpURLConnection CloseGuard warning due to lack of close on GZIPInputStream"
8155888a2c4e7cc28596deec28433e1984cfaf11 25-Jul-2012 Brian Carlstrom <bdc@google.com> Fix HttpURLConnection CloseGuard warning due to lack of close on GZIPInputStream

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
ttpURLConnectionImpl.java
459718ce7114a918efcc7d464e4209dbfade6a86 21-Jul-2012 Brian Carlstrom <bdc@google.com> Tolerate cache files being removed from underneath DiskLruCache

Bug: 6777079
Change-Id: I2f950ab6d847dd63061aeb449fc5d46ab9e6c50a
ttpResponseCache.java
b7705a4629bb74a5bb19d97bf0b4dd4c74cecd9e 20-Jul-2012 Brian Carlstrom <bdc@google.com> TLS + SNI + proxy => bug : the SNI at the TLS layer is the hostname of the proxy instead of the hostname in the URL

Bug: http://code.google.com/p/android/issues/detail?id=35050

Change-Id: Ia12f54e0521cf98eac184d80744192c1f782e7c2
ttpConnection.java
5655e03a7e10b3201b6814dac7b2f6ac5607ebf2 10-Jul-2012 Jean-Baptiste Queru <jbq@google.com> Merge from AOSP

Change-Id: I83f2ba38dca0fa86e9ff802e5df02311f6bc6e99
ebac4e8fcafe084009925cfa7526e73fa4ed0487 06-Jul-2012 Vladimir Marko <vmarko@google.com> Improve HttpResponseCache performance.

Avoid writing to HttpResponseCache.CacheRequestImpl.cacheOut
one byte at a time via inefficient FilterOutputStream write.

(cherry-picked from 91cc423115fdfa682d9c4cd025dee06aaa145b3c.)

Bug: 6738383
Change-Id: Ia657d7417cc292746968809f6896a5e790f1394d
ttpResponseCache.java
4ec2d0dea800397fb32227e0631246f4d2a73191 29-Jun-2012 Brian Carlstrom <bdc@google.com> HttpEngine should not attempt to cache proxy CONNECT responses

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
ttpEngine.java
e2fda3eb560dd75b6be16e2a8fce3860ce3c4e0f 12-Mar-2012 Brian Carlstrom <bdc@google.com> Make classes accessible to ParsedHeadersTest

Bug: 5835156

(cherry picked from commit 943036db28577070ae5b5fed5051a2e47d95f6ea)

Change-Id: I7a1a9d7ae7003e54847fb2b0e99cc560e1fe34f0
hallenge.java
eaderParser.java
e636ca4d6bd101324bd95fbc817401e6e0b80a2c 15-Feb-2012 Jesse Wilson <jessewilson@google.com> Introduce an ExtendedResponseCache interface.

We had an ugly bug where HttpEngine was inspecting its response
cache's implementation type, and calling stats tracking methods
if that type permitted it.

This worked for all the libcore tests, but not in practice since
the public HttpResponseCache class WRAPS the libcore HttpResponseCache.
The new interface makes the new APIs called by HttpEngine on its
cache explicit, and permits the public android.net.HttpResponseCache
to implement the API.

Bug: http://code.google.com/p/android/issues/detail?id=25418
Change-Id: Ic9697af96635256e7ffc24f86628a85fbe2defd4
ttpEngine.java
ttpResponseCache.java
esponseHeaders.java
esponseSource.java
df29c7dc69965462cd19de8910b04c8cb463e57f 15-Feb-2012 Jesse Wilson <jessewilson@google.com> Don't attempt to parse an HTTP response body on HEAD requests.

Previously if the response had a Content-Length or Transfer-Encoding
header we assumed it had a body. This was untrue of HEAD requests.
This is not a regression.

Bug: http://code.google.com/p/android/issues/detail?id=24672
Change-Id: I264db2014e681a6f8e93cd40b0f1640c95103d21
ttpEngine.java
58d229ebb70c7f6018e7b39c004638b9bdd62e31 26-Jan-2012 Jesse Wilson <jessewilson@google.com> Merge commit 'f41105dc' into manualmerge

Conflicts:
luni/src/test/java/libcore/java/net/URLConnectionTest.java

Change-Id: I8f2bd79b02d1c3315e97e36a59497054ec3e1dc2
a468471e8ccc2f642d5b2ae3c75873a74267ece2 26-Jan-2012 Jesse Wilson <jessewilson@google.com> Don't throw needlessly when returning the CacheResponse.

We were throwing under the premise that we'd always have
response headers before we had a cached body. But when the
user calls connect() we'll have queried the cache but we
won't necessarily have response headers from the server yet.
That's because connect() doesn't require a response to be ready.

Bug: http://b/5920659
Cherry-picked from: I9d69b44b5be3d0e29f14d8b83781f6e65c67582a

Change-Id: Ia403b42ddc9783fd1456164f4b7350da3ce80566
ttpEngine.java
72baec6104b80ff6a6b189dc78968f042f0b91ef 04-Jan-2012 Jesse Wilson <jessewilson@google.com> Merge "Update the response cache on a conditional cache hit"
5d7e0fc1af3141aa41e9c21d74da3c36b933517f 23-Dec-2011 Jesse Wilson <jessewilson@google.com> Update the response cache on a conditional cache hit

Bug: http://b/4460598
Change-Id: I5f274b2109861b9d2ed59eda8b3e5b4e89fd27b3
ttpEngine.java
ttpResponseCache.java
esponseHeaders.java
fa5e8dfe3c7ed144b0fbe69091628dedd6a3b961 21-Dec-2011 Jesse Wilson <jessewilson@google.com> Don't reuse an SSL socket if the socket factory has changed.

Bug: http://b/3042192
Change-Id: Iaa9deb69058afcca4ab79ca6ba745c55d1e9321a
ttpConnection.java
ttpEngine.java
ttpsURLConnectionImpl.java
5757cb35ad2e58d7accb7f5d3db6f2d5e72f097d 16-Dec-2011 Jesse Wilson <jessewilson@google.com> Support multiple challenges for HTTP authentication.

This fixes the problem reported in the bug, but we still need
to give attention to the digest scheme. Currently we can't do
Basic auth if the HTTP response contains both a Digest challenge
and a Basic challenge!

Bug: http://code.google.com/p/android/issues/detail?id=19081
Change-Id: Ifffb307678c2afa0db1d50c1ef5fc49ec7769306
hallenge.java
eaderParser.java
ttpURLConnectionImpl.java
esponseHeaders.java
b2b02ac6cd42a69463fd172531aa1f9b9bb887a8 15-Dec-2011 Jesse Wilson <jessewilson@google.com> Change the way we cope with stale pooled connections.

Previously we'd attempt to detect if a connection was stale by
probing it. This was expensive (it relied on catching a 1-millisecond
read timing out with a SocketTimeoutException), and racy. If the
recycled connection was stale, the application would have to catch
the failure and retry.

The new approach is to try the stale connection directly and to recover
if that connection fails. This is simpler and avoids the isStale
heuristics.

This fixes some flakiness in URLConnectionTest tests like
testServerShutdownOutput and testServerClosesOutput.

Bug: http://b/2974888
Change-Id: I1f1711c0a6855f99e6ff9c348790740117c7ffb9
ttpConnection.java
ttpConnectionPool.java
ttpEngine.java
ttpURLConnectionImpl.java
2d9fa917aae6a6da38e9d1eda05841ffdf8855bb 15-Dec-2011 Jesse Wilson <jessewilson@google.com> Document the effect on timeouts of having both IPv4 and IPv6 addresses

Bug: http://b/3441111

Change-Id: Ib4c2e3e0d8d86eb5eb77cf92a0814c7444fd153f
ttpsURLConnectionImpl.java
ecd3536488a6b5cbbe30104370c8fbd7d941a8cd 25-Nov-2011 Jesse Wilson <jessewilson@google.com> Don't check available() when testing if a socket is stale.

When the HTTP server is well behaved, available() will always
return 0. Any other result would be necessarily bogus; the server
doesn't know what the client is going to request. So this check
wasn't adding anything.

Removing the check has a pleasant side effect of fixing
URLConnectionTest#testServerShutdownOutput, which is failing due
to a bug in PlainSocketImpl.available().

Bug: http://b/5534202
Change-Id: I1c567e91c2bcbe3884dfbefe77ce4b0201a2c0d6
ttpConnection.java
d0d626655f1d452070d3116678037e8759f807f4 10-Nov-2011 Jesse Wilson <jessewilson@google.com> Don't NullPointerException when a URL contains a space.

We end up creating a URI of http://and%20roid which has no host
name part because and%20roid is not a valid host name. It's unclear
where the best place to fail is. This is consistent with the RI
which doesn't fail until it attempts to connect.

Bug: http://code.google.com/p/android/issues/detail?id=16895
Change-Id: Ifa4dc3c651f4627e27622ed5cedfa820f9a35358
ttpConnection.java
25a753691a80186cd4d7086b12c0e52225d95897 30-Sep-2011 Jesse Wilson <jessewilson@google.com> Fix chunked input stream's available() method to never return -1.

Change-Id: I6ea268e469675ef890010282dbe35ed5838cca73
http://code.google.com/p/android/issues/detail?id=20442
hunkedInputStream.java
ed211506be4a0985678cf099282ed8fe851868fb 15-Aug-2011 Jesse Wilson <jessewilson@google.com> Make HTTP implementation details public for CTS tests.

Our testing tools cannot normally test package-private APIs
because the tests are loaded in a different class loader than
the production classes. This is an unfortunate workaround.

Change-Id: Ic8d9d3088887bccceaf166959468cd52bfef9aae
ttpEngine.java
ttpResponseCache.java
ttpURLConnectionImpl.java
ttpsURLConnectionImpl.java
awHeaders.java
equestHeaders.java
esponseHeaders.java
5112325117859c7c6cd042c17f519f967c551b20 29-Jun-2011 Jesse Wilson <jessewilson@google.com> Move socket tagging to frameworks/base.

Change-Id: I6f6f840d5d5eee6ca2170fc127fd525155dd40b8
ttpConnectionPool.java
5292410e4ebf7fb5149eefd2f52fcb94c46690a6 24-May-2011 Jesse Wilson <jessewilson@google.com> Rewrite parsing for java.net.URL.

This fixes many broken cases on handling relative URLs.

We normalize all URLs by default. This will result
in more URL equality than before. Previously the URLs
http://android.com/a/../ and http://android.com/ were not
equal; now they are equal.

Change-Id: I8cf7be2e42eeb1386520be2698d8f14e0a55decb
http://b/4361656
ttpEngine.java
c8e161cd543d2a327a7db23b8ce8f127b2e2ebae 20-May-2011 Jesse Wilson <jessewilson@google.com> Merge "Support HTTP cookies and header combining." into dalvik-dev
cd8c1dd724036dcd1b7c27542cc4d745391b8d04 20-May-2011 Jesse Wilson <jessewilson@google.com> Support HTTP cookies and header combining.

Change-Id: Ifdf15dc2f551e58bdd6a1aae847f7dec254ac7e8
http://b/3180373
ttpEngine.java
esponseHeaders.java
80f4d25b880b83abfd79474bb0e6fdc4d898f94c 19-May-2011 Jesse Wilson <jessewilson@google.com> Address FindBugs warnings in libcore.net.http

Change-Id: Ia0c4f95e62825a4ed4debac2578d353491a7ff2c
awHeaders.java
equestHeaders.java
esponseHeaders.java
e5eb80e6adaab18ff7372adcd09f9e1af3a76871 19-May-2011 Jesse Wilson <jessewilson@google.com> Make the HttpResponseCache robust to file I/O errors.

If the filesystem fails, cache performance degrades. Ongoing
writes should not see any filesystem errors: don't punish the
writer who isn't benefitting from the cache. Ongoing reads may
see IOExceptions while streaming files. In practice this will
only happen if the directory disappears during use, as is the
case when a removable partition is removed.

Change-Id: Ibf4d51998d9beaba9f8c86c449fd5c97ca869cee
http://b/3180373
ttpResponseCache.java
09f1b0cc860e039dff39e9429c1eaddcb6af598e 18-May-2011 Jesse Wilson <jessewilson@google.com> Parse HTTP request headers only once.

Change-Id: Ib3df045c546b424651eb1164c2dc610d366b5b39
ttpEngine.java
ttpResponseCache.java
ttpURLConnectionImpl.java
ttpsURLConnectionImpl.java
awHeaders.java
equestHeaders.java
esponseHeaders.java
7a891b5c83357dbeea2bbe4a5335ae685501e21c 18-May-2011 Jesse Wilson <jessewilson@google.com> Don't read through HTTP response headers more than necessary.

This refactoring changes HttpEngine to prefer the parsed
response headers over the raw response headers. I'll do likewise
for the request headers in a follow-up change.

Change-Id: Iab8329a836d14b3ac7bb0abe190e0a8fa7cc0694
ttpEngine.java
ttpResponseCache.java
ttpURLConnectionImpl.java
ttpsURLConnectionImpl.java
esponseHeaders.java
6f778cc173cc60ec184e8ca54a16ad10cf55f2cf 18-May-2011 Jesse Wilson <jessewilson@google.com> Cache HTTP responses with a Vary header.

This requires a backdoor for the cache to read the request headers
at put time. This is implemented by getting the HttpEngine, which
will allow us to eventually share the response header parsing.

Change-Id: I177467244e5af0a3dda07883cd58d641bf75362f
http://b/3180373
ttpResponseCache.java
ttpURLConnectionImpl.java
ttpsURLConnectionImpl.java
awHeaders.java
esponseHeaders.java
e342455abc6b650f847d931728223411e58831ce 17-May-2011 Jesse Wilson <jessewilson@google.com> Test DiskLruCache with fault injection.

This tests what happens when the filesystem fails while reading or
writing the cached files. I still need to test what happens when
there are failures reading or writing the journal.

Change-Id: I48018514ef5b8cc206efc905b1823eb49589c8e8
http://b/3180373
ttpResponseCache.java
ae3dad3194393a6800590284e3632f44fac1ddfb 16-May-2011 Jesse Wilson <jessewilson@google.com> Merge "Move APIs from internal HttpResponseCache to external one." into dalvik-dev
fb4a6392a04b1f3a1124b3db6bae51d8cbfa53f8 14-May-2011 Jesse Wilson <jessewilson@google.com> Move APIs from internal HttpResponseCache to external one.

Change-Id: Ia6c88f292088bfd3ed546c067376fcb36b435b48
http://b/3180373
ttpResponseCache.java
5637884f8217dbf28de0913c06aceaf09c898510 14-May-2011 Jeff Sharkey <jsharkey@android.com> resolved conflicts for merge of 1e8d508f to dalvik-dev

Change-Id: Id0739d4e567b112cbea48f5ecb7dd46425da1a36
1e8d508f2d97e19f2fc8a709330ea97e1e9f203a 04-May-2011 Jeff Sharkey <jsharkey@android.com> Add Socket tagging for granular data accounting.

Changes BlockGuard to maintain a set of "tags" for the current thread,
which it communicates to kernel before each Socket use. Also changes
HttpConnectionPool to tag/untag sockets as they are recycled.

Change-Id: I33e614f1f570466bdffbf07cc5c718f18b8f3773
ttpConnection.java
ttpConnectionPool.java
396af46f45fd302e6309fc48ac1fd68cbb739edb 12-May-2011 Jesse Wilson <jessewilson@google.com> Add the application version to the DiskLruCache journal.

This makes it easy for us to change how we store HTTP cache
data without fear of compatibility problems.

Change-Id: I26cd6645d26f359ab76e2f87b6ab73bbf24ab715
http://b/3180373
iskResponseCache.java
ttpEngine.java
ttpResponseCache.java
ca8ae42fd6a787757897a680108bdcf7b0d37f13 12-May-2011 Jesse Wilson <jessewilson@google.com> Provide more user-friendly HTTP cache stats.

Rather than strictly trackign what's convenient for implementation,
we now provide stats based on what we anticipate the user will want
to know:
- how many requests were made?
- how many requests required network use?
- how many requests were served by the cache?

This doesn't provide individual stats on how many conditional gets
were made, but those can be computed.

Change-Id: Ieeebaf8b98664e78f828971052404dd7da28ad78
http://b/3180373
iskResponseCache.java
ttpEngine.java
ttpResponseCache.java
757afaa7afe96791a3cc612c9e3c4597a7321c7e 12-May-2011 Jesse Wilson <jessewilson@google.com> Provide hit and miss stats on the HTTP response cache.

Also capture FDs rather than InputStreams when a cache
entry is read. This permits the cache to return as many
streams as the caller requires.

Also fix bugs where we weren't properly releasing the
input streams from the responses.

Change-Id: I04807eab648864229f1e8734ad1fbb6a2d6bb51d
http://b/3180373
bstractHttpInputStream.java
ttpEngine.java
ttpResponseCache.java
ttpURLConnectionImpl.java
ttpsURLConnectionImpl.java
f589846f86761ffea3c06ab9d105d3f19328d121 11-May-2011 Jesse Wilson <jessewilson@google.com> Address code review comments to Adopt DiskLruCache change.

That change was submitted too early. This is the missing
follow-up.

Change-Id: I521455a7d249f8841c989561775c91d4368a8966
http://b/3180373
hunkedInputStream.java
ttpEngine.java
433e3fac172d0c4449051b0c61c0c63b298a0903 11-May-2011 Jesse Wilson <jessewilson@google.com> Adopt DiskLruCache in HttpResponseCache.

http://b/3180373

Change-Id: I55ed45c5d0b8fc72cf50e8912416367ac802dc7a
hunkedInputStream.java
ttpEngine.java
awHeaders.java
32b2c95c350002f67c8b3e65777161feda766b72 10-May-2011 Jesse Wilson <jessewilson@google.com> Dont line wrap Base64.

Change-Id: I9a16a09dad9ff170921591455b17a3b738e70655
ttpURLConnectionImpl.java
9531eea15052eccc004b5f853ab4452becf7a8ab 06-May-2011 Jesse Wilson <jessewilson@google.com> Test that headers aren't accidentally transferred across requests.

We used to have a bug where we'd only ever add headers. So if
a request was redirected from a.com to b.com to c.com, then
c.com would be able to see cookies from the other two hosts.

This was fixed by the HttpEngine refactor, but tests haven't
been added until now.

Change-Id: I01588fe9662aae7404fef4d4b2c4f0468e7c670d
http://b/3180373
ttpEngine.java
ttpURLConnectionImpl.java
2f16d502415452f808b5f077ad07b941645d14e4 06-May-2011 Jesse Wilson <jessewilson@google.com> Support Cache-Control 'must-revalidate' directive.

Change-Id: I98094e90307e7a39e40de6a09f34f038ad143ea4
http://b/3180373
esponseHeaders.java
c996149b500fc4825156106554457fe2394ae087 06-May-2011 Jesse Wilson <jessewilson@google.com> Fix proxy+HTTPS to handle authentication requests from the proxy.

Previously I'd introduced a bug by assuming that CONNECT
responses would always be successful.

Change-Id: Iaf0caf67f52154f6951a20284c75db0090843b99
http://b/4188137
ttpEngine.java
ttpURLConnectionImpl.java
ttpsURLConnectionImpl.java
19c77c6a6da8cea7327ccbb741963ac76d3fae53 05-May-2011 Jesse Wilson <jessewilson@google.com> Address some test failures in the HTTP client.

Change-Id: I44783aa7cadd51ed6b9e7aabc94144c60252c095
http://b/3180373
ttpEngine.java
ttpURLConnectionImpl.java
ttpsURLConnectionImpl.java
d742d7fc7f0593eb8c6e4ac9dd4c0f6a80374e46 05-May-2011 Jesse Wilson <jessewilson@google.com> Use GET after a POST is redirected.

Also dropping support for response code 305 Use Proxy, which
is seldom used, and whose behavior is quite different from
Chrome and Firefox. This is an intentional delta from the RI.

Also testing disconnect().

Change-Id: I80433f4776a2cfc5e228179421a787a44a4ded69
http://b/3180373
ttpEngine.java
ttpURLConnectionImpl.java
a4193d7e636802a2705ffb52cb69c69ff59bfbb2 05-May-2011 Jesse Wilson <jessewilson@google.com> Clean up HTTP engine connection reuse.

Also fixing cached responses to set warnings on the
response header and not the request header.

Change-Id: I4def2abf00e43aedc4baa63d1624bfa2f4d9bc16
ttpEngine.java
ttpURLConnectionImpl.java
esponseHeaders.java
953df613522e12a418cb7cb73248594d6c9f53d4 03-May-2011 Jesse Wilson <jessewilson@google.com> Refactor HttpURLConnection implementation.

Break HttpURLConnectionImpl into two parts: the part that
implements the Java API (that follows redirects etc.) and
the part that speaks HTTP. The HTTP part is called HttpEngine,
and it can only be used for a single HTTP request. This makes
it easier to set request properties that only apply to a
single socket request.

Tests for 'Vary', 'Content-Location' and warnings.

For simplicity of implementation I've chosen not to support
'Vary' at this time.

The 'Content-Location' header doesn't require any work from
the cache.

Warnings are ugly but allow the caller to identify when the
cache results may be problematic.

Also breaking HttpResponseCache's dependency on HttpURLConnectionImpl
so it can be tested on the RI.

Change-Id: Idbabb51251f479c2cdea4e0fceb029bfd07182be
http://b/3180373
bstractHttpInputStream.java
hunkedInputStream.java
ixedLengthInputStream.java
ttpConnection.java
ttpEngine.java
ttpHeaders.java
ttpURLConnectionImpl.java
ttpsURLConnectionImpl.java
awHeaders.java
equestHeaders.java
esponseHeaders.java
nknownLengthHttpInputStream.java
0406097759dafaee2390e3ff8dbabd5a1d098122 03-May-2011 Jesse Wilson <jessewilson@google.com> Split CacheHeader into RequestHeader and ResponseHeader.

Fix suspicious use of the word 'header' in the HttpURLConnectionImpl.
Use 'header field' and 'headers' as necessary.

Change-Id: I502808005a727772091e5770a517d3170e102549
http://b/3180373
acheHeader.java
eaderParser.java
ttpConnection.java
ttpConnectionPool.java
ttpHandler.java
ttpHeaders.java
ttpURLConnectionImpl.java
ttpsHandler.java
ttpsURLConnectionImpl.java
equestHeaders.java
esponseHeaders.java
21dddca4064527116af7a1553de502c6d11138da 03-May-2011 Jesse Wilson <jessewilson@google.com> Cache authorization headers and default expiration date.

Neither of these are particularly pretty. Authorization is a
silly special case in the spec that makes caching opt-in rather
than opt-out. Default expiration dates are reasonable but require
a hack to not cache get queries like http://foo.com/?q=bar.

http://b/3180373

Change-Id: Ica76ccfde30fe1e7a0d64895ef5370b43bd980ec
acheHeader.java
ttpURLConnectionImpl.java
84f1fd18b9db6fc6f2bb65694bee99d42f88bb79 02-May-2011 Jesse Wilson <jessewilson@google.com> Honor client conditions in HTTP response caching.

Also whitelist acceptable response codes and use the same
logic in both the write-to and read-from cache code paths.

Change-Id: I9500c6c2c0f9bb35e05e2a3443542a86de76cb66
http://b/3180373
acheHeader.java
ttpURLConnectionImpl.java
c9e12f729cb962eb60754e4500312421c46e71dd 30-Apr-2011 Jesse Wilson <jessewilson@google.com> Adding support for only-if-cached request header.

This is somewhat ugly because it means we need to fake a 502 bad gateway
status when the response would otherwise be a cached or conditionally
cached result.

Also adding support for max-stale. This completes the set of three
client cache timing headers, max-age, min-fresh and max-stale.

Change-Id: I923a3e5a4685989cb49fb57d6a1359e10026b94b
http://b/3180373
acheHeader.java
ttpURLConnectionImpl.java
adb64fbba2b781467e055706c3de0873dfc01166 30-Apr-2011 Jesse Wilson <jessewilson@google.com> Honor max-age and min-fresh request headers.

We now honor headers from both the server's response (which
we have cached) and the client's request.

Change-Id: Ib46e4fc0c5dd5b3e74cff8f45eea2dda51d20b94
http://b/3180373
acheHeader.java
ttpURLConnectionImpl.java
fe2dea5d0747cbe711fcf64f89845735f4da10c2 30-Apr-2011 Jesse Wilson <jessewilson@google.com> Hack to fix URLConnectionTest.

We weren't preparing the request headers early enough
for some requests. This code needs some hefty refactoring,
but I'm putting this quick hack in to get tests working
until that's done.

http://b/3180373

Change-Id: I03dbd306070bd21b4c7e86052b0b41339cbab628
ttpURLConnectionImpl.java
9b35d1ad04cdaf0905aee3cb04064ba977e846ac 29-Apr-2011 Jesse Wilson <jessewilson@google.com> Improve parsing of HTTP caching headers.

Change-Id: Ie2b4c76ac97cc7a4783bd6a695cfb28f7ea2296f
http://b/3180373
acheHeader.java
ttpHeaders.java
ttpURLConnectionImpl.java
0c59055dd24e1659f85d9ff7e2148883f663bd62 27-Apr-2011 Jesse Wilson <jessewilson@google.com> Support conditional gets in HttpURLConnection.

This is the first step towards adding an HTTP response cache.
There's still much to do; details are listed on the bug.

Change-Id: Ie693fe424d1d90e90576fc959595e4d96a31f767
http://b/3180373
acheHeader.java
hunkedInputStream.java
ttpDate.java
ttpHeaders.java
ttpURLConnectionImpl.java
ttpsURLConnectionImpl.java
esponseSource.java
9fa7c4cd4a619236db70aefab8da3abafb065bca 31-Mar-2011 Jesse Wilson <jessewilson@google.com> am 866b399e: am 9d28a32d: am bc4c79c6: Don\'t read from the delegate stream after we close it.

* commit '866b399e1d5cab4cc8d196f8008ba8ad8376765d':
Don't read from the delegate stream after we close it.
5aafac4db69e6d087c512cdfa5c7c0e2f1611681 19-Mar-2011 Jesse Wilson <jessewilson@google.com> Move URLConnection classes to libcore.net.

Change-Id: I14bf8373dfce50dda94e1a64419b9a8a9cf3c82e
bstractHttpInputStream.java
bstractHttpOutputStream.java
hunkedInputStream.java
hunkedOutputStream.java
ixedLengthInputStream.java
ixedLengthOutputStream.java
ttpConnection.java
ttpConnectionPool.java
ttpHandler.java
ttpHeaders.java
ttpURLConnectionImpl.java
ttpsHandler.java
ttpsURLConnectionImpl.java
etryableOutputStream.java
nknownLengthHttpInputStream.java