[][src]Type Definition libnghttp2_sys::nghttp2_on_begin_frame_callback

type nghttp2_on_begin_frame_callback = Option<unsafe extern "C" fn(session: *mut nghttp2_session, hd: *const nghttp2_frame_hd, user_data: *mut c_void) -> c_int>;

@functypedef

Callback function invoked when a frame header is received. The |hd| points to received frame header.

Unlike :type:nghttp2_on_frame_recv_callback, this callback will also be called when frame header of CONTINUATION frame is received.

If both :type:nghttp2_on_begin_frame_callback and :type:nghttp2_on_begin_headers_callback are set and HEADERS or PUSH_PROMISE is received, :type:nghttp2_on_begin_frame_callback will be called first.

The implementation of this function must return 0 if it succeeds. If nonzero value 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_begin_frame_callback().