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 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(String code,
String message) |
void |
sendResponse(Response response) |
protected int |
startParsingRequestBody(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 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 IOException
processRead in class SessionIOExceptionprotected void handleSocketClosed()
protected int getMaxRequestBodyLength()
protected int startParsingRequestBody(String contentLengthHeader, byte[] buffer, int offset, int remaining) throws IOException, HttpException
IOExceptionHttpExceptionprotected void handleParsedRequest()
throws IOException
IOExceptionprotected int processHttpBuffer(byte[] buffer,
int length)
throws IOException,
HttpException
IOExceptionHttpExceptionprotected Request parseRequest(byte[] buffer, int start, int length) throws HttpException
HttpExceptionpublic void sendResponse(Response response) throws IOException
IOExceptionpublic void sendError(String code, String message) throws IOException
IOExceptionprotected void writeResponse(Response response, boolean includeBody) throws IOException
IOExceptionCopyright © 2019. All rights reserved.