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

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


                    frames.clear();
                }

                if (this.opcode == OPCODE_TEXT) {
                    if (frame.readableBytes() > MAX_LENGTH) {
                        throw new TooLongFrameException();
                    }
                    return new DefaultWebSocketFrame(0x00, frame);
                } else if (this.opcode == OPCODE_BINARY) {
                    return new DefaultWebSocketFrame(0xFF, frame);
                } else if (this.opcode == OPCODE_PING) {
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

            // 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

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

                }
                headerSize ++;
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

    }
    return retString.toString();
  }

  private void fail(long frameLength) throws TooLongFrameException {
    throw new TooLongFrameException("The frame length exceeds " + maxFrameLength + ": " + frameLength);
  }
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

        int messageLength = messageContentsLength + MESSAGE_FRAME_SIZE;

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

        int messageContentsOffset = messageStartReaderIndex + MESSAGE_FRAME_SIZE;
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.