Connector.onHeaderField

Callback function invoked when a header header field is received for the |frame|. The |hf.name| of length |hf.name.length| is header name. The |hf.value| of length |hf.value.length| is header value. The |hf.flags| is a HeaderFlag.

If HeaderFlag.NO_INDEX is set in |hf.flags|, the receiver must not index this header field when forwarding it to the next hop. More specifically, "Literal Header Field never Indexed" representation must be used in HPACK encoding.

When this callback is invoked, frame.hd.type is either FrameFlags.HEADERS or FrameFlags.PUSH_PROMISE. After all header fields are processed with this callback, and no error has been detected, Connector.onFrame will be invoked. If there is an error in decompression, Connector.onFrame for the |frame| will not be invoked.

The |value| may be null if the |value.length| is 0.

Please note that unless setNoHTTPMessaging() is used, nghttp2 library does perform validation against |hf.name| and |hf.value| using hf.validateName() and hf.validateValue(). In addition to this, libhttp2 performs vaidation based on HTTP Messaging rule, which is briefly explained in HTTP Messaging_ section.

If the application uses Session.memRecv, it can enable pause to make Session.memRecv return without processing further input bytes. The memory pointed by |frame|, |name| and |value| parameters are retained until Session.memRecv or Session.recv is called. The application must retain the input bytes which was used to produce these parameters, because it may refer to the memory region included in the input bytes.

Enabling rst_stream will close the stream by issuing RST_STREAM with FrameError.INTERNAL_ERROR. In this case, Connector.onFrame will not be invoked. If a different error code is desirable, use submitRstStream with a desired error code and then set rst_stream to true.

The implementation of this function must return true if it succeeds. If false is returned, it is treated as ErrorCode.CALLBACK_FAILURE and in this case, Session.recv or Session.memRecv functions immediately return ErrorCode.CALLBACK_FAILURE.

class Connector
public
bool
onHeaderField
(,,
ref bool pause
,
ref bool rst_stream
)

Meta