| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
http://elliotth.blogspot.com/2012/01/beware-convenience-methods.html
Bug: https://code.google.com/p/android/issues/detail?id=58359
Change-Id: I597b2ac940f17b5b2bc176e390dc4b63fe0a4e72
|
|
|
|
| |
Change-Id: I6db6d91e21b8e1aca5b5338534196fd5bdef8a06
|
|
|
|
| |
Change-Id: I4dac34f88b23484643bce31e5f25ac6eb1fea426
|
|
|
|
| |
Change-Id: I90fcf6c284f4a3bbe36ef0ed44f85ddf5a424ffb
|
|
|
|
|
|
|
|
| |
Previously I'd introduced a bug by assuming that CONNECT
responses would always be successful.
Change-Id: Iaf0caf67f52154f6951a20284c75db0090843b99
http://b/4188137
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| |
| |
| |
| |
| | |
after we close it.
* commit '866b399e1d5cab4cc8d196f8008ba8ad8376765d':
Don't read from the delegate stream after we close it.
|
| |
| |
| |
| |
| | |
Change-Id: Ib724b170f7ec10ea0025c0e2e7978119fd070eb6
http://b/4188137
|
|/
|
|
| |
Change-Id: I31c9f6e9add87a17737eac4f09949540e5da8cb5
|
|
|
|
|
|
|
|
|
| |
While I'm here fix a MockWebServer bug I recently introduced
that broke cookie tests that needed to know port numbers before
responses were enqueued.
Change-Id: Idb2389ac5ed66656248c10aeb68209641acc0a68
http://b/3325637
|
|
|
|
|
|
|
|
| |
This includes some changes to MockWebServer to make it stop
accepting connections as soon as its response queue is empty.
Change-Id: I5a6bcdf1c03d0c36b11552ae086d0dece0440f64
http://b/1158780
|
|
|
|
|
| |
Change-Id: I5110d58d91e7c6f8f7553ad400f0bd841bcf07b6
http://b/2612240
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes several specific problems:
- HTTP header map didn't contain the status line (under the null key)
- response code, message and version weren't set by caches
- caches didn't work with redirects
This change also makes some significant cleanup to the Headers class.
We might be able to simplify this further by dropping the map, should
that prove efficient enough.
Change-Id: Ib79ec17bef5978b3234f68102114eee7d4b7cda2
http://b/3139211
http://b/3139211
|
|
|
|
|
|
|
|
|
|
| |
Previously it would fail with an internal error because of
inconsistencies because HttpURLConnectionImpl claimed to be
'connected' when it had a cache hit, and HttpsURLConnection
acted upon this by talking to its sockets.
Change-Id: I51f4215ceb9c5fd851223a501488306fa6d382b1
http://b/3043966
|
|
|
|
|
| |
Change-Id: I8ea7923c3ea72728c7df64c13bdd6f94b91be121
http://b/3032912
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See also b/1569612
Summary:
- OpenSSlSocket support for SNI, session tickets, compression
- URLConnection mimics Chrome behavior of trying connection with these enabled,
falling back to SSL w/o encryption on failure
Details:
libcore
URLConnection https retry
Change HttpConnection.getSecureSocket to enable non-standard features on first
connection attempt. On second attempt, we back off to SSLv3 from
TLSv1, mimicking Chrome's behavior.
luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnection.java
Change HttpsEngine.connect to implement SSL reconnect
luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/HttpsURLConnectionImpl.java
OpenSSL SSLSocket implementation
OpenSSLSocketImpl and OpenSSLServerSocketImpl now have an array of
enabled compression methods interface and implementation to
parallel that of procotols and ciphersuites.
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java
OpenSSLSessionImpl now has a cache of the native
compressionMethod. Also replaced "gives" javadoc working with
"returns".
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java
OpenSSLSocketImpl session caching now needs to skip cached
sessions with mismatched compression requirements.
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
OpenSSLSocketImpl.startHandshake now uses NativeCrypto to support
our non-standard extensions.
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
NativeCrypto changes
- Added declaration of SSL options for tickets and compression.
- Added general "compression methods" interface
paralleling "cipher suites" and "protocols" interfaces.
- Added SSL_set_tlsext_host_name to set SNI (Server Name Indication) value
- Added SSL_get_servername to read SNI (Server Name Indication) value
- Added SSL_SESSION_compress_meth read negotiated compression method
- SSL_new makes sure to default compression to off for compatibility
luni/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java
luni/src/main/native/NativeCrypto.cpp
Testing
Added URLConnectionTest.testConnectViaHttpsWithSSLFallback to make
sure we properly retry an https connection if the server
terminates unexpectedly. Fixed up
URLConnectionTest.testHttpsWithCustomTrustManager with new
expected certificate chain. Fixed a few mistaken
TestSSLContext.serverContext uses to clientContext
luni/src/test/java/java/net/URLConnectionTest.java
Added test_SSL_set_tlsext_host_name, test_SSL_get_servername,
test_SSL_SESSION_compress_meth. Added a number of missing fail()
calls in expected exception cases which caught one test with
mistaken expectations. Removed some unnecessary scopes. Fixed some
badly scoped catch blocks.
luni/src/test/java/org/apache/harmony/xnet/provider/jsse/NativeCryptoTest.java
Changed MockWebServer to support a new MockResponse propery of
disconnectAtStart, which immediately terminates the connection
support/src/test/java/tests/http/MockResponse.java
support/src/test/java/tests/http/MockWebServer.java
external/openssl
Restore -ZLIB to OpenSSL build. Note that NativeCrypto.SSL_new
disables compression by for default SSLSocket for compatibility.
android-config.mk
Force clean build with new CFLAGS
CleanSpec.mk
Change-Id: Iba6268f9096f2be43f0d30de151dd3fd0aea4a81
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also cleanup of HttpConfiguration (renamed HttpConnection.Address),
including removing some dead code.
Also adding performance-run support to MockWebServer to permit
benchmarking.
I benchmarked different buffer sizes, and a buffer as small as 16 bytes
halved the runtime on some HTTP requests. Ultimately I chose a 128 byte
buffer, since that's the point of diminishing returns.
The following report shows benchmark results for 5 different buffer
sizes. Notice how our previous unbuffered behaviour was particularly
inefficient.
bodySize transferEncoding responseHeaders bufferSize ms logarithmic runtime
0 FIXED_LENGTH MINIMAL 0 5.44 =
0 FIXED_LENGTH MINIMAL 16 5.17 =
0 FIXED_LENGTH MINIMAL 128 5.06 =
0 FIXED_LENGTH MINIMAL 512 5.19 =
0 FIXED_LENGTH MINIMAL 1024 5.27 =
0 FIXED_LENGTH TYPICAL 0 14.61 ===========
0 FIXED_LENGTH TYPICAL 16 7.35 ====
0 FIXED_LENGTH TYPICAL 128 6.48 ===
0 FIXED_LENGTH TYPICAL 512 6.97 ====
0 FIXED_LENGTH TYPICAL 1024 6.92 ====
0 CHUNKED MINIMAL 0 5.72 ==
0 CHUNKED MINIMAL 16 5.26 =
0 CHUNKED MINIMAL 128 5.27 =
0 CHUNKED MINIMAL 512 5.16 =
0 CHUNKED MINIMAL 1024 5.31 =
0 CHUNKED TYPICAL 0 14.81 ===========
0 CHUNKED TYPICAL 16 7.30 ====
0 CHUNKED TYPICAL 128 6.62 ===
0 CHUNKED TYPICAL 512 6.51 ===
0 CHUNKED TYPICAL 1024 6.50 ===
1024 FIXED_LENGTH MINIMAL 0 5.47 =
1024 FIXED_LENGTH MINIMAL 16 5.40 =
1024 FIXED_LENGTH MINIMAL 128 5.43 =
1024 FIXED_LENGTH MINIMAL 512 5.40 =
1024 FIXED_LENGTH MINIMAL 1024 5.37 =
1024 FIXED_LENGTH TYPICAL 0 14.83 ===========
1024 FIXED_LENGTH TYPICAL 16 7.42 ====
1024 FIXED_LENGTH TYPICAL 128 6.50 ===
1024 FIXED_LENGTH TYPICAL 512 6.50 ===
1024 FIXED_LENGTH TYPICAL 1024 6.51 ===
1024 CHUNKED MINIMAL 0 6.12 ==
1024 CHUNKED MINIMAL 16 5.51 =
1024 CHUNKED MINIMAL 128 5.55 =
1024 CHUNKED MINIMAL 512 5.60 ==
1024 CHUNKED MINIMAL 1024 5.50 =
1024 CHUNKED TYPICAL 0 15.00 ===========
1024 CHUNKED TYPICAL 16 7.56 =====
1024 CHUNKED TYPICAL 128 6.86 ====
1024 CHUNKED TYPICAL 512 6.73 ===
1024 CHUNKED TYPICAL 1024 6.60 ===
1048576 FIXED_LENGTH MINIMAL 0 25.27 =================
1048576 FIXED_LENGTH MINIMAL 16 25.36 =================
1048576 FIXED_LENGTH MINIMAL 128 25.86 =================
1048576 FIXED_LENGTH MINIMAL 512 25.25 =================
1048576 FIXED_LENGTH MINIMAL 1024 32.51 ===================
1048576 FIXED_LENGTH TYPICAL 0 36.65 =====================
1048576 FIXED_LENGTH TYPICAL 16 27.43 ==================
1048576 FIXED_LENGTH TYPICAL 128 26.88 =================
1048576 FIXED_LENGTH TYPICAL 512 26.94 =================
1048576 FIXED_LENGTH TYPICAL 1024 33.13 ====================
1048576 CHUNKED MINIMAL 0 77.02 ============================
1048576 CHUNKED MINIMAL 16 51.32 ========================
1048576 CHUNKED MINIMAL 128 50.98 ========================
1048576 CHUNKED MINIMAL 512 51.82 ========================
1048576 CHUNKED MINIMAL 1024 50.40 ========================
1048576 CHUNKED TYPICAL 0 88.99 ==============================
1048576 CHUNKED TYPICAL 16 53.94 ========================
1048576 CHUNKED TYPICAL 128 53.03 ========================
1048576 CHUNKED TYPICAL 512 52.14 ========================
1048576 CHUNKED TYPICAL 1024 50.90 ========================
Benchmark source code is here:
http://code.google.com/p/dalvik/source/browse/trunk/benchmarks/regression/URLConnectionBenchmark.java
Change-Id: Ie3e754ab8497e6200f8b6e7f9c63c40a7d4784e2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code splits our HTTP input streams into four (!) inner
classes. The base class takes care of ensuring split() and
single byte reads get cached and call disconnect() as necessary.
Our code closes the cache when the stream is exhausted; this
is different from the RI which closes it when in.close() is
called.
When a fixed length input stream of length 0 is received,
we cache it immediately. This has behavior consequences for
CONNECT, which needs the otherwise-recyclable connection to
stick around.
This adds explicit shutdown capabilities to MockWebServer.
This is necessary now that we don't guarantee all enqueued
responses will be requested.
We still need test coverage for malformed chunk sizes.
Change-Id: Iaf866af4fc1d76faea559df267a4bde6fdfa1d83
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- reading extra bytes from the server depending on available()
- not sending the port with the proxy request
- returning a read-til-the-end stream instead of a read-0-bytes-stream
on CONNECT requests
- fixing MockWebServer to omit the unnecessary \r\n after
the response body
- tests no longer mask the issue by unambiguously reading characters.
Trailing newlines aren't discarded!
- New tests when content-length and content disagree. The RI fails
the test when the transfer-encoding is not chunked.
Change-Id: I888569844d323bc770cd5bb95ac71c740dd5e720
|
|
|
|
|
|
| |
One failure is here: http://b/issue?id=2761326
Change-Id: If1918a2e59bd4335e38ce3ec4214dfccd24ee798
|
|
|
|
|
|
|
|
| |
Also exposing core-tests-support for use by tests in frameworks/base.
I'm not particularly happy about this, but it seems to be the best
way to share test support code between the two build targets.
Change-Id: I5e8dcac90fc5d9be791e46c2606498978212108e
|
|
|
|
|
|
|
|
| |
These all fail on Dalvik because we haven't wired these together.
On the RI, everything passes except for the two tests that check
parsing for multiple cookies in a single HTTP header.
Change-Id: Idb10c5b51b7ae5ca400dc564f2926f0d5792093d
|
|
|
|
|
|
|
| |
From the post-review comments here:
https://android-git.corp.google.com/g/51054
Change-Id: I67be25a6648a2df02a888a0ae8559c05614de20c
|
|
Unlike the Support_TestWebServer, this server is dumb but scriptable.
It's intended to make it easier to test uncommon HTTP behavior, such
as an intermediate HTTP proxy.
Change-Id: Iac07e0b4788eeaa172d5c55d8ed9e034d98aa8e6
|