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

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


                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);
            if(resetReaderIndex) {
              content.readerIndex(READER_INDEX_RESET_VALUE);
            }
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

            else
            {
                // Abort decoding if the decoded line is too large.
                if ( sb.length() >=  maxLineLegth )
                {
                    throw new TooLongFrameException(
                            "ESL header line is longer than " + maxLineLegth + " bytes.");
                }
                sb.append( (char) nextByte );
            }
        }
View Full Code Here

            else
            {
                // Abort decoding if the decoded line is too large.
                if ( sb.length() >= maxLineLength )
                {
                    throw new TooLongFrameException(
                            "ESL message line is longer than " + maxLineLength + " bytes.");
                }
                sb.append( (char) nextByte );
            }
        }
View Full Code Here

            Object obj = unmarshaller.readObject();
            unmarshaller.finish();
            return obj;
        } catch (LimitingByteInput.TooBigObjectException e) {
            discardingTooLongFrame = true;
            throw new TooLongFrameException();
        } finally {
            // Call close in a finally block as the ReplayingDecoder will throw an Error if not enough bytes are
            // readable. This helps to be sure that we do not leak resource
            unmarshaller.close();
        }
View Full Code Here

            if (content.readableBytes() > maxContentLength - chunk.getContent().readableBytes()) {
                // TODO: Respond with 413 Request Entity Too Large
                //   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 content length exceeded " + maxContentLength +
                        " bytes.");
            }

            // Append the content of the chunk
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.