org.mortbay.jetty
Class HttpParser
java.lang.Object
org.mortbay.jetty.HttpParser
- All Implemented Interfaces:
- HttpTokens
public class HttpParser
- extends Object
- implements HttpTokens
- Author:
- gregw
Fields inherited from interface org.mortbay.jetty.HttpTokens |
CARRIAGE_RETURN, CHUNKED_CONTENT, COLON, CRLF, EOF_CONTENT, LINE_FEED, NO_CONTENT, SELF_DEFINING_CONTENT, SEMI_COLON, SPACE, TAB, UNKNOWN_CONTENT |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STATE_START
public static final int STATE_START
- See Also:
- Constant Field Values
STATE_FIELD0
public static final int STATE_FIELD0
- See Also:
- Constant Field Values
STATE_SPACE1
public static final int STATE_SPACE1
- See Also:
- Constant Field Values
STATE_FIELD1
public static final int STATE_FIELD1
- See Also:
- Constant Field Values
STATE_SPACE2
public static final int STATE_SPACE2
- See Also:
- Constant Field Values
STATE_END0
public static final int STATE_END0
- See Also:
- Constant Field Values
STATE_END1
public static final int STATE_END1
- See Also:
- Constant Field Values
STATE_FIELD2
public static final int STATE_FIELD2
- See Also:
- Constant Field Values
STATE_HEADER
public static final int STATE_HEADER
- See Also:
- Constant Field Values
STATE_HEADER_NAME
public static final int STATE_HEADER_NAME
- See Also:
- Constant Field Values
STATE_HEADER_VALUE
public static final int STATE_HEADER_VALUE
- See Also:
- Constant Field Values
STATE_END
public static final int STATE_END
- See Also:
- Constant Field Values
STATE_EOF_CONTENT
public static final int STATE_EOF_CONTENT
- See Also:
- Constant Field Values
STATE_CONTENT
public static final int STATE_CONTENT
- See Also:
- Constant Field Values
STATE_CHUNKED_CONTENT
public static final int STATE_CHUNKED_CONTENT
- See Also:
- Constant Field Values
STATE_CHUNK_SIZE
public static final int STATE_CHUNK_SIZE
- See Also:
- Constant Field Values
STATE_CHUNK_PARAMS
public static final int STATE_CHUNK_PARAMS
- See Also:
- Constant Field Values
STATE_CHUNK
public static final int STATE_CHUNK
- See Also:
- Constant Field Values
_state
protected int _state
_eol
protected byte _eol
_length
protected int _length
_contentLength
protected int _contentLength
_contentPosition
protected int _contentPosition
_chunkLength
protected int _chunkLength
_chunkPosition
protected int _chunkPosition
_buffers
private Buffers _buffers
_endp
private EndPoint _endp
_header
private Buffer _header
_content
private Buffer _content
_buffer
private Buffer _buffer
_headerBufferSize
private int _headerBufferSize
_contentBufferSize
private int _contentBufferSize
_hasContent
private boolean _hasContent
_handler
private HttpParser.EventHandler _handler
_cached
private BufferCache.CachedBuffer _cached
_tok0
private View _tok0
_tok1
private View _tok1
_multiLineValue
private String _multiLineValue
_response
private boolean _response
HttpParser
public HttpParser(Buffer buffer,
HttpParser.EventHandler handler)
- Constructor.
HttpParser
public HttpParser(Buffers buffers,
EndPoint endp,
HttpParser.EventHandler handler,
int headerBufferSize,
int contentBufferSize)
- Constructor.
- Parameters:
headerBufferSize
- TODOcontentBufferSize
- TODO
getState
public int getState()
isState
public boolean isState(int state)
setState
public void setState(int state)
inHeaderState
public boolean inHeaderState()
inContentState
public boolean inContentState()
getContentLength
public int getContentLength()
isChunking
public boolean isChunking()
toString
public String toString(Buffer buf)
parse
public void parse()
throws IOException
- Parse until END state.
- Parameters:
handler
- source
-
- Throws:
IOException
parseAvailable
public void parseAvailable()
throws IOException
- Parse until END state.
- Parameters:
handler
- source
-
- Throws:
IOException
parseNext
public long parseNext()
throws IOException
- Parse until next Event.
- Throws:
IOException
reset
public void reset(boolean returnBuffers)
getHeaderBuffer
Buffer getHeaderBuffer()