Package org.jboss.netty.handler.codec.frame

Examples of org.jboss.netty.handler.codec.frame.TooLongFrameException


        int messageContentsLength = messageStartReaderIndex + messageLength - messageContentsOffset;

        if (messageContentsLength > maxFrameSize) {
            Channels.fireExceptionCaught(
                    ctx,
                    new TooLongFrameException("Maximum frame size of " + maxFrameSize +
                                              " exceeded")
            );
        }

        if (messageLength == 0) {
View Full Code Here


            return null;
        } finally {
            if (buffer.readerIndex() - messageStartReaderIndex > maxFrameSize) {
                Channels.fireExceptionCaught(
                        ctx,
                        new TooLongFrameException("Maximum frame size of " + maxFrameSize + " exceeded")
                );
            }

            buffer.readerIndex(messageStartReaderIndex);
        }
View Full Code Here

    }
    return null;
  }

  private void fail(final ChannelHandlerContext ctx, final String msg) {
    Channels.fireExceptionCaught(ctx.getChannel(), new TooLongFrameException("Frame length exceeds " + maxLength + " ("
        + msg + ')'));
  }
View Full Code Here

            // Merge the received chunk into the content of the current message.
            HttpChunk chunk = (HttpChunk) msg;
            ChannelBuffer content = currentMessage.getContent();

            if (content.readableBytes() > maxContentLength - chunk.getContent().readableBytes()) {
                throw new TooLongFrameException(
                        "HTTP content length exceeded " + maxContentLength +
                        " bytes.");
            }

            content.writeBytes(chunk.getContent());
View Full Code Here

                break loop;
            }

            // Abort decoding if the header part is too large.
            if (headerSize >= maxHeaderSize) {
                throw new TooLongFrameException(
                        "HTTP header is larger than " +
                        maxHeaderSize + " bytes.");

            }
View Full Code Here

            else if (nextByte == HttpCodecUtil.LF) {
                return sb.toString();
            }
            else {
                if (lineLength >= maxLineLength) {
                    throw new TooLongFrameException(
                            "An HTTP line is larger than " + maxLineLength +
                            " bytes.");
                }
                lineLength ++;
                sb.append((char) nextByte);
View Full Code Here

          message = null;
        } else {
          ChannelBuffer chunkBuffer = chunk.getContent();
          ChannelBuffer content = message.getContent();
          if(content.readableBytes() > maxContentLength - chunkBuffer.readableBytes()) {
            throw new TooLongFrameException("ICAP content length exceeded [" + maxContentLength + "] bytes");
          } else {
            content.writeBytes(chunkBuffer);
          }
        }
      } else {
View Full Code Here

    return counter;
  }
 
  private void checkLimit() throws DecodingException {
    if(counter >= limit) {
      throw new DecodingException(new TooLongFrameException(errorMessage + "[" + (counter - limit) + "] counts"));
    }
  }
View Full Code Here

                }
            } else if (nextByte == IcapCodecUtil.LF) {
                return sb.toString();
            } else {
                if (lineLength >= maxLineLength) {
                    throw new DecodingException(new TooLongFrameException(
                            "An HTTP line is larger than " + maxLineLength +
                            " bytes."));
                }
                lineLength ++;
                sb.append((char) nextByte);
View Full Code Here

                }
            } else if (nextByte == IcapCodecUtil.LF) {
              break;
            } else {
                if (lineLength >= maxLineLength) {
                    throw new DecodingException(new TooLongFrameException(
                            "An HTTP line is larger than " + maxLineLength +
                            " bytes."));
                }
                lineLength ++;
                sb.append((char) nextByte);
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.frame.TooLongFrameException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.