[−][src]Type Definition libnghttp2_sys::nghttp2_on_invalid_header_callback2
type nghttp2_on_invalid_header_callback2 = Option<unsafe extern "C" fn(session: *mut nghttp2_session, frame: *const nghttp2_frame, name: *mut nghttp2_rcbuf, value: *mut nghttp2_rcbuf, flags: u8, user_data: *mut c_void) -> c_int>;
@functypedef
Callback function invoked when a invalid header name/value pair is received for the |frame|.
The parameter and behaviour are similar to
:type:nghttp2_on_header_callback2
. The difference is that this
callback is only invoked when a invalid header name/value pair is
received which is silently ignored if this callback is not set.
Only invalid regular header field are passed to this callback. In
other words, invalid pseudo header field is not passed to this
callback. Also header fields which includes upper cased latter are
also treated as error without passing them to this callback.
This callback is only considered if HTTP messaging validation is
turned on (which is on by default, see
nghttp2_option_set_no_http_messaging()
).
With this callback, application inspects the incoming invalid
field, and it also can reset stream from this callback by returning
:enum:NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE
. By default, the
error code is :enum:NGHTTP2_INTERNAL_ERROR
. To change the error
code, call nghttp2_submit_rst_stream()
with the error code of
choice in addition to returning
:enum:NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE
.