HTTPCodec.CallBack

Members

Functions

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.

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

onChunkComplete
void onChunkComplete(HTTPTransaction txn)

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

onChunkHeader
void onChunkHeader(HTTPTransaction txn, size_t length)

Called for each HTTP chunk header.

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

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

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

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.

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