History log of /external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ConnectionPool.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6c251e20f00c7574b217bd4351ac81666f574380 24-Jun-2016 Tobias Thierer <tobiast@google.com> Update OkHttp to 2.7.5 and advance okio by one commit.

This brings OkHttp and okio exactly in line with upstream commits
with no local changes.

Corresponding upstream commits:
okhttp:6e236ce3b80f21369dc544f0e1053ff71be8689b (= parent-2.7.5)
okio: 02481cc0cc84bc92e3eab6d5212a226496f56a7e

The okio commit differs from the one in the previous pull from
Sep 2015 (AOSP commit 71b9f47b26fb57ac3e436a19519c6e3ec70e86eb)
only by a single upstream commit, the switch to 8 KiB segments.
That commit was previously cherry-picked in AOSP. This CL will
temporarily revert the AOSP changes to okio, but those
AOSP changes to okio will be reapplied in the subsequent CL.

Compilation and tests do not pass after this CL, they will only
pass at the end of the chain of 11 CLs going in at the same time.
9 of these 11 CLs are in external/okhttp, the others affect
libcore and frameworks/base.

Details of behavioural changes introduced by this upgrade are at:
https://docs.google.com/document/d/19PF3Exd_q32gAGCiRFWRf0Pq_xrIWs-cRViHkFTxJg8/edit

This CL includes files that are not used in Android, such as
- top level dot files (.travis.yml etc.)
- subdirectories okurl, okhttp-apache, samples, which aren't used
- tests in okhttp-hpacktests, okhttp-ws-tests that aren't run
or test functionality that we aren't used

Test: I've run the following tests *at the end* of the chain of
commits, in cts-tradefed:
1.) run cts -p android.core.tests.libcore.package.harmony_java_net
2.) run cts -c libcore.java.net.URLConnectionTest
3.) run cts -p android.core.tests.libcore.package.okhttp
4.) run cts -p android.core.tests.libcore.package.libcore

1.-3.) all passed
4.) had 24 unrelated failures per b/29496407 and b/29744850

Change-Id: Id798d6cf49fa4a7a4ab8ae3b699a38104bf42db3
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ConnectionPool.java
71b9f47b26fb57ac3e436a19519c6e3ec70e86eb 16-Sep-2015 Neil Fuller <nfuller@google.com> Pull latest code from upstream okhttp and okio

This change contains the OkHttp and Okio changes without
modification. The only additions are the
MODULE_LICENSE_APACHE2 files.

This corresponds closely to OkHttp 2.5.0 and
Okio 1.6.0. Behavior changes are documented in
CHANGELOG.md.

This change does not compile as is. The next
commit makes the Android modifications required.

okhttp: 4305dc3fabeab392eb56f2db51538e06c3a54e51
okio: 313436764bf35794e158c6171e319fee868298df

Change-Id: I97ce07ff0472cdbce09f588863a1e5ccdcea0c20
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ConnectionPool.java
e78f117bcbd6b57d783737107f445ef75ecb474a 20-Jan-2015 Neil Fuller <nfuller@google.com> Pull latest OkHttp code from upstream

okio:

okio is now managed upstream as a separate project but has
been included here as a sub directory: the okio version here
is intended only for use with OkHttp.
okio is synced to upstream commit
82358df7f09e18aa42348836c614212085bbf045.
See okio/README.android for local changed needed to make it
compile.

okhttp:

This is effectively an upgrade from a snapshot close to
OkHttp 1.5 with Android additions to a snapshot close to
OkHttp 2.2.
okhttp was synced to upstream commit
0a197466608681593cc9be9487965a0b1d5c244c
See README.android for local changes needed to make it
compile.

Most of the old Android changes have been pushed upstream
and other upstream changes have been made to keep OkHttp
working on Android.

TLS fallback changes have not been upstreamed yet:
bcce0a3d26d66d33beb742ae2adddb3b7db5ad08
ede2bf1af0917482da8ccb7b048130592034253d

This means that some CTS tests will start to fail. A later
commit will fix those changes when it has been accepted
upstream.

There are associated changes in libcore and frameworks/base.

Change-Id: I0a68b27b1ec7067be452671bc591edfd84e310f2
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ConnectionPool.java
351b2ea7014d12c2e08eff6d22ac6dfbb85ce691 01-Dec-2014 Neil Fuller <nfuller@google.com> Fixes to ConnectionPool noticed during upstream review

Suggested by Jake Wharton. Minor documentation fixes, plus:

The pool should explicitly re-enter DRAINING state if a
connection is added to a drained pool. This state change was
missing.

The pool was implicitly in DRAINING while the pool still had
connections in it, so the pool would still drain.
However, adding back connections to a pool that was DRAINING
but still incorrectly marked as DRAINED would cause a
new runnable to be scheduled. This would cause the queue of
scheduled items to grow unnecesarily and the clean up thread
would continue to operate longer than necessary.

Bug: 18369687
(cherry picked from commit 6257f0c1c5e6e94d446051f856207782d7188c43)

Change-Id: Id60486a70163679d4f587ea75b71fc438a1d8df0
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ConnectionPool.java
ff345b6c0ffcc691e4c3c594f8a222cf81bb325c 19-Nov-2014 Neil Fuller <nfuller@google.com> Fix for a socket leak in OkHttp on Android

When the preferred Android network changes from
cell -> wifi or wifi -> cell the HTTP connection
pool in use is abandoned to avoid reuse of
connections on the old network. This was added
in commit 8bced3e.

The design for the connection pool was such that
continuous use of the connection pool was required to
clean up idle / expired connections. If a connection
pool becomes idle (as when it is dereferenced on a
network change) it is possible for some connections
to remain in the pool indefinitely.

After the preferred network change, because the old
connection pool was no longer referenced the pool
would be garbage collected and Android's "Strict Mode"
would complain about sockets not being closed.

The only existing way to avoid this was to call
"evictAll()", which would have had issues when a
large number of connections were returned to the pool
after evictAll() was called. It also wouldn't work
for SPDY connections which are shared but not reference
counted, which makes knowing whether it is safe to
close them difficult. SPDY is not enabled on Android
by default and so that may have been safe to ignore.

This fix tries to keep the existing cleaning behavior
intact to avoid introducing new bugs or new thread
behavior that might impact battery life. It adds a
new mode to the pool for "draining", which handles
cleaning up any existing entries in the pool and any
added after the pool has been placed into draining
mode.

The drainModeRunnable introduced serves two purposes:

1) While scheduled / executing, it pins the connection
pool in memory to avoid it being garbage collected.
2) It continues to close connections (safely) until the
pool is empty.

If a connection is then added back to the pool the
drainModeRunnable is restarted.

Bug: 18369687
Change-Id: I7e9bdd0edba84784f667105f52ef80655c1b06ff
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ConnectionPool.java
78092f38ebd93018ead53a87b53118dc829cbb8a 01-Apr-2014 Neil Fuller <nfuller@google.com> Pull upstream fixes from OkHttp

This synced to commit b21b40e480cdcd09b618e399a349556de509d88d
/ master / 1st April 2014.

Notably this contains a fix for apps that bundle an older
copy of OkHttp or which call android.net.http.HttpResponseCache.get()
or android.net.http.HttpResponseCache.put().

See for details:
https://github.com/square/okhttp/pull/672

Change-Id: I90acd9f9946014e834ea203dbc62cdcf7bc80cc6
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ConnectionPool.java
3c938a3f6b61ce5e2dba0d039b03fe73b89fd26c 19-Feb-2014 Neil Fuller <nfuller@google.com> Update okhttp to a more recent commit.

Updating to upstream commit : 7b106923e078ac2435e8c8ce9d615f9903106ed8
/ 7th Mar 2014 / main branch.

The following changes were made to Android-only code:
1) HttpsHandler has been changed to deal with the fix for:
https://github.com/square/okhttp/issues/184 (commit 5d7fdba).
2) Platform.java changed to accomodate changes in okhttp Platform
method signatures.
3) .mk file updates to reflect src directory changes.

The following changes were made to OkHttp code:
1) Removal of org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
annotation from okio/src/main/java/okio/DeflaterSink.java

Change-Id: I644a883482ac7ee7d029785f110a2ca00762419b
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ConnectionPool.java
166772be0e5cfdaea1a64b9f63e4c8dbfe48cba3 04-Nov-2013 Narayan Kamath <narayan@google.com> Update okhttp.

Updated to commit 19a21936ffbb5e358799af9e4fb7306af45f38.

This also moves src/ to okhttp/src/ to stay faithful
to the original okhttp tree & to make it easier to pull
updates.

Change-Id: Ia1971823f31e5c6957d831f368e3a1fcce38d44d
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ConnectionPool.java