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

Merge pull request #376 from lingmingyb/mtu

getMtu issue
This commit is contained in:
Adrian Cole
2013-12-28 09:29:48 -08:00

View File

@@ -330,11 +330,7 @@ public final class Connection implements Closeable {
}
private void streamWrapper() throws IOException {
//Use MTU-sized buffers to send fewer packets.
int mtu = Platform.get().getMtu(socket);
if (mtu < 1024) mtu = 1024;
if (mtu > 8192) mtu = 8192;
in = new BufferedInputStream(in, mtu);
out = new BufferedOutputStream(out, mtu);
in = new BufferedInputStream(in, 4096);
out = new BufferedOutputStream(out, 256);
}
}