Type Definition libnghttp2_sys::nghttp2_on_invalid_frame_recv_callback [−][src]
type nghttp2_on_invalid_frame_recv_callback = Option<unsafe extern "C" fn(session: *mut nghttp2_session, frame: *const nghttp2_frame, lib_error_code: c_int, user_data: *mut c_void) -> c_int>;
@functypedef
Callback function invoked by nghttp2_session_recv()
and
nghttp2_session_mem_recv()
when an invalid non-DATA frame is
received. The error is indicated by the |lib_error_code|, which is
one of the values defined in :type:nghttp2_error
. When this
callback function is invoked, the library automatically submits
either RST_STREAM or GOAWAY frame. The |user_data| pointer is the
third argument passed in to the call to
nghttp2_session_client_new()
or nghttp2_session_server_new()
.
If frame is HEADERS or PUSH_PROMISE, the nva
and nvlen
member of their data structure are always NULL
and 0
respectively.
The implementation of this function must return 0 if it succeeds.
If nonzero is returned, it is treated as fatal error and
nghttp2_session_recv()
and nghttp2_session_mem_recv()
functions
immediately return :enum:NGHTTP2_ERR_CALLBACK_FAILURE
.
To set this callback to :type:nghttp2_session_callbacks
, use
nghttp2_session_callbacks_set_on_invalid_frame_recv_callback()
.