public class HttpSession extends Session
Session.ArrayQueueItem, Session.QueueItem| Modifier and Type | Field and Description |
|---|---|
protected static Request |
FIN |
protected byte[] |
fragment |
protected int |
fragmentLength |
protected Request |
handling |
protected Request |
parsing |
protected java.util.LinkedList<Request> |
pipeline |
protected int |
requestBodyOffset |
protected HttpServer |
server |
ACTIVE, closing, CLOSING, EVENT_MASK, events, eventsToListen, IDLE, lastAccessTime, log, queueHead, READABLE, selector, slot, socket, SSL, STALE, wasSelected, WRITEABLE| Constructor and Description |
|---|
HttpSession(Socket socket,
HttpServer server) |
| Modifier and Type | Method and Description |
|---|---|
int |
checkStatus(long currentTime,
long keepAlive) |
protected int |
getMaxRequestBodyLength() |
protected void |
handleParsedRequest() |
protected void |
handleSocketClosed() |
protected Request |
parseRequest(byte[] buffer,
int start,
int length) |
protected int |
processHttpBuffer(byte[] buffer,
int length) |
protected void |
processRead(byte[] buffer) |
void |
sendError(java.lang.String code,
java.lang.String message) |
void |
sendResponse(Response response) |
protected int |
startParsingRequestBody(java.lang.String contentLengthHeader,
byte[] buffer,
int offset,
int remaining) |
protected void |
writeResponse(Response response,
boolean includeBody) |
close, getQueueStats, getRemoteHost, handleException, isSsl, lastAccessTime, listen, process, processWrite, read, readRaw, scheduleClose, socket, write, write, writeprotected static final Request FIN
protected final HttpServer server
protected final java.util.LinkedList<Request> pipeline
protected final byte[] fragment
protected int fragmentLength
protected int requestBodyOffset
protected Request parsing
protected volatile Request handling
public HttpSession(Socket socket, HttpServer server)
public int checkStatus(long currentTime,
long keepAlive)
checkStatus in class Sessionprotected void processRead(byte[] buffer)
throws java.io.IOException
processRead in class Sessionjava.io.IOExceptionprotected void handleSocketClosed()
protected int getMaxRequestBodyLength()
protected int startParsingRequestBody(java.lang.String contentLengthHeader,
byte[] buffer,
int offset,
int remaining)
throws java.io.IOException,
HttpException
java.io.IOExceptionHttpExceptionprotected void handleParsedRequest()
throws java.io.IOException
java.io.IOExceptionprotected int processHttpBuffer(byte[] buffer,
int length)
throws java.io.IOException,
HttpException
java.io.IOExceptionHttpExceptionprotected Request parseRequest(byte[] buffer, int start, int length) throws HttpException
HttpExceptionpublic void sendResponse(Response response) throws java.io.IOException
java.io.IOExceptionpublic void sendError(java.lang.String code,
java.lang.String message)
throws java.io.IOException
java.io.IOExceptionprotected void writeResponse(Response response, boolean includeBody) throws java.io.IOException
java.io.IOException