Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2014-02-16 15:51:22 +09:00
parent 6d4aebe09c
commit 23d10cf378
7 changed files with 320 additions and 195 deletions

View File

@ -555,14 +555,14 @@ The GOAWAY frame.</p>
<dl class="macro">
<dt id="NGHTTP2_WINDOW_UPDATE">
<tt class="descname">NGHTTP2_WINDOW_UPDATE</tt><a class="headerlink" href="#NGHTTP2_WINDOW_UPDATE" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">9</span></tt>)
<dd><p>(<tt class="docutils literal"><span class="pre">8</span></tt>)
The WINDOW_UPDATE frame.</p>
</dd></dl>
<dl class="macro">
<dt id="NGHTTP2_CONTINUATION">
<tt class="descname">NGHTTP2_CONTINUATION</tt><a class="headerlink" href="#NGHTTP2_CONTINUATION" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">10</span></tt>)
<dd><p>(<tt class="docutils literal"><span class="pre">9</span></tt>)
The CONTINUATION frame.</p>
</dd></dl>
@ -615,6 +615,27 @@ The END_PUSH_PROMISE flag.</p>
The ACK flag.</p>
</dd></dl>
<dl class="macro">
<dt id="NGHTTP2_FLAG_END_SEGMENT">
<tt class="descname">NGHTTP2_FLAG_END_SEGMENT</tt><a class="headerlink" href="#NGHTTP2_FLAG_END_SEGMENT" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x2</span></tt>)
The END_SEGMENT flag.</p>
</dd></dl>
<dl class="macro">
<dt id="NGHTTP2_FLAG_PAD_LOW">
<tt class="descname">NGHTTP2_FLAG_PAD_LOW</tt><a class="headerlink" href="#NGHTTP2_FLAG_PAD_LOW" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x10</span></tt>)
The PAD_LOW flag.</p>
</dd></dl>
<dl class="macro">
<dt id="NGHTTP2_FLAG_PAD_HIGH">
<tt class="descname">NGHTTP2_FLAG_PAD_HIGH</tt><a class="headerlink" href="#NGHTTP2_FLAG_PAD_HIGH" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x20</span></tt>)
The PAD_HIGH flag.</p>
</dd></dl>
</dd></dl>
<dl class="type">
@ -638,28 +659,21 @@ SETTINGS_ENABLE_PUSH</p>
<dl class="macro">
<dt id="NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS">
<tt class="descname">NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS</tt><a class="headerlink" href="#NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">4</span></tt>)
<dd><p>(<tt class="docutils literal"><span class="pre">3</span></tt>)
SETTINGS_MAX_CONCURRENT_STREAMS</p>
</dd></dl>
<dl class="macro">
<dt id="NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE">
<tt class="descname">NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE</tt><a class="headerlink" href="#NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">7</span></tt>)
<dd><p>(<tt class="docutils literal"><span class="pre">4</span></tt>)
SETTINGS_INITIAL_WINDOW_SIZE</p>
</dd></dl>
<dl class="macro">
<dt id="NGHTTP2_SETTINGS_FLOW_CONTROL_OPTIONS">
<tt class="descname">NGHTTP2_SETTINGS_FLOW_CONTROL_OPTIONS</tt><a class="headerlink" href="#NGHTTP2_SETTINGS_FLOW_CONTROL_OPTIONS" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">10</span></tt>)
SETTINGS_FLOW_CONTROL_OPTIONS</p>
</dd></dl>
<dl class="macro">
<dt id="NGHTTP2_SETTINGS_MAX">
<tt class="descname">NGHTTP2_SETTINGS_MAX</tt><a class="headerlink" href="#NGHTTP2_SETTINGS_MAX" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">10</span></tt>)
<dd><p>(<tt class="docutils literal"><span class="pre">4</span></tt>)
Maximum ID of <a class="reference internal" href="#nghttp2_settings_id" title="nghttp2_settings_id"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_settings_id</span></tt></a>.</p>
</dd></dl>
@ -749,10 +763,17 @@ CONNECT_ERROR</p>
<dl class="macro">
<dt id="NGHTTP2_ENHANCE_YOUR_CALM">
<tt class="descname">NGHTTP2_ENHANCE_YOUR_CALM</tt><a class="headerlink" href="#NGHTTP2_ENHANCE_YOUR_CALM" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">420</span></tt>)
<dd><p>(<tt class="docutils literal"><span class="pre">11</span></tt>)
ENHANCE_YOUR_CALM</p>
</dd></dl>
<dl class="macro">
<dt id="NGHTTP2_INADEQUATE_SECURITY">
<tt class="descname">NGHTTP2_INADEQUATE_SECURITY</tt><a class="headerlink" href="#NGHTTP2_INADEQUATE_SECURITY" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">12</span></tt>)
INADEQUATE_SECURITY</p>
</dd></dl>
</dd></dl>
<dl class="type">
@ -1015,6 +1036,13 @@ of data from it.</p>
<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>
<dl class="member">
<dt id="nghttp2_data.padlen">
size_t <tt class="descname">padlen</tt><a class="headerlink" href="#nghttp2_data.padlen" title="Permalink to this definition"></a></dt>
<dd><p>The length of the padding in this frame. This includes PAD_HIGH
and PAD_LOW.</p>
</dd></dl>
</dd></dl>
<dl class="type">
@ -1027,6 +1055,13 @@ of data from it.</p>
<dd><p>The frame header.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_headers.padlen">
size_t <tt class="descname">padlen</tt><a class="headerlink" href="#nghttp2_headers.padlen" title="Permalink to this definition"></a></dt>
<dd><p>The length of the padding in this frame. This includes PAD_HIGH
and PAD_LOW.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_headers.nva">
<a class="reference internal" href="#nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a> *<tt class="descname">nva</tt><a class="headerlink" href="#nghttp2_headers.nva" title="Permalink to this definition"></a></dt>
@ -1141,6 +1176,13 @@ size_t <tt class="descname">niv</tt><a class="headerlink" href="#nghttp2_setting
<dd><p>The frame header.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_push_promise.padlen">
size_t <tt class="descname">padlen</tt><a class="headerlink" href="#nghttp2_push_promise.padlen" title="Permalink to this definition"></a></dt>
<dd><p>The length of the padding in this frame. This includes PAD_HIGH
and PAD_LOW.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_push_promise.nva">
<a class="reference internal" href="#nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a> *<tt class="descname">nva</tt><a class="headerlink" href="#nghttp2_push_promise.nva" title="Permalink to this definition"></a></dt>
@ -1549,6 +1591,21 @@ the other nonzero value is returned, it is treated as
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_select_padding_callback">
typedef ssize_t <tt class="descname">(*nghttp2_select_padding_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>, size_t<em>&nbsp;max_payloadlen</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#nghttp2_select_padding_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked when the library asks application how
much padding is required for the transmission of the <em>frame</em>. The
application must choose the total length of payload including
padded bytes in range [frame-&gt;hd.length, max_payloadlen],
inclusive. Choosing number not in this range will be treated as
<a class="reference internal" href="#NGHTTP2_ERR_CALLBACK_FAILURE" title="NGHTTP2_ERR_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_CALLBACK_FAILURE</span></tt></a>. Returning
<tt class="docutils literal"><span class="pre">frame-&gt;hd.length</span></tt> means no padding is added. Returning
<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> will make
<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> function 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_session_callbacks">
<tt class="descname">nghttp2_session_callbacks</tt><a class="headerlink" href="#nghttp2_session_callbacks" title="Permalink to this definition"></a></dt>
@ -1634,6 +1691,13 @@ HEADERS or PUSH_PROMISE is started.</p>
received.</p>
</dd></dl>
<dl class="member">
<dt id="nghttp2_session_callbacks.select_padding_callback">
<a class="reference internal" href="#nghttp2_select_padding_callback" title="nghttp2_select_padding_callback">nghttp2_select_padding_callback</a> <tt class="descname">select_padding_callback</tt><a class="headerlink" href="#nghttp2_session_callbacks.select_padding_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked when the library asks application how
much padding is required for the transmission of the given frame.</p>
</dd></dl>
</dd></dl>
<dl class="type">
@ -1979,8 +2043,6 @@ that and returns effective data length. In particular, if the
local window size is reduced by submitting negative
window_size_increment with <a class="reference internal" href="#nghttp2_submit_window_update" title="nghttp2_submit_window_update"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_window_update()</span></tt></a>, this
function returns the number of bytes less than actually received.</p>
<p>If flow control is disabled for that stream, this function returns
0.</p>
<p>This function returns -1 if it fails.</p>
</dd></dl>
@ -2005,8 +2067,6 @@ that and returns effective data length. In particular, if the local
window size is reduced by submitting negative window_size_increment
with <a class="reference internal" href="#nghttp2_submit_window_update" title="nghttp2_submit_window_update"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_window_update()</span></tt></a>, this function returns the
number of bytes less than actually received.</p>
<p>If flow control is disabled for a connection, this function returns
0.</p>
<p>This function returns -1 if it fails.</p>
</dd></dl>
@ -2303,8 +2363,8 @@ by the library and application could not send it at its will.</p>
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 invalid value (e.g., attempting to re-enable
flow control).</dd>
<dd>The <em>iv</em> contains invalid value (e.g., initial window size
strictly greater than (1 &lt;&lt; 31) - 1.</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>

View File

@ -201,6 +201,10 @@
</dt>
<dt><a href="apiref.html#nghttp2_data.padlen">nghttp2_data.padlen (C member)</a>
</dt>
<dt><a href="apiref.html#nghttp2_data_provider">nghttp2_data_provider (C type)</a>
</dt>
@ -377,6 +381,10 @@
</dt>
<dt><a href="apiref.html#NGHTTP2_FLAG_END_SEGMENT">NGHTTP2_FLAG_END_SEGMENT (C macro)</a>
</dt>
<dt><a href="apiref.html#NGHTTP2_FLAG_END_STREAM">NGHTTP2_FLAG_END_STREAM (C macro)</a>
</dt>
@ -385,6 +393,14 @@
</dt>
<dt><a href="apiref.html#NGHTTP2_FLAG_PAD_HIGH">NGHTTP2_FLAG_PAD_HIGH (C macro)</a>
</dt>
<dt><a href="apiref.html#NGHTTP2_FLAG_PAD_LOW">NGHTTP2_FLAG_PAD_LOW (C macro)</a>
</dt>
<dt><a href="apiref.html#NGHTTP2_FLAG_PRIORITY">NGHTTP2_FLAG_PRIORITY (C macro)</a>
</dt>
@ -549,6 +565,10 @@
</dt>
<dt><a href="apiref.html#nghttp2_headers.padlen">nghttp2_headers.padlen (C member)</a>
</dt>
<dt><a href="apiref.html#nghttp2_headers.pri">nghttp2_headers.pri (C member)</a>
</dt>
@ -557,6 +577,10 @@
</dt>
<dt><a href="apiref.html#NGHTTP2_INADEQUATE_SECURITY">NGHTTP2_INADEQUATE_SECURITY (C macro)</a>
</dt>
<dt><a href="apiref.html#nghttp2_info">nghttp2_info (C type)</a>
</dt>
@ -616,6 +640,8 @@
<dt><a href="apiref.html#nghttp2_nv.name">nghttp2_nv.name (C member)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="apiref.html#nghttp2_nv.namelen">nghttp2_nv.namelen (C member)</a>
</dt>
@ -624,8 +650,6 @@
<dt><a href="apiref.html#nghttp2_nv.value">nghttp2_nv.value (C member)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="apiref.html#nghttp2_nv.valuelen">nghttp2_nv.valuelen (C member)</a>
</dt>
@ -775,6 +799,10 @@
</dt>
<dt><a href="apiref.html#nghttp2_push_promise.padlen">nghttp2_push_promise.padlen (C member)</a>
</dt>
<dt><a href="apiref.html#nghttp2_push_promise.promised_stream_id">nghttp2_push_promise.promised_stream_id (C member)</a>
</dt>
@ -807,6 +835,10 @@
</dt>
<dt><a href="apiref.html#nghttp2_select_padding_callback">nghttp2_select_padding_callback (C type)</a>
</dt>
<dt><a href="apiref.html#nghttp2_send_callback">nghttp2_send_callback (C type)</a>
</dt>
@ -863,6 +895,10 @@
</dt>
<dt><a href="apiref.html#nghttp2_session_callbacks.select_padding_callback">nghttp2_session_callbacks.select_padding_callback (C member)</a>
</dt>
<dt><a href="apiref.html#nghttp2_session_callbacks.send_callback">nghttp2_session_callbacks.send_callback (C member)</a>
</dt>
@ -983,10 +1019,6 @@
</dt>
<dt><a href="apiref.html#NGHTTP2_SETTINGS_FLOW_CONTROL_OPTIONS">NGHTTP2_SETTINGS_FLOW_CONTROL_OPTIONS (C macro)</a>
</dt>
<dt><a href="apiref.html#NGHTTP2_SETTINGS_HEADER_TABLE_SIZE">NGHTTP2_SETTINGS_HEADER_TABLE_SIZE (C macro)</a>
</dt>

View File

@ -199,8 +199,8 @@ version 2.0.</p>
<div class="section" id="resources">
<h2>Resources<a class="headerlink" href="#resources" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><a class="reference external" href="http://tools.ietf.org/html/draft-ietf-httpbis-http2-09">http://tools.ietf.org/html/draft-ietf-httpbis-http2-09</a></li>
<li><a class="reference external" href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05">http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05</a></li>
<li><a class="reference external" href="http://tools.ietf.org/html/draft-ietf-httpbis-http2-10">http://tools.ietf.org/html/draft-ietf-httpbis-http2-10</a></li>
<li><a class="reference external" href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-06">http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-06</a></li>
</ul>
</div>
</div>

View File

@ -190,13 +190,13 @@
<span class="cm"> *</span>
<span class="cm"> * The protocol version identification of this library supports.</span>
<span class="cm"> */</span>
<span class="cp">#define NGHTTP2_PROTO_VERSION_ID &quot;HTTP-draft-09/2.0&quot;</span>
<span class="cp">#define NGHTTP2_PROTO_VERSION_ID &quot;h2-10&quot;</span>
<span class="cm">/**</span>
<span class="cm"> * @macro</span>
<span class="cm"> *</span>
<span class="cm"> * The length of :macro:`NGHTTP2_PROTO_VERSION_ID`.</span>
<span class="cm"> */</span>
<span class="cp">#define NGHTTP2_PROTO_VERSION_ID_LEN 17</span>
<span class="cp">#define NGHTTP2_PROTO_VERSION_ID_LEN 5</span>
<span class="k">struct</span> <span class="n">nghttp2_session</span><span class="p">;</span>
<span class="cm">/**</span>
@ -514,11 +514,11 @@
<span class="cm">/**</span>
<span class="cm"> * The WINDOW_UPDATE frame.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_WINDOW_UPDATE</span> <span class="o">=</span> <span class="mi">9</span><span class="p">,</span>
<span class="n">NGHTTP2_WINDOW_UPDATE</span> <span class="o">=</span> <span class="mi">8</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * The CONTINUATION frame.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_CONTINUATION</span> <span class="o">=</span> <span class="mi">10</span>
<span class="n">NGHTTP2_CONTINUATION</span> <span class="o">=</span> <span class="mi">9</span>
<span class="p">}</span> <span class="n">nghttp2_frame_type</span><span class="p">;</span>
<span class="cm">/**</span>
@ -551,7 +551,19 @@
<span class="cm">/**</span>
<span class="cm"> * The ACK flag.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_FLAG_ACK</span> <span class="o">=</span> <span class="mh">0x1</span>
<span class="n">NGHTTP2_FLAG_ACK</span> <span class="o">=</span> <span class="mh">0x1</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * The END_SEGMENT flag.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_FLAG_END_SEGMENT</span> <span class="o">=</span> <span class="mh">0x2</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * The PAD_LOW flag.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_FLAG_PAD_LOW</span> <span class="o">=</span> <span class="mh">0x10</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * The PAD_HIGH flag.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_FLAG_PAD_HIGH</span> <span class="o">=</span> <span class="mh">0x20</span>
<span class="p">}</span> <span class="n">nghttp2_flag</span><span class="p">;</span>
<span class="cm">/**</span>
@ -570,19 +582,15 @@
<span class="cm">/**</span>
<span class="cm"> * SETTINGS_MAX_CONCURRENT_STREAMS</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS</span> <span class="o">=</span> <span class="mi">4</span><span class="p">,</span>
<span class="n">NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS</span> <span class="o">=</span> <span class="mi">3</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * SETTINGS_INITIAL_WINDOW_SIZE</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE</span> <span class="o">=</span> <span class="mi">7</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * SETTINGS_FLOW_CONTROL_OPTIONS</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_SETTINGS_FLOW_CONTROL_OPTIONS</span> <span class="o">=</span> <span class="mi">10</span><span class="p">,</span>
<span class="n">NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE</span> <span class="o">=</span> <span class="mi">4</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * Maximum ID of :type:`nghttp2_settings_id`.</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_SETTINGS_MAX</span> <span class="o">=</span> <span class="mi">10</span>
<span class="n">NGHTTP2_SETTINGS_MAX</span> <span class="o">=</span> <span class="mi">4</span>
<span class="p">}</span> <span class="n">nghttp2_settings_id</span><span class="p">;</span>
<span class="cm">/**</span>
@ -643,7 +651,11 @@
<span class="cm">/**</span>
<span class="cm"> * ENHANCE_YOUR_CALM</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_ENHANCE_YOUR_CALM</span> <span class="o">=</span> <span class="mi">420</span>
<span class="n">NGHTTP2_ENHANCE_YOUR_CALM</span> <span class="o">=</span> <span class="mi">11</span><span class="p">,</span>
<span class="cm">/**</span>
<span class="cm"> * INADEQUATE_SECURITY</span>
<span class="cm"> */</span>
<span class="n">NGHTTP2_INADEQUATE_SECURITY</span> <span class="o">=</span> <span class="mi">12</span>
<span class="p">}</span> <span class="n">nghttp2_error_code</span><span class="p">;</span>
<span class="cm">/**</span>
@ -737,6 +749,11 @@
<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="cm">/**</span>
<span class="cm"> * The length of the padding in this frame. This includes PAD_HIGH</span>
<span class="cm"> * and PAD_LOW.</span>
<span class="cm"> */</span>
<span class="kt">size_t</span> <span class="n">padlen</span><span class="p">;</span>
<span class="p">}</span> <span class="n">nghttp2_data</span><span class="p">;</span>
<span class="cm">/**</span>
@ -781,6 +798,11 @@
<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 length of the padding in this frame. This includes PAD_HIGH</span>
<span class="cm"> * and PAD_LOW.</span>
<span class="cm"> */</span>
<span class="kt">size_t</span> <span class="n">padlen</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * The name/value pairs.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_nv</span> <span class="o">*</span><span class="n">nva</span><span class="p">;</span>
@ -872,6 +894,11 @@
<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 length of the padding in this frame. This includes PAD_HIGH</span>
<span class="cm"> * and PAD_LOW.</span>
<span class="cm"> */</span>
<span class="kt">size_t</span> <span class="n">padlen</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * The name/value pairs.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_nv</span> <span class="o">*</span><span class="n">nva</span><span class="p">;</span>
@ -1299,6 +1326,26 @@
<span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">value</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">valuelen</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 the library asks application how</span>
<span class="cm"> * much padding is required for the transmission of the |frame|. The</span>
<span class="cm"> * application must choose the total length of payload including</span>
<span class="cm"> * padded bytes in range [frame-&gt;hd.length, max_payloadlen],</span>
<span class="cm"> * inclusive. Choosing number not in this range will be treated as</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Returning</span>
<span class="cm"> * ``frame-&gt;hd.length`` means no padding is added. Returning</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE` will make</span>
<span class="cm"> * `nghttp2_session_send()` function immediately return</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`.</span>
<span class="cm"> */</span>
<span class="k">typedef</span> <span class="nf">ssize_t</span> <span class="p">(</span><span class="o">*</span><span class="n">nghttp2_select_padding_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="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">size_t</span> <span class="n">max_payloadlen</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"> * @struct</span>
<span class="cm"> *</span>
@ -1362,6 +1409,11 @@
<span class="cm"> * received.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_on_header_callback</span> <span class="n">on_header_callback</span><span class="p">;</span>
<span class="cm">/**</span>
<span class="cm"> * Callback function invoked when the library asks application how</span>
<span class="cm"> * much padding is required for the transmission of the given frame.</span>
<span class="cm"> */</span>
<span class="n">nghttp2_select_padding_callback</span> <span class="n">select_padding_callback</span><span class="p">;</span>
<span class="p">}</span> <span class="n">nghttp2_session_callbacks</span><span class="p">;</span>
<span class="cm">/**</span>
@ -1773,9 +1825,6 @@
<span class="cm"> * window_size_increment with `nghttp2_submit_window_update()`, this</span>
<span class="cm"> * function returns the number of bytes less than actually received.</span>
<span class="cm"> *</span>
<span class="cm"> * If flow control is disabled for that stream, this function returns</span>
<span class="cm"> * 0.</span>
<span class="cm"> *</span>
<span class="cm"> * This function returns -1 if it fails.</span>
<span class="cm"> */</span>
<span class="kt">int32_t</span> <span class="nf">nghttp2_session_get_stream_effective_recv_data_length</span>
@ -1806,9 +1855,6 @@
<span class="cm"> * with `nghttp2_submit_window_update()`, this function returns the</span>
<span class="cm"> * number of bytes less than actually received.</span>
<span class="cm"> *</span>
<span class="cm"> * If flow control is disabled for a connection, this function returns</span>
<span class="cm"> * 0.</span>
<span class="cm"> *</span>
<span class="cm"> * This function returns -1 if it fails.</span>
<span class="cm"> */</span>
<span class="kt">int32_t</span> <span class="nf">nghttp2_session_get_effective_recv_data_length</span>
@ -2171,8 +2217,8 @@
<span class="cm"> * negative error codes:</span>
<span class="cm"> *</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`</span>
<span class="cm"> * The |iv| contains invalid value (e.g., attempting to re-enable</span>
<span class="cm"> * flow control).</span>
<span class="cm"> * The |iv| contains invalid value (e.g., initial window size</span>
<span class="cm"> * strictly greater than (1 &lt;&lt; 31) - 1.</span>
<span class="cm"> * :enum:`NGHTTP2_ERR_NOMEM`</span>
<span class="cm"> * Out of memory.</span>
<span class="cm"> */</span>

Binary file not shown.

View File

@ -152,45 +152,36 @@
version 2.0.</p>
<div class="section" id="development-status">
<h2>Development Status<a class="headerlink" href="#development-status" title="Permalink to this headline"></a></h2>
<p>We started to implement HTTP-draft-09/2.0
(<a class="reference external" href="http://tools.ietf.org/html/draft-ietf-httpbis-http2-09">http://tools.ietf.org/html/draft-ietf-httpbis-http2-09</a>) and the
<p>We started to implement h2-10
(<a class="reference external" href="http://tools.ietf.org/html/draft-ietf-httpbis-http2-10">http://tools.ietf.org/html/draft-ietf-httpbis-http2-10</a>) and the
header compression
(<a class="reference external" href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05">http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-05</a>).</p>
(<a class="reference external" href="http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-06">http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-06</a>).</p>
<p>The nghttp2 code base was forked from spdylay project.</p>
<table border="1" class="docutils">
<colgroup>
<col width="60%" />
<col width="40%" />
<col width="84%" />
<col width="16%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Features</th>
<th class="head">HTTP-draft-09/2.0</th>
<th class="head">h2-10</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>:authority</td>
<tr class="row-even"><td>HPACK-draft-06</td>
<td>Done</td>
</tr>
<tr class="row-odd"><td>HPACK-draft-05</td>
<tr class="row-odd"><td>Strict SETTINGS validation</td>
<td>Done</td>
</tr>
<tr class="row-even"><td>SETTINGS_HEADER_TABLE_SIZE</td>
<tr class="row-even"><td>Disallow client to push</td>
<td>Done</td>
</tr>
<tr class="row-odd"><td>SETTINGS_ENABLE_PUSH</td>
<tr class="row-odd"><td>Padding</td>
<td>Done</td>
</tr>
<tr class="row-even"><td>FRAME_SIZE_ERROR</td>
<td>Done</td>
</tr>
<tr class="row-odd"><td>SETTINGS with ACK</td>
<td>Done</td>
</tr>
<tr class="row-even"><td>Header Continuation</td>
<td>Done</td>
</tr>
<tr class="row-odd"><td>ALPN</td>
<td>Done</td>
<tr class="row-even"><td>END_SEGMENT</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
@ -198,15 +189,20 @@ header compression
<div class="section" id="public-test-server">
<h2>Public Test Server<a class="headerlink" href="#public-test-server" title="Permalink to this headline"></a></h2>
<p>The following endpoints are available to try out nghttp2
implementation. These endpoints supports <tt class="docutils literal"><span class="pre">HTTP-draft-09/2.0</span></tt> and
the earlier draft versions are not supporeted.</p>
implementation.</p>
<ul>
<li><p class="first"><a class="reference external" href="https://106.186.112.116">https://106.186.112.116</a> (TLS + NPN / ALPN)</p>
<li><p class="first"><a class="reference external" href="https://106.186.112.116:8443/">https://106.186.112.116:8443/</a> (TLS + NPN / ALPN)</p>
<p>ALPN and NPN offer <tt class="docutils literal"><span class="pre">h2-10</span></tt>, <tt class="docutils literal"><span class="pre">spdy/3.1</span></tt>, <tt class="docutils literal"><span class="pre">spdy/3</span></tt>, <tt class="docutils literal"><span class="pre">spdy/2</span></tt>
and <tt class="docutils literal"><span class="pre">http/1.1</span></tt>.</p>
<p>Note: certificate is self-signed and a browser will show alert</p>
</li>
<li><p class="first"><a class="reference external" href="https://106.186.112.116/">https://106.186.112.116/</a> (TLS + NPN / ALPN)</p>
<p>ALPN and NPN offer <tt class="docutils literal"><span class="pre">HTTP-draft-09/2.0</span></tt>, <tt class="docutils literal"><span class="pre">spdy/3.1</span></tt>, <tt class="docutils literal"><span class="pre">spdy/3</span></tt>,
<tt class="docutils literal"><span class="pre">spdy/2</span></tt> and <tt class="docutils literal"><span class="pre">http/1.1</span></tt>.</p>
<p>Note: certificate is self-signed and a browser will show alert</p>
</li>
<li><p class="first"><a class="reference external" href="http://106.186.112.116">http://106.186.112.116</a> (Upgrade + Direct)</p>
<li><p class="first"><a class="reference external" href="http://106.186.112.116/">http://106.186.112.116/</a> (Upgrade / Direct)</p>
<p><tt class="docutils literal"><span class="pre">HTTP-draft-09/2.0</span></tt> and <tt class="docutils literal"><span class="pre">http/1.1</span></tt></p>
</li>
</ul>
</div>
@ -305,19 +301,21 @@ $ make</pre>
with prior knowledge, HTTP Upgrade and NPN/ALPN TLS extension.</p>
<p>It has verbose output mode for framing information. Here is sample
output from <tt class="docutils literal"><span class="pre">nghttp</span></tt> client:</p>
<div class="highlight-c"><pre>$ src/nghttp -vn https://localhost:8443
[ 0.003] NPN select next protocol: the remote server offers:
* HTTP-draft-09/2.0
<div class="highlight-c"><pre>$ src/nghttp -nv https://localhost:8443
[ 0.004][NPN] server offers:
* h2-10
* spdy/3.1
* spdy/3
* spdy/2
* http/1.1
NPN selected the protocol: HTTP-draft-09/2.0
[ 0.005] send SETTINGS frame &lt;length=16, flags=0x00, stream_id=0&gt;
The negotiated protocol: h2-10
[ 0.006] send SETTINGS frame &lt;length=10, flags=0x00, stream_id=0&gt;
(niv=2)
[SETTINGS_MAX_CONCURRENT_STREAMS(4):100]
[SETTINGS_INITIAL_WINDOW_SIZE(7):65535]
[ 0.006] send HEADERS frame &lt;length=47, flags=0x05, stream_id=1&gt;
[SETTINGS_MAX_CONCURRENT_STREAMS(3):100]
[SETTINGS_INITIAL_WINDOW_SIZE(4):65535]
[ 0.007] send HEADERS frame &lt;length=48, flags=0x05, stream_id=1&gt;
; END_STREAM | END_HEADERS
(padlen=0)
; Open new stream
:authority: localhost:8443
:method: GET
@ -325,90 +323,90 @@ output from <tt class="docutils literal"><span class="pre">nghttp</span></tt> cl
:scheme: https
accept: */*
accept-encoding: gzip, deflate
user-agent: nghttp2/0.1.0-DEV
[ 0.006] recv SETTINGS frame &lt;length=16, flags=0x00, stream_id=0&gt;
(niv=2)
[SETTINGS_MAX_CONCURRENT_STREAMS(4):100]
[SETTINGS_INITIAL_WINDOW_SIZE(7):65535]
[ 0.006] send SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
user-agent: nghttp2/0.4.0-DEV
[ 0.007] recv SETTINGS frame &lt;length=15, flags=0x00, stream_id=0&gt;
(niv=3)
[SETTINGS_MAX_CONCURRENT_STREAMS(3):100]
[SETTINGS_INITIAL_WINDOW_SIZE(4):65535]
[SETTINGS_ENABLE_PUSH(2):0]
[ 0.007] send SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
; ACK
(niv=0)
[ 0.006] recv WINDOW_UPDATE frame &lt;length=4, flags=0x00, stream_id=0&gt;
(window_size_increment=1000000007)
[ 0.006] recv SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
[ 0.007] recv SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
; ACK
(niv=0)
[ 0.006] recv HEADERS frame &lt;length=132, flags=0x04, stream_id=1&gt;
[ 0.008] (stream_id=1) :status: 200
[ 0.008] (stream_id=1) accept-ranges: bytes
[ 0.008] (stream_id=1) content-encoding: gzip
[ 0.008] (stream_id=1) content-length: 146
[ 0.008] (stream_id=1) content-type: text/html
[ 0.008] (stream_id=1) date: Sat, 15 Feb 2014 08:14:12 GMT
[ 0.008] (stream_id=1) etag: "b1-4e5535a027780-gzip"
[ 0.008] (stream_id=1) last-modified: Sun, 01 Sep 2013 14:34:22 GMT
[ 0.008] (stream_id=1) server: Apache/2.4.6 (Debian)
[ 0.008] (stream_id=1) vary: Accept-Encoding
[ 0.008] (stream_id=1) via: 1.1 nghttpx
[ 0.008] recv HEADERS frame &lt;length=141, flags=0x04, stream_id=1&gt;
; END_HEADERS
(padlen=0)
; First response header
:status: 200
accept-ranges: bytes
content-encoding: gzip
content-length: 146
content-type: text/html
date: Sun, 27 Oct 2013 14:23:54 GMT
etag: "b1-4e5535a027780-gzip"
last-modified: Sun, 01 Sep 2013 14:34:22 GMT
server: Apache/2.4.6 (Debian)
vary: Accept-Encoding
via: 1.1 nghttpx
[ 0.006] recv DATA frame &lt;length=146, flags=0x00, stream_id=1&gt;
[ 0.006] recv DATA frame &lt;length=0, flags=0x01, stream_id=1&gt;
[ 0.008] recv DATA frame &lt;length=146, flags=0x00, stream_id=1&gt;
[ 0.008] recv DATA frame &lt;length=0, flags=0x01, stream_id=1&gt;
; END_STREAM
[ 0.007] send GOAWAY frame &lt;length=8, flags=0x00, stream_id=0&gt;
[ 0.008] send GOAWAY frame &lt;length=8, flags=0x00, stream_id=0&gt;
(last_stream_id=0, error_code=NO_ERROR(0), opaque_data(0)=[])</pre>
</div>
<p>The HTTP Upgrade is performed like this:</p>
<div class="highlight-c"><pre>$ src/nghttp -vnu http://localhost:8080
<div class="highlight-c"><pre>$ src/nghttp -nvu http://localhost:8080
[ 0.000] HTTP Upgrade request
GET / HTTP/1.1
Host: localhost:8080
Connection: Upgrade, HTTP2-Settings
Upgrade: HTTP-draft-09/2.0
HTTP2-Settings: AAAABAAAAGQAAAAHAAD__w
Upgrade: h2-10
HTTP2-Settings: AwAAAGQEAAD__w
Accept: */*
User-Agent: nghttp2/0.1.0-DEV
User-Agent: nghttp2/0.4.0-DEV
[ 0.000] HTTP Upgrade response
[ 0.001] HTTP Upgrade response
HTTP/1.1 101 Switching Protocols
Connection: Upgrade
Upgrade: HTTP-draft-09/2.0
Upgrade: h2-10
[ 0.001] HTTP Upgrade success
[ 0.001] send SETTINGS frame &lt;length=16, flags=0x00, stream_id=0&gt;
[ 0.001] send SETTINGS frame &lt;length=10, flags=0x00, stream_id=0&gt;
(niv=2)
[SETTINGS_MAX_CONCURRENT_STREAMS(4):100]
[SETTINGS_INITIAL_WINDOW_SIZE(7):65535]
[ 0.001] recv SETTINGS frame &lt;length=16, flags=0x00, stream_id=0&gt;
(niv=2)
[SETTINGS_MAX_CONCURRENT_STREAMS(4):100]
[SETTINGS_INITIAL_WINDOW_SIZE(7):65535]
[ 0.001] recv WINDOW_UPDATE frame &lt;length=4, flags=0x00, stream_id=0&gt;
(window_size_increment=1000000007)
[ 0.001] recv HEADERS frame &lt;length=121, flags=0x04, stream_id=1&gt;
[SETTINGS_MAX_CONCURRENT_STREAMS(3):100]
[SETTINGS_INITIAL_WINDOW_SIZE(4):65535]
[ 0.001] recv SETTINGS frame &lt;length=15, flags=0x00, stream_id=0&gt;
(niv=3)
[SETTINGS_MAX_CONCURRENT_STREAMS(3):100]
[SETTINGS_INITIAL_WINDOW_SIZE(4):65535]
[SETTINGS_ENABLE_PUSH(2):0]
[ 0.001] (stream_id=1) :status: 200
[ 0.001] (stream_id=1) accept-ranges: bytes
[ 0.001] (stream_id=1) content-length: 177
[ 0.001] (stream_id=1) content-type: text/html
[ 0.001] (stream_id=1) date: Sat, 15 Feb 2014 08:16:23 GMT
[ 0.001] (stream_id=1) etag: "b1-4e5535a027780"
[ 0.001] (stream_id=1) last-modified: Sun, 01 Sep 2013 14:34:22 GMT
[ 0.001] (stream_id=1) server: Apache/2.4.6 (Debian)
[ 0.001] (stream_id=1) vary: Accept-Encoding
[ 0.001] (stream_id=1) via: 1.1 nghttpx
[ 0.001] recv HEADERS frame &lt;length=132, flags=0x04, stream_id=1&gt;
; END_HEADERS
(padlen=0)
; First response header
:status: 200
accept-ranges: bytes
content-length: 177
content-type: text/html
date: Sun, 27 Oct 2013 14:26:04 GMT
etag: "b1-4e5535a027780"
last-modified: Sun, 01 Sep 2013 14:34:22 GMT
server: Apache/2.4.6 (Debian)
vary: Accept-Encoding
via: 1.1 nghttpx
[ 0.001] recv DATA frame &lt;length=177, flags=0x00, stream_id=1&gt;
[ 0.001] recv DATA frame &lt;length=0, flags=0x01, stream_id=1&gt;
; END_STREAM
[ 0.001] send SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
[ 0.002] send SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
; ACK
(niv=0)
[ 0.001] send GOAWAY frame &lt;length=8, flags=0x00, stream_id=0&gt;
[ 0.002] send GOAWAY frame &lt;length=8, flags=0x00, stream_id=0&gt;
(last_stream_id=0, error_code=NO_ERROR(0), opaque_data(0)=[])
[ 0.001] recv SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
[ 0.002] recv SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
; ACK
(niv=0)</pre>
</div>
@ -427,50 +425,53 @@ information. Here is sample output from <tt class="docutils literal"><span class
<div class="highlight-c"><pre>$ src/nghttpd --no-tls -v 8080
IPv4: listen on port 8080
IPv6: listen on port 8080
[id=1] [ 1.189] send SETTINGS frame &lt;length=8, flags=0x00, stream_id=0&gt;
(niv=1)
[SETTINGS_MAX_CONCURRENT_STREAMS(4):100]
[id=1] [ 1.191] recv SETTINGS frame &lt;length=16, flags=0x00, stream_id=0&gt;
[id=1] [ 1.027] send SETTINGS frame &lt;length=10, flags=0x00, stream_id=0&gt;
(niv=2)
[SETTINGS_MAX_CONCURRENT_STREAMS(4):100]
[SETTINGS_INITIAL_WINDOW_SIZE(7):65535]
[id=1] [ 1.191] recv HEADERS frame &lt;length=47, flags=0x05, stream_id=1&gt;
[SETTINGS_MAX_CONCURRENT_STREAMS(3):100]
[SETTINGS_ENABLE_PUSH(2):0]
[id=1] [ 1.027] recv SETTINGS frame &lt;length=10, flags=0x00, stream_id=0&gt;
(niv=2)
[SETTINGS_MAX_CONCURRENT_STREAMS(3):100]
[SETTINGS_INITIAL_WINDOW_SIZE(4):65535]
[id=1] [ 1.027] (stream_id=1) :authority: localhost:8080
[id=1] [ 1.027] (stream_id=1) :method: GET
[id=1] [ 1.027] (stream_id=1) :path: /
[id=1] [ 1.027] (stream_id=1) :scheme: http
[id=1] [ 1.027] (stream_id=1) accept: */*
[id=1] [ 1.027] (stream_id=1) accept-encoding: gzip, deflate
[id=1] [ 1.027] (stream_id=1) user-agent: nghttp2/0.4.0-DEV
[id=1] [ 1.027] recv HEADERS frame &lt;length=48, flags=0x05, stream_id=1&gt;
; END_STREAM | END_HEADERS
(padlen=0)
; Open new stream
:authority: localhost:8080
:method: GET
:path: /
:scheme: http
accept: */*
accept-encoding: gzip, deflate
user-agent: nghttp2/0.1.0-DEV
[id=1] [ 1.192] send SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
[id=1] [ 1.027] send SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
; ACK
(niv=0)
[id=1] [ 1.192] send HEADERS frame &lt;length=70, flags=0x04, stream_id=1&gt;
[id=1] [ 1.027] send HEADERS frame &lt;length=72, flags=0x04, stream_id=1&gt;
; END_HEADERS
(padlen=0)
; First response header
:status: 404
content-encoding: gzip
content-type: text/html; charset=UTF-8
date: Sun, 27 Oct 2013 14:27:53 GMT
server: nghttpd nghttp2/0.1.0-DEV
[id=1] [ 1.192] send DATA frame &lt;length=117, flags=0x00, stream_id=1&gt;
[id=1] [ 1.192] send DATA frame &lt;length=0, flags=0x01, stream_id=1&gt;
date: Sat, 15 Feb 2014 08:18:53 GMT
server: nghttpd nghttp2/0.4.0-DEV
[id=1] [ 1.028] send DATA frame &lt;length=118, flags=0x00, stream_id=1&gt;
[id=1] [ 1.028] send DATA frame &lt;length=0, flags=0x01, stream_id=1&gt;
; END_STREAM
[id=1] [ 1.192] stream_id=1 closed
[id=1] [ 1.192] recv SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
[id=1] [ 1.028] stream_id=1 closed
[id=1] [ 1.028] recv SETTINGS frame &lt;length=0, flags=0x01, stream_id=0&gt;
; ACK
(niv=0)
[id=1] [ 1.192] recv GOAWAY frame &lt;length=8, flags=0x00, stream_id=0&gt;
[id=1] [ 1.028] recv GOAWAY frame &lt;length=8, flags=0x00, stream_id=0&gt;
(last_stream_id=0, error_code=NO_ERROR(0), opaque_data(0)=[])
[id=1] [ 1.192] closed</pre>
[id=1] [ 1.028] closed</pre>
</div>
</div>
<div class="section" id="nghttpx-proxy">
<h3>nghttpx - proxy<a class="headerlink" href="#nghttpx-proxy" title="Permalink to this headline"></a></h3>
<p>The <tt class="docutils literal"><span class="pre">nghttpx</span></tt> is a multi-threaded reverse proxy for
HTTP-draft-09/2.0, SPDY and HTTP/1.1. It has several operation modes:</p>
h2-10, SPDY and HTTP/1.1. It has several operation modes:</p>
<table border="1" class="docutils">
<colgroup>
<col width="24%" />
@ -514,7 +515,7 @@ HTTP-draft-09/2.0, SPDY and HTTP/1.1. It has several operation modes:</p>
</tbody>
</table>
<p>The interesting mode at the moment is the default mode. It works like
a reverse proxy and listens HTTP-draft-09/2.0, SPDY and HTTP/1.1 and
a reverse proxy and listens h2-10, SPDY and HTTP/1.1 and
can be deployed SSL/TLS terminator for existing web server.</p>
<p>The default mode, <tt class="docutils literal"><span class="pre">--http2-proxy</span></tt> and <tt class="docutils literal"><span class="pre">--http2-bridge</span></tt> modes use
SSL/TLS in the frontend connection by default. To disable SSL/TLS, use
@ -606,17 +607,14 @@ format used in <a class="reference external" href="https://github.com/Jxck/hpack
<h3>deflatehd - header compressor<a class="headerlink" href="#deflatehd-header-compressor" title="Permalink to this headline"></a></h3>
<p>The <tt class="docutils literal"><span class="pre">deflatehd</span></tt> reads JSON data or HTTP/1-style header fields from
stdin and outputs compressed header block in JSON.</p>
<p>For the JSON input, the root JSON object must contain <tt class="docutils literal"><span class="pre">context</span></tt> key,
which indicates which compression context is used. If it is
<tt class="docutils literal"><span class="pre">request</span></tt>, request compression context is used. Otherwise, response
compression context is used. The value of <tt class="docutils literal"><span class="pre">cases</span></tt> key contains the
sequence of input header set. They share the same compression context
and are processed in the order they appear. Each item in the sequence
is a JSON object and it must have at least <tt class="docutils literal"><span class="pre">headers</span></tt> key. Its value
is an array of a JSON object containing exactly one name/value pair.</p>
<p>For the JSON input, the root JSON object must include <tt class="docutils literal"><span class="pre">cases</span></tt>
key. Its value has to include the sequence of input header set. They
share the same compression context and are processed in the order they
appear. Each item in the sequence is a JSON object and it must
include <tt class="docutils literal"><span class="pre">headers</span></tt> key. Its value is an array of a JSON object ,
which includes exactly one name/value pair.</p>
<p>Example:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">&quot;context&quot;</span><span class="p">:</span> <span class="s2">&quot;request&quot;</span><span class="p">,</span>
<span class="nt">&quot;cases&quot;</span><span class="p">:</span>
<span class="p">[</span>
<span class="p">{</span>
@ -646,9 +644,7 @@ header field block. Each header set is delimited by empty line:</p>
<span class="n">user</span><span class="o">-</span><span class="n">agent</span><span class="o">:</span> <span class="n">nghttp2</span>
</pre></div>
</div>
<p>The output is JSON object. It contains <tt class="docutils literal"><span class="pre">context</span></tt> key and its value
is <tt class="docutils literal"><span class="pre">request</span></tt> if the compression context is request, otherwise
<tt class="docutils literal"><span class="pre">response</span></tt>. The root JSON object also contains <tt class="docutils literal"><span class="pre">cases</span></tt> key and its
<p>The output is JSON object. It should include <tt class="docutils literal"><span class="pre">cases</span></tt> key and its
value is an array of JSON object, which has at least following keys:</p>
<dl class="docutils">
<dt>seq</dt>
@ -668,7 +664,6 @@ value is an array of JSON object, which has at least following keys:</p>
</dl>
<p>Examples:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">&quot;context&quot;</span><span class="p">:</span> <span class="s2">&quot;request&quot;</span><span class="p">,</span>
<span class="nt">&quot;cases&quot;</span><span class="p">:</span>
<span class="p">[</span>
<span class="p">{</span>
@ -729,9 +724,9 @@ value is an array of JSON object, which has at least following keys:</p>
<p>The output can be used as the input for <tt class="docutils literal"><span class="pre">inflatehd</span></tt> and
<tt class="docutils literal"><span class="pre">deflatehd</span></tt>.</p>
<p>With <tt class="docutils literal"><span class="pre">-d</span></tt> option, the extra <tt class="docutils literal"><span class="pre">header_table</span></tt> key is added and its
associated value contains the state of dyanmic header table after the
corresponding header set was processed. The value contains following
keys:</p>
associated value includes the state of dyanmic header table after the
corresponding header set was processed. The value includes at least
following keys:</p>
<dl class="docutils">
<dt>entries</dt>
<dd>The entry in the header table. If <tt class="docutils literal"><span class="pre">referenced</span></tt> is <tt class="docutils literal"><span class="pre">true</span></tt>, it
@ -760,7 +755,6 @@ that they are no longer referenced.</dd>
</dl>
<p>Example:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">&quot;context&quot;</span><span class="p">:</span> <span class="s2">&quot;request&quot;</span><span class="p">,</span>
<span class="nt">&quot;cases&quot;</span><span class="p">:</span>
<span class="p">[</span>
<span class="p">{</span>
@ -916,17 +910,13 @@ that they are no longer referenced.</dd>
<h3>inflatehd - header decompressor<a class="headerlink" href="#inflatehd-header-decompressor" title="Permalink to this headline"></a></h3>
<p>The <tt class="docutils literal"><span class="pre">inflatehd</span></tt> reads JSON data from stdin and outputs decompressed
name/value pairs in JSON.</p>
<p>The root JSON object must contain <tt class="docutils literal"><span class="pre">context</span></tt> key, which indicates
which compression context is used. If it is <tt class="docutils literal"><span class="pre">request</span></tt>, request
compression context is used. Otherwise, response compression context
is used. The value of <tt class="docutils literal"><span class="pre">cases</span></tt> key contains the sequence of
compressed header block. They share the same compression context and
are processed in the order they appear. Each item in the sequence is a
JSON object and it must have at least <tt class="docutils literal"><span class="pre">wire</span></tt> key. Its value is a
string containing compressed header block in hex string.</p>
<p>The root JSON object must include <tt class="docutils literal"><span class="pre">cases</span></tt> key. Its value has to
include the sequence of compressed header block. They share the same
compression context and are processed in the order they appear. Each
item in the sequence is a JSON object and it must have at least
<tt class="docutils literal"><span class="pre">wire</span></tt> key. Its value is a compressed header block in hex string.</p>
<p>Example:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">&quot;context&quot;</span><span class="p">:</span> <span class="s2">&quot;request&quot;</span><span class="p">,</span>
<span class="nt">&quot;cases&quot;</span><span class="p">:</span>
<span class="p">[</span>
<span class="p">{</span> <span class="nt">&quot;wire&quot;</span><span class="p">:</span> <span class="s2">&quot;8285&quot;</span> <span class="p">},</span>
@ -935,15 +925,13 @@ string containing compressed header block in hex string.</p>
<span class="p">}</span>
</pre></div>
</div>
<p>The output is JSON object. It contains <tt class="docutils literal"><span class="pre">context</span></tt> key and its value
is <tt class="docutils literal"><span class="pre">request</span></tt> if the compression context is request, otherwise
<tt class="docutils literal"><span class="pre">response</span></tt>. The root JSON object also contains <tt class="docutils literal"><span class="pre">cases</span></tt> key and its
<p>The output is JSON object. It should include <tt class="docutils literal"><span class="pre">cases</span></tt> key and its
value is an array of JSON object, which has at least following keys:</p>
<dl class="docutils">
<dt>seq</dt>
<dd>The index of header set in the input.</dd>
<dt>headers</dt>
<dd>The JSON array contains decompressed name/value pairs.</dd>
<dd>The JSON array includes decompressed name/value pairs.</dd>
<dt>wire</dt>
<dd>The compressed header block in hex string.</dd>
<dt>header_table_size</dt>
@ -952,7 +940,6 @@ block.</dd>
</dl>
<p>Example:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">&quot;context&quot;</span><span class="p">:</span> <span class="s2">&quot;request&quot;</span><span class="p">,</span>
<span class="nt">&quot;cases&quot;</span><span class="p">:</span>
<span class="p">[</span>
<span class="p">{</span>
@ -1007,7 +994,7 @@ block.</dd>
<p>The output can be used as the input for <tt class="docutils literal"><span class="pre">deflatehd</span></tt> and
<tt class="docutils literal"><span class="pre">inflatehd</span></tt>.</p>
<p>With <tt class="docutils literal"><span class="pre">-d</span></tt> option, the extra <tt class="docutils literal"><span class="pre">header_table</span></tt> key is added and its
associated value contains the state of dyanmic header table after the
associated value includes the state of dyanmic header table after the
corresponding header set was processed. The format is the same as
<tt class="docutils literal"><span class="pre">deflatehd</span></tt>.</p>
</div>
@ -1030,8 +1017,8 @@ and decompressor in Python:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">binascii</span>
<span class="kn">import</span> <span class="nn">nghttp2</span>
<span class="n">deflater</span> <span class="o">=</span> <span class="n">nghttp2</span><span class="o">.</span><span class="n">HDDeflater</span><span class="p">(</span><span class="n">nghttp2</span><span class="o">.</span><span class="n">HD_SIDE_REQUEST</span><span class="p">)</span>
<span class="n">inflater</span> <span class="o">=</span> <span class="n">nghttp2</span><span class="o">.</span><span class="n">HDInflater</span><span class="p">(</span><span class="n">nghttp2</span><span class="o">.</span><span class="n">HD_SIDE_REQUEST</span><span class="p">)</span>
<span class="n">deflater</span> <span class="o">=</span> <span class="n">nghttp2</span><span class="o">.</span><span class="n">HDDeflater</span><span class="p">()</span>
<span class="n">inflater</span> <span class="o">=</span> <span class="n">nghttp2</span><span class="o">.</span><span class="n">HDInflater</span><span class="p">()</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">deflater</span><span class="o">.</span><span class="n">deflate</span><span class="p">([(</span><span class="n">b</span><span class="s">&#39;foo&#39;</span><span class="p">,</span> <span class="n">b</span><span class="s">&#39;bar&#39;</span><span class="p">),</span>
<span class="p">(</span><span class="n">b</span><span class="s">&#39;baz&#39;</span><span class="p">,</span> <span class="n">b</span><span class="s">&#39;buz&#39;</span><span class="p">)])</span>

File diff suppressed because one or more lines are too long