|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.coyote.http11.filters.ChunkedInputFilter
Chunked input filter. Parses chunked data according to
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1
Field Summary | |
protected byte[] |
buf
Read bytes buffer. |
protected InputBuffer |
buffer
Next buffer in the pipeline. |
protected static ByteChunk |
ENCODING
|
protected static java.lang.String |
ENCODING_NAME
|
protected boolean |
endChunk
Flag set to true when the end chunk has been read. |
protected int |
lastValid
Last valid byte in the buffer. |
protected boolean |
needCRLFParse
Flag set to true if the next call to doRead() must parse a CRLF pair before doing anything else. |
protected int |
pos
Position in the buffer. |
protected ByteChunk |
readChunk
Byte chunk used to read bytes. |
protected int |
remaining
Number of bytes remaining in the current chunk. |
Constructor Summary | |
ChunkedInputFilter()
|
Method Summary | |
int |
doRead(ByteChunk chunk,
Request req)
Read bytes. |
long |
end()
End the current request. |
ByteChunk |
getEncodingName()
Return the name of the associated encoding; Here, the value is "identity". |
protected boolean |
parseChunkHeader()
Parse the header of a chunk. |
protected boolean |
parseCRLF()
Parse CRLF at end of chunk. |
protected boolean |
parseEndChunk()
Parse end chunk data. |
protected int |
readBytes()
Read bytes from the previous buffer. |
void |
recycle()
Make the filter ready to process the next request. |
void |
setBuffer(InputBuffer buffer)
Set the next buffer in the filter pipeline. |
void |
setRequest(Request request)
Read the content length from the request. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String ENCODING_NAME
protected static final ByteChunk ENCODING
protected InputBuffer buffer
protected int remaining
protected int pos
protected int lastValid
protected byte[] buf
protected ByteChunk readChunk
protected boolean endChunk
protected boolean needCRLFParse
Constructor Detail |
public ChunkedInputFilter()
Method Detail |
public int doRead(ByteChunk chunk, Request req) throws java.io.IOException
doRead
in interface InputFilter
java.io.IOException
public void setRequest(Request request)
setRequest
in interface InputFilter
public long end() throws java.io.IOException
end
in interface InputFilter
java.io.IOException
public void setBuffer(InputBuffer buffer)
setBuffer
in interface InputFilter
public void recycle()
recycle
in interface InputFilter
public ByteChunk getEncodingName()
getEncodingName
in interface InputFilter
protected int readBytes() throws java.io.IOException
java.io.IOException
protected boolean parseChunkHeader() throws java.io.IOException
The letters before CRLF or ';' (whatever comes first) must be valid hex digits. We should not parse F23IAMGONNAMESSTHISUP34CRLF as a valid header according to the spec.
java.io.IOException
protected boolean parseCRLF() throws java.io.IOException
java.io.IOException
protected boolean parseEndChunk() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |