OSDN Git Service

Rewrite the HTTP connection pool used by HttpURLConnection.
authorJesse Wilson <jessewilson@google.com>
Wed, 21 Apr 2010 04:34:28 +0000 (21:34 -0700)
committerJesse Wilson <jessewilson@google.com>
Wed, 21 Apr 2010 05:16:25 +0000 (22:16 -0700)
commit7de8d22b0b42f9bb42936929506d291d3876c84d
treeeceb11ea42e0800a50f5c94ea769c524b52c5b66
parent01e13df5425e262d951052b6f5e7b461b5214481
Rewrite the HTTP connection pool used by HttpURLConnection.

This started off as incremental changes, but it ended up going
far enough that it earned the "rewrite" badge.

System.getProperty() is not called for every HTTP connection.
This is slightly controversial, but the old code had to bend
over backwards to support dynamic pool changes, and it didn't
even support the case when the pool shrank but not to 0.

The new code doesn't do I/O within static synchronized blocks.
This should reduce contention described here: http://b/issue?id=2606547

Also: simpify implementation, prettier names, more focused doc.
libcore/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConfiguration.java
libcore/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnectionManager.java [deleted file]
libcore/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnectionPool.java [new file with mode: 0644]
libcore/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java
libcore/luni/src/test/java/java/net/URLConnectionTest.java
libcore/support/src/test/java/tests/support/Support_TestWebServer.java