|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object seda.sandStorm.lib.http.httpPacketReader
class httpPacketReader
This is a package-internal class which reads HTTP request packets. An instance of this class is fed ATcpInPackets (via the parsePacket method). When a complete packet has been read, an httpRequest is pushed to the corresponding SinkIF. This is the bulk of the HTTP protocol implementation.
Field Summary | |
---|---|
private aSocketInputStream |
ais
|
private SinkIF |
compQ
|
private httpConnection |
conn
|
private static boolean |
DEBUG
|
private java.util.Vector |
header
|
private int |
httpver
|
private java.lang.String |
request
|
private int |
state
|
private static int |
STATE_DONE
|
private static int |
STATE_HEADER
|
private static int |
STATE_START
|
private java.io.StreamTokenizer |
tok
|
private java.lang.String |
url
|
Fields inherited from interface seda.sandStorm.lib.http.httpConst |
---|
CRLF, DEFAULT_HTTP_PORT, HTTP_VERSION, WRITE_CLOG_THRESHOLD |
Constructor Summary | |
---|---|
httpPacketReader(httpConnection conn,
SinkIF compQ)
Create an httpPacketReader with the given httpConnection and completion queue. |
Method Summary | |
---|---|
private int |
accumulateHeader()
Accumulate header lines. |
private java.lang.String |
nextLine()
Read the next line from the packet. |
private java.lang.String |
nextWord()
Read the next whitespace-delimited word from the packet. |
(package private) boolean |
parsePacket(ATcpInPacket pkt)
Parse the given packet; returns true if a complete HTTP request has been received and parsed. |
private int |
parseURL()
Parse the first line of the request header. |
private void |
processHeader()
Process the header, possibly pushing an httpRequest to the user. |
private void |
reset()
Reset the internal state of the packet reader. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final boolean DEBUG
private static final int STATE_START
private static final int STATE_HEADER
private static final int STATE_DONE
private int state
private aSocketInputStream ais
private java.io.StreamTokenizer tok
private java.lang.String request
private java.lang.String url
private int httpver
private java.util.Vector header
private httpConnection conn
private SinkIF compQ
Constructor Detail |
---|
httpPacketReader(httpConnection conn, SinkIF compQ)
Method Detail |
---|
boolean parsePacket(ATcpInPacket pkt) throws java.io.IOException
java.io.IOException
private void reset()
private int parseURL() throws java.io.IOException
java.io.IOException
private int accumulateHeader() throws java.io.IOException
java.io.IOException
private void processHeader() throws java.io.IOException
java.io.IOException
private java.lang.String nextWord() throws java.io.IOException
java.io.IOException
private java.lang.String nextLine() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |