| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static enum | |
| private static enum | |
| private class | Http11InputBuffer.
This class is an input buffer which will read its data from an input stream. |
| Modifier and Type | Field and Description |
|---|---|
| private InputFilter[] | activeFilters
Active filters (in order). |
| private ByteBuffer | byteBuffer
The read buffer. |
| private byte | |
| private static final byte[] | |
| private int | end
Pos of the end of the header in the buffer, which is also the start of the body. |
| private InputFilter[] | filterLibrary
Filter library. |
| private final int | headerBufferSize
Maximum allowed size of the HTTP request line plus headers plus any leading blank lines. |
| private final Http11InputBuffer. | |
| private Http11InputBuffer. | |
| private final MimeHeaders | headers
Headers of the associated request. |
| private final HttpParser | |
| private InputBuffer | inputStreamInputBuffer
Underlying input buffer. |
| private int | lastActiveFilter
Index of the last active filter. |
| private static final Log | |
| private volatile boolean | parsingHeader
State. |
| private volatile boolean | |
| private boolean | |
| private int | |
| private int | |
| private int | |
| private byte | prevChr
Parsing state - used for non blocking parsing so that when more data arrives, we can pick up where we left off. |
| private final boolean | |
| private final Request | request
Associated Coyote request. |
| private static final StringManager | sm
The string manager for this package. |
| private int | socketReadBufferSize
Known size of the NioChannel read buffer. |
| private boolean | swallowInput
Swallow input ? |
| private SocketWrapperBase | wrapper
Wrapper that provides access to the underlying socket. |
| Access | Constructor and Description |
|---|---|
| public | Http11InputBuffer(Request request, int headerBufferSize, boolean rejectIllegalHeader, HttpParser httpParser)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv void | |
| public int | available()
Implements org. Obtain an estimate of the number of bytes that can be read without blocking. |
| pack-priv int | |
| public int | doRead(ApplicationBufferHandler
ApplicationBufferHandler that provides the buffer to read data into. handler)Implements org. Read from the input stream into the ByteBuffer provided by the ApplicationBufferHandler. |
| pack-priv void | |
| public void | |
| private boolean | Returns: true if more data was added to the input buffer otherwise falseAttempts to read some data into the input buffer. |
| public ByteBuffer | |
| pack-priv InputFilter[] | |
| pack-priv ByteBuffer | |
| pack-priv int | |
| pack-priv void | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv void | |
| private Http11InputBuffer. | Returns: One ofHeaderParseStatus#NEED_MORE_DATA, HeaderParseStatus#HAVE_MORE_HEADERS or
HeaderParseStatus#DONE.Parse an HTTP header. |
| pack-priv boolean | |
| private String | |
| pack-priv boolean | Returns: true if data is properly fed; false if no data is available immediately and thread should be freedRead the request line. |
| pack-priv void | |
| public void | |
| pack-priv void | |
| private Http11InputBuffer. |
| activeFilters | back to summary |
|---|---|
| private InputFilter[] activeFilters Active filters (in order). | |
| byteBuffer | back to summary |
|---|---|
| private ByteBuffer byteBuffer The read buffer. | |
| chr | back to summary |
|---|---|
| private byte chr | |
| CLIENT_PREFACE_START | back to summary |
|---|---|
| private static final byte[] CLIENT_PREFACE_START | |
| end | back to summary |
|---|---|
| private int end Pos of the end of the header in the buffer, which is also the start of the body. | |
| filterLibrary | back to summary |
|---|---|
| private InputFilter[] filterLibrary Filter library. Note Filter[Constants.CHUNKED_FILTER] is always the "chunked" filter. | |
| headerBufferSize | back to summary |
|---|---|
| private final int headerBufferSize Maximum allowed size of the HTTP request line plus headers plus any leading blank lines. | |
| headerData | back to summary |
|---|---|
| private final Http11InputBuffer. | |
| headerParsePos | back to summary |
|---|---|
| private Http11InputBuffer. | |
| headers | back to summary |
|---|---|
| private final MimeHeaders headers Headers of the associated request. | |
| httpParser | back to summary |
|---|---|
| private final HttpParser httpParser | |
| inputStreamInputBuffer | back to summary |
|---|---|
| private InputBuffer inputStreamInputBuffer Underlying input buffer. | |
| lastActiveFilter | back to summary |
|---|---|
| private int lastActiveFilter Index of the last active filter. | |
| log | back to summary |
|---|---|
| private static final Log log | |
| parsingHeader | back to summary |
|---|---|
| private volatile boolean parsingHeader State. | |
| parsingRequestLine | back to summary |
|---|---|
| private volatile boolean parsingRequestLine | |
| parsingRequestLineEol | back to summary |
|---|---|
| private boolean parsingRequestLineEol | |
| parsingRequestLinePhase | back to summary |
|---|---|
| private int parsingRequestLinePhase | |
| parsingRequestLineQPos | back to summary |
|---|---|
| private int parsingRequestLineQPos | |
| parsingRequestLineStart | back to summary |
|---|---|
| private int parsingRequestLineStart | |
| prevChr | back to summary |
|---|---|
| private byte prevChr Parsing state - used for non blocking parsing so that when more data arrives, we can pick up where we left off. | |
| rejectIllegalHeader | back to summary |
|---|---|
| private final boolean rejectIllegalHeader | |
| request | back to summary |
|---|---|
| private final Request request Associated Coyote request. | |
| sm | back to summary |
|---|---|
| private static final StringManager sm The string manager for this package. | |
| socketReadBufferSize | back to summary |
|---|---|
| private int socketReadBufferSize Known size of the NioChannel read buffer. | |
| swallowInput | back to summary |
|---|---|
| private boolean swallowInput Swallow input ? (in the case of an expectation) | |
| wrapper | back to summary |
|---|---|
| private SocketWrapperBase<?> wrapper Wrapper that provides access to the underlying socket. | |
| Http11InputBuffer | back to summary |
|---|---|
| public Http11InputBuffer(Request request, int headerBufferSize, boolean rejectIllegalHeader, HttpParser httpParser) | |
| addActiveFilter | back to summary |
|---|---|
| pack-priv void addActiveFilter(InputFilter filter) Add an input filter to the filter library. | |
| addFilter | back to summary |
|---|---|
| pack-priv void addFilter(InputFilter filter) Add an input filter to the filter library.
| |
| available | back to summary |
|---|---|
| public int available() Implements org. Doc from org. Obtain an estimate of the number of bytes that can be read without blocking. Typically, this will be the number of available bytes known to be buffered.
| |
| available | back to summary |
|---|---|
| pack-priv int available(boolean read) Available bytes in the buffers for the current request. Note that when requests are pipelined, the data in byteBuffer may relate to the next request rather than this one. | |
| doRead | back to summary |
|---|---|
| public int doRead(ApplicationBufferHandler handler) throws IOException Implements org. Doc from org. Read from the input stream into the ByteBuffer provided by the ApplicationBufferHandler. Important Note the current model assumes that the protocol will 'own' the ByteBuffer and return a pointer to it.
| |
| endRequest | back to summary |
|---|---|
| pack-priv void endRequest() throws IOException End request (consumes leftover bytes).
| |
| expand | back to summary |
|---|---|
| public void expand(int size) Implements org.
| |
| fill | back to summary |
|---|---|
| private boolean fill(boolean block) throws IOException Attempts to read some data into the input buffer.
| |
| getByteBuffer | back to summary |
|---|---|
| public ByteBuffer getByteBuffer() Implements org.
| |
| getFilters | back to summary |
|---|---|
| pack-priv InputFilter[] getFilters() Get filters. | |
| getLeftover | back to summary |
|---|---|
| pack-priv ByteBuffer getLeftover() | |
| getParsingRequestLinePhase | back to summary |
|---|---|
| pack-priv int getParsingRequestLinePhase() | |
| init | back to summary |
|---|---|
| pack-priv void init(SocketWrapperBase<?> socketWrapper) | |
| isChunking | back to summary |
|---|---|
| pack-priv boolean isChunking() | |
| isFinished | back to summary |
|---|---|
| pack-priv boolean isFinished() Has all of the request body been read? There are subtle differences between this and available() > 0 primarily because of having to handle faking non-blocking reads with the blocking IO connector. | |
| nextRequest | back to summary |
|---|---|
| pack-priv void nextRequest() End processing of current HTTP request. Note All bytes of the current request should have been already consumed. This method only resets all the pointers so that we are ready to parse the next HTTP request. | |
| parseHeader | back to summary |
|---|---|
| private Http11InputBuffer. Parse an HTTP header. | |
| parseHeaders | back to summary |
|---|---|
| pack-priv boolean parseHeaders() throws IOException Parse the HTTP headers. | |
| parseInvalid | back to summary |
|---|---|
| private String parseInvalid(int startPos, ByteBuffer buffer) | |
| parseRequestLine | back to summary |
|---|---|
| pack-priv boolean parseRequestLine(boolean keptAlive, int connectionTimeout, int keepAliveTimeout) throws IOException Read the request line. This function is meant to be used during the HTTP request header parsing. Do NOT attempt to read the request body using it.
| |
| recycle | back to summary |
|---|---|
| pack-priv void recycle() Recycle the input buffer. This should be called when closing the connection. | |
| setByteBuffer | back to summary |
|---|---|
| public void setByteBuffer(ByteBuffer buffer) Implements org.
| |
| setSwallowInput | back to summary |
|---|---|
| pack-priv void setSwallowInput(boolean swallowInput) Set the swallow input flag. | |
| skipLine | back to summary |
|---|---|
| private Http11InputBuffer. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv MessageBytes | headerValue
MB that will store the value of the header. |
| pack-priv int | lastSignificantChar
When parsing header name: not used (stays as 0). |
| pack-priv int | lineStart
The first character of the header line. |
| pack-priv int | realPos
When parsing header name: not used (stays as 0). |
| pack-priv int | start
When parsing header name: first character of the header. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| headerValue | back to summary |
|---|---|
| pack-priv MessageBytes headerValue MB that will store the value of the header. It is null while parsing header name and is created after the name has been parsed. | |
| lastSignificantChar | back to summary |
|---|---|
| pack-priv int lastSignificantChar When parsing header name: not used (stays as 0). | |
| lineStart | back to summary |
|---|---|
| pack-priv int lineStart The first character of the header line. | |
| realPos | back to summary |
|---|---|
| pack-priv int realPos When parsing header name: not used (stays as 0). | |
| start | back to summary |
|---|---|
| pack-priv int start When parsing header name: first character of the header. | |
| HeaderParseData | back to summary |
|---|---|
| private HeaderParseData() | |
| recycle | back to summary |
|---|---|
| public void recycle() | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Http11InputBuffer. | HEADER_MULTI_LINE
Before reading a new line of a header. |
| public static final Http11InputBuffer. | HEADER_NAME
Reading a header name. |
| public static final Http11InputBuffer. | HEADER_SKIPLINE
Reading all bytes until the next CRLF. |
| public static final Http11InputBuffer. | HEADER_START
Start of a new header. |
| public static final Http11InputBuffer. | HEADER_VALUE
Reading the header value. |
| public static final Http11InputBuffer. | HEADER_VALUE_START
Skipping whitespace before text of header value starts, either on the first line of header value (just after ':') or on subsequent lines when it is known that subsequent line starts with SP or HT. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Http11InputBuffer. | |
| public static Http11InputBuffer. |
| HEADER_MULTI_LINE | back to summary |
|---|---|
| public static final Http11InputBuffer. Before reading a new line of a header. Once the next byte is peeked, the state changes without advancing our position. The state becomes either HEADER_VALUE_START (if that first byte is SP or HT), or HEADER_START (otherwise). | |
| HEADER_NAME | back to summary |
|---|---|
| public static final Http11InputBuffer. Reading a header name. All characters of header are HTTP_TOKEN_CHAR. Header name is followed by ':'. No
whitespace is allowed. | |
| HEADER_SKIPLINE | back to summary |
|---|---|
| public static final Http11InputBuffer. Reading all bytes until the next CRLF. The line is being ignored. | |
| HEADER_START | back to summary |
|---|---|
| public static final Http11InputBuffer. Start of a new header. A CRLF here means that there are no more headers. Any other character starts a header name. | |
| HEADER_VALUE | back to summary |
|---|---|
| public static final Http11InputBuffer. Reading the header value. We are inside the value. Either on the first line or on any subsequent line. We come into this state from HEADER_VALUE_START after the first non-SP/non-HT byte is encountered on the line. | |
| HEADER_VALUE_START | back to summary |
|---|---|
| public static final Http11InputBuffer. Skipping whitespace before text of header value starts, either on the first line of header value (just after ':') or on subsequent lines when it is known that subsequent line starts with SP or HT. | |
| HeaderParsePosition | back to summary |
|---|---|
| private HeaderParsePosition() | |
| valueOf | back to summary |
|---|---|
| public static Http11InputBuffer. | |
| values | back to summary |
|---|---|
| public static Http11InputBuffer. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Http11InputBuffer. | |
| public static final Http11InputBuffer. | |
| public static final Http11InputBuffer. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Http11InputBuffer. | |
| public static Http11InputBuffer. |
| DONE | back to summary |
|---|---|
| public static final Http11InputBuffer. | |
| HAVE_MORE_HEADERS | back to summary |
|---|---|
| public static final Http11InputBuffer. | |
| NEED_MORE_DATA | back to summary |
|---|---|
| public static final Http11InputBuffer. | |
| HeaderParseStatus | back to summary |
|---|---|
| private HeaderParseStatus() | |
| valueOf | back to summary |
|---|---|
| public static Http11InputBuffer. | |
| values | back to summary |
|---|---|
| public static Http11InputBuffer. | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Implements org. Obtain an estimate of the number of bytes that can be read without blocking. |
| public int | doRead(ApplicationBufferHandler
ApplicationBufferHandler that provides the buffer to read data into. handler)Implements org. Read from the input stream into the ByteBuffer provided by the ApplicationBufferHandler. |
| SocketInputBuffer | back to summary |
|---|---|
| private SocketInputBuffer() | |
| available | back to summary |
|---|---|
| public int available() Implements org. Doc from org. Obtain an estimate of the number of bytes that can be read without blocking. Typically, this will be the number of available bytes known to be buffered.
| |
| doRead | back to summary |
|---|---|
| public int doRead(ApplicationBufferHandler handler) throws IOException Implements org. Doc from org. Read from the input stream into the ByteBuffer provided by the ApplicationBufferHandler. Important Note the current model assumes that the protocol will 'own' the ByteBuffer and return a pointer to it.
| |