Type Definition libnghttp2_sys::nghttp2_on_header_callback2 [−][src]
type nghttp2_on_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 header name/value pair is received
for the |frame|. The |name| is header name. The |value| is header
value. The |flags| is bitwise OR of one or more of
:type:nghttp2_nv_flag
.
This callback behaves like :type:nghttp2_on_header_callback
,
except that |name| and |value| are stored in reference counted
buffer. If application wishes to keep these references without
copying them, use nghttp2_rcbuf_incref()
to increment their
reference count. It is the application’s responsibility to call
nghttp2_rcbuf_decref()
if they called nghttp2_rcbuf_incref()
so
as not to leak memory. If the |session| is created by
nghttp2_session_server_new3()
or nghttp2_session_client_new3()
,
the function to free memory is the one belongs to the mem
parameter. As long as this free function alives, |name| and
|value| can live after |session| was destroyed.