summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2011-03-31 11:30:37 -0700
committerJesse Wilson <jessewilson@google.com>2011-03-31 11:30:37 -0700
commitbc4c79c6a2059003f695f7ad204de36700e8d701 (patch)
treeb0a21db9b26c11e014eca65fad6b58b015b0c758 /support
parenta321720e459ae0d7fc403d112f2e974102a59d9f (diff)
downloadlibcore-bc4c79c6a2059003f695f7ad204de36700e8d701.zip
libcore-bc4c79c6a2059003f695f7ad204de36700e8d701.tar.gz
libcore-bc4c79c6a2059003f695f7ad204de36700e8d701.tar.bz2
Don't read from the delegate stream after we close it.
Change-Id: Ib724b170f7ec10ea0025c0e2e7978119fd070eb6 http://b/4188137
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 35729ed..48e53e7 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;