[][src]Type Definition libnghttp2_sys::nghttp2_before_frame_send_callback

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

@functypedef

Callback function invoked just before the non-DATA frame |frame| is sent. The |user_data| pointer is the third argument passed in to the call to nghttp2_session_client_new() or nghttp2_session_server_new().

The implementation of this function must return 0 if it succeeds. It can also return :enum:NGHTTP2_ERR_CANCEL to cancel the transmission of the given frame.

If there is a fatal error while executing this callback, the implementation should return :enum:NGHTTP2_ERR_CALLBACK_FAILURE, which makes nghttp2_session_send() and nghttp2_session_mem_send() functions immediately return :enum:NGHTTP2_ERR_CALLBACK_FAILURE.

If the other value is returned, it is treated as if :enum:NGHTTP2_ERR_CALLBACK_FAILURE is returned. But the implementation should not rely on this since the library may define new return value to extend its capability.

To set this callback to :type:nghttp2_session_callbacks, use nghttp2_session_callbacks_set_before_frame_send_callback().