public static MqttMessage newInvalidMessage(Throwable cause) { return new MqttMessage(null, null, null, DecoderResult.failure(cause)); }
private HttpContent invalidChunk(ByteBuf in, Exception cause) { currentState = State.BAD_MESSAGE; // Advance the readerIndex so that ByteToMessageDecoder does not complain // when we produced an invalid message without consuming anything. in.skipBytes(in.readableBytes()); HttpContent chunk = new DefaultLastHttpContent(Unpooled.EMPTY_BUFFER); chunk.setDecoderResult(DecoderResult.failure(cause)); message = null; trailer = null; return chunk; }
private HttpMessage invalidMessage(ByteBuf in, Exception cause) { currentState = State.BAD_MESSAGE; // Advance the readerIndex so that ByteToMessageDecoder does not complain // when we produced an invalid message without consuming anything. in.skipBytes(in.readableBytes()); if (message == null) { message = createInvalidMessage(); } message.setDecoderResult(DecoderResult.failure(cause)); HttpMessage ret = message; message = null; return ret; }
/** * Helper method to create a message indicating a invalid decoding result. * * @param cause the cause of the decoding failure. * @return a valid message indicating failure. */ private M invalidMessage(Exception cause) { state = State.BAD_MESSAGE; M message = buildInvalidMessage(); message.setDecoderResult(DecoderResult.failure(cause)); return message; }
/** * Helper method to create a content chunk indicating a invalid decoding result. * * @param cause the cause of the decoding failure. * @return a valid content chunk indicating failure. */ private MemcacheContent invalidChunk(Exception cause) { state = State.BAD_MESSAGE; MemcacheContent chunk = new DefaultLastMemcacheContent(Unpooled.EMPTY_BUFFER); chunk.setDecoderResult(DecoderResult.failure(cause)); return chunk; }
private void fail(List<Object> out, Exception cause) { if (!(cause instanceof DecoderException)) { cause = new DecoderException(cause); } checkpoint(State.FAILURE); Socks5Message m = new DefaultSocks5CommandResponse( Socks5CommandStatus.FAILURE, Socks5AddressType.IPv4, null, 0); m.setDecoderResult(DecoderResult.failure(cause)); out.add(m); } }
private void fail(List<Object> out, Exception cause) { if (!(cause instanceof DecoderException)) { cause = new DecoderException(cause); } checkpoint(State.FAILURE); Socks5Message m = new DefaultSocks5CommandRequest( Socks5CommandType.CONNECT, Socks5AddressType.IPv4, "0.0.0.0", 1); m.setDecoderResult(DecoderResult.failure(cause)); out.add(m); } }
private void fail(List<Object> out, Exception cause) { if (!(cause instanceof DecoderException)) { cause = new DecoderException(cause); } checkpoint(State.FAILURE); Socks5Message m = new DefaultSocks5InitialResponse(Socks5AuthMethod.UNACCEPTED); m.setDecoderResult(DecoderResult.failure(cause)); out.add(m); } }
private void fail(List<Object> out, Exception cause) { if (!(cause instanceof DecoderException)) { cause = new DecoderException(cause); } Socks4CommandResponse m = new DefaultSocks4CommandResponse(Socks4CommandStatus.REJECTED_OR_FAILED); m.setDecoderResult(DecoderResult.failure(cause)); out.add(m); checkpoint(State.FAILURE); } }
private void fail(List<Object> out, Exception cause) { if (!(cause instanceof DecoderException)) { cause = new DecoderException(cause); } checkpoint(State.FAILURE); Socks5Message m = new DefaultSocks5PasswordAuthResponse(Socks5PasswordAuthStatus.FAILURE); m.setDecoderResult(DecoderResult.failure(cause)); out.add(m); } }
private void fail(List<Object> out, Exception cause) { if (!(cause instanceof DecoderException)) { cause = new DecoderException(cause); } checkpoint(State.FAILURE); Socks5Message m = new DefaultSocks5PasswordAuthRequest("", ""); m.setDecoderResult(DecoderResult.failure(cause)); out.add(m); } }
private void fail(List<Object> out, Exception cause) { if (!(cause instanceof DecoderException)) { cause = new DecoderException(cause); } checkpoint(State.FAILURE); Socks5Message m = new DefaultSocks5InitialRequest(Socks5AuthMethod.NO_AUTH); m.setDecoderResult(DecoderResult.failure(cause)); out.add(m); } }
private void fail(List<Object> out, Exception cause) { if (!(cause instanceof DecoderException)) { cause = new DecoderException(cause); } Socks4CommandRequest m = new DefaultSocks4CommandRequest( type != null? type : Socks4CommandType.CONNECT, dstAddr != null? dstAddr : "", dstPort != 0? dstPort : 65535, userId != null? userId : ""); m.setDecoderResult(DecoderResult.failure(cause)); out.add(m); checkpoint(State.FAILURE); }
if (currentMessage instanceof DecoderResultProvider) { ((DecoderResultProvider) currentMessage).setDecoderResult( DecoderResult.failure(decoderResult.cause()));
if (currentMessage instanceof DecoderResultProvider) { ((DecoderResultProvider) currentMessage).setDecoderResult( DecoderResult.failure(decoderResult.cause()));
if (currentMessage instanceof DecoderResultProvider) { ((DecoderResultProvider) currentMessage).setDecoderResult( DecoderResult.failure(decoderResult.cause()));
private HttpContent invalidChunk(ByteBuf in, Exception cause) { currentState = State.BAD_MESSAGE; // Advance the readerIndex so that ByteToMessageDecoder does not complain // when we produced an invalid message without consuming anything. in.skipBytes(in.readableBytes()); HttpContent chunk = new DefaultLastHttpContent(Unpooled.EMPTY_BUFFER); chunk.setDecoderResult(DecoderResult.failure(cause)); message = null; trailer = null; return chunk; }
private void fail(List<Object> out, Exception cause) { if (!(cause instanceof DecoderException)) { cause = new DecoderException(cause); } checkpoint(State.FAILURE); Socks5Message m = new DefaultSocks5CommandRequest( Socks5CommandType.CONNECT, Socks5AddressType.IPv4, "0.0.0.0", 1); m.setDecoderResult(DecoderResult.failure(cause)); out.add(m); } }
private void fail(List<Object> out, Exception cause) { if (!(cause instanceof DecoderException)) { cause = new DecoderException(cause); } checkpoint(State.FAILURE); Socks5Message m = new DefaultSocks5PasswordAuthRequest("", ""); m.setDecoderResult(DecoderResult.failure(cause)); out.add(m); } }