Add tweakable buffer size.

This commit is contained in:
md_5 2012-12-24 11:47:25 +11:00
parent 51ed8beffa
commit bc3f63790a
3 changed files with 3 additions and 2 deletions

View File

@ -133,6 +133,7 @@ public class Configuration
*/
public String statsUuid = UUID.randomUUID().toString();
public boolean metricsEnabled = true;
public int bufferSize = 2048;
/**
* Load the configuration and save default values.

View File

@ -68,7 +68,7 @@ public class InitialHandler implements Runnable
out.write(new PacketFCEncryptionResponse().getPacket());
in = new PacketInputStream(new CipherInputStream(socket.getInputStream(), EncryptionUtil.getCipher(false, shared)));
out = new CipherOutputStream(new BufferedOutputStream(socket.getOutputStream(), 4096), EncryptionUtil.getCipher(true, shared));
out = new CipherOutputStream(new BufferedOutputStream(socket.getOutputStream(), BungeeCord.instance.config.bufferSize), EncryptionUtil.getCipher(true, shared));
List<byte[]> customPackets = new ArrayList<>();
byte[] custom;
while (Util.getId((custom = in.readPacket())) != 0xCD)

View File

@ -66,7 +66,7 @@ public class ServerConnection extends GenericConnection
out.write(new PacketFAPluginMessage("REGISTER", channel.getBytes()).getPacket());
}
out = new BufferedOutputStream(out, 4096);
out = new BufferedOutputStream(out, BungeeCord.instance.config.bufferSize);
return new ServerConnection(name, socket, in, out, login);
} catch (KickException ex)