HTTPSession

HTTPSession will not send any read event

abstract
class HTTPSession : Transport , CallBack {
Address _localAddr;
Address _peerAddr;
HTTPCodec _codec;
HTTPSessionController _controller;
SessionDown _down;
}

Members

Functions

setupOnHeadersComplete
void setupOnHeadersComplete(ref HTTPTransaction txn, HTTPMessage msg)

Called by onHeadersComplete(). This function allows downstream and upstream to do any setup (like preparing a handler) when headers are first received from the remote side on a given transaction.

Inherited Members

From CallBack

onMessageBegin
void onMessageBegin(HTTPTransaction txn, HTTPMessage msg)

Called when a new message is seen while parsing the ingress @param stream The stream ID @param msg A newly allocated HTTPMessage

onHeadersComplete
void onHeadersComplete(HTTPTransaction txn, HTTPMessage msg)

Called when all the headers of an ingress message have been parsed @param stream The stream ID @param msg The message @param size Size of the ingress header

onBody
void onBody(HTTPTransaction txn, const ubyte[] data)

Called for each block of message body data @param stream The stream ID @param chain One or more buffers of body data. The codec will remove any protocol framing, such as HTTP/1.1 chunk headers, from the buffers before calling this function. @param padding Number of pad bytes that came with the data segment

onChunkHeader
void onChunkHeader(HTTPTransaction txn, size_t length)

Called for each HTTP chunk header.

onChunkComplete
void onChunkComplete(HTTPTransaction txn)

Called when the terminating CRLF is received to end a chunk of HTTP body data.

onMessageComplete
void onMessageComplete(HTTPTransaction txn, bool upgrade)

Called at end of a message (including body and trailers, if applicable) @param stream The stream ID @param upgrade Whether the connection has been upgraded to another protocol.

onError
void onError(HTTPTransaction txn, HTTPErrorCode)

Called when a parsing or protocol error has occurred @param stream The stream ID @param error Description of the error @param newTxn true if onMessageBegin has not been called for txn

onAbort
void onAbort(HTTPTransaction txn, HTTPErrorCode code)

Called when the peer has asked to shut down a stream immediately. @param stream The stream ID @param code The code the stream was aborted with @note Not applicable to all protocols.

onNativeProtocolUpgrade
void onNativeProtocolUpgrade(HTTPTransaction txn, CodecProtocol protocol, string protocolString, HTTPMessage msg)

Called upon receipt of a valid protocol switch. Return false if protocol switch could not be completed.

Meta