1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-25 16:01:38 +03:00

Increase the stream drain timeout from 30ms to 100ms.

We were missing out on opportunities to reuse HTTPS connections
with the previous timeout. This even occured on unit tests where
the latency should be very low.

https://github.com/square/okhttp/issues/90
This commit is contained in:
jwilson
2013-02-01 11:00:38 -05:00
parent 2a319f7ece
commit c7751ee158
2 changed files with 2 additions and 6 deletions

View File

@@ -43,7 +43,7 @@ public final class HttpTransport implements Transport {
* used for connection reuse, this timeout should be significantly less than
* the time it takes to establish a new connection.
*/
private static final int DISCARD_STREAM_TIMEOUT_MILLIS = 30;
private static final int DISCARD_STREAM_TIMEOUT_MILLIS = 100;
public static final int DEFAULT_CHUNK_LENGTH = 1024;

View File

@@ -393,11 +393,7 @@ public final class URLConnectionTest {
testServerClosesOutput(SHUTDOWN_INPUT_AT_END);
}
/**
* Ignored because this test is racy.
* https://github.com/square/okhttp/issues/90
*/
@Test @Ignore public void serverShutdownOutput() throws Exception {
@Test public void serverShutdownOutput() throws Exception {
testServerClosesOutput(SHUTDOWN_OUTPUT_AT_END);
}