| |
|
| java.lang.Object org.apache.coyote.http11.InternalNioInputBuffer
InternalNioInputBuffer | public class InternalNioInputBuffer implements InputBuffer(Code) | | Implementation of InputBuffer which provides HTTP request header parsing as
well as transfer decoding.
author: Remy Maucherat author: Filip Hanik |
Inner Class : enum HeaderParseStatus | |
Inner Class : enum HeaderParsePosition | |
Inner Class :public static class HeaderParseData | |
Inner Class :protected class SocketInputBuffer implements InputBuffer | |
buf | protected byte[] buf(Code) | | Pointer to the current read buffer.
|
end | protected int end(Code) | | Pos of the end of the header in the buffer, which is also the
start of the body.
|
filterLibrary | protected InputFilter[] filterLibrary(Code) | | Filter library.
Note: Filter[0] is always the "chunked" filter.
|
headerData | protected HeaderParseData headerData(Code) | | |
headerParsePos | protected HeaderParsePosition headerParsePos(Code) | | |
inputStreamInputBuffer | protected InputBuffer inputStreamInputBuffer(Code) | | Underlying input buffer.
|
lastActiveFilter | protected int lastActiveFilter(Code) | | Index of the last active filter.
|
lastValid | protected int lastValid(Code) | | Last valid byte.
|
parsingHeader | protected boolean parsingHeader(Code) | | State.
|
parsingRequestLine | protected boolean parsingRequestLine(Code) | | |
pos | protected int pos(Code) | | Position in the buffer.
|
readTimeout | protected long readTimeout(Code) | | The socket timeout used when reading the first block of the request
header.
|
request | protected Request request(Code) | | Associated Coyote request.
|
swallowInput | protected boolean swallowInput(Code) | | Swallow input ? (in the case of an expectation)
|
InternalNioInputBuffer | public InternalNioInputBuffer(Request request, int headerBufferSize, long readTimeout)(Code) | | Alternate constructor.
|
addActiveFilter | public void addActiveFilter(InputFilter filter)(Code) | | Add an input filter to the filter library.
|
addFilter | public void addFilter(InputFilter filter)(Code) | | Add an input filter to the filter library.
|
available | public int available()(Code) | | Available bytes (note that due to encoding, this may not correspond )
|
clearFilters | public void clearFilters()(Code) | | Clear filters.
|
endRequest | public void endRequest() throws IOException(Code) | | End request (consumes leftover bytes).
throws: IOException - an undelying I/O error occured |
fill | protected boolean fill(boolean timeout, boolean block) throws IOException, EOFException(Code) | | Fill the internal buffer using data from the undelying input stream.
false if at end of stream |
getSocket | public NioChannel getSocket()(Code) | | Get the underlying socket input stream.
|
nextRequest | public void nextRequest()(Code) | | 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 | public HeaderParseStatus parseHeader() throws IOException(Code) | | Parse an HTTP header.
false after reading a blank line (which indicates that theHTTP header parsing is done |
parseHeaders | public boolean parseHeaders() throws IOException(Code) | | Parse the HTTP headers.
|
parseRequestLine | public boolean parseRequestLine(boolean useAvailableData) throws IOException(Code) | | 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.
throws: IOException - If an exception occurs during the underlying socketread operations, or if the given buffer is not big enough to accomodatethe whole line. true if data is properly fed; false if no data is available immediately and thread should be freed |
recycle | public void recycle()(Code) | | Recycle the input buffer. This should be called when closing the
connection.
|
setSocket | public void setSocket(NioChannel socket)(Code) | | Set the underlying socket.
|
setSwallowInput | public void setSwallowInput(boolean swallowInput)(Code) | | Set the swallow input flag.
|
|
|
|