mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 18:17:38 +01:00
Update to Netty 4.0.6-Final
This commit is contained in:
parent
db5a147491
commit
172b8bc75b
2
pom.xml
2
pom.xml
@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<build.number>unknown</build.number>
|
<build.number>unknown</build.number>
|
||||||
<netty.version>4.0.0.CR9</netty.version>
|
<netty.version>4.0.6.Final</netty.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ public class HttpHandler extends SimpleChannelInboundHandler<HttpObject>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void messageReceived(ChannelHandlerContext ctx, HttpObject msg) throws Exception
|
protected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception
|
||||||
{
|
{
|
||||||
if ( msg instanceof HttpResponse )
|
if ( msg instanceof HttpResponse )
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,7 @@ public class ChannelWrapper
|
|||||||
if ( !closed )
|
if ( !closed )
|
||||||
{
|
{
|
||||||
ch.write( packet );
|
ch.write( packet );
|
||||||
|
ch.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ public class ChannelWrapper
|
|||||||
if ( !closed )
|
if ( !closed )
|
||||||
{
|
{
|
||||||
closed = true;
|
closed = true;
|
||||||
|
ch.flush();
|
||||||
ch.close();
|
ch.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -38,6 +40,7 @@ public class ChannelWrapper
|
|||||||
public void addBefore(String baseName, String name, ChannelHandler handler)
|
public void addBefore(String baseName, String name, ChannelHandler handler)
|
||||||
{
|
{
|
||||||
Preconditions.checkState( ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop" );
|
Preconditions.checkState( ch.eventLoop().inEventLoop(), "cannot add handler outside of event loop" );
|
||||||
|
ch.pipeline().flush();
|
||||||
ch.pipeline().addBefore( baseName, name, handler );
|
ch.pipeline().addBefore( baseName, name, handler );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@ package net.md_5.bungee.netty;
|
|||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.MessageList;
|
|
||||||
import io.netty.handler.codec.MessageToMessageDecoder;
|
import io.netty.handler.codec.MessageToMessageDecoder;
|
||||||
|
import java.util.List;
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
|
|
||||||
public class CipherDecoder extends MessageToMessageDecoder<ByteBuf>
|
public class CipherDecoder extends MessageToMessageDecoder<ByteBuf>
|
||||||
@ -17,7 +17,7 @@ public class CipherDecoder extends MessageToMessageDecoder<ByteBuf>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void decode(ChannelHandlerContext ctx, ByteBuf msg, MessageList<Object> out) throws Exception
|
protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception
|
||||||
{
|
{
|
||||||
out.add( cipher.cipher( ctx, msg ) );
|
out.add( cipher.cipher( ctx, msg ) );
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package net.md_5.bungee.netty;
|
|||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||||
import io.netty.channel.MessageList;
|
|
||||||
import io.netty.handler.timeout.ReadTimeoutException;
|
import io.netty.handler.timeout.ReadTimeoutException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
@ -61,9 +60,8 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void messageReceived(ChannelHandlerContext ctx, MessageList<Object> msgs) throws Exception
|
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
|
||||||
{
|
{
|
||||||
for ( Object msg : msgs )
|
|
||||||
{
|
{
|
||||||
if ( handler != null )
|
if ( handler != null )
|
||||||
{
|
{
|
||||||
|
@ -2,8 +2,8 @@ package net.md_5.bungee.netty;
|
|||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.MessageList;
|
|
||||||
import io.netty.handler.codec.ReplayingDecoder;
|
import io.netty.handler.codec.ReplayingDecoder;
|
||||||
|
import java.util.List;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@ -28,7 +28,7 @@ public class PacketDecoder extends ReplayingDecoder<Void>
|
|||||||
private Protocol protocol;
|
private Protocol protocol;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void decode(ChannelHandlerContext ctx, ByteBuf in, MessageList<Object> out) throws Exception
|
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception
|
||||||
{
|
{
|
||||||
// While we have enough data
|
// While we have enough data
|
||||||
while ( true )
|
while ( true )
|
||||||
|
Loading…
Reference in New Issue
Block a user