mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-09-10 05:08:04 +02:00
Buffer all the streams. @phanaticD please try this build as soon as you can, without your changes.
This commit is contained in:
parent
b0faea5254
commit
3114e1e802
@ -1,5 +1,6 @@
|
|||||||
package net.md_5.bungee;
|
package net.md_5.bungee;
|
||||||
|
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
@ -67,7 +68,7 @@ public class InitialHandler implements Runnable
|
|||||||
|
|
||||||
out.write(new PacketFCEncryptionResponse().getPacket());
|
out.write(new PacketFCEncryptionResponse().getPacket());
|
||||||
in = new PacketInputStream(new CipherInputStream(socket.getInputStream(), EncryptionUtil.getCipher(false, shared)));
|
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<>();
|
List<byte[]> customPackets = new ArrayList<>();
|
||||||
byte[] custom;
|
byte[] custom;
|
||||||
while (Util.getId((custom = in.readPacket())) != 0xCD)
|
while (Util.getId((custom = in.readPacket())) != 0xCD)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package net.md_5.bungee;
|
package net.md_5.bungee;
|
||||||
|
|
||||||
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
@ -65,6 +66,8 @@ public class ServerConnection extends GenericConnection
|
|||||||
out.write(new PacketFAPluginMessage("REGISTER", channel.getBytes()).getPacket());
|
out.write(new PacketFAPluginMessage("REGISTER", channel.getBytes()).getPacket());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out = new BufferedOutputStream(out);
|
||||||
|
|
||||||
return new ServerConnection(name, socket, in, out, login);
|
return new ServerConnection(name, socket, in, out, login);
|
||||||
} catch (KickException ex)
|
} catch (KickException ex)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user