org.apache.coyote.http11
Class InternalInputBuffer
java.lang.Object
org.apache.coyote.http11.InternalInputBuffer
- InputBuffer
public class InternalInputBuffer
extends java.lang.Object
Implementation of InputBuffer which provides HTTP request header parsing as
well as transfer decoding.
- Remy Maucherat
activeFilters
protected InputFilter[] activeFilters
Active filters (in order).
ascbuf
protected char[] ascbuf
Pointer to the US-ASCII header buffer.
bodyBuffer
protected byte[] bodyBuffer
HTTP body buffer.
buf
protected byte[] buf
Pointer to the current read buffer.
filterLibrary
protected InputFilter[] filterLibrary
Filter library.
Note: Filter[0] is always the "chunked" filter.
headerBuffer
protected char[] headerBuffer
US-ASCII header buffer.
headerBuffer1
protected byte[] headerBuffer1
HTTP header buffer no 1.
headerBuffer2
protected byte[] headerBuffer2
HTTP header buffer no 2.
headers
protected MimeHeaders headers
Headers of the associated request.
inputStream
protected InputStream inputStream
Underlying input stream.
inputStreamInputBuffer
protected InputBuffer inputStreamInputBuffer
Underlying input buffer.
lastActiveFilter
protected int lastActiveFilter
Index of the last active filter.
lastValid
protected int lastValid
Last valid byte.
parsingHeader
protected boolean parsingHeader
State.
pos
protected int pos
Position in the buffer.
request
protected Request request
Associated Coyote request.
sm
protected static StringManager sm
The string manager for this package.
swallowInput
protected boolean swallowInput
Swallow input ? (in the case of an expectation)
InternalInputBuffer
public InternalInputBuffer(Request request)
Default constructor.
InternalInputBuffer
public InternalInputBuffer(Request request,
int headerBufferSize)
Alternate constructor.
addActiveFilter
public void addActiveFilter(InputFilter filter)
Add an input filter to the filter library.
addFilter
public void addFilter(InputFilter filter)
Add an input filter to the filter library.
clearFilters
public void clearFilters()
Clear filters.
endRequest
public void endRequest()
throws IOException
End request (consumes leftover bytes).
fill
protected boolean fill()
throws IOException
Fill the internal buffer using data from the undelying input stream.
- false if at end of stream
getFilters
public InputFilter[] getFilters()
Get filters.
getInputStream
public InputStream getInputStream()
Get the underlying socket input stream.
nextRequest
public void nextRequest()
throws IOException
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 boolean parseHeader()
throws IOException
Parse an HTTP header.
- false after reading a blank line (which indicates that the
HTTP header parsing is done
parseHeaders
public void parseHeaders()
throws IOException
Parse the HTTP headers.
parseRequestLine
public void parseRequestLine()
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
public void recycle()
Recycle the input buffer. This should be called when closing the
connection.
setInputStream
public void setInputStream(InputStream inputStream)
Set the underlying socket input stream.
setSwallowInput
public void setSwallowInput(boolean swallowInput)
Set the swallow input flag.
Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.