Update doc
This commit is contained in:
parent
4f42e5af88
commit
6289910a43
|
@ -1628,7 +1628,7 @@ Functions
|
|||
*data_prd*. If *data_prd* is ``NULL``, HEADERS will have
|
||||
END_STREAM flag set.
|
||||
|
||||
This method can be used as normal HTTP response and server-push
|
||||
This method can be used as normal HTTP response and push
|
||||
response. When pushing a resource using this function, the
|
||||
*session* must be configured using `nghttp2_session_server_new()`
|
||||
or its variants and the target stream denoted by the *stream_id*
|
||||
|
@ -1805,6 +1805,9 @@ Functions
|
|||
callback is called just before the frame is sent. For PUSH_PROMISE
|
||||
frame, the argument frame has the promised stream ID assigned.
|
||||
|
||||
The client side can use this function to send PUSH_PROMISE to the
|
||||
server. But in normal HTTP usage, the server may treat it error.
|
||||
|
||||
This function returns 0 if it succeeds, or one of the following
|
||||
negative error codes:
|
||||
|
||||
|
|
|
@ -78,7 +78,8 @@
|
|||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#header-compression-test-tools">Header compression test tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2.0 client</a><ul>
|
||||
|
@ -2171,7 +2172,7 @@ in subsequent DATA frames. This function does not take ownership
|
|||
of the <em>data_prd</em>. The function copies the members of the
|
||||
<em>data_prd</em>. If <em>data_prd</em> is <tt class="docutils literal"><span class="pre">NULL</span></tt>, HEADERS will have
|
||||
END_STREAM flag set.</p>
|
||||
<p>This method can be used as normal HTTP response and server-push
|
||||
<p>This method can be used as normal HTTP response and push
|
||||
response. When pushing a resource using this function, the
|
||||
<em>session</em> must be configured using <a class="reference internal" href="#nghttp2_session_server_new" title="nghttp2_session_server_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_server_new()</span></tt></a>
|
||||
or its variants and the target stream denoted by the <em>stream_id</em>
|
||||
|
@ -2336,6 +2337,8 @@ stream ID, the application can use
|
|||
<a class="reference internal" href="#nghttp2_session_callbacks.before_frame_send_callback" title="nghttp2_session_callbacks.before_frame_send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.before_frame_send_callback</span></tt></a>. This
|
||||
callback is called just before the frame is sent. For PUSH_PROMISE
|
||||
frame, the argument frame has the promised stream ID assigned.</p>
|
||||
<p>The client side can use this function to send PUSH_PROMISE to the
|
||||
server. But in normal HTTP usage, the server may treat it error.</p>
|
||||
<p>This function returns 0 if it succeeds, or one of the following
|
||||
negative error codes:</p>
|
||||
<dl class="docutils">
|
||||
|
|
|
@ -78,7 +78,8 @@
|
|||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#header-compression-test-tools">Header compression test tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2.0 client</a><ul>
|
||||
|
|
|
@ -77,7 +77,8 @@
|
|||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#header-compression-test-tools">Header compression test tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2.0 client</a><ul>
|
||||
|
@ -147,7 +148,8 @@ version 2.0.</p>
|
|||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#header-compression-test-tools">Header compression test tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2.0 client</a><ul>
|
||||
|
|
|
@ -78,7 +78,8 @@
|
|||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#header-compression-test-tools">Header compression test tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2.0 client</a><ul>
|
||||
|
@ -2010,7 +2011,7 @@
|
|||
<span class="cm"> * |data_prd|. If |data_prd| is ``NULL``, HEADERS will have</span>
|
||||
<span class="cm"> * END_STREAM flag set.</span>
|
||||
<span class="cm"> *</span>
|
||||
<span class="cm"> * This method can be used as normal HTTP response and server-push</span>
|
||||
<span class="cm"> * This method can be used as normal HTTP response and push</span>
|
||||
<span class="cm"> * response. When pushing a resource using this function, the</span>
|
||||
<span class="cm"> * |session| must be configured using `nghttp2_session_server_new()`</span>
|
||||
<span class="cm"> * or its variants and the target stream denoted by the |stream_id|</span>
|
||||
|
@ -2212,6 +2213,9 @@
|
|||
<span class="cm"> * callback is called just before the frame is sent. For PUSH_PROMISE</span>
|
||||
<span class="cm"> * frame, the argument frame has the promised stream ID assigned.</span>
|
||||
<span class="cm"> *</span>
|
||||
<span class="cm"> * The client side can use this function to send PUSH_PROMISE to the</span>
|
||||
<span class="cm"> * server. But in normal HTTP usage, the server may treat it error.</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>
|
||||
|
|
|
@ -77,7 +77,8 @@
|
|||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#header-compression-test-tools">Header compression test tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2.0 client</a><ul>
|
||||
|
|
|
@ -78,7 +78,8 @@
|
|||
<li class="toctree-l2"><a class="reference internal" href="#build-from-git">Build from git</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#building-documentation">Building documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#header-compression-test-tools">Header compression test tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#hpack-tools">HPACK tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#python-bindings">Python bindings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2.0 client</a><ul>
|
||||
|
@ -231,11 +232,15 @@ resource) in <tt class="docutils literal"><span class="pre">nghttp</span></tt>,
|
|||
<ul class="simple">
|
||||
<li>libxml2 >= 2.7.7</li>
|
||||
</ul>
|
||||
<p>The header compression test tools in hdtest directory require the
|
||||
following package:</p>
|
||||
<p>The HPACK tools require the following package:</p>
|
||||
<ul class="simple">
|
||||
<li>jansson >= 2.5</li>
|
||||
</ul>
|
||||
<p>The Python bindings require the following packages:</p>
|
||||
<ul class="simple">
|
||||
<li>cython >= 0.19</li>
|
||||
<li>python >= 2.7</li>
|
||||
</ul>
|
||||
<p>If you are using Ubuntu 12.04, you need the following packages
|
||||
installed:</p>
|
||||
<ul class="simple">
|
||||
|
@ -577,13 +582,13 @@ the outside HTTP/2.0 proxy through HTTP proxy:</p>
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="header-compression-test-tools">
|
||||
<h2>Header compression test tools<a class="headerlink" href="#header-compression-test-tools" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The <tt class="docutils literal"><span class="pre">hdtest</span></tt> directory contains header compression test tools. The
|
||||
<tt class="docutils literal"><span class="pre">deflatehd</span></tt> is command-line header compression tool. The
|
||||
<tt class="docutils literal"><span class="pre">inflatehd</span></tt> is command-line header decompression tool. Both tools
|
||||
read input from stdin and write output to stdout. The errors are
|
||||
written to stderr. They take JSON as input and output.</p>
|
||||
<div class="section" id="hpack-tools">
|
||||
<h2>HPACK tools<a class="headerlink" href="#hpack-tools" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The <tt class="docutils literal"><span class="pre">src</span></tt> directory contains HPACK tools. The <tt class="docutils literal"><span class="pre">deflatehd</span></tt> is
|
||||
command-line header compression tool. The <tt class="docutils literal"><span class="pre">inflatehd</span></tt> is
|
||||
command-line header decompression tool. Both tools read input from
|
||||
stdin and write output to stdout. The errors are written to
|
||||
stderr. They take JSON as input and output.</p>
|
||||
<div class="section" id="deflatehd-header-compressor">
|
||||
<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 array or HTTP/1-style header fields from
|
||||
|
@ -868,6 +873,36 @@ corresponding header set was processed. The format is the same as
|
|||
<tt class="docutils literal"><span class="pre">deflatehd</span></tt>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="python-bindings">
|
||||
<h2>Python bindings<a class="headerlink" href="#python-bindings" title="Permalink to this headline">¶</a></h2>
|
||||
<p>This <tt class="docutils literal"><span class="pre">python</span></tt> directory contains nghttp2 Python bindings. The
|
||||
bindings currently only provide HPACK compressor and decompressor
|
||||
classes.</p>
|
||||
<p>The extension module is called <tt class="docutils literal"><span class="pre">nghttp2</span></tt>.</p>
|
||||
<p><tt class="docutils literal"><span class="pre">make</span></tt> will build the bindings and target Python version is
|
||||
determined by configure script. If the detected Python version is not
|
||||
what you expect, specify a path to Python executable in <tt class="docutils literal"><span class="pre">PYTHON</span></tt>
|
||||
variable as an argument to configure script (e.g., <tt class="docutils literal"><span class="pre">./configure</span>
|
||||
<span class="pre">PYTHON=/usr/bin/python3.3</span></tt>).</p>
|
||||
<div class="section" id="example">
|
||||
<h3>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The following example code illustrates basic usage of HPACK compressor
|
||||
and decompressor in Python:</p>
|
||||
<div class="highlight-c"><pre>import binascii
|
||||
import nghttp2
|
||||
|
||||
deflater = nghttp2.HDDeflater(nghttp2.HD_SIDE_REQUEST)
|
||||
inflater = nghttp2.HDInflater(nghttp2.HD_SIDE_REQUEST)
|
||||
|
||||
data = deflater.deflate([(b'foo', b'bar'),
|
||||
(b'baz', b'buz')])
|
||||
print(binascii.b2a_hex(data))
|
||||
|
||||
hdrs = inflater.inflate(data)
|
||||
print(hdrs)</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -83,7 +83,8 @@
|
|||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#header-compression-test-tools">Header compression test tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2.0 client</a><ul>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -78,7 +78,8 @@
|
|||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#header-compression-test-tools">Header compression test tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="">Tutorial: HTTP/2.0 client</a><ul>
|
||||
|
|
|
@ -78,7 +78,8 @@
|
|||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#build-from-git">Build from git</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#building-documentation">Building documentation</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#client-server-and-proxy-programs">Client, Server and Proxy programs</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#header-compression-test-tools">Header compression test tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#hpack-tools">HPACK tools</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="package_README.html#python-bindings">Python bindings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2.0 client</a><ul>
|
||||
|
|
Loading…
Reference in New Issue