Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2013-09-07 23:46:28 +09:00
parent 5caecebcc5
commit 3a0c0870ef
5 changed files with 146 additions and 56 deletions

View File

@ -709,7 +709,9 @@ Types (structs, unions and typedefs)
not used and always 0. It must return the number of bytes sent if not used and always 0. It must return the number of bytes sent if
it succeeds. If it cannot send any single byte without blocking, it succeeds. If it cannot send any single byte without blocking,
it must return :macro:`NGHTTP2_ERR_WOULDBLOCK`. For other errors, it it must return :macro:`NGHTTP2_ERR_WOULDBLOCK`. For other errors, it
must return :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`. must return :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`. The *user_data*
pointer is the third argument passed in to the call to
`nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
.. type:: typedef ssize_t (*nghttp2_recv_callback) (nghttp2_session *session, uint8_t *buf, size_t length, int flags, void *user_data) .. type:: typedef ssize_t (*nghttp2_recv_callback) (nghttp2_session *session, uint8_t *buf, size_t length, int flags, void *user_data)
@ -723,13 +725,17 @@ Types (structs, unions and typedefs)
it gets EOF before it reads any single byte, it must return it gets EOF before it reads any single byte, it must return
:macro:`NGHTTP2_ERR_EOF`. For other errors, it must return :macro:`NGHTTP2_ERR_EOF`. For other errors, it must return
:macro:`NGHTTP2_ERR_CALLBACK_FAILURE`. Returning 0 is treated as :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`. Returning 0 is treated as
:macro:`NGHTTP2_ERR_WOULDBLOCK`. :macro:`NGHTTP2_ERR_WOULDBLOCK`. The *user_data* pointer is the
third argument passed in to the call to
`nghttp2_session_client_new()` or `nghttp2_session_server_new()`.
.. type:: typedef int (*nghttp2_on_frame_recv_callback) (nghttp2_session *session, const nghttp2_frame *frame, void *user_data) .. type:: typedef int (*nghttp2_on_frame_recv_callback) (nghttp2_session *session, const nghttp2_frame *frame, void *user_data)
Callback function invoked by `nghttp2_session_recv()` when a Callback function invoked by `nghttp2_session_recv()` when a
non-DATA frame is received. non-DATA frame is received. 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -743,7 +749,9 @@ Types (structs, unions and typedefs)
invalid non-DATA frame is received. The *error_code* is one of the invalid non-DATA frame is received. The *error_code* is one of the
:macro:`nghttp2_error_code` and indicates the error. When this :macro:`nghttp2_error_code` and indicates the error. When this
callback function is invoked, the library automatically submits callback function is invoked, the library automatically submits
either RST_STREAM or GOAWAY frame. either RST_STREAM or GOAWAY frame. 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -759,7 +767,9 @@ Types (structs, unions and typedefs)
contained. ``(flags & NGHTTP2_FLAG_END_STREAM) != 0`` does not contained. ``(flags & NGHTTP2_FLAG_END_STREAM) != 0`` does not
necessarily mean this chunk of data is the last one in the necessarily mean this chunk of data is the last one in the
stream. You should use :type:`nghttp2_on_data_recv_callback` to stream. You should use :type:`nghttp2_on_data_recv_callback` to
know all data frames are received. know all data frames are received. 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -771,7 +781,9 @@ Types (structs, unions and typedefs)
Callback function invoked when DATA frame is received. The actual Callback function invoked when DATA frame is received. The actual
data it contains are received by data it contains are received by
:type:`nghttp2_on_data_chunk_recv_callback`. :type:`nghttp2_on_data_chunk_recv_callback`. 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -785,7 +797,9 @@ Types (structs, unions and typedefs)
sent. This may be useful, for example, to know the stream ID of sent. This may be useful, for example, to know the stream ID of
HEADERS and PUSH_PROMISE frame (see also HEADERS and PUSH_PROMISE frame (see also
`nghttp2_session_get_stream_user_data()`), which is not assigned `nghttp2_session_get_stream_user_data()`), which is not assigned
when it was queued. when it was queued. 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -796,6 +810,9 @@ Types (structs, unions and typedefs)
Callback function invoked after the non-DATA frame *frame* is sent. Callback function invoked after 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -808,7 +825,9 @@ Types (structs, unions and typedefs)
Callback function invoked after the non-DATA frame *frame* is not Callback function invoked after the non-DATA frame *frame* is not
sent because of the error. The error is indicated by the sent because of the error. The error is indicated by the
*lib_error_code*, which is one of the values defined in *lib_error_code*, which is one of the values defined in
:type:`nghttp2_error`. :type:`nghttp2_error`. 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -818,7 +837,9 @@ Types (structs, unions and typedefs)
.. type:: typedef int (*nghttp2_on_data_send_callback) (nghttp2_session *session, uint16_t length, uint8_t flags, int32_t stream_id, void *user_data) .. type:: typedef int (*nghttp2_on_data_send_callback) (nghttp2_session *session, uint16_t length, uint8_t flags, int32_t stream_id, void *user_data)
Callback function invoked after DATA frame is sent. Callback function invoked after DATA 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -829,10 +850,12 @@ Types (structs, unions and typedefs)
Callback function invoked when the stream *stream_id* is Callback function invoked when the stream *stream_id* is
closed. The reason of closure is indicated by the closed. The reason of closure is indicated by the *error_code*. The
*error_code*. The stream_user_data, which was specified in stream_user_data, which was specified in `nghttp2_submit_request()`
`nghttp2_submit_request()` or `nghttp2_submit_headers()`, is or `nghttp2_submit_headers()`, is still available in this
still available in this function. function. 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -845,7 +868,9 @@ Types (structs, unions and typedefs)
Callback function invoked when the request from the remote peer is Callback function invoked when the request from the remote peer is
received. In other words, the frame with END_STREAM flag set is received. In other words, the frame with END_STREAM flag set is
received. In HTTP, this means HTTP request, including request received. In HTTP, this means HTTP request, including request
body, is fully received. body, is fully received. 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -863,8 +888,10 @@ Types (structs, unions and typedefs)
words, the *head* is the first 8 bytes of the received frame. The words, the *head* is the first 8 bytes of the received frame. The
*payload* is the pointer to the data portion of the received frame. *payload* is the pointer to the data portion of the received frame.
The *payloadlen* is the length of the *payload*. This is the data The *payloadlen* is the length of the *payload*. This is the data
after the length field. The *lib_error_code* is one of the error code after the length field. The *lib_error_code* is one of the error
defined in :macro:`nghttp2_error` and indicates the error. code defined in :macro:`nghttp2_error` and indicates the error. 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -880,7 +907,10 @@ Types (structs, unions and typedefs)
spec, the *headlen* is always 8. In other words, the *head* is the spec, the *headlen* is always 8. In other words, the *head* is the
first 8 bytes of the received frame. The *payload* is the pointer first 8 bytes of the received frame. The *payload* is the pointer
to the data portion of the received frame. The *payloadlen* is the to the data portion of the received frame. The *payloadlen* is the
length of the *payload*. This is the data after the length field. length of the *payload*. This is the data after the length
field. 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 The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
@ -1278,7 +1308,7 @@ Functions
to hold serialized data. The required space for the *niv* entries to hold serialized data. The required space for the *niv* entries
are ``8*niv`` bytes. This function is used mainly for creating are ``8*niv`` bytes. This function is used mainly for creating
SETTINGS payload to be sent with ``HTTP2-Settings`` header field in SETTINGS payload to be sent with ``HTTP2-Settings`` header field in
HTTP Upgrade request. The data written in *buf* is not still HTTP Upgrade request. The data written in *buf* is NOT
base64url encoded and the application is responsible for encoding. base64url encoded and the application is responsible for encoding.
This function returns the number of bytes written in *buf*, or one This function returns the number of bytes written in *buf*, or one

View File

@ -1099,7 +1099,9 @@ remote peer. The implementation of this function must send at most
not used and always 0. It must return the number of bytes sent if not used and always 0. It must return the number of bytes sent if
it succeeds. If it cannot send any single byte without blocking, it succeeds. If it cannot send any single byte without blocking,
it must return <a class="reference internal" href="#NGHTTP2_ERR_WOULDBLOCK" title="NGHTTP2_ERR_WOULDBLOCK"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_WOULDBLOCK</span></tt></a>. For other errors, it it must return <a class="reference internal" href="#NGHTTP2_ERR_WOULDBLOCK" title="NGHTTP2_ERR_WOULDBLOCK"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_WOULDBLOCK</span></tt></a>. For other errors, it
must return <a class="reference internal" href="#NGHTTP2_ERR_CALLBACK_FAILURE" title="NGHTTP2_ERR_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_CALLBACK_FAILURE</span></tt></a>.</p> must return <a class="reference internal" href="#NGHTTP2_ERR_CALLBACK_FAILURE" title="NGHTTP2_ERR_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_CALLBACK_FAILURE</span></tt></a>. The <em>user_data</em>
pointer is the third argument passed in to the call to
<a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
</dd></dl> </dd></dl>
<dl class="type"> <dl class="type">
@ -1114,14 +1116,18 @@ without blocking, it must return <a class="reference internal" href="#NGHTTP2_ER
it gets EOF before it reads any single byte, it must return it gets EOF before it reads any single byte, it must return
<a class="reference internal" href="#NGHTTP2_ERR_EOF" title="NGHTTP2_ERR_EOF"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_EOF</span></tt></a>. For other errors, it must return <a class="reference internal" href="#NGHTTP2_ERR_EOF" title="NGHTTP2_ERR_EOF"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_EOF</span></tt></a>. For other errors, it must return
<a class="reference internal" href="#NGHTTP2_ERR_CALLBACK_FAILURE" title="NGHTTP2_ERR_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_CALLBACK_FAILURE</span></tt></a>. Returning 0 is treated as <a class="reference internal" href="#NGHTTP2_ERR_CALLBACK_FAILURE" title="NGHTTP2_ERR_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_CALLBACK_FAILURE</span></tt></a>. Returning 0 is treated as
<a class="reference internal" href="#NGHTTP2_ERR_WOULDBLOCK" title="NGHTTP2_ERR_WOULDBLOCK"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_WOULDBLOCK</span></tt></a>.</p> <a class="reference internal" href="#NGHTTP2_ERR_WOULDBLOCK" title="NGHTTP2_ERR_WOULDBLOCK"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_WOULDBLOCK</span></tt></a>. The <em>user_data</em> pointer is the
third argument passed in to the call to
<a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
</dd></dl> </dd></dl>
<dl class="type"> <dl class="type">
<dt id="nghttp2_on_frame_recv_callback"> <dt id="nghttp2_on_frame_recv_callback">
typedef int <tt class="descname">(*nghttp2_on_frame_recv_callback)</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_on_frame_recv_callback" title="Permalink to this definition"></a></dt> typedef int <tt class="descname">(*nghttp2_on_frame_recv_callback)</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_on_frame_recv_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked by <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> when a <dd><p>Callback function invoked by <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> when a
non-DATA frame is received.</p> non-DATA frame is received. The <em>user_data</em> pointer is the third
argument passed in to the call to <a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1135,7 +1141,9 @@ typedef int <tt class="descname">(*nghttp2_on_invalid_frame_recv_callback)</tt><
invalid non-DATA frame is received. The <em>error_code</em> is one of the invalid non-DATA frame is received. The <em>error_code</em> is one of the
<a class="reference internal" href="#nghttp2_error_code" title="nghttp2_error_code"><tt class="xref c c-macro docutils literal"><span class="pre">nghttp2_error_code</span></tt></a> and indicates the error. When this <a class="reference internal" href="#nghttp2_error_code" title="nghttp2_error_code"><tt class="xref c c-macro docutils literal"><span class="pre">nghttp2_error_code</span></tt></a> and indicates the error. When this
callback function is invoked, the library automatically submits callback function is invoked, the library automatically submits
either RST_STREAM or GOAWAY frame.</p> either RST_STREAM or GOAWAY frame. The <em>user_data</em> pointer is the
third argument passed in to the call to
<a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1151,7 +1159,9 @@ to. The <em>flags</em> is the flags of DATA frame which this data chunk is
contained. <tt class="docutils literal"><span class="pre">(flags</span> <span class="pre">&amp;</span> <span class="pre">NGHTTP2_FLAG_END_STREAM)</span> <span class="pre">!=</span> <span class="pre">0</span></tt> does not contained. <tt class="docutils literal"><span class="pre">(flags</span> <span class="pre">&amp;</span> <span class="pre">NGHTTP2_FLAG_END_STREAM)</span> <span class="pre">!=</span> <span class="pre">0</span></tt> does not
necessarily mean this chunk of data is the last one in the necessarily mean this chunk of data is the last one in the
stream. You should use <a class="reference internal" href="#nghttp2_on_data_recv_callback" title="nghttp2_on_data_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_data_recv_callback</span></tt></a> to stream. You should use <a class="reference internal" href="#nghttp2_on_data_recv_callback" title="nghttp2_on_data_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_data_recv_callback</span></tt></a> to
know all data frames are received.</p> know all data frames are received. The <em>user_data</em> pointer is the
third argument passed in to the call to
<a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1163,7 +1173,9 @@ immediately return <a class="reference internal" href="#NGHTTP2_ERR_CALLBACK_FAI
typedef int <tt class="descname">(*nghttp2_on_data_recv_callback)</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, uint16_t<em>&nbsp;length</em>, uint8_t<em>&nbsp;flags</em>, int32_t<em>&nbsp;stream_id</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_on_data_recv_callback" title="Permalink to this definition"></a></dt> typedef int <tt class="descname">(*nghttp2_on_data_recv_callback)</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, uint16_t<em>&nbsp;length</em>, uint8_t<em>&nbsp;flags</em>, int32_t<em>&nbsp;stream_id</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_on_data_recv_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked when DATA frame is received. The actual <dd><p>Callback function invoked when DATA frame is received. The actual
data it contains are received by data it contains are received by
<a class="reference internal" href="#nghttp2_on_data_chunk_recv_callback" title="nghttp2_on_data_chunk_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_data_chunk_recv_callback</span></tt></a>.</p> <a class="reference internal" href="#nghttp2_on_data_chunk_recv_callback" title="nghttp2_on_data_chunk_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_data_chunk_recv_callback</span></tt></a>. The <em>user_data</em>
pointer is the third argument passed in to the call to
<a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1177,7 +1189,9 @@ typedef int <tt class="descname">(*nghttp2_before_frame_send_callback)</tt><big>
sent. This may be useful, for example, to know the stream ID of sent. This may be useful, for example, to know the stream ID of
HEADERS and PUSH_PROMISE frame (see also HEADERS and PUSH_PROMISE frame (see also
<a class="reference internal" href="#nghttp2_session_get_stream_user_data" title="nghttp2_session_get_stream_user_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_get_stream_user_data()</span></tt></a>), which is not assigned <a class="reference internal" href="#nghttp2_session_get_stream_user_data" title="nghttp2_session_get_stream_user_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_get_stream_user_data()</span></tt></a>), which is not assigned
when it was queued.</p> when it was queued. The <em>user_data</em> pointer is the third argument
passed in to the call to <a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1187,7 +1201,10 @@ immediately return <a class="reference internal" href="#NGHTTP2_ERR_CALLBACK_FAI
<dl class="type"> <dl class="type">
<dt id="nghttp2_on_frame_send_callback"> <dt id="nghttp2_on_frame_send_callback">
typedef int <tt class="descname">(*nghttp2_on_frame_send_callback)</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_on_frame_send_callback" title="Permalink to this definition"></a></dt> typedef int <tt class="descname">(*nghttp2_on_frame_send_callback)</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_on_frame_send_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked after the non-DATA frame <em>frame</em> is sent.</p> <dd><p>Callback function invoked after the non-DATA frame <em>frame</em> is sent.
The <em>user_data</em> pointer is the third argument passed in to the call
to <a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1200,7 +1217,9 @@ typedef int <tt class="descname">(*nghttp2_on_frame_not_send_callback)</tt><big>
<dd><p>Callback function invoked after the non-DATA frame <em>frame</em> is not <dd><p>Callback function invoked after the non-DATA frame <em>frame</em> is not
sent because of the error. The error is indicated by the sent because of the error. The error is indicated by the
<em>lib_error_code</em>, which is one of the values defined in <em>lib_error_code</em>, which is one of the values defined in
<a class="reference internal" href="#nghttp2_error" title="nghttp2_error"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_error</span></tt></a>.</p> <a class="reference internal" href="#nghttp2_error" title="nghttp2_error"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_error</span></tt></a>. The <em>user_data</em> pointer is the third
argument passed in to the call to <a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1210,7 +1229,9 @@ immediately return <a class="reference internal" href="#NGHTTP2_ERR_CALLBACK_FAI
<dl class="type"> <dl class="type">
<dt id="nghttp2_on_data_send_callback"> <dt id="nghttp2_on_data_send_callback">
typedef int <tt class="descname">(*nghttp2_on_data_send_callback)</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, uint16_t<em>&nbsp;length</em>, uint8_t<em>&nbsp;flags</em>, int32_t<em>&nbsp;stream_id</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_on_data_send_callback" title="Permalink to this definition"></a></dt> typedef int <tt class="descname">(*nghttp2_on_data_send_callback)</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, uint16_t<em>&nbsp;length</em>, uint8_t<em>&nbsp;flags</em>, int32_t<em>&nbsp;stream_id</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_on_data_send_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked after DATA frame is sent.</p> <dd><p>Callback function invoked after DATA frame is sent. The <em>user_data</em>
pointer is the third argument passed in to the call to
<a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1221,10 +1242,12 @@ immediately return <a class="reference internal" href="#NGHTTP2_ERR_CALLBACK_FAI
<dt id="nghttp2_on_stream_close_callback"> <dt id="nghttp2_on_stream_close_callback">
typedef int <tt class="descname">(*nghttp2_on_stream_close_callback)</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, int32_t<em>&nbsp;stream_id</em>, <a class="reference internal" href="#nghttp2_error_code" title="nghttp2_error_code">nghttp2_error_code</a><em>&nbsp;error_code</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_on_stream_close_callback" title="Permalink to this definition"></a></dt> typedef int <tt class="descname">(*nghttp2_on_stream_close_callback)</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, int32_t<em>&nbsp;stream_id</em>, <a class="reference internal" href="#nghttp2_error_code" title="nghttp2_error_code">nghttp2_error_code</a><em>&nbsp;error_code</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_on_stream_close_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked when the stream <em>stream_id</em> is <dd><p>Callback function invoked when the stream <em>stream_id</em> is
closed. The reason of closure is indicated by the closed. The reason of closure is indicated by the <em>error_code</em>. The
<em>error_code</em>. The stream_user_data, which was specified in stream_user_data, which was specified in <a class="reference internal" href="#nghttp2_submit_request" title="nghttp2_submit_request"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_request()</span></tt></a>
<a class="reference internal" href="#nghttp2_submit_request" title="nghttp2_submit_request"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_request()</span></tt></a> or <a class="reference internal" href="#nghttp2_submit_headers" title="nghttp2_submit_headers"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_headers()</span></tt></a>, is or <a class="reference internal" href="#nghttp2_submit_headers" title="nghttp2_submit_headers"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_headers()</span></tt></a>, is still available in this
still available in this function.</p> function. The <em>user_data</em> pointer is the third argument passed in
to the call to <a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1237,7 +1260,9 @@ typedef int <tt class="descname">(*nghttp2_on_request_recv_callback)</tt><big>(<
<dd><p>Callback function invoked when the request from the remote peer is <dd><p>Callback function invoked when the request from the remote peer is
received. In other words, the frame with END_STREAM flag set is received. In other words, the frame with END_STREAM flag set is
received. In HTTP, this means HTTP request, including request received. In HTTP, this means HTTP request, including request
body, is fully received.</p> body, is fully received. The <em>user_data</em> pointer is the third
argument passed in to the call to <a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1255,8 +1280,10 @@ the received frame. The <em>headlen</em> is the length of the
words, the <em>head</em> is the first 8 bytes of the received frame. The words, the <em>head</em> is the first 8 bytes of the received frame. The
<em>payload</em> is the pointer to the data portion of the received frame. <em>payload</em> is the pointer to the data portion of the received frame.
The <em>payloadlen</em> is the length of the <em>payload</em>. This is the data The <em>payloadlen</em> is the length of the <em>payload</em>. This is the data
after the length field. The <em>lib_error_code</em> is one of the error code after the length field. The <em>lib_error_code</em> is one of the error
defined in <a class="reference internal" href="#nghttp2_error" title="nghttp2_error"><tt class="xref c c-macro docutils literal"><span class="pre">nghttp2_error</span></tt></a> and indicates the error.</p> code defined in <a class="reference internal" href="#nghttp2_error" title="nghttp2_error"><tt class="xref c c-macro docutils literal"><span class="pre">nghttp2_error</span></tt></a> and indicates the error. The
<em>user_data</em> pointer is the third argument passed in to the call to
<a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1272,7 +1299,10 @@ frame. The <em>headlen</em> is the length of the <em>head</em>. According to the
spec, the <em>headlen</em> is always 8. In other words, the <em>head</em> is the spec, the <em>headlen</em> is always 8. In other words, the <em>head</em> is the
first 8 bytes of the received frame. The <em>payload</em> is the pointer first 8 bytes of the received frame. The <em>payload</em> is the pointer
to the data portion of the received frame. The <em>payloadlen</em> is the to the data portion of the received frame. The <em>payloadlen</em> is the
length of the <em>payload</em>. This is the data after the length field.</p> length of the <em>payload</em>. This is the data after the length
field. The <em>user_data</em> pointer is the third argument passed in to
the call to <a class="reference internal" href="#nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>.</p>
<p>The implementation of this function must return 0 if it <p>The implementation of this function must return 0 if it
succeeds. If nonzero is returned, it is treated as fatal error and succeeds. If nonzero is returned, it is treated as fatal error and
<a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions <a class="reference internal" href="#nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
@ -1721,7 +1751,7 @@ may reorder the pointers in <em>iv</em>. The <em>buf</em> must have enough regio
to hold serialized data. The required space for the <em>niv</em> entries to hold serialized data. The required space for the <em>niv</em> entries
are <tt class="docutils literal"><span class="pre">8*niv</span></tt> bytes. This function is used mainly for creating are <tt class="docutils literal"><span class="pre">8*niv</span></tt> bytes. This function is used mainly for creating
SETTINGS payload to be sent with <tt class="docutils literal"><span class="pre">HTTP2-Settings</span></tt> header field in SETTINGS payload to be sent with <tt class="docutils literal"><span class="pre">HTTP2-Settings</span></tt> header field in
HTTP Upgrade request. The data written in <em>buf</em> is not still HTTP Upgrade request. The data written in <em>buf</em> is NOT
base64url encoded and the application is responsible for encoding.</p> base64url encoded and the application is responsible for encoding.</p>
<p>This function returns the number of bytes written in <em>buf</em>, or one <p>This function returns the number of bytes written in <em>buf</em>, or one
of the following negative error codes:</p> of the following negative error codes:</p>

View File

@ -843,7 +843,9 @@
<span class="cm"> * not used and always 0. It must return the number of bytes sent if</span> <span class="cm"> * not used and always 0. It must return the number of bytes sent if</span>
<span class="cm"> * it succeeds. If it cannot send any single byte without blocking,</span> <span class="cm"> * it succeeds. If it cannot send any single byte without blocking,</span>
<span class="cm"> * it must return :enum:`NGHTTP2_ERR_WOULDBLOCK`. For other errors, it</span> <span class="cm"> * it must return :enum:`NGHTTP2_ERR_WOULDBLOCK`. For other errors, it</span>
<span class="cm"> * must return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.</span> <span class="cm"> * must return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. The |user_data|</span>
<span class="cm"> * pointer is the third argument passed in to the call to</span>
<span class="cm"> * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.</span>
<span class="cm"> */</span> <span class="cm"> */</span>
<span class="k">typedef</span> <span class="nf">ssize_t</span> <span class="p">(</span><span class="o">*</span><span class="n">nghttp2_send_callback</span><span class="p">)</span> <span class="k">typedef</span> <span class="nf">ssize_t</span> <span class="p">(</span><span class="o">*</span><span class="n">nghttp2_send_callback</span><span class="p">)</span>
<span class="p">(</span><span class="n">nghttp2_session</span> <span class="o">*</span><span class="n">session</span><span class="p">,</span> <span class="p">(</span><span class="n">nghttp2_session</span> <span class="o">*</span><span class="n">session</span><span class="p">,</span>
@ -861,7 +863,9 @@
<span class="cm"> * it gets EOF before it reads any single byte, it must return</span> <span class="cm"> * it gets EOF before it reads any single byte, it must return</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_EOF`. For other errors, it must return</span> <span class="cm"> * :enum:`NGHTTP2_ERR_EOF`. For other errors, it must return</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Returning 0 is treated as</span> <span class="cm"> * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Returning 0 is treated as</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_WOULDBLOCK`.</span> <span class="cm"> * :enum:`NGHTTP2_ERR_WOULDBLOCK`. The |user_data| pointer is the</span>
<span class="cm"> * third argument passed in to the call to</span>
<span class="cm"> * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.</span>
<span class="cm"> */</span> <span class="cm"> */</span>
<span class="k">typedef</span> <span class="nf">ssize_t</span> <span class="p">(</span><span class="o">*</span><span class="n">nghttp2_recv_callback</span><span class="p">)</span> <span class="k">typedef</span> <span class="nf">ssize_t</span> <span class="p">(</span><span class="o">*</span><span class="n">nghttp2_recv_callback</span><span class="p">)</span>
<span class="p">(</span><span class="n">nghttp2_session</span> <span class="o">*</span><span class="n">session</span><span class="p">,</span> <span class="p">(</span><span class="n">nghttp2_session</span> <span class="o">*</span><span class="n">session</span><span class="p">,</span>
@ -871,7 +875,9 @@
<span class="cm"> * @functypedef</span> <span class="cm"> * @functypedef</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * Callback function invoked by `nghttp2_session_recv()` when a</span> <span class="cm"> * Callback function invoked by `nghttp2_session_recv()` when a</span>
<span class="cm"> * non-DATA frame is received.</span> <span class="cm"> * non-DATA frame is received. The |user_data| pointer is the third</span>
<span class="cm"> * argument passed in to the call to `nghttp2_session_client_new()` or</span>
<span class="cm"> * `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -888,7 +894,9 @@
<span class="cm"> * invalid non-DATA frame is received. The |error_code| is one of the</span> <span class="cm"> * invalid non-DATA frame is received. The |error_code| is one of the</span>
<span class="cm"> * :enum:`nghttp2_error_code` and indicates the error. When this</span> <span class="cm"> * :enum:`nghttp2_error_code` and indicates the error. When this</span>
<span class="cm"> * callback function is invoked, the library automatically submits</span> <span class="cm"> * callback function is invoked, the library automatically submits</span>
<span class="cm"> * either RST_STREAM or GOAWAY frame.</span> <span class="cm"> * either RST_STREAM or GOAWAY frame. The |user_data| pointer is the</span>
<span class="cm"> * third argument passed in to the call to</span>
<span class="cm"> * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -908,7 +916,9 @@
<span class="cm"> * contained. ``(flags &amp; NGHTTP2_FLAG_END_STREAM) != 0`` does not</span> <span class="cm"> * contained. ``(flags &amp; NGHTTP2_FLAG_END_STREAM) != 0`` does not</span>
<span class="cm"> * necessarily mean this chunk of data is the last one in the</span> <span class="cm"> * necessarily mean this chunk of data is the last one in the</span>
<span class="cm"> * stream. You should use :type:`nghttp2_on_data_recv_callback` to</span> <span class="cm"> * stream. You should use :type:`nghttp2_on_data_recv_callback` to</span>
<span class="cm"> * know all data frames are received.</span> <span class="cm"> * know all data frames are received. The |user_data| pointer is the</span>
<span class="cm"> * third argument passed in to the call to</span>
<span class="cm"> * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -924,7 +934,9 @@
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * Callback function invoked when DATA frame is received. The actual</span> <span class="cm"> * Callback function invoked when DATA frame is received. The actual</span>
<span class="cm"> * data it contains are received by</span> <span class="cm"> * data it contains are received by</span>
<span class="cm"> * :type:`nghttp2_on_data_chunk_recv_callback`.</span> <span class="cm"> * :type:`nghttp2_on_data_chunk_recv_callback`. The |user_data|</span>
<span class="cm"> * pointer is the third argument passed in to the call to</span>
<span class="cm"> * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -942,7 +954,9 @@
<span class="cm"> * sent. This may be useful, for example, to know the stream ID of</span> <span class="cm"> * sent. This may be useful, for example, to know the stream ID of</span>
<span class="cm"> * HEADERS and PUSH_PROMISE frame (see also</span> <span class="cm"> * HEADERS and PUSH_PROMISE frame (see also</span>
<span class="cm"> * `nghttp2_session_get_stream_user_data()`), which is not assigned</span> <span class="cm"> * `nghttp2_session_get_stream_user_data()`), which is not assigned</span>
<span class="cm"> * when it was queued.</span> <span class="cm"> * when it was queued. The |user_data| pointer is the third argument</span>
<span class="cm"> * passed in to the call to `nghttp2_session_client_new()` or</span>
<span class="cm"> * `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -956,6 +970,9 @@
<span class="cm"> * @functypedef</span> <span class="cm"> * @functypedef</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * Callback function invoked after the non-DATA frame |frame| is sent.</span> <span class="cm"> * Callback function invoked after the non-DATA frame |frame| is sent.</span>
<span class="cm"> * The |user_data| pointer is the third argument passed in to the call</span>
<span class="cm"> * to `nghttp2_session_client_new()` or</span>
<span class="cm"> * `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -971,7 +988,9 @@
<span class="cm"> * Callback function invoked after the non-DATA frame |frame| is not</span> <span class="cm"> * Callback function invoked after the non-DATA frame |frame| is not</span>
<span class="cm"> * sent because of the error. The error is indicated by the</span> <span class="cm"> * sent because of the error. The error is indicated by the</span>
<span class="cm"> * |lib_error_code|, which is one of the values defined in</span> <span class="cm"> * |lib_error_code|, which is one of the values defined in</span>
<span class="cm"> * :type:`nghttp2_error`.</span> <span class="cm"> * :type:`nghttp2_error`. The |user_data| pointer is the third</span>
<span class="cm"> * argument passed in to the call to `nghttp2_session_client_new()` or</span>
<span class="cm"> * `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -985,7 +1004,9 @@
<span class="cm">/**</span> <span class="cm">/**</span>
<span class="cm"> * @functypedef</span> <span class="cm"> * @functypedef</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * Callback function invoked after DATA frame is sent.</span> <span class="cm"> * Callback function invoked after DATA frame is sent. The |user_data|</span>
<span class="cm"> * pointer is the third argument passed in to the call to</span>
<span class="cm"> * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -1000,10 +1021,12 @@
<span class="cm"> * @functypedef</span> <span class="cm"> * @functypedef</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * Callback function invoked when the stream |stream_id| is</span> <span class="cm"> * Callback function invoked when the stream |stream_id| is</span>
<span class="cm"> * closed. The reason of closure is indicated by the</span> <span class="cm"> * closed. The reason of closure is indicated by the |error_code|. The</span>
<span class="cm"> * |error_code|. The stream_user_data, which was specified in</span> <span class="cm"> * stream_user_data, which was specified in `nghttp2_submit_request()`</span>
<span class="cm"> * `nghttp2_submit_request()` or `nghttp2_submit_headers()`, is</span> <span class="cm"> * or `nghttp2_submit_headers()`, is still available in this</span>
<span class="cm"> * still available in this function.</span> <span class="cm"> * function. The |user_data| pointer is the third argument passed in</span>
<span class="cm"> * to the call to `nghttp2_session_client_new()` or</span>
<span class="cm"> * `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -1020,7 +1043,9 @@
<span class="cm"> * Callback function invoked when the request from the remote peer is</span> <span class="cm"> * Callback function invoked when the request from the remote peer is</span>
<span class="cm"> * received. In other words, the frame with END_STREAM flag set is</span> <span class="cm"> * received. In other words, the frame with END_STREAM flag set is</span>
<span class="cm"> * received. In HTTP, this means HTTP request, including request</span> <span class="cm"> * received. In HTTP, this means HTTP request, including request</span>
<span class="cm"> * body, is fully received.</span> <span class="cm"> * body, is fully received. The |user_data| pointer is the third</span>
<span class="cm"> * argument passed in to the call to `nghttp2_session_client_new()` or</span>
<span class="cm"> * `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -1041,8 +1066,10 @@
<span class="cm"> * words, the |head| is the first 8 bytes of the received frame. The</span> <span class="cm"> * words, the |head| is the first 8 bytes of the received frame. The</span>
<span class="cm"> * |payload| is the pointer to the data portion of the received frame.</span> <span class="cm"> * |payload| is the pointer to the data portion of the received frame.</span>
<span class="cm"> * The |payloadlen| is the length of the |payload|. This is the data</span> <span class="cm"> * The |payloadlen| is the length of the |payload|. This is the data</span>
<span class="cm"> * after the length field. The |lib_error_code| is one of the error code</span> <span class="cm"> * after the length field. The |lib_error_code| is one of the error</span>
<span class="cm"> * defined in :enum:`nghttp2_error` and indicates the error.</span> <span class="cm"> * code defined in :enum:`nghttp2_error` and indicates the error. The</span>
<span class="cm"> * |user_data| pointer is the third argument passed in to the call to</span>
<span class="cm"> * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -1064,7 +1091,10 @@
<span class="cm"> * spec, the |headlen| is always 8. In other words, the |head| is the</span> <span class="cm"> * spec, the |headlen| is always 8. In other words, the |head| is the</span>
<span class="cm"> * first 8 bytes of the received frame. The |payload| is the pointer</span> <span class="cm"> * first 8 bytes of the received frame. The |payload| is the pointer</span>
<span class="cm"> * to the data portion of the received frame. The |payloadlen| is the</span> <span class="cm"> * to the data portion of the received frame. The |payloadlen| is the</span>
<span class="cm"> * length of the |payload|. This is the data after the length field.</span> <span class="cm"> * length of the |payload|. This is the data after the length</span>
<span class="cm"> * field. The |user_data| pointer is the third argument passed in to</span>
<span class="cm"> * the call to `nghttp2_session_client_new()` or</span>
<span class="cm"> * `nghttp2_session_server_new()`.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span> <span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span> <span class="cm"> * succeeds. If nonzero is returned, it is treated as fatal error and</span>
@ -1534,7 +1564,7 @@
<span class="cm"> * to hold serialized data. The required space for the |niv| entries</span> <span class="cm"> * to hold serialized data. The required space for the |niv| entries</span>
<span class="cm"> * are ``8*niv`` bytes. This function is used mainly for creating</span> <span class="cm"> * are ``8*niv`` bytes. This function is used mainly for creating</span>
<span class="cm"> * SETTINGS payload to be sent with ``HTTP2-Settings`` header field in</span> <span class="cm"> * SETTINGS payload to be sent with ``HTTP2-Settings`` header field in</span>
<span class="cm"> * HTTP Upgrade request. The data written in |buf| is not still</span> <span class="cm"> * HTTP Upgrade request. The data written in |buf| is NOT</span>
<span class="cm"> * base64url encoded and the application is responsible for encoding.</span> <span class="cm"> * base64url encoded and the application is responsible for encoding.</span>
<span class="cm"> *</span> <span class="cm"> *</span>
<span class="cm"> * This function returns the number of bytes written in |buf|, or one</span> <span class="cm"> * This function returns the number of bytes written in |buf|, or one</span>

Binary file not shown.

File diff suppressed because one or more lines are too long