Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2014-05-06 23:23:33 +09:00
parent 2f2b071353
commit 3dcd179edb
9 changed files with 73 additions and 213 deletions

2
_static/jquery.js vendored
View File

@ -11,7 +11,7 @@
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Fri Jul 5 14:07:58 UTC 2013
* Date: Thu Aug 1 23:20:30 BRT 2013
*/
(function( window, undefined ) {

View File

@ -561,7 +561,7 @@ No flag set.</p>
<dl class="macro">
<dt id="c.NGHTTP2_NV_FLAG_NO_INDEX">
<tt class="descname">NGHTTP2_NV_FLAG_NO_INDEX</tt><a class="headerlink" href="#c.NGHTTP2_NV_FLAG_NO_INDEX" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x1</span></tt>)
<dd><p>(<tt class="docutils literal"><span class="pre">0x01</span></tt>)
Indicates that this name/value pair must not be indexed.</p>
</dd></dl>
@ -956,14 +956,14 @@ No flag set.</p>
<dl class="macro">
<dt id="c.NGHTTP2_HD_INFLATE_FINAL">
<tt class="descname">NGHTTP2_HD_INFLATE_FINAL</tt><a class="headerlink" href="#c.NGHTTP2_HD_INFLATE_FINAL" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">1</span></tt>)
<dd><p>(<tt class="docutils literal"><span class="pre">0x01</span></tt>)
Indicates all headers were inflated.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_HD_INFLATE_EMIT">
<tt class="descname">NGHTTP2_HD_INFLATE_EMIT</tt><a class="headerlink" href="#c.NGHTTP2_HD_INFLATE_EMIT" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">(1</span> <span class="pre">&lt;&lt;</span> <span class="pre">1)</span></tt>)
<dd><p>(<tt class="docutils literal"><span class="pre">0x02</span></tt>)
Indicates a header was emitted.</p>
</dd></dl>
@ -1034,13 +1034,13 @@ terminated.</p>
<dl class="member">
<dt id="c.nghttp2_nv.namelen">
uint16_t <tt class="descname">namelen</tt><a class="headerlink" href="#c.nghttp2_nv.namelen" title="Permalink to this definition"></a></dt>
size_t <tt class="descname">namelen</tt><a class="headerlink" href="#c.nghttp2_nv.namelen" title="Permalink to this definition"></a></dt>
<dd><p>The length of the <em>name</em>.</p>
</dd></dl>
<dl class="member">
<dt id="c.nghttp2_nv.valuelen">
uint16_t <tt class="descname">valuelen</tt><a class="headerlink" href="#c.nghttp2_nv.valuelen" title="Permalink to this definition"></a></dt>
size_t <tt class="descname">valuelen</tt><a class="headerlink" href="#c.nghttp2_nv.valuelen" title="Permalink to this definition"></a></dt>
<dd><p>The length of the <em>value</em>.</p>
</dd></dl>
@ -1980,13 +1980,6 @@ request HEADERS is serialized to the wire format.</p>
this structure are intentionally hidden from the public API.</p>
</dd></dl>
<dl class="type">
<dt id="c.nghttp2_gzip">
<tt class="descname">nghttp2_gzip</tt><a class="headerlink" href="#c.nghttp2_gzip" title="Permalink to this definition"></a></dt>
<dd><p>The gzip stream to inflate data. The details of this structure are
intentionally hidden from the public API.</p>
</dd></dl>
<dl class="type">
<dt id="c.nghttp2_hd_inflater">
<tt class="descname">nghttp2_hd_inflater</tt><a class="headerlink" href="#c.nghttp2_hd_inflater" title="Permalink to this definition"></a></dt>
@ -2460,6 +2453,12 @@ negative error codes:</p>
</dl>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_session_get_remote_settings">
uint32_t <tt class="descname">nghttp2_session_get_remote_settings</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, <a class="reference internal" href="#c.nghttp2_settings_id" title="nghttp2_settings_id">nghttp2_settings_id</a><em>&nbsp;id</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_get_remote_settings" title="Permalink to this definition"></a></dt>
<dd><p>Returns the value of SETTINGS <em>id</em> notified by a remote endpoint.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_session_upgrade">
int <tt class="descname">nghttp2_session_upgrade</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const uint8_t<em>&nbsp;*settings_payload</em>, size_t<em>&nbsp;settings_payloadlen</em>, void<em>&nbsp;*stream_user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_upgrade" title="Permalink to this definition"></a></dt>
@ -2979,72 +2978,6 @@ details about NPN.</p>
</div>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_gzip_inflate_new">
int <tt class="descname">nghttp2_gzip_inflate_new</tt><big>(</big><a class="reference internal" href="#c.nghttp2_gzip" title="nghttp2_gzip">nghttp2_gzip</a><em>&nbsp;**inflater_ptr</em><big>)</big><a class="headerlink" href="#c.nghttp2_gzip_inflate_new" title="Permalink to this definition"></a></dt>
<dd><p>A helper function to set up a per request gzip stream to inflate
data.</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="#c.NGHTTP2_ERR_GZIP" title="NGHTTP2_ERR_GZIP"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_GZIP</span></tt></a></dt>
<dd>The initialization of gzip stream failed.</dd>
<dt><a class="reference internal" href="#c.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="c.nghttp2_gzip_inflate_del">
void <tt class="descname">nghttp2_gzip_inflate_del</tt><big>(</big><a class="reference internal" href="#c.nghttp2_gzip" title="nghttp2_gzip">nghttp2_gzip</a><em>&nbsp;*inflater</em><big>)</big><a class="headerlink" href="#c.nghttp2_gzip_inflate_del" title="Permalink to this definition"></a></dt>
<dd><p>Frees the inflate stream. The <em>inflater</em> may be <tt class="docutils literal"><span class="pre">NULL</span></tt>.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_gzip_inflate">
int <tt class="descname">nghttp2_gzip_inflate</tt><big>(</big><a class="reference internal" href="#c.nghttp2_gzip" title="nghttp2_gzip">nghttp2_gzip</a><em>&nbsp;*inflater</em>, uint8_t<em>&nbsp;*out</em>, size_t<em>&nbsp;*outlen_ptr</em>, const uint8_t<em>&nbsp;*in</em>, size_t<em>&nbsp;*inlen_ptr</em><big>)</big><a class="headerlink" href="#c.nghttp2_gzip_inflate" title="Permalink to this definition"></a></dt>
<dd><p>Inflates data in <em>in</em> with the length <em>*inlen_ptr</em> and stores the
inflated data to <em>out</em> which has allocated size at least
<em>*outlen_ptr</em>. On return, <em>*outlen_ptr</em> is updated to represent
the number of data written in <em>out</em>. Similarly, <em>*inlen_ptr</em> is
updated to represent the number of input bytes processed.</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="#c.NGHTTP2_ERR_GZIP" title="NGHTTP2_ERR_GZIP"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_GZIP</span></tt></a></dt>
<dd>The inflation of gzip stream failed.</dd>
</dl>
<p>The example follows:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="kt">void</span> <span class="nf">on_data_chunk_recv_callback</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">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="p">{</span>
<span class="p">...</span>
<span class="n">req</span> <span class="o">=</span> <span class="n">nghttp2_session_get_stream_user_data</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="n">stream_id</span><span class="p">);</span>
<span class="n">nghttp2_gzip</span> <span class="o">*</span><span class="n">inflater</span> <span class="o">=</span> <span class="n">req</span><span class="o">-&gt;</span><span class="n">inflater</span><span class="p">;</span>
<span class="k">while</span><span class="p">(</span><span class="n">len</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="kt">uint8_t</span> <span class="n">out</span><span class="p">[</span><span class="n">MAX_OUTLEN</span><span class="p">];</span>
<span class="kt">size_t</span> <span class="n">outlen</span> <span class="o">=</span> <span class="n">MAX_OUTLEN</span><span class="p">;</span>
<span class="kt">size_t</span> <span class="n">tlen</span> <span class="o">=</span> <span class="n">len</span><span class="p">;</span>
<span class="kt">int</span> <span class="n">rv</span><span class="p">;</span>
<span class="n">rv</span> <span class="o">=</span> <span class="n">nghttp2_gzip_inflate</span><span class="p">(</span><span class="n">inflater</span><span class="p">,</span> <span class="n">out</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">outlen</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">tlen</span><span class="p">);</span>
<span class="k">if</span><span class="p">(</span><span class="n">rv</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="n">nghttp2_submit_rst_stream</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="n">stream_id</span><span class="p">,</span>
<span class="n">NGHTTP2_INTERNAL_ERROR</span><span class="p">);</span>
<span class="k">break</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">...</span> <span class="n">Do</span> <span class="n">stuff</span> <span class="p">...</span>
<span class="n">data</span> <span class="o">+=</span> <span class="n">tlen</span><span class="p">;</span>
<span class="n">len</span> <span class="o">-=</span> <span class="n">tlen</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">....</span>
<span class="p">}</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_version">
<a class="reference internal" href="#c.nghttp2_info" title="nghttp2_info">nghttp2_info</a> *<tt class="descname">nghttp2_version</tt><big>(</big>int<em>&nbsp;least_version</em><big>)</big><a class="headerlink" href="#c.nghttp2_version" title="Permalink to this definition"></a></dt>
@ -3103,7 +3036,7 @@ void <tt class="descname">nghttp2_hd_inflate_del</tt><big>(</big><a class="refer
<dl class="function">
<dt id="c.nghttp2_hd_inflate_change_table_size">
int <tt class="descname">nghttp2_hd_inflate_change_table_size</tt><big>(</big><a class="reference internal" href="#c.nghttp2_hd_inflater" title="nghttp2_hd_inflater">nghttp2_hd_inflater</a><em>&nbsp;*inflater</em>, size_t<em>&nbsp;settings_hd_table_bufsize_max</em><big>)</big><a class="headerlink" href="#c.nghttp2_hd_inflate_change_table_size" title="Permalink to this definition"></a></dt>
<dd><p>Changes header table size in the <em>inflater</em>. This may trigger
<dd><p>Changes header table size in the <em>inflater</em>. This may trigger
eviction in the dynamic table.</p>
<p>The <em>settings_hd_table_bufsize_max</em> should be the value transmitted
in SETTINGS_HEADER_TABLE_SIZE.</p>
@ -3118,22 +3051,22 @@ negative error codes:</p>
<dl class="function">
<dt id="c.nghttp2_hd_inflate_hd">
ssize_t <tt class="descname">nghttp2_hd_inflate_hd</tt><big>(</big><a class="reference internal" href="#c.nghttp2_hd_inflater" title="nghttp2_hd_inflater">nghttp2_hd_inflater</a><em>&nbsp;*inflater</em>, <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*nv_out</em>, int<em>&nbsp;*inflate_flags</em>, uint8_t<em>&nbsp;*in</em>, size_t<em>&nbsp;inlen</em>, int<em>&nbsp;in_final</em><big>)</big><a class="headerlink" href="#c.nghttp2_hd_inflate_hd" title="Permalink to this definition"></a></dt>
<dd><p>Inflates name/value block stored in <em>in</em> with length <em>inlen</em>. This
function performs decompression. For each successful emission of
<dd><p>Inflates name/value block stored in <em>in</em> with length <em>inlen</em>. This
function performs decompression. For each successful emission of
header name/value pair, <a class="reference internal" href="#c.NGHTTP2_HD_INFLATE_EMIT" title="NGHTTP2_HD_INFLATE_EMIT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_HD_INFLATE_EMIT</span></tt></a> is set in
<em>*inflate_flags</em> and name/value pair is assigned to the <em>nv_out</em>
and the function returns. The caller must not free the members of
and the function returns. The caller must not free the members of
<em>nv_out</em>.</p>
<p>The <em>nv_out</em> may include pointers to the memory region in the
<em>in</em>. The caller must retain the <em>in</em> while the <em>nv_out</em> is used.</p>
<p>The <em>nv_out</em> may include pointers to the memory region in the <em>in</em>.
The caller must retain the <em>in</em> while the <em>nv_out</em> is used.</p>
<p>The application should call this function repeatedly until the
<tt class="docutils literal"><span class="pre">(*inflate_flags)</span> <span class="pre">&amp;</span> <span class="pre">NGHTTP2_HD_INFLATE_FINAL</span></tt> is nonzero and
return value is non-negative. This means the all input values are
processed successfully. Then the application must call
return value is non-negative. This means the all input values are
processed successfully. Then the application must call
<a class="reference internal" href="#c.nghttp2_hd_inflate_end_headers" title="nghttp2_hd_inflate_end_headers"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_hd_inflate_end_headers()</span></tt></a> to prepare for the next header
block input.</p>
<p>The caller can feed complete compressed header block. It also can
feed it in several chunks. The caller must set <em>in_final</em> to
<p>The caller can feed complete compressed header block. It also can
feed it in several chunks. The caller must set <em>in_final</em> to
nonzero if the given input is the last block of the compressed
header.</p>
<p>This function returns the number of bytes processed if it succeeds,

View File

@ -627,22 +627,6 @@
</dt>
<dt><a href="apiref.html#c.nghttp2_gzip">nghttp2_gzip (C type)</a>
</dt>
<dt><a href="apiref.html#c.nghttp2_gzip_inflate">nghttp2_gzip_inflate (C function)</a>
</dt>
<dt><a href="apiref.html#c.nghttp2_gzip_inflate_del">nghttp2_gzip_inflate_del (C function)</a>
</dt>
<dt><a href="apiref.html#c.nghttp2_gzip_inflate_new">nghttp2_gzip_inflate_new (C function)</a>
</dt>
<dt><a href="apiref.html#c.NGHTTP2_HCAT_HEADERS">NGHTTP2_HCAT_HEADERS (C macro)</a>
</dt>
@ -754,8 +738,6 @@
<dt><a href="apiref.html#c.nghttp2_info.version_num">nghttp2_info.version_num (C member)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="apiref.html#c.nghttp2_info.version_str">nghttp2_info.version_str (C member)</a>
</dt>
@ -764,6 +746,8 @@
<dt><a href="apiref.html#c.NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE">NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE (C macro)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="apiref.html#c.NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS">NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS (C macro)</a>
</dt>
@ -1125,6 +1109,10 @@
</dt>
<dt><a href="apiref.html#c.nghttp2_session_get_remote_settings">nghttp2_session_get_remote_settings (C function)</a>
</dt>
<dt><a href="apiref.html#c.nghttp2_session_get_stream_effective_local_window_size">nghttp2_session_get_stream_effective_local_window_size (C function)</a>
</dt>

View File

@ -523,7 +523,7 @@
<span class="cm">/**</span>
<span class="cm"> * Indicates that this name/value pair must not be indexed.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_NV_FLAG_NO_INDEX</span> <span class="o">=</span> <span class="mh">0x1</span>
<span class="n">NGHTTP2_NV_FLAG_NO_INDEX</span> <span class="o">=</span> <span class="mh">0x01</span>
<span class="p">}</span> <span class="n">nghttp2_nv_flag</span><span class="p">;</span>
<span class="cm">/**</span>
@ -545,11 +545,11 @@
<span class="cm">/**</span>
<span class="cm"> * The length of the |name|.</span>
<span class="cm"> */</span>
<span class="kt">uint16_t</span> <span class="n">namelen</span><span class="p">;</span>
<span class="kt">size_t</span> <span class="n">namelen</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * The length of the |value|.</span>
<span class="cm"> */</span>
<span class="kt">uint16_t</span> <span class="n">valuelen</span><span class="p">;</span>
<span class="kt">size_t</span> <span class="n">valuelen</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Bitwise OR of one or more of :type:`nghttp2_nv_flag`.</span>
<span class="cm"> */</span>
@ -2241,6 +2241,14 @@
<span class="kt">int</span> <span class="nf">nghttp2_session_terminate_session</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="n">nghttp2_error_code</span> <span class="n">error_code</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * Returns the value of SETTINGS |id| notified by a remote endpoint.</span>
<span class="cm"> */</span>
<span class="kt">uint32_t</span> <span class="nf">nghttp2_session_get_remote_settings</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="n">nghttp2_settings_id</span> <span class="n">id</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
@ -2879,87 +2887,6 @@
<span class="kt">int</span> <span class="nf">nghttp2_select_next_protocol</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">**</span><span class="n">out</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">outlen</span><span class="p">,</span>
<span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">inlen</span><span class="p">);</span>
<span class="k">struct</span> <span class="n">nghttp2_gzip</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * @struct</span>
<span class="cm"> *</span>
<span class="cm"> * The gzip stream to inflate data. The details of this structure are</span>
<span class="cm"> * intentionally hidden from the public API.</span>
<span class="cm"> */</span>
<span class="k">typedef</span> <span class="k">struct</span> <span class="n">nghttp2_gzip</span> <span class="n">nghttp2_gzip</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * A helper function to set up a per request gzip stream to inflate</span>
<span class="cm"> * data.</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_GZIP`</span>
<span class="cm"> * The initialization of gzip stream failed.</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_gzip_inflate_new</span><span class="p">(</span><span class="n">nghttp2_gzip</span> <span class="o">**</span><span class="n">inflater_ptr</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * Frees the inflate stream. The |inflater| may be ``NULL``.</span>
<span class="cm"> */</span>
<span class="kt">void</span> <span class="nf">nghttp2_gzip_inflate_del</span><span class="p">(</span><span class="n">nghttp2_gzip</span> <span class="o">*</span><span class="n">inflater</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * Inflates data in |in| with the length |*inlen_ptr| and stores the</span>
<span class="cm"> * inflated data to |out| which has allocated size at least</span>
<span class="cm"> * |*outlen_ptr|. On return, |*outlen_ptr| is updated to represent</span>
<span class="cm"> * the number of data written in |out|. Similarly, |*inlen_ptr| is</span>
<span class="cm"> * updated to represent the number of input bytes processed.</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_GZIP`</span>
<span class="cm"> * The inflation of gzip stream failed.</span>
<span class="cm"> *</span>
<span class="cm"> * The example follows::</span>
<span class="cm"> *</span>
<span class="cm"> * void on_data_chunk_recv_callback(nghttp2_session *session,</span>
<span class="cm"> * uint8_t flags,</span>
<span class="cm"> * int32_t stream_id,</span>
<span class="cm"> * const uint8_t *data, size_t len,</span>
<span class="cm"> * void *user_data)</span>
<span class="cm"> * {</span>
<span class="cm"> * ...</span>
<span class="cm"> * req = nghttp2_session_get_stream_user_data(session, stream_id);</span>
<span class="cm"> * nghttp2_gzip *inflater = req-&gt;inflater;</span>
<span class="cm"> * while(len &gt; 0) {</span>
<span class="cm"> * uint8_t out[MAX_OUTLEN];</span>
<span class="cm"> * size_t outlen = MAX_OUTLEN;</span>
<span class="cm"> * size_t tlen = len;</span>
<span class="cm"> * int rv;</span>
<span class="cm"> * rv = nghttp2_gzip_inflate(inflater, out, &amp;outlen, data, &amp;tlen);</span>
<span class="cm"> * if(rv != 0) {</span>
<span class="cm"> * nghttp2_submit_rst_stream(session, stream_id,</span>
<span class="cm"> * NGHTTP2_INTERNAL_ERROR);</span>
<span class="cm"> * break;</span>
<span class="cm"> * }</span>
<span class="cm"> * ... Do stuff ...</span>
<span class="cm"> * data += tlen;</span>
<span class="cm"> * len -= tlen;</span>
<span class="cm"> * }</span>
<span class="cm"> * ....</span>
<span class="cm"> * }</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">nghttp2_gzip_inflate</span><span class="p">(</span><span class="n">nghttp2_gzip</span> <span class="o">*</span><span class="n">inflater</span><span class="p">,</span>
<span class="kt">uint8_t</span> <span class="o">*</span><span class="n">out</span><span class="p">,</span> <span class="kt">size_t</span> <span class="o">*</span><span class="n">outlen_ptr</span><span class="p">,</span>
<span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="kt">size_t</span> <span class="o">*</span><span class="n">inlen_ptr</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
@ -3037,7 +2964,7 @@
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * Changes header table size in the |inflater|. This may trigger</span>
<span class="cm"> * Changes header table size in the |inflater|. This may trigger</span>
<span class="cm"> * eviction in the dynamic table.</span>
<span class="cm"> *</span>
<span class="cm"> * The |settings_hd_table_bufsize_max| should be the value transmitted</span>
@ -3065,35 +2992,35 @@
<span class="cm">/**</span>
<span class="cm"> * Indicates all headers were inflated.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_HD_INFLATE_FINAL</span> <span class="o">=</span> <span class="mi">1</span><span class="p">,</span>
<span class="n">NGHTTP2_HD_INFLATE_FINAL</span> <span class="o">=</span> <span class="mh">0x01</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * Indicates a header was emitted.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_HD_INFLATE_EMIT</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1</span> <span class="o">&lt;&lt;</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">NGHTTP2_HD_INFLATE_EMIT</span> <span class="o">=</span> <span class="mh">0x02</span>
<span class="p">}</span> <span class="n">nghttp2_hd_inflate_flag</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * Inflates name/value block stored in |in| with length |inlen|. This</span>
<span class="cm"> * function performs decompression. For each successful emission of</span>
<span class="cm"> * Inflates name/value block stored in |in| with length |inlen|. This</span>
<span class="cm"> * function performs decompression. For each successful emission of</span>
<span class="cm"> * header name/value pair, :enum:`NGHTTP2_HD_INFLATE_EMIT` is set in</span>
<span class="cm"> * |*inflate_flags| and name/value pair is assigned to the |nv_out|</span>
<span class="cm"> * and the function returns. The caller must not free the members of</span>
<span class="cm"> * and the function returns. The caller must not free the members of</span>
<span class="cm"> * |nv_out|.</span>
<span class="cm"> *</span>
<span class="cm"> * The |nv_out| may include pointers to the memory region in the</span>
<span class="cm"> * |in|. The caller must retain the |in| while the |nv_out| is used.</span>
<span class="cm"> * The |nv_out| may include pointers to the memory region in the |in|.</span>
<span class="cm"> * The caller must retain the |in| while the |nv_out| is used.</span>
<span class="cm"> *</span>
<span class="cm"> * The application should call this function repeatedly until the</span>
<span class="cm"> * ``(*inflate_flags) &amp; NGHTTP2_HD_INFLATE_FINAL`` is nonzero and</span>
<span class="cm"> * return value is non-negative. This means the all input values are</span>
<span class="cm"> * processed successfully. Then the application must call</span>
<span class="cm"> * return value is non-negative. This means the all input values are</span>
<span class="cm"> * processed successfully. Then the application must call</span>
<span class="cm"> * `nghttp2_hd_inflate_end_headers()` to prepare for the next header</span>
<span class="cm"> * block input.</span>
<span class="cm"> *</span>
<span class="cm"> * The caller can feed complete compressed header block. It also can</span>
<span class="cm"> * feed it in several chunks. The caller must set |in_final| to</span>
<span class="cm"> * The caller can feed complete compressed header block. It also can</span>
<span class="cm"> * feed it in several chunks. The caller must set |in_final| to</span>
<span class="cm"> * nonzero if the given input is the last block of the compressed</span>
<span class="cm"> * header.</span>
<span class="cm"> *</span>

Binary file not shown.

View File

@ -208,12 +208,11 @@ service is available at port 443.</p>
</div>
<div class="section" id="requirements">
<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline"></a></h2>
<p>The following packages are needed to build the library:</p>
<p>The following package is required to build the libnghttp2 library:</p>
<ul class="simple">
<li>pkg-config &gt;= 0.20</li>
<li>zlib &gt;= 1.2.3</li>
</ul>
<p>To build and run the unit test programs, the following packages are
<p>To build and run the unit test programs, the following package is
required:</p>
<ul class="simple">
<li>cunit &gt;= 2.1</li>
@ -228,15 +227,16 @@ required:</p>
<ul class="simple">
<li>OpenSSL &gt;= 1.0.1</li>
<li>libevent-openssl &gt;= 2.0.8</li>
<li>zlib &gt;= 1.2.3</li>
</ul>
<p>ALPN support requires unreleased version OpenSSL &gt;= 1.0.2.</p>
<p>To enable SPDY protocol in the application program <tt class="docutils literal"><span class="pre">nghttpx</span></tt> and
<tt class="docutils literal"><span class="pre">h2load</span></tt>, the following packages are required:</p>
<tt class="docutils literal"><span class="pre">h2load</span></tt>, the following package is required:</p>
<ul class="simple">
<li>spdylay &gt;= 1.2.3</li>
</ul>
<p>To enable <tt class="docutils literal"><span class="pre">-a</span></tt> option (getting linked assets from the downloaded
resource) in <tt class="docutils literal"><span class="pre">nghttp</span></tt>, the following packages are needed:</p>
resource) in <tt class="docutils literal"><span class="pre">nghttp</span></tt>, the following package is required:</p>
<ul class="simple">
<li>libxml2 &gt;= 2.7.7</li>
</ul>

File diff suppressed because one or more lines are too long

View File

@ -982,7 +982,9 @@ here.</p>
<span class="k">static</span> <span class="kt">void</span> <span class="nf">initialize_nghttp2_session</span><span class="p">(</span><span class="n">http2_session_data</span> <span class="o">*</span><span class="n">session_data</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">nghttp2_session_callbacks</span> <span class="n">callbacks</span> <span class="o">=</span> <span class="p">{</span><span class="mi">0</span><span class="p">};</span>
<span class="n">nghttp2_session_callbacks</span> <span class="n">callbacks</span><span class="p">;</span>
<span class="n">memset</span><span class="p">(</span><span class="o">&amp;</span><span class="n">callbacks</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">callbacks</span><span class="p">));</span>
<span class="n">callbacks</span><span class="p">.</span><span class="n">send_callback</span> <span class="o">=</span> <span class="n">send_callback</span><span class="p">;</span>
<span class="n">callbacks</span><span class="p">.</span><span class="n">before_frame_send_callback</span> <span class="o">=</span> <span class="n">before_frame_send_callback</span><span class="p">;</span>

View File

@ -1117,9 +1117,17 @@ stream is about to close and we no longer use that object.</p>
<span class="p">}</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">write</span><span class="p">(</span><span class="n">pipefd</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">ERROR_HTML</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">ERROR_HTML</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">);</span>
<span class="n">rv</span> <span class="o">=</span> <span class="n">write</span><span class="p">(</span><span class="n">pipefd</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">ERROR_HTML</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">ERROR_HTML</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">);</span>
<span class="n">close</span><span class="p">(</span><span class="n">pipefd</span><span class="p">[</span><span class="mi">1</span><span class="p">]);</span>
<span class="k">if</span><span class="p">(</span><span class="n">rv</span> <span class="o">!=</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">ERROR_HTML</span><span class="p">))</span> <span class="p">{</span>
<span class="n">close</span><span class="p">(</span><span class="n">pipefd</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
<span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">stream_data</span><span class="o">-&gt;</span><span class="n">fd</span> <span class="o">=</span> <span class="n">pipefd</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
<span class="k">if</span><span class="p">(</span><span class="n">send_response</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="n">stream_data</span><span class="o">-&gt;</span><span class="n">stream_id</span><span class="p">,</span> <span class="n">hdrs</span><span class="p">,</span> <span class="n">ARRLEN</span><span class="p">(</span><span class="n">hdrs</span><span class="p">),</span>
<span class="n">pipefd</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="n">close</span><span class="p">(</span><span class="n">pipefd</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
@ -1275,7 +1283,9 @@ stream is about to close and we no longer use that object.</p>
<span class="k">static</span> <span class="kt">void</span> <span class="nf">initialize_nghttp2_session</span><span class="p">(</span><span class="n">http2_session_data</span> <span class="o">*</span><span class="n">session_data</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">nghttp2_session_callbacks</span> <span class="n">callbacks</span> <span class="o">=</span> <span class="p">{</span><span class="mi">0</span><span class="p">};</span>
<span class="n">nghttp2_session_callbacks</span> <span class="n">callbacks</span><span class="p">;</span>
<span class="n">memset</span><span class="p">(</span><span class="o">&amp;</span><span class="n">callbacks</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">callbacks</span><span class="p">));</span>
<span class="n">callbacks</span><span class="p">.</span><span class="n">send_callback</span> <span class="o">=</span> <span class="n">send_callback</span><span class="p">;</span>
<span class="n">callbacks</span><span class="p">.</span><span class="n">on_frame_recv_callback</span> <span class="o">=</span> <span class="n">on_frame_recv_callback</span><span class="p">;</span>
@ -1414,7 +1424,7 @@ stream is about to close and we no longer use that object.</p>
<span class="n">hints</span><span class="p">.</span><span class="n">ai_flags</span> <span class="o">=</span> <span class="n">AI_PASSIVE</span><span class="p">;</span>
<span class="cp">#ifdef AI_ADDRCONFIG</span>
<span class="n">hints</span><span class="p">.</span><span class="n">ai_flags</span> <span class="o">|=</span> <span class="n">AI_ADDRCONFIG</span><span class="p">;</span>
<span class="cp">#endif </span><span class="c1">// AI_ADDRCONFIG</span>
<span class="cp">#endif </span><span class="cm">/* AI_ADDRCONFIG */</span><span class="cp"></span>
<span class="n">rv</span> <span class="o">=</span> <span class="n">getaddrinfo</span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span> <span class="n">service</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">hints</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">res</span><span class="p">);</span>
<span class="k">if</span><span class="p">(</span><span class="n">rv</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>