Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » coyote » http11 » [javadoc | source]
org.apache.coyote.http11
public class: InternalAprInputBuffer [javadoc | source]
java.lang.Object
   org.apache.coyote.http11.InternalAprInputBuffer

All Implemented Interfaces:
    InputBuffer

Implementation of InputBuffer which provides HTTP request header parsing as well as transfer decoding.
Nested Class Summary:
protected class  InternalAprInputBuffer.SocketInputBuffer  This class is an input buffer which will read its data from an input stream. 
Field Summary
protected static  StringManager sm    The string manager for this package. 
protected  Request request    Associated Coyote request. 
protected  MimeHeaders headers    Headers of the associated request. 
protected  boolean parsingHeader    State. 
protected  boolean swallowInput    Swallow input ? (in the case of an expectation) 
protected  byte[] buf    Pointer to the current read buffer. 
protected  int lastValid    Last valid byte. 
protected  int pos    Position in the buffer. 
protected  int end    Pos of the end of the header in the buffer, which is also the start of the body. 
protected  ByteBuffer bbuf    Direct byte buffer used to perform actual reading. 
protected  long socket    Underlying socket. 
protected  InputBuffer inputStreamInputBuffer    Underlying input buffer. 
protected  InputFilter[] filterLibrary    Filter library. Note: Filter[0] is always the "chunked" filter. 
protected  InputFilter[] activeFilters    Active filters (in order). 
protected  int lastActiveFilter    Index of the last active filter. 
Constructor:
 public InternalAprInputBuffer(Request request,
    int headerBufferSize) 
    Alternate constructor.
Method from org.apache.coyote.http11.InternalAprInputBuffer Summary:
addActiveFilter,   addFilter,   available,   clearFilters,   doRead,   endRequest,   fill,   getFilters,   getSocket,   nextRequest,   parseHeader,   parseHeaders,   parseRequestLine,   recycle,   setSocket,   setSwallowInput
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.coyote.http11.InternalAprInputBuffer Detail:
 public  void addActiveFilter(InputFilter filter) 
    Add an input filter to the filter library.
 public  void addFilter(InputFilter filter) 
    Add an input filter to the filter library.
 public int available() 
    Available bytes (note that due to encoding, this may not correspond )
 public  void clearFilters() 
    Clear filters.
 public int doRead(ByteChunk chunk,
    Request req) throws IOException 
    Read some bytes.
 public  void endRequest() throws IOException 
    End request (consumes leftover bytes).
 protected boolean fill() throws IOException 
    Fill the internal buffer using data from the undelying input stream.
 public InputFilter[] getFilters() 
    Get filters.
 public long getSocket() 
    Get the underlying socket input stream.
 public  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.
 public boolean parseHeader() throws IOException 
    Parse an HTTP header.
 public  void parseHeaders() throws IOException 
    Parse the HTTP headers.
 public boolean parseRequestLine(boolean useAvailableData) 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.
 public  void recycle() 
    Recycle the input buffer. This should be called when closing the connection.
 public  void setSocket(long socket) 
    Set the underlying socket.
 public  void setSwallowInput(boolean swallowInput) 
    Set the swallow input flag.