Type Definition libnghttp2_sys::nghttp2_error_callback2
source · [−]pub type nghttp2_error_callback2 = Option<unsafe extern "C" fn(session: *mut nghttp2_session, lib_error_code: c_int, msg: *const c_char, len: usize, user_data: *mut c_void) -> c_int>;
Expand description
@functypedef
Callback function invoked when library provides the error code, and
message. This callback is solely for debugging purpose.
|lib_error_code| is one of error code defined in
:enum:nghttp2_error
. The |msg| is typically NULL-terminated
string of length |len|, and intended for human consumption. |len|
does not include the sentinel NULL character.
The format of error message may change between nghttp2 library versions. The application should not depend on the particular format.
Normally, application should return 0 from this callback. If fatal
error occurred while doing something in this callback, application
should return :enum:NGHTTP2_ERR_CALLBACK_FAILURE
. In this case,
library will return immediately with return value
:enum:NGHTTP2_ERR_CALLBACK_FAILURE
. Currently, if nonzero value
is returned from this callback, they are treated as
:enum:NGHTTP2_ERR_CALLBACK_FAILURE
, but application should not
rely on this details.