mirror of
https://github.com/square/okhttp.git
synced 2026-01-24 04:02:07 +03:00
getMtu issue
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user