HTTPCodec

Members

Aliases

StreamID
alias StreamID = uint

Key that uniquely identifies a request/response pair within (and only within) the scope of the codec. Code outside the codec should regard the StreamID as an opaque data structure; different subclasses of HTTPCodec are likely to use different conventions for generating StreamID values.

Functions

generateBody
size_t generateBody(HTTPTransaction txn, HttpWriteBuffer chain, in ubyte[] data, bool eom)

Write part of an egress message body.

generateChunkHeader
size_t generateChunkHeader(HTTPTransaction txn, HttpWriteBuffer buffer, size_t length)

Write a body chunk header, if relevant.

generateChunkTerminator
size_t generateChunkTerminator(HTTPTransaction txn, HttpWriteBuffer buffer)

Write a body chunk terminator, if relevant.

generateEOM
size_t generateEOM(HTTPTransaction txn, HttpWriteBuffer buffer)

Generate any protocol framing needed to finalize an egress message. This method must be called to complete a stream.

generateHeader
size_t generateHeader(HTTPTransaction txn, HTTPMessage msg, HttpWriteBuffer buffer, bool eom = false)

Write an egress message header. For pushed streams, you must specify the assocStream. @retval size the size of the generated message, both the actual size and the size of the uncompressed data. @return None

generateRstStream
size_t generateRstStream(HTTPTransaction txn, HttpWriteBuffer buffer, HTTPErrorCode code)

Generate any protocol framing needed to abort a connection. @return number of bytes written

getTransportDirection
TransportDirection getTransportDirection()

Get the transport direction of this codec: DOWNSTREAM if the codec receives requests from clients or UPSTREAM if the codec sends requests to servers.

isBusy
bool isBusy()

Check whether the codec still has at least one HTTP stream to parse.

onIngress
size_t onIngress(ubyte[] buf)

Parse ingress data. @param buf A single IOBuf of data to parse @return Number of bytes consumed.

setCallback
void setCallback(CallBack callback)

Set the callback to notify on ingress events @param callback The callback object

setParserPaused
void setParserPaused(bool paused)

Pause or resume the ingress parser @param paused Whether the caller wants the parser to be paused

supportsSessionFlowControl
bool supportsSessionFlowControl()

Returns true iff this codec supports session level flow control

supportsStreamFlowControl
bool supportsStreamFlowControl()

Returns true iff this codec supports per stream flow control

Interfaces

CallBack
interface CallBack

Meta