1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-24 04:02:07 +03:00

getMtu issue

This commit is contained in:
lingming.yb
2013-12-28 13:30:22 +08:00
parent 5dc27c7172
commit 1c90331a3d

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);
}
}