Buffer all the streams. @phanaticD please try this build as soon as you can, without your changes.

This commit is contained in:
md_5 2012-12-23 13:57:39 +11:00
parent b0faea5254
commit 3114e1e802
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package net.md_5.bungee;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
@ -67,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(socket.getOutputStream(), EncryptionUtil.getCipher(true, shared));
out = new CipherOutputStream(new BufferedOutputStream(socket.getOutputStream()), EncryptionUtil.getCipher(true, shared));
List<byte[]> customPackets = new ArrayList<>();
byte[] custom;
while (Util.getId((custom = in.readPacket())) != 0xCD)

View File

@ -1,5 +1,6 @@
package net.md_5.bungee;
import java.io.BufferedOutputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
@ -65,6 +66,8 @@ public class ServerConnection extends GenericConnection
out.write(new PacketFAPluginMessage("REGISTER", channel.getBytes()).getPacket());
}
out = new BufferedOutputStream(out);
return new ServerConnection(name, socket, in, out, login);
} catch (KickException ex)
{