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

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


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

    return counter;
  }
 
  private void checkLimit() throws DecodingException {
    if(counter >= limit) {
      throw new DecodingException(new TooLongFrameException(errorMessage + "[" + (counter - limit) + "] counts"));
    }
  }
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);
            if(resetReaderIndex) {
              content.readerIndex(READER_INDEX_RESET_VALUE);
            }
View Full Code Here

        throw new CorruptedFrameException(reason);
    }

    private int toFrameLength(long l) throws TooLongFrameException {
        if (l > Integer.MAX_VALUE) {
            throw new TooLongFrameException("Length:" + l);
        } else {
            return (int) l;
        }
    }
View Full Code Here

        ChannelBuffer header;
        int length = data.readableBytes();

        if (opcode == Opcodes.OPCODE_PING && length > 125) {
            throw new TooLongFrameException("invalid payload for PING (payload length must be <= 125, was " + length);
        }

        if (length <= 125) {
            b1 |= length & 0x7F;
            header = createBuffer(headerLength + length);
View Full Code Here

            if (headerSize >= maxHeaderSize) {
                // TODO: Respond with Bad Request and discard the traffic
                //    or close the connection.
                //       No need to notify the upstream handlers - just log.
                //       If decoding a response, just throw an exception.
                throw new TooLongFrameException(
                        "HTTP header is larger than " +
                        maxHeaderSize + " bytes.");

            }
        }
View Full Code Here

                        if (lineLength >= maxLineLength) {
                            // TODO: Respond with Bad Request and discard the traffic
                            //    or close the connection.
                            //       No need to notify the upstream handlers - just log.
                            //       If decoding a response, just throw an exception.
                            throw new TooLongFrameException(
                                    "An HTTP line is larger than " + maxLineLength +
                                    " bytes.");
                        }
                        lineLength ++;
                        //sb.append((char) nextByte);
View Full Code Here

            if (headerSize >= maxHeaderSize ) {
                // TODO: Respond with Bad Request and discard the traffic
                //    or close the connection.
                //       No need to notify the upstream handlers - just log.
                //       If decoding a response, just throw an exception.
                throw new TooLongFrameException(
                        "HTTP header is larger than " +
                        maxHeaderSize + " bytes.");

            }
View Full Code Here

                if (lineLength >= maxLineLength) {
                    // TODO: Respond with Bad Request and discard the traffic
                    //    or close the connection.
                    //       No need to notify the upstream handlers - just log.
                    //       If decoding a response, just throw an exception.
                    throw new TooLongFrameException(
                            "An HTTP line is larger than " + maxLineLength +
                            " bytes.");
                }
                lineLength ++;
                readLineStringBuilder.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.