mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 20:29:52 +01:00
Use larger buffer in test connections to prevent deadlock.
This commit is contained in:
@@ -21,6 +21,7 @@ public class TestDuplexTransportConnection
|
|||||||
private final TransportConnectionReader reader;
|
private final TransportConnectionReader reader;
|
||||||
private final TransportConnectionWriter writer;
|
private final TransportConnectionWriter writer;
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess")
|
||||||
public TestDuplexTransportConnection(InputStream in, OutputStream out) {
|
public TestDuplexTransportConnection(InputStream in, OutputStream out) {
|
||||||
reader = new TestTransportConnectionReader(in);
|
reader = new TestTransportConnectionReader(in);
|
||||||
writer = new TestTransportConnectionWriter(out);
|
writer = new TestTransportConnectionWriter(out);
|
||||||
@@ -42,8 +43,9 @@ public class TestDuplexTransportConnection
|
|||||||
*/
|
*/
|
||||||
public static TestDuplexTransportConnection[] createPair()
|
public static TestDuplexTransportConnection[] createPair()
|
||||||
throws IOException {
|
throws IOException {
|
||||||
PipedInputStream aliceIn = new PipedInputStream();
|
// Use 64k buffers to prevent deadlock
|
||||||
PipedInputStream bobIn = new PipedInputStream();
|
PipedInputStream aliceIn = new PipedInputStream(1 << 16);
|
||||||
|
PipedInputStream bobIn = new PipedInputStream(1 << 16);
|
||||||
PipedOutputStream aliceOut = new PipedOutputStream(bobIn);
|
PipedOutputStream aliceOut = new PipedOutputStream(bobIn);
|
||||||
PipedOutputStream bobOut = new PipedOutputStream(aliceIn);
|
PipedOutputStream bobOut = new PipedOutputStream(aliceIn);
|
||||||
TestDuplexTransportConnection alice =
|
TestDuplexTransportConnection alice =
|
||||||
|
|||||||
Reference in New Issue
Block a user