Class ContentParser

java.lang.Object
org.eclipse.jetty.fcgi.parser.ContentParser
Direct Known Subclasses:
BeginRequestContentParser, EndRequestContentParser, ParamsContentParser, StreamContentParser

public abstract class ContentParser extends Object

Parser for FastCGI frame content.

Depending on the frame type specified in the FastCGI frame header, the FastCGI frame content has different formats and it is parsed by different implementation of this abstract class.

There are these frame content types:

  • BEGIN_REQUEST, to signal the begin of the request
  • PARAMS, key/value pairs
  • STDIN, the request body, handled as a stream
  • STDOUT, the response body, handled as a stream
  • STDERR, the response error, handled as a stream
  • END_REQUEST, to signal the end of the response
See Also:
  • Constructor Details

    • ContentParser

      protected ContentParser(HeaderParser headerParser)
  • Method Details

    • parse

      public abstract ContentParser.Result parse(ByteBuffer buffer)

      Parses the bytes in the given buffer as FastCGI frame content bytes.

      Parameters:
      buffer - the bytes to parse
      Returns:
      the result of the parsing
    • noContent

      public boolean noContent()

      Invoked by the Parser when the frame content length is zero.

      Returns:
      whether the parsing should stop
    • getRequest

      protected int getRequest()
    • getContentLength

      protected int getContentLength()