Function libnghttp2_sys::nghttp2_submit_extension [−][src]
pub unsafe extern "C" fn nghttp2_submit_extension(
session: *mut nghttp2_session,
type_: u8,
flags: u8,
stream_id: i32,
payload: *mut c_void
) -> c_int
@function
Submits extension frame.
Application can pass arbitrary frame flags and stream ID in |flags|
and |stream_id| respectively. The |payload| is opaque pointer, and
it can be accessible though frame->ext.payload
in
:type:nghttp2_pack_extension_callback
. The library will not own
passed |payload| pointer.
The application must set :type:nghttp2_pack_extension_callback
using nghttp2_session_callbacks_set_pack_extension_callback()
.
The application should retain the memory pointed by |payload| until
the transmission of extension frame is done (which is indicated by
:type:nghttp2_on_frame_send_callback
), or transmission fails
(which is indicated by :type:nghttp2_on_frame_not_send_callback
).
If application does not touch this memory region after packing it
into a wire format, application can free it inside
:type:nghttp2_pack_extension_callback
.
The standard HTTP/2 frame cannot be sent with this function, so
|type| must be strictly grater than 0x9. Otherwise, this function
will fail with error code :enum:NGHTTP2_ERR_INVALID_ARGUMENT
.
This function returns 0 if it succeeds, or one of the following negative error codes:
:enum:NGHTTP2_ERR_INVALID_STATE
If :type:nghttp2_pack_extension_callback
is not set.
:enum:NGHTTP2_ERR_INVALID_ARGUMENT
If |type| specifies standard HTTP/2 frame type. The frame
types in the rage [0x0, 0x9], both inclusive, are standard
HTTP/2 frame type, and cannot be sent using this function.
:enum:NGHTTP2_ERR_NOMEM
Out of memory