Class AbstractMessageParser<T extends HttpMessage>

    • Method Detail

      • parseHeaders

        public static Header[] parseHeaders​(SessionInputBuffer inbuffer,
                                            int maxHeaderCount,
                                            int maxLineLen,
                                            LineParser parser)
                                     throws HttpException,
                                            java.io.IOException
        Parses HTTP headers from the data receiver stream according to the generic format as given in Section 3.1 of RFC 822, RFC-2616 Section 4 and 19.3.
        Parameters:
        inbuffer - Session input buffer
        maxHeaderCount - maximum number of headers allowed. If the number of headers received from the data stream exceeds maxCount value, an IOException will be thrown. Setting this parameter to a negative value or zero will disable the check.
        maxLineLen - maximum number of characters for a header line, including the continuation lines. Setting this parameter to a negative value or zero will disable the check.
        parser - line parser to use. Can be null, in which case the default implementation of this interface will be used.
        Returns:
        array of HTTP headers
        Throws:
        java.io.IOException - in case of an I/O error
        HttpException - in case of HTTP protocol violation
      • parseHeaders

        public static Header[] parseHeaders​(SessionInputBuffer inbuffer,
                                            int maxHeaderCount,
                                            int maxLineLen,
                                            LineParser parser,
                                            java.util.List<CharArrayBuffer> headerLines)
                                     throws HttpException,
                                            java.io.IOException
        Parses HTTP headers from the data receiver stream according to the generic format as given in Section 3.1 of RFC 822, RFC-2616 Section 4 and 19.3.
        Parameters:
        inbuffer - Session input buffer
        maxHeaderCount - maximum number of headers allowed. If the number of headers received from the data stream exceeds maxCount value, an IOException will be thrown. Setting this parameter to a negative value or zero will disable the check.
        maxLineLen - maximum number of characters for a header line, including the continuation lines. Setting this parameter to a negative value or zero will disable the check.
        parser - line parser to use.
        headerLines - List of header lines. This list will be used to store intermediate results. This makes it possible to resume parsing of headers in case of a InterruptedIOException.
        Returns:
        array of HTTP headers
        Throws:
        java.io.IOException - in case of an I/O error
        HttpException - in case of HTTP protocol violation
        Since:
        4.1