summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2011-03-31 11:54:23 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-31 11:54:23 -0700
commit9fa7c4cd4a619236db70aefab8da3abafb065bca (patch)
tree878c53d35f6960c9c7621afa09a8c4eb087b7685 /support
parent0ade5524d972b9dfd69b0126aa4c35319c1b7fa4 (diff)
parent866b399e1d5cab4cc8d196f8008ba8ad8376765d (diff)
downloadlibcore-9fa7c4cd4a619236db70aefab8da3abafb065bca.zip
libcore-9fa7c4cd4a619236db70aefab8da3abafb065bca.tar.gz
libcore-9fa7c4cd4a619236db70aefab8da3abafb065bca.tar.bz2
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.
Diffstat (limited to 'support')
-rw-r--r--support/src/test/java/tests/http/MockWebServer.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/support/src/test/java/tests/http/MockWebServer.java b/support/src/test/java/tests/http/MockWebServer.java
index 0cdd561..2083117 100644
--- a/support/src/test/java/tests/http/MockWebServer.java
+++ b/support/src/test/java/tests/http/MockWebServer.java
@@ -33,11 +33,12 @@ import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingDeque;
@@ -63,7 +64,7 @@ public final class MockWebServer {
private final BlockingQueue<MockResponse> responseQueue
= new LinkedBlockingDeque<MockResponse>();
private final Set<Socket> openClientSockets
- = Collections.synchronizedSet(new HashSet<Socket>());
+ = Collections.newSetFromMap(new ConcurrentHashMap<Socket, Boolean>());
private boolean singleResponse;
private final AtomicInteger requestCount = new AtomicInteger();
private int bodyLimit = Integer.MAX_VALUE;