|
Apache Tomcat 7.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.coyote.http11.AbstractInputBuffer
org.apache.coyote.http11.InternalNioInputBuffer
public class InternalNioInputBuffer
Implementation of InputBuffer which provides HTTP request header parsing as well as transfer decoding.
Nested Class Summary | |
---|---|
static class |
InternalNioInputBuffer.HeaderParseData
|
protected class |
InternalNioInputBuffer.SocketInputBuffer
This class is an input buffer which will read its data from an input stream. |
Field Summary | |
---|---|
protected InternalNioInputBuffer.HeaderParseData |
headerData
|
protected org.apache.coyote.http11.InternalNioInputBuffer.HeaderParsePosition |
headerParsePos
|
protected boolean |
parsingHeader
Parsing state - used for non blocking parsing so that when more data arrives, we can pick up where we left off. |
protected boolean |
parsingRequestLine
|
protected boolean |
parsingRequestLineEol
|
protected int |
parsingRequestLinePhase
|
protected int |
parsingRequestLineQPos
|
protected int |
parsingRequestLineStart
|
protected NioSelectorPool |
pool
Selector pool, for blocking reads and blocking writes |
protected NioChannel |
socket
Underlying socket. |
Fields inherited from class org.apache.coyote.http11.AbstractInputBuffer |
---|
activeFilters, buf, end, filterLibrary, headers, inputStream, inputStreamInputBuffer, lastActiveFilter, lastValid, pos, request, sm, swallowInput |
Constructor Summary | |
---|---|
InternalNioInputBuffer(Request request,
int headerBufferSize)
Alternate constructor. |
Method Summary | |
---|---|
int |
available()
Available bytes (note that due to encoding, this may not correspond ) |
protected boolean |
fill(boolean block)
Fill the internal buffer using data from the underlying input stream. |
protected boolean |
fill(boolean timeout,
boolean block)
|
int |
getParsingRequestLinePhase()
|
NioSelectorPool |
getSelectorPool()
|
NioChannel |
getSocket()
Get the underlying socket input stream. |
boolean |
isReadable()
Returns true if there are bytes available from the socket layer |
int |
nbRead()
Issues a non blocking read |
void |
nextRequest()
End processing of current HTTP request. |
org.apache.coyote.http11.InternalNioInputBuffer.HeaderParseStatus |
parseHeader()
Parse an HTTP header. |
boolean |
parseHeaders()
Parse the HTTP headers. |
boolean |
parseRequestLine(boolean useAvailableDataOnly)
Read the request line. |
void |
recycle()
Recycle the input buffer. |
void |
setSelectorPool(NioSelectorPool pool)
|
void |
setSocket(NioChannel socket)
Set the underlying socket. |
Methods inherited from class org.apache.coyote.http11.AbstractInputBuffer |
---|
addActiveFilter, addFilter, clearFilters, doRead, endRequest, getFilters, getInputStream, setInputStream, setSwallowInput |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean parsingHeader
protected boolean parsingRequestLine
protected int parsingRequestLinePhase
protected boolean parsingRequestLineEol
protected int parsingRequestLineStart
protected int parsingRequestLineQPos
protected org.apache.coyote.http11.InternalNioInputBuffer.HeaderParsePosition headerParsePos
protected NioChannel socket
protected NioSelectorPool pool
protected InternalNioInputBuffer.HeaderParseData headerData
Constructor Detail |
---|
public InternalNioInputBuffer(Request request, int headerBufferSize)
Method Detail |
---|
public void setSocket(NioChannel socket)
public NioChannel getSocket()
public void setSelectorPool(NioSelectorPool pool)
public NioSelectorPool getSelectorPool()
public boolean isReadable() throws IOException
IOException
public int nbRead() throws IOException
IOException
public void recycle()
recycle
in class AbstractInputBuffer
public void nextRequest()
nextRequest
in class AbstractInputBuffer
public boolean parseRequestLine(boolean useAvailableDataOnly) throws IOException
parseRequestLine
in class AbstractInputBuffer
IOException
- If an exception occurs during the underlying socket
read operations, or if the given buffer is not big enough to accommodate
the whole line.public boolean parseHeaders() throws IOException
parseHeaders
in class AbstractInputBuffer
IOException
public org.apache.coyote.http11.InternalNioInputBuffer.HeaderParseStatus parseHeader() throws IOException
IOException
public int available()
protected boolean fill(boolean block) throws IOException, EOFException
fill
in class AbstractInputBuffer
IOException
EOFException
protected boolean fill(boolean timeout, boolean block) throws IOException, EOFException
IOException
EOFException
public int getParsingRequestLinePhase()
|
Apache Tomcat 7.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |