Discard the buffer if the protocol is unknown

This commit is contained in:
Trustin Lee 2010-02-02 04:30:44 +00:00
parent 6f2897a37b
commit 3f6c564090

View File

@ -78,7 +78,8 @@ public class PortUnificationServerHandler extends FrameDecoder {
} else if (isFactorial(magic1)) {
switchToFactorial(ctx);
} else {
// Unknown protocol
// Unknown protocol discard everything and close the connection.
buffer.skipBytes(buffer.readableBytes());
ctx.getChannel().close();
return null;
}