Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2014-01-28 01:20:50 +09:00
parent 608c70d398
commit cd0b716f08
6 changed files with 119 additions and 190 deletions

View File

@ -595,6 +595,14 @@ Types (structs, unions and typedefs)
The callback function to read a chunk of data from the *source*.
.. type:: nghttp2_data
The DATA frame. The received data is delivered via
:type:`nghttp2_on_data_chunk_recv_callback`.
.. type:: nghttp2_headers
The HEADERS frame. It has the following members:
@ -741,6 +749,9 @@ Types (structs, unions and typedefs)
.. member:: nghttp2_frame_hd hd
The frame header, which is convenient to inspect frame header.
.. member:: nghttp2_data data
The DATA frame.
.. member:: nghttp2_headers headers
The HEADERS frame.
@ -799,9 +810,9 @@ Types (structs, unions and typedefs)
.. 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
non-DATA frame is received. The *user_data* pointer is the third
argument passed in to the call to `nghttp2_session_client_new()` or
Callback function invoked by `nghttp2_session_recv()` when a aframe
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()`.
If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen``
@ -846,7 +857,7 @@ Types (structs, unions and typedefs)
to. The *flags* is the flags of DATA frame which this data chunk is
contained. ``(flags & NGHTTP2_FLAG_END_STREAM) != 0`` does not
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_frame_recv_callback` to
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()`.
@ -865,20 +876,6 @@ Types (structs, unions and typedefs)
`nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions
immediately return :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef int (*nghttp2_on_data_recv_callback) (nghttp2_session *session, uint16_t length, uint8_t flags, int32_t stream_id, void *user_data)
Callback function invoked when DATA frame is received. The actual
data it contains are received by
: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
succeeds. If nonzero is returned, it is treated as fatal error and
`nghttp2_session_recv()` and `nghttp2_session_send()` functions
immediately return :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef int (*nghttp2_before_frame_send_callback) (nghttp2_session *session, const nghttp2_frame *frame, void *user_data)
@ -898,10 +895,9 @@ Types (structs, unions and typedefs)
.. type:: typedef int (*nghttp2_on_frame_send_callback) (nghttp2_session *session, const nghttp2_frame *frame, void *user_data)
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()`.
Callback function invoked after the 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. If nonzero is returned, it is treated as fatal error and
@ -923,18 +919,6 @@ Types (structs, unions and typedefs)
`nghttp2_session_recv()` and `nghttp2_session_send()` functions
immediately return :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. 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. 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. If nonzero is returned, it is treated as fatal error and
`nghttp2_session_recv()` and `nghttp2_session_send()` functions
immediately return :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
.. type:: typedef int (*nghttp2_on_stream_close_callback) (nghttp2_session *session, int32_t stream_id, nghttp2_error_code error_code, void *user_data)
@ -1008,9 +992,18 @@ Types (structs, unions and typedefs)
to produce these parameters, because it may refer to the memory
region included in the input bytes.
Returning :macro:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will close
the stream by issuing RST_STREAM with
:macro:`NGHTTP2_INTERNAL_ERROR`. In this case,
:type:`nghttp2_on_end_headers_callback` will not be invoked.
The implementation of this function must return 0 if it
succeeds. It may return :macro:`NGHTTP2_ERR_PAUSE`. If the other
nonzero value is returned, it is treated as fatal error and
succeeds. It may return :macro:`NGHTTP2_ERR_PAUSE` or
:macro:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. For other critical
failures, it must return :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`. If
the other nonzero value is returned, it is treated as
:macro:`NGHTTP2_ERR_CALLBACK_FAILURE`. If
:macro:`NGHTTP2_ERR_CALLBACK_FAILURE` is returned,
`nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions
immediately return :macro:`NGHTTP2_ERR_CALLBACK_FAILURE`.
@ -1050,7 +1043,7 @@ Types (structs, unions and typedefs)
.. member:: nghttp2_on_frame_recv_callback on_frame_recv_callback
Callback function invoked by `nghttp2_session_recv()` when a
non-DATA frame is received.
frame is received.
.. member:: nghttp2_on_invalid_frame_recv_callback on_invalid_frame_recv_callback
Callback function invoked by `nghttp2_session_recv()` when an
@ -1059,22 +1052,16 @@ Types (structs, unions and typedefs)
Callback function invoked when a chunk of data in DATA frame is
received.
.. member:: nghttp2_on_data_recv_callback on_data_recv_callback
Callback function invoked when DATA frame is received.
.. member:: nghttp2_before_frame_send_callback before_frame_send_callback
Callback function invoked before the non-DATA frame is sent.
Callback function invoked before a non-DATA frame is sent.
.. member:: nghttp2_on_frame_send_callback on_frame_send_callback
Callback function invoked after the non-DATA frame is sent.
Callback function invoked after a frame is sent.
.. member:: nghttp2_on_frame_not_send_callback on_frame_not_send_callback
The callback function invoked when a non-DATA frame is not sent
because of an error.
.. member:: nghttp2_on_data_send_callback on_data_send_callback
Callback function invoked after DATA frame is sent.
.. member:: nghttp2_on_stream_close_callback on_stream_close_callback
Callback function invoked when the stream is closed.
@ -1236,13 +1223,9 @@ Functions
invoked.
6. :member:`nghttp2_session_callbacks.send_callback` is invoked one
or more times to send the frame.
7. If the frame is a control frame,
:member:`nghttp2_session_callbacks.on_frame_send_callback` is
7. :member:`nghttp2_session_callbacks.on_frame_send_callback` is
invoked.
8. If the frame is a DATA frame,
:member:`nghttp2_session_callbacks.on_data_send_callback` is
invoked.
9. If the transmission of the frame triggers closure of the stream,
8. If the transmission of the frame triggers closure of the stream,
the stream is closed and
:member:`nghttp2_session_callbacks.on_stream_close_callback` is
invoked.
@ -1276,7 +1259,7 @@ Functions
:member:`nghttp2_session_callbacks.on_data_chunk_recv_callback`
is invoked.
2. If one DATA frame is completely received,
:member:`nghttp2_session_callbacks.on_data_recv_callback` is
:member:`nghttp2_session_callbacks.on_frame_recv_callback` is
invoked. If the frame is the final frame of the request,
:member:`nghttp2_session_callbacks.on_request_recv_callback`
is invoked. If the reception of the frame triggers the

View File

@ -998,6 +998,13 @@ of data from it.</p>
</dd></dl>
<dl class="type">
<dt id="nghttp2_data">
<tt class="descname">nghttp2_data</tt><a class="headerlink" href="#nghttp2_data" title="Permalink to this definition"></a></dt>
<dd><p>The DATA frame. The received data is delivered via
<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>
</dd></dl>
<dl class="type">
<dt id="nghttp2_headers">
<tt class="descname">nghttp2_headers</tt><a class="headerlink" href="#nghttp2_headers" title="Permalink to this definition"></a></dt>
@ -1226,6 +1233,12 @@ omitted from here.</p>
<dd><p>The frame header, which is convenient to inspect frame header.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_frame.data">
<a class="reference internal" href="#nghttp2_data" title="nghttp2_data">nghttp2_data</a> <tt class="descname">data</tt><a class="headerlink" href="#nghttp2_frame.data" title="Permalink to this definition"></a></dt>
<dd><p>The DATA frame.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_frame.headers">
<a class="reference internal" href="#nghttp2_headers" title="nghttp2_headers">nghttp2_headers</a> <tt class="descname">headers</tt><a class="headerlink" href="#nghttp2_frame.headers" title="Permalink to this definition"></a></dt>
@ -1310,9 +1323,9 @@ third argument passed in to the call to
<dl class="type">
<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>
<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. 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
<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 aframe
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>If frame is HEADERS or PUSH_PROMISE, the <tt class="docutils literal"><span class="pre">nva</span></tt> and <tt class="docutils literal"><span class="pre">nvlen</span></tt>
member of their data structure are always <tt class="docutils literal"><span class="pre">NULL</span></tt> and 0
@ -1354,7 +1367,7 @@ received. The <em>stream_id</em> is the stream ID this DATA frame belongs
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
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_frame_recv_callback" title="nghttp2_on_frame_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_frame_recv_callback</span></tt></a> to
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>
@ -1372,20 +1385,6 @@ succeeds. If nonzero is returned, it is treated as fatal error and
immediately 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>
</dd></dl>
<dl class="type">
<dt id="nghttp2_on_data_recv_callback">
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
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>. 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
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
immediately 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>
</dd></dl>
<dl class="type">
<dt id="nghttp2_before_frame_send_callback">
typedef int <tt class="descname">(*nghttp2_before_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_before_frame_send_callback" title="Permalink to this definition"></a></dt>
@ -1405,10 +1404,9 @@ immediately return <a class="reference internal" href="#NGHTTP2_ERR_CALLBACK_FAI
<dl class="type">
<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>
<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>
<dd><p>Callback function invoked after the 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
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
@ -1430,18 +1428,6 @@ succeeds. If nonzero is returned, it is treated as fatal error and
immediately 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>
</dd></dl>
<dl class="type">
<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>
<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
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
immediately 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>
</dd></dl>
<dl class="type">
<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>
@ -1512,9 +1498,17 @@ by <em>frame</em>, <em>name</em> and <em>value</em> parameters are retained unti
called. The application must retain the input bytes which was used
to produce these parameters, because it may refer to the memory
region included in the input bytes.</p>
<p>Returning <a class="reference internal" href="#NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE" title="NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE</span></tt></a> will close
the stream by issuing RST_STREAM with
<a class="reference internal" href="#NGHTTP2_INTERNAL_ERROR" title="NGHTTP2_INTERNAL_ERROR"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_INTERNAL_ERROR</span></tt></a>. In this case,
<a class="reference internal" href="#nghttp2_on_end_headers_callback" title="nghttp2_on_end_headers_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_end_headers_callback</span></tt></a> will not be invoked.</p>
<p>The implementation of this function must return 0 if it
succeeds. It may return <a class="reference internal" href="#NGHTTP2_ERR_PAUSE" title="NGHTTP2_ERR_PAUSE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PAUSE</span></tt></a>. If the other
nonzero value is returned, it is treated as fatal error and
succeeds. It may return <a class="reference internal" href="#NGHTTP2_ERR_PAUSE" title="NGHTTP2_ERR_PAUSE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PAUSE</span></tt></a> or
<a class="reference internal" href="#NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE" title="NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE</span></tt></a>. For other critical
failures, 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>. If
the other nonzero value is returned, it 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>. If
<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> is returned,
<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_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a> functions
immediately 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>
</dd></dl>
@ -1560,7 +1554,7 @@ data from the remote peer.</p>
<dt id="nghttp2_session_callbacks.on_frame_recv_callback">
<a class="reference internal" href="#nghttp2_on_frame_recv_callback" title="nghttp2_on_frame_recv_callback">nghttp2_on_frame_recv_callback</a> <tt class="descname">on_frame_recv_callback</tt><a class="headerlink" href="#nghttp2_session_callbacks.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
non-DATA frame is received.</p>
frame is received.</p>
</dd></dl>
<dl class="member">
@ -1577,22 +1571,16 @@ invalid non-DATA frame is received.</p>
received.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_session_callbacks.on_data_recv_callback">
<a class="reference internal" href="#nghttp2_on_data_recv_callback" title="nghttp2_on_data_recv_callback">nghttp2_on_data_recv_callback</a> <tt class="descname">on_data_recv_callback</tt><a class="headerlink" href="#nghttp2_session_callbacks.on_data_recv_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked when DATA frame is received.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_session_callbacks.before_frame_send_callback">
<a class="reference internal" href="#nghttp2_before_frame_send_callback" title="nghttp2_before_frame_send_callback">nghttp2_before_frame_send_callback</a> <tt class="descname">before_frame_send_callback</tt><a class="headerlink" href="#nghttp2_session_callbacks.before_frame_send_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked before the non-DATA frame is sent.</p>
<dd><p>Callback function invoked before a non-DATA frame is sent.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_session_callbacks.on_frame_send_callback">
<a class="reference internal" href="#nghttp2_on_frame_send_callback" title="nghttp2_on_frame_send_callback">nghttp2_on_frame_send_callback</a> <tt class="descname">on_frame_send_callback</tt><a class="headerlink" href="#nghttp2_session_callbacks.on_frame_send_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked after the non-DATA frame is sent.</p>
<dd><p>Callback function invoked after a frame is sent.</p>
</dd></dl>
<dl class="member">
@ -1602,12 +1590,6 @@ received.</p>
because of an error.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_session_callbacks.on_data_send_callback">
<a class="reference internal" href="#nghttp2_on_data_send_callback" title="nghttp2_on_data_send_callback">nghttp2_on_data_send_callback</a> <tt class="descname">on_data_send_callback</tt><a class="headerlink" href="#nghttp2_session_callbacks.on_data_send_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked after DATA frame is sent.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_session_callbacks.on_stream_close_callback">
<a class="reference internal" href="#nghttp2_on_stream_close_callback" title="nghttp2_on_stream_close_callback">nghttp2_on_stream_close_callback</a> <tt class="descname">on_stream_close_callback</tt><a class="headerlink" href="#nghttp2_session_callbacks.on_stream_close_callback" title="Permalink to this definition"></a></dt>
@ -1791,11 +1773,7 @@ here.</li>
invoked.</li>
<li><a class="reference internal" href="#nghttp2_session_callbacks.send_callback" title="nghttp2_session_callbacks.send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.send_callback</span></tt></a> is invoked one
or more times to send the frame.</li>
<li>If the frame is a control frame,
<a class="reference internal" href="#nghttp2_session_callbacks.on_frame_send_callback" title="nghttp2_session_callbacks.on_frame_send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_frame_send_callback</span></tt></a> is
invoked.</li>
<li>If the frame is a DATA frame,
<a class="reference internal" href="#nghttp2_session_callbacks.on_data_send_callback" title="nghttp2_session_callbacks.on_data_send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_data_send_callback</span></tt></a> is
<li><a class="reference internal" href="#nghttp2_session_callbacks.on_frame_send_callback" title="nghttp2_session_callbacks.on_frame_send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_frame_send_callback</span></tt></a> is
invoked.</li>
<li>If the transmission of the frame triggers closure of the stream,
the stream is closed and
@ -1831,7 +1809,7 @@ to receive DATA payload. For each chunk of data,
<a class="reference internal" href="#nghttp2_session_callbacks.on_data_chunk_recv_callback" title="nghttp2_session_callbacks.on_data_chunk_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_data_chunk_recv_callback</span></tt></a>
is invoked.</li>
<li>If one DATA frame is completely received,
<a class="reference internal" href="#nghttp2_session_callbacks.on_data_recv_callback" title="nghttp2_session_callbacks.on_data_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_data_recv_callback</span></tt></a> is
<a class="reference internal" href="#nghttp2_session_callbacks.on_frame_recv_callback" title="nghttp2_session_callbacks.on_frame_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_frame_recv_callback</span></tt></a> is
invoked. If the frame is the final frame of the request,
<a class="reference internal" href="#nghttp2_session_callbacks.on_request_recv_callback" title="nghttp2_session_callbacks.on_request_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_request_recv_callback</span></tt></a>
is invoked. If the reception of the frame triggers the

View File

@ -175,6 +175,10 @@
</dt>
<dt><a href="apiref.html#nghttp2_data">nghttp2_data (C type)</a>
</dt>
<dt><a href="apiref.html#nghttp2_data_provider">nghttp2_data_provider (C type)</a>
</dt>
@ -371,6 +375,10 @@
</dt>
<dt><a href="apiref.html#nghttp2_frame.data">nghttp2_frame.data (C member)</a>
</dt>
<dt><a href="apiref.html#nghttp2_frame.goaway">nghttp2_frame.goaway (C member)</a>
</dt>
@ -602,21 +610,13 @@
<dt><a href="apiref.html#nghttp2_nv_compare_name">nghttp2_nv_compare_name (C function)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="apiref.html#nghttp2_on_data_chunk_recv_callback">nghttp2_on_data_chunk_recv_callback (C type)</a>
</dt>
<dt><a href="apiref.html#nghttp2_on_data_recv_callback">nghttp2_on_data_recv_callback (C type)</a>
</dt>
<dt><a href="apiref.html#nghttp2_on_data_send_callback">nghttp2_on_data_send_callback (C type)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="apiref.html#nghttp2_on_end_headers_callback">nghttp2_on_end_headers_callback (C type)</a>
</dt>
@ -809,14 +809,6 @@
</dt>
<dt><a href="apiref.html#nghttp2_session_callbacks.on_data_recv_callback">nghttp2_session_callbacks.on_data_recv_callback (C member)</a>
</dt>
<dt><a href="apiref.html#nghttp2_session_callbacks.on_data_send_callback">nghttp2_session_callbacks.on_data_send_callback (C member)</a>
</dt>
<dt><a href="apiref.html#nghttp2_session_callbacks.on_end_headers_callback">nghttp2_session_callbacks.on_end_headers_callback (C member)</a>
</dt>

View File

@ -717,6 +717,16 @@
<span class="n">nghttp2_data_source_read_callback</span> <span class="n">read_callback</span><span class="p">;</span>
<span class="p">}</span> <span class="n">nghttp2_data_provider</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * @struct</span>
<span class="cm"> *</span>
<span class="cm"> * The DATA frame. The received data is delivered via</span>
<span class="cm"> * :type:`nghttp2_on_data_chunk_recv_callback`.</span>
<span class="cm"> */</span>
<span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
<span class="n">nghttp2_frame_hd</span> <span class="n">hd</span><span class="p">;</span>
<span class="p">}</span> <span class="n">nghttp2_data</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * @enum</span>
<span class="cm"> *</span>
@ -934,6 +944,10 @@
<span class="cm"> */</span>
<span class="n">nghttp2_frame_hd</span> <span class="n">hd</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * The DATA frame.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_data</span> <span class="n">data</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * The HEADERS frame.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_headers</span> <span class="n">headers</span><span class="p">;</span>
@ -1007,9 +1021,9 @@
<span class="cm">/**</span>
<span class="cm"> * @functypedef</span>
<span class="cm"> *</span>
<span class="cm"> * Callback function invoked by `nghttp2_session_recv()` when a</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"> * Callback function invoked by `nghttp2_session_recv()` when a aframe</span>
<span class="cm"> * is received. The |user_data| pointer is the third argument passed</span>
<span class="cm"> * 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"> * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen``</span>
@ -1061,7 +1075,7 @@
<span class="cm"> * to. The |flags| is the flags of DATA frame which this data chunk is</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"> * stream. You should use :type:`nghttp2_on_data_recv_callback` to</span>
<span class="cm"> * stream. You should use :type:`nghttp2_on_frame_recv_callback` to</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>
@ -1084,24 +1098,6 @@
<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="kt">uint8_t</span> <span class="n">flags</span><span class="p">,</span> <span class="kt">int32_t</span> <span class="n">stream_id</span><span class="p">,</span>
<span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">data</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">len</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">user_data</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @functypedef</span>
<span class="cm"> *</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"> * :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"> * 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"> * `nghttp2_session_recv()` and `nghttp2_session_send()` functions</span>
<span class="cm"> * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.</span>
<span class="cm"> */</span>
<span class="k">typedef</span> <span class="nf">int</span> <span class="p">(</span><span class="o">*</span><span class="n">nghttp2_on_data_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="kt">uint16_t</span> <span class="n">length</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">flags</span><span class="p">,</span> <span class="kt">int32_t</span> <span class="n">stream_id</span><span class="p">,</span>
<span class="kt">void</span> <span class="o">*</span><span class="n">user_data</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @functypedef</span>
<span class="cm"> *</span>
@ -1124,10 +1120,9 @@
<span class="cm">/**</span>
<span class="cm"> * @functypedef</span>
<span class="cm"> *</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"> * Callback function invoked after the frame |frame| is sent. 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"> * 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>
@ -1156,22 +1151,6 @@
<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="k">const</span> <span class="n">nghttp2_frame</span> <span class="o">*</span><span class="n">frame</span><span class="p">,</span> <span class="kt">int</span> <span class="n">lib_error_code</span><span class="p">,</span>
<span class="kt">void</span> <span class="o">*</span><span class="n">user_data</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @functypedef</span>
<span class="cm"> *</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"> * 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"> * `nghttp2_session_recv()` and `nghttp2_session_send()` functions</span>
<span class="cm"> * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.</span>
<span class="cm"> */</span>
<span class="k">typedef</span> <span class="nf">int</span> <span class="p">(</span><span class="o">*</span><span class="n">nghttp2_on_data_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="kt">uint16_t</span> <span class="n">length</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">flags</span><span class="p">,</span> <span class="kt">int32_t</span> <span class="n">stream_id</span><span class="p">,</span>
<span class="kt">void</span> <span class="o">*</span><span class="n">user_data</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @functypedef</span>
<span class="cm"> *</span>
@ -1258,9 +1237,18 @@
<span class="cm"> * to produce these parameters, because it may refer to the memory</span>
<span class="cm"> * region included in the input bytes.</span>
<span class="cm"> *</span>
<span class="cm"> * Returning :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will close</span>
<span class="cm"> * the stream by issuing RST_STREAM with</span>
<span class="cm"> * :enum:`NGHTTP2_INTERNAL_ERROR`. In this case,</span>
<span class="cm"> * :type:`nghttp2_on_end_headers_callback` will not be invoked.</span>
<span class="cm"> *</span>
<span class="cm"> * The implementation of this function must return 0 if it</span>
<span class="cm"> * succeeds. It may return :enum:`NGHTTP2_ERR_PAUSE`. If the other</span>
<span class="cm"> * nonzero value is returned, it is treated as fatal error and</span>
<span class="cm"> * succeeds. It may return :enum:`NGHTTP2_ERR_PAUSE` or</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. For other critical</span>
<span class="cm"> * failures, it must return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If</span>
<span class="cm"> * the other nonzero value is returned, it is treated as</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. If</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` is returned,</span>
<span class="cm"> * `nghttp2_session_recv()` and `nghttp2_session_mem_recv()` functions</span>
<span class="cm"> * immediately return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.</span>
<span class="cm"> */</span>
@ -1315,7 +1303,7 @@
<span class="n">nghttp2_recv_callback</span> <span class="n">recv_callback</span><span class="p">;</span>
<span class="cm">/**</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"> * frame is received.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_on_frame_recv_callback</span> <span class="n">on_frame_recv_callback</span><span class="p">;</span>
<span class="cm">/**</span>
@ -1329,15 +1317,11 @@
<span class="cm"> */</span>
<span class="n">nghttp2_on_data_chunk_recv_callback</span> <span class="n">on_data_chunk_recv_callback</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Callback function invoked when DATA frame is received.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_on_data_recv_callback</span> <span class="n">on_data_recv_callback</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Callback function invoked before the non-DATA frame is sent.</span>
<span class="cm"> * Callback function invoked before a non-DATA frame is sent.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_before_frame_send_callback</span> <span class="n">before_frame_send_callback</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Callback function invoked after the non-DATA frame is sent.</span>
<span class="cm"> * Callback function invoked after a frame is sent.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_on_frame_send_callback</span> <span class="n">on_frame_send_callback</span><span class="p">;</span>
<span class="cm">/**</span>
@ -1346,10 +1330,6 @@
<span class="cm"> */</span>
<span class="n">nghttp2_on_frame_not_send_callback</span> <span class="n">on_frame_not_send_callback</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Callback function invoked after DATA frame is sent.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_on_data_send_callback</span> <span class="n">on_data_send_callback</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Callback function invoked when the stream is closed.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_on_stream_close_callback</span> <span class="n">on_stream_close_callback</span><span class="p">;</span>
@ -1570,13 +1550,9 @@
<span class="cm"> * invoked.</span>
<span class="cm"> * 6. :member:`nghttp2_session_callbacks.send_callback` is invoked one</span>
<span class="cm"> * or more times to send the frame.</span>
<span class="cm"> * 7. If the frame is a control frame,</span>
<span class="cm"> * :member:`nghttp2_session_callbacks.on_frame_send_callback` is</span>
<span class="cm"> * 7. :member:`nghttp2_session_callbacks.on_frame_send_callback` is</span>
<span class="cm"> * invoked.</span>
<span class="cm"> * 8. If the frame is a DATA frame,</span>
<span class="cm"> * :member:`nghttp2_session_callbacks.on_data_send_callback` is</span>
<span class="cm"> * invoked.</span>
<span class="cm"> * 9. If the transmission of the frame triggers closure of the stream,</span>
<span class="cm"> * 8. If the transmission of the frame triggers closure of the stream,</span>
<span class="cm"> * the stream is closed and</span>
<span class="cm"> * :member:`nghttp2_session_callbacks.on_stream_close_callback` is</span>
<span class="cm"> * invoked.</span>
@ -1612,7 +1588,7 @@
<span class="cm"> * :member:`nghttp2_session_callbacks.on_data_chunk_recv_callback`</span>
<span class="cm"> * is invoked.</span>
<span class="cm"> * 2. If one DATA frame is completely received,</span>
<span class="cm"> * :member:`nghttp2_session_callbacks.on_data_recv_callback` is</span>
<span class="cm"> * :member:`nghttp2_session_callbacks.on_frame_recv_callback` is</span>
<span class="cm"> * invoked. If the frame is the final frame of the request,</span>
<span class="cm"> * :member:`nghttp2_session_callbacks.on_request_recv_callback`</span>
<span class="cm"> * is invoked. If the reception of the frame triggers the</span>

Binary file not shown.

File diff suppressed because one or more lines are too long