|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.coyote.http11.InternalAprInputBuffer
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 InputFilter[] |
activeFilters
Active filters (in order). |
protected char[] |
ascbuf
Pointer to the US-ASCII header buffer. |
protected java.nio.ByteBuffer |
bbuf
Direct byte buffer used to perform actual reading. |
protected byte[] |
bodyBuffer
HTTP body buffer. |
protected byte[] |
buf
Pointer to the current read buffer. |
protected InputFilter[] |
filterLibrary
Filter library. |
protected char[] |
headerBuffer
US-ASCII header buffer. |
protected byte[] |
headerBuffer1
HTTP header buffer no 1. |
protected byte[] |
headerBuffer2
HTTP header buffer no 2. |
protected MimeHeaders |
headers
Headers of the associated request. |
protected InputBuffer |
inputStreamInputBuffer
Underlying input buffer. |
protected int |
lastActiveFilter
Index of the last active filter. |
protected int |
lastValid
Last valid byte. |
protected boolean |
parsingHeader
State. |
protected int |
pos
Position in the buffer. |
protected long |
readTimeout
The socket timeout used when reading the first block of the request header. |
protected Request |
request
Associated Coyote request. |
protected static StringManager |
sm
The string manager for this package. |
protected long |
socket
Underlying socket. |
protected boolean |
swallowInput
Swallow input ? |
Constructor Summary | |
InternalAprInputBuffer(Request request,
int headerBufferSize,
long readTimeout)
Alternate constructor. |
Method Summary | |
void |
addActiveFilter(InputFilter filter)
Add an input filter to the filter library. |
void |
addFilter(InputFilter filter)
Add an input filter to the filter library. |
void |
clearFilters()
Clear filters. |
int |
doRead(ByteChunk chunk,
Request req)
Read some bytes. |
void |
endRequest()
End request (consumes leftover bytes). |
protected boolean |
fill()
Fill the internal buffer using data from the undelying input stream. |
InputFilter[] |
getFilters()
Get filters. |
long |
getSocket()
Get the underlying socket input stream. |
void |
nextRequest()
End processing of current HTTP request. |
boolean |
parseHeader()
Parse an HTTP header. |
void |
parseHeaders()
Parse the HTTP headers. |
boolean |
parseRequestLine(boolean useAvailableData)
Read the request line. |
void |
recycle()
Recycle the input buffer. |
void |
setSocket(long socket)
Set the underlying socket. |
void |
setSwallowInput(boolean swallowInput)
Set the swallow input flag. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static StringManager sm
protected Request request
protected MimeHeaders headers
protected boolean parsingHeader
protected boolean swallowInput
protected byte[] buf
protected char[] ascbuf
protected int lastValid
protected int pos
protected byte[] headerBuffer1
protected byte[] headerBuffer2
protected byte[] bodyBuffer
protected char[] headerBuffer
protected java.nio.ByteBuffer bbuf
protected long socket
protected InputBuffer inputStreamInputBuffer
protected InputFilter[] filterLibrary
protected InputFilter[] activeFilters
protected int lastActiveFilter
protected long readTimeout
Constructor Detail |
public InternalAprInputBuffer(Request request, int headerBufferSize, long readTimeout)
Method Detail |
public void setSocket(long socket)
public long getSocket()
public void addFilter(InputFilter filter)
public InputFilter[] getFilters()
public void clearFilters()
public void addActiveFilter(InputFilter filter)
public void setSwallowInput(boolean swallowInput)
public void recycle()
public void nextRequest() throws java.io.IOException
java.io.IOException
public void endRequest() throws java.io.IOException
java.io.IOException
- an undelying I/O error occuredpublic boolean parseRequestLine(boolean useAvailableData) throws java.io.IOException
java.io.IOException
- If an exception occurs during the underlying socket
read operations, or if the given buffer is not big enough to accomodate
the whole line.public void parseHeaders() throws java.io.IOException
java.io.IOException
public boolean parseHeader() throws java.io.IOException
java.io.IOException
public int doRead(ByteChunk chunk, Request req) throws java.io.IOException
doRead
in interface InputBuffer
java.io.IOException
protected boolean fill() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |