Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2013-09-11 00:59:12 +09:00
parent 3a0c0870ef
commit 5761af75d4
6 changed files with 126 additions and 25 deletions

View File

@ -203,6 +203,10 @@ Enums
(``-524``)
Flow control error
.. macro:: NGHTTP2_ERR_INSUFF_BUFSIZE
(``-525``)
Insufficient buffer size given to function.
.. macro:: NGHTTP2_ERR_FATAL
(``-900``)
@ -1299,16 +1303,16 @@ Functions
:macro:`NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS` and
:macro:`NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE`.
.. function:: ssize_t nghttp2_pack_settings_payload(uint8_t *buf, nghttp2_settings_entry *iv, size_t niv)
.. function:: ssize_t nghttp2_pack_settings_payload(uint8_t *buf, size_t buflen, const nghttp2_settings_entry *iv, size_t niv)
Serializes the SETTINGS values *iv* in the *buf*. The number of
entry pointed by *iv* array is given by the *niv*. This function
may reorder the pointers in *iv*. The *buf* must have enough region
to hold serialized data. The required space for the *niv* entries
are ``8*niv`` bytes. This function is used mainly for creating
SETTINGS payload to be sent with ``HTTP2-Settings`` header field in
HTTP Upgrade request. The data written in *buf* is NOT
Serializes the SETTINGS values *iv* in the *buf*. The size of the
*buf* is specified by *buflen*. The number of entries in the *iv*
array is given by *niv*. The required space in *buf* for the *niv*
entries is ``8*niv`` bytes and if the given buffer is too small, an
error is returned. This function is used mainly for creating a
SETTINGS payload to be sent with the ``HTTP2-Settings`` header
field in an HTTP Upgrade request. The data written in *buf* is NOT
base64url encoded and the application is responsible for encoding.
This function returns the number of bytes written in *buf*, or one
@ -1317,6 +1321,9 @@ Functions
:macro:`NGHTTP2_ERR_INVALID_ARGUMENT`
The *iv* contains duplicate settings ID or invalid value.
:macro:`NGHTTP2_ERR_INSUFF_BUFSIZE`
The provided *buflen* size is too small to hold the output.
.. function:: const char* nghttp2_strerror(int lib_error_code)
@ -1354,6 +1361,10 @@ Functions
This function creates copies of all name/value pairs in *nv*. It
also lower-cases all names in *nv*.
The string in *nv* must be NULL-terminated. Use
`nghttp2_submit_request2()` if name/value pairs are not
NULL-terminated strings.
If *data_prd* is not ``NULL``, it provides data which will be sent
in subsequent DATA frames. In this case, a method that allows
request message bodies
@ -1387,6 +1398,23 @@ Functions
:macro:`NGHTTP2_ERR_NOMEM`
Out of memory.
.. function:: int nghttp2_submit_request2(nghttp2_session *session, int32_t pri, const nghttp2_nv *nva, size_t nvlen, const nghttp2_data_provider *data_prd, void *stream_user_data)
Just like `nghttp2_submit_request()`, but this function takes the
*nva*, which is an array of ``nghttp2_nv`` with *nvlen* elements,
as name/value pairs. This function is useful if name/value pairs
are not NULL-terminated strings.
This function returns 0 if it succeeds, or one of the following
negative error codes:
:macro:`NGHTTP2_ERR_INVALID_ARGUMENT`
The *pri* is invalid; or the *nva* includes empty name or
name which contains invalid characters.
:macro:`NGHTTP2_ERR_NOMEM`
Out of memory.
.. function:: int nghttp2_submit_response(nghttp2_session *session, int32_t stream_id, const char **nv, const nghttp2_data_provider *data_prd)

View File

@ -338,6 +338,13 @@ Header block inflate/deflate error.</p>
Flow control error</p>
</dd></dl>
<dl class="macro">
<dt id="NGHTTP2_ERR_INSUFF_BUFSIZE">
<tt class="descname">NGHTTP2_ERR_INSUFF_BUFSIZE</tt><a class="headerlink" href="#NGHTTP2_ERR_INSUFF_BUFSIZE" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">-525</span></tt>)
Insufficient buffer size given to function.</p>
</dd></dl>
<dl class="macro">
<dt id="NGHTTP2_ERR_FATAL">
<tt class="descname">NGHTTP2_ERR_FATAL</tt><a class="headerlink" href="#NGHTTP2_ERR_FATAL" title="Permalink to this definition"></a></dt>
@ -1744,20 +1751,22 @@ or the <em>settings_payload</em> does not include both
<dl class="function">
<dt id="nghttp2_pack_settings_payload">
ssize_t <tt class="descname">nghttp2_pack_settings_payload</tt><big>(</big>uint8_t<em>&nbsp;*buf</em>, <a class="reference internal" href="#nghttp2_settings_entry" title="nghttp2_settings_entry">nghttp2_settings_entry</a><em>&nbsp;*iv</em>, size_t<em>&nbsp;niv</em><big>)</big><a class="headerlink" href="#nghttp2_pack_settings_payload" title="Permalink to this definition"></a></dt>
<dd><p>Serializes the SETTINGS values <em>iv</em> in the <em>buf</em>. The number of
entry pointed by <em>iv</em> array is given by the <em>niv</em>. This function
may reorder the pointers in <em>iv</em>. The <em>buf</em> must have enough region
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
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
ssize_t <tt class="descname">nghttp2_pack_settings_payload</tt><big>(</big>uint8_t<em>&nbsp;*buf</em>, size_t<em>&nbsp;buflen</em>, const <a class="reference internal" href="#nghttp2_settings_entry" title="nghttp2_settings_entry">nghttp2_settings_entry</a><em>&nbsp;*iv</em>, size_t<em>&nbsp;niv</em><big>)</big><a class="headerlink" href="#nghttp2_pack_settings_payload" title="Permalink to this definition"></a></dt>
<dd><p>Serializes the SETTINGS values <em>iv</em> in the <em>buf</em>. The size of the
<em>buf</em> is specified by <em>buflen</em>. The number of entries in the <em>iv</em>
array is given by <em>niv</em>. The required space in <em>buf</em> for the <em>niv</em>
entries is <tt class="docutils literal"><span class="pre">8*niv</span></tt> bytes and if the given buffer is too small, an
error is returned. This function is used mainly for creating a
SETTINGS payload to be sent with the <tt class="docutils literal"><span class="pre">HTTP2-Settings</span></tt> header
field in an HTTP Upgrade request. The data written in <em>buf</em> is NOT
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
of the following negative error codes:</p>
<dl class="docutils">
<dt><a class="reference internal" href="#NGHTTP2_ERR_INVALID_ARGUMENT" title="NGHTTP2_ERR_INVALID_ARGUMENT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_INVALID_ARGUMENT</span></tt></a></dt>
<dd>The <em>iv</em> contains duplicate settings ID or invalid value.</dd>
<dt><a class="reference internal" href="#NGHTTP2_ERR_INSUFF_BUFSIZE" title="NGHTTP2_ERR_INSUFF_BUFSIZE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_INSUFF_BUFSIZE</span></tt></a></dt>
<dd>The provided <em>buflen</em> size is too small to hold the output.</dd>
</dl>
</dd></dl>
@ -1795,6 +1804,9 @@ field.</dd>
</dl>
<p>This function creates copies of all name/value pairs in <em>nv</em>. It
also lower-cases all names in <em>nv</em>.</p>
<p>The string in <em>nv</em> must be NULL-terminated. Use
<a class="reference internal" href="#nghttp2_submit_request2" title="nghttp2_submit_request2"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_request2()</span></tt></a> if name/value pairs are not
NULL-terminated strings.</p>
<p>If <em>data_prd</em> is not <tt class="docutils literal"><span class="pre">NULL</span></tt>, it provides data which will be sent
in subsequent DATA frames. In this case, a method that allows
request message bodies
@ -1828,6 +1840,24 @@ negative error codes:</p>
</dl>
</dd></dl>
<dl class="function">
<dt id="nghttp2_submit_request2">
int <tt class="descname">nghttp2_submit_request2</tt><big>(</big><a class="reference internal" href="#nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, int32_t<em>&nbsp;pri</em>, const <a class="reference internal" href="#nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*nva</em>, size_t<em>&nbsp;nvlen</em>, const <a class="reference internal" href="#nghttp2_data_provider" title="nghttp2_data_provider">nghttp2_data_provider</a><em>&nbsp;*data_prd</em>, void<em>&nbsp;*stream_user_data</em><big>)</big><a class="headerlink" href="#nghttp2_submit_request2" title="Permalink to this definition"></a></dt>
<dd><p>Just like <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>, but this function takes the
<em>nva</em>, which is an array of <tt class="docutils literal"><span class="pre">nghttp2_nv</span></tt> with <em>nvlen</em> elements,
as name/value pairs. This function is useful if name/value pairs
are not NULL-terminated strings.</p>
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
<dt><a class="reference internal" href="#NGHTTP2_ERR_INVALID_ARGUMENT" title="NGHTTP2_ERR_INVALID_ARGUMENT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_INVALID_ARGUMENT</span></tt></a></dt>
<dd>The <em>pri</em> is invalid; or the <em>nva</em> includes empty name or
name which contains invalid characters.</dd>
<dt><a class="reference internal" href="#NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="nghttp2_submit_response">
int <tt class="descname">nghttp2_submit_response</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>, const char<em>&nbsp;**nv</em>, const <a class="reference internal" href="#nghttp2_data_provider" title="nghttp2_data_provider">nghttp2_data_provider</a><em>&nbsp;*data_prd</em><big>)</big><a class="headerlink" href="#nghttp2_submit_response" title="Permalink to this definition"></a></dt>

View File

@ -149,6 +149,10 @@
</dt>
<dt><a href="apiref.html#NGHTTP2_ERR_INSUFF_BUFSIZE">NGHTTP2_ERR_INSUFF_BUFSIZE (C macro)</a>
</dt>
<dt><a href="apiref.html#NGHTTP2_ERR_INVALID_ARGUMENT">NGHTTP2_ERR_INVALID_ARGUMENT (C macro)</a>
</dt>
@ -851,6 +855,10 @@
</dt>
<dt><a href="apiref.html#nghttp2_submit_request2">nghttp2_submit_request2 (C function)</a>
</dt>
<dt><a href="apiref.html#nghttp2_submit_response">nghttp2_submit_response (C function)</a>
</dt>

View File

@ -311,6 +311,10 @@
<span class="cm"> */</span>
<span class="n">NGHTTP2_ERR_FLOW_CONTROL</span> <span class="o">=</span> <span class="o">-</span><span class="mi">524</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * Insufficient buffer size given to function.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_ERR_INSUFF_BUFSIZE</span> <span class="o">=</span> <span class="o">-</span><span class="mi">525</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * The errors &lt; :enum:`NGHTTP2_ERR_FATAL` mean that the library is</span>
<span class="cm"> * under unexpected condition and cannot process any further data</span>
<span class="cm"> * reliably (e.g., out of memory).</span>
@ -1558,13 +1562,13 @@
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * Serializes the SETTINGS values |iv| in the |buf|. The number of</span>
<span class="cm"> * entry pointed by |iv| array is given by the |niv|. This function</span>
<span class="cm"> * may reorder the pointers in |iv|. The |buf| must have enough region</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"> * 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</span>
<span class="cm"> * Serializes the SETTINGS values |iv| in the |buf|. The size of the</span>
<span class="cm"> * |buf| is specified by |buflen|. The number of entries in the |iv|</span>
<span class="cm"> * array is given by |niv|. The required space in |buf| for the |niv|</span>
<span class="cm"> * entries is ``8*niv`` bytes and if the given buffer is too small, an</span>
<span class="cm"> * error is returned. This function is used mainly for creating a</span>
<span class="cm"> * SETTINGS payload to be sent with the ``HTTP2-Settings`` header</span>
<span class="cm"> * field in an 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"> *</span>
<span class="cm"> * This function returns the number of bytes written in |buf|, or one</span>
@ -1572,9 +1576,14 @@
<span class="cm"> *</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`</span>
<span class="cm"> * The |iv| contains duplicate settings ID or invalid value.</span>
<span class="cm"> *</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_INSUFF_BUFSIZE`</span>
<span class="cm"> * The provided |buflen| size is too small to hold the output.</span>
<span class="cm"> */</span>
<span class="kt">ssize_t</span> <span class="nf">nghttp2_pack_settings_payload</span><span class="p">(</span><span class="kt">uint8_t</span> <span class="o">*</span><span class="n">buf</span><span class="p">,</span>
<span class="n">nghttp2_settings_entry</span> <span class="o">*</span><span class="n">iv</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">niv</span><span class="p">);</span>
<span class="kt">size_t</span> <span class="n">buflen</span><span class="p">,</span>
<span class="k">const</span> <span class="n">nghttp2_settings_entry</span> <span class="o">*</span><span class="n">iv</span><span class="p">,</span>
<span class="kt">size_t</span> <span class="n">niv</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
@ -1615,6 +1624,10 @@
<span class="cm"> * This function creates copies of all name/value pairs in |nv|. It</span>
<span class="cm"> * also lower-cases all names in |nv|.</span>
<span class="cm"> *</span>
<span class="cm"> * The string in |nv| must be NULL-terminated. Use</span>
<span class="cm"> * `nghttp2_submit_request2()` if name/value pairs are not</span>
<span class="cm"> * NULL-terminated strings.</span>
<span class="cm"> *</span>
<span class="cm"> * If |data_prd| is not ``NULL``, it provides data which will be sent</span>
<span class="cm"> * in subsequent DATA frames. In this case, a method that allows</span>
<span class="cm"> * request message bodies</span>
@ -1653,6 +1666,28 @@
<span class="k">const</span> <span class="n">nghttp2_data_provider</span> <span class="o">*</span><span class="n">data_prd</span><span class="p">,</span>
<span class="kt">void</span> <span class="o">*</span><span class="n">stream_user_data</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * Just like `nghttp2_submit_request()`, but this function takes the</span>
<span class="cm"> * |nva|, which is an array of ``nghttp2_nv`` with |nvlen| elements,</span>
<span class="cm"> * as name/value pairs. This function is useful if name/value pairs</span>
<span class="cm"> * are not NULL-terminated strings.</span>
<span class="cm"> *</span>
<span class="cm"> * This function returns 0 if it succeeds, or one of the following</span>
<span class="cm"> * negative error codes:</span>
<span class="cm"> *</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`</span>
<span class="cm"> * The |pri| is invalid; or the |nva| includes empty name or</span>
<span class="cm"> * name which contains invalid characters.</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_NOMEM`</span>
<span class="cm"> * Out of memory.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">nghttp2_submit_request2</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">int32_t</span> <span class="n">pri</span><span class="p">,</span>
<span class="k">const</span> <span class="n">nghttp2_nv</span> <span class="o">*</span><span class="n">nva</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">nvlen</span><span class="p">,</span>
<span class="k">const</span> <span class="n">nghttp2_data_provider</span> <span class="o">*</span><span class="n">data_prd</span><span class="p">,</span>
<span class="kt">void</span> <span class="o">*</span><span class="n">stream_user_data</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>

Binary file not shown.

File diff suppressed because one or more lines are too long