Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2014-01-02 01:03:29 +09:00
parent d813ae89f6
commit 33f5605c5c
6 changed files with 31 additions and 39 deletions

View File

@ -1904,10 +1904,11 @@ Functions
.. function:: int nghttp2_select_next_protocol(unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen)
A helper function for dealing with NPN in client side. The *in*
contains server's protocol in preferable order. The format of *in*
is length-prefixed and not null-terminated. For example,
``HTTP-draft-04/2.0`` and ``http/1.1`` stored in *in* like this::
A helper function for dealing with NPN in client side or ALPN in
server side. The *in* contains peer's protocol list in preferable
order. The format of *in* is length-prefixed and not
null-terminated. For example, ``HTTP-draft-04/2.0`` and
``http/1.1`` stored in *in* like this::
in[0] = 17
in[1..17] = "HTTP-draft-04/2.0"
@ -1917,10 +1918,10 @@ Functions
The selection algorithm is as follows:
1. If server's list contains ``HTTP-draft-04/2.0``, it is selected
and returns 1. The following step is not taken.
1. If peer's list contains HTTP/2.0 protocol the library supports,
it is selected and returns 1. The following step is not taken.
2. If server's list contains ``http/1.1``, this function selects
2. If peer's list contains ``http/1.1``, this function selects
``http/1.1`` and returns 0. The following step is not taken.
3. This function selects nothing and returns -1. (So called
@ -1934,7 +1935,7 @@ Functions
See http://technotes.googlecode.com/git/nextprotoneg.html for more
details about NPN.
To use this method you should do something like::
For NPN, to use this method you should do something like::
static int select_next_proto_cb(SSL* ssl,
unsigned char **out,
@ -1953,10 +1954,6 @@ Functions
...
SSL_CTX_set_next_proto_select_cb(ssl_ctx, select_next_proto_cb, my_obj);
Note that the HTTP/2.0 spec does use ALPN instead of NPN. This
function is provided for transitional period before ALPN is got
implemented in major SSL/TLS libraries.
.. function:: int nghttp2_gzip_inflate_new(nghttp2_gzip **inflater_ptr)

View File

@ -2433,10 +2433,11 @@ is found to be greater than rhs-&gt;name; or returns 0 otherwise.</p>
<dl class="function">
<dt id="nghttp2_select_next_protocol">
int <tt class="descname">nghttp2_select_next_protocol</tt><big>(</big>unsigned char<em>&nbsp;**out</em>, unsigned char<em>&nbsp;*outlen</em>, const unsigned char<em>&nbsp;*in</em>, unsigned int<em>&nbsp;inlen</em><big>)</big><a class="headerlink" href="#nghttp2_select_next_protocol" title="Permalink to this definition"></a></dt>
<dd><p>A helper function for dealing with NPN in client side. The <em>in</em>
contains server&#8217;s protocol in preferable order. The format of <em>in</em>
is length-prefixed and not null-terminated. For example,
<tt class="docutils literal"><span class="pre">HTTP-draft-04/2.0</span></tt> and <tt class="docutils literal"><span class="pre">http/1.1</span></tt> stored in <em>in</em> like this:</p>
<dd><p>A helper function for dealing with NPN in client side or ALPN in
server side. The <em>in</em> contains peer&#8217;s protocol list in preferable
order. The format of <em>in</em> is length-prefixed and not
null-terminated. For example, <tt class="docutils literal"><span class="pre">HTTP-draft-04/2.0</span></tt> and
<tt class="docutils literal"><span class="pre">http/1.1</span></tt> stored in <em>in</em> like this:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="n">in</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="mi">17</span>
<span class="n">in</span><span class="p">[</span><span class="mf">1..17</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;HTTP-draft-04/2.0&quot;</span>
<span class="n">in</span><span class="p">[</span><span class="mi">18</span><span class="p">]</span> <span class="o">=</span> <span class="mi">8</span>
@ -2446,9 +2447,9 @@ is length-prefixed and not null-terminated. For example,
</div>
<p>The selection algorithm is as follows:</p>
<ol class="arabic simple">
<li>If server&#8217;s list contains <tt class="docutils literal"><span class="pre">HTTP-draft-04/2.0</span></tt>, it is selected
and returns 1. The following step is not taken.</li>
<li>If server&#8217;s list contains <tt class="docutils literal"><span class="pre">http/1.1</span></tt>, this function selects
<li>If peer&#8217;s list contains HTTP/2.0 protocol the library supports,
it is selected and returns 1. The following step is not taken.</li>
<li>If peer&#8217;s list contains <tt class="docutils literal"><span class="pre">http/1.1</span></tt>, this function selects
<tt class="docutils literal"><span class="pre">http/1.1</span></tt> and returns 0. The following step is not taken.</li>
<li>This function selects nothing and returns -1. (So called
non-overlap case). In this case, <em>out</em> and <em>outlen</em> are left
@ -2459,7 +2460,7 @@ written into <em>*out</em> and its length (which is 17) is
assigned to <em>*outlen</em>.</p>
<p>See <a class="reference external" href="http://technotes.googlecode.com/git/nextprotoneg.html">http://technotes.googlecode.com/git/nextprotoneg.html</a> for more
details about NPN.</p>
<p>To use this method you should do something like:</p>
<p>For NPN, to use this method you should do something like:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="k">static</span> <span class="kt">int</span> <span class="nf">select_next_proto_cb</span><span class="p">(</span><span class="n">SSL</span><span class="o">*</span> <span class="n">ssl</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>
@ -2478,9 +2479,6 @@ details about NPN.</p>
<span class="n">SSL_CTX_set_next_proto_select_cb</span><span class="p">(</span><span class="n">ssl_ctx</span><span class="p">,</span> <span class="n">select_next_proto_cb</span><span class="p">,</span> <span class="n">my_obj</span><span class="p">);</span>
</pre></div>
</div>
<p>Note that the HTTP/2.0 spec does use ALPN instead of NPN. This
function is provided for transitional period before ALPN is got
implemented in major SSL/TLS libraries.</p>
</dd></dl>
<dl class="function">

View File

@ -2328,10 +2328,11 @@
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * A helper function for dealing with NPN in client side. The |in|</span>
<span class="cm"> * contains server&#39;s protocol in preferable order. The format of |in|</span>
<span class="cm"> * is length-prefixed and not null-terminated. For example,</span>
<span class="cm"> * ``HTTP-draft-04/2.0`` and ``http/1.1`` stored in |in| like this::</span>
<span class="cm"> * A helper function for dealing with NPN in client side or ALPN in</span>
<span class="cm"> * server side. The |in| contains peer&#39;s protocol list in preferable</span>
<span class="cm"> * order. The format of |in| is length-prefixed and not</span>
<span class="cm"> * null-terminated. For example, ``HTTP-draft-04/2.0`` and</span>
<span class="cm"> * ``http/1.1`` stored in |in| like this::</span>
<span class="cm"> *</span>
<span class="cm"> * in[0] = 17</span>
<span class="cm"> * in[1..17] = &quot;HTTP-draft-04/2.0&quot;</span>
@ -2341,10 +2342,10 @@
<span class="cm"> *</span>
<span class="cm"> * The selection algorithm is as follows:</span>
<span class="cm"> *</span>
<span class="cm"> * 1. If server&#39;s list contains ``HTTP-draft-04/2.0``, it is selected</span>
<span class="cm"> * and returns 1. The following step is not taken.</span>
<span class="cm"> * 1. If peer&#39;s list contains HTTP/2.0 protocol the library supports,</span>
<span class="cm"> * it is selected and returns 1. The following step is not taken.</span>
<span class="cm"> *</span>
<span class="cm"> * 2. If server&#39;s list contains ``http/1.1``, this function selects</span>
<span class="cm"> * 2. If peer&#39;s list contains ``http/1.1``, this function selects</span>
<span class="cm"> * ``http/1.1`` and returns 0. The following step is not taken.</span>
<span class="cm"> *</span>
<span class="cm"> * 3. This function selects nothing and returns -1. (So called</span>
@ -2358,7 +2359,7 @@
<span class="cm"> * See http://technotes.googlecode.com/git/nextprotoneg.html for more</span>
<span class="cm"> * details about NPN.</span>
<span class="cm"> *</span>
<span class="cm"> * To use this method you should do something like::</span>
<span class="cm"> * For NPN, to use this method you should do something like::</span>
<span class="cm"> *</span>
<span class="cm"> * static int select_next_proto_cb(SSL* ssl,</span>
<span class="cm"> * unsigned char **out,</span>
@ -2377,10 +2378,6 @@
<span class="cm"> * ...</span>
<span class="cm"> * SSL_CTX_set_next_proto_select_cb(ssl_ctx, select_next_proto_cb, my_obj);</span>
<span class="cm"> *</span>
<span class="cm"> * Note that the HTTP/2.0 spec does use ALPN instead of NPN. This</span>
<span class="cm"> * function is provided for transitional period before ALPN is got</span>
<span class="cm"> * implemented in major SSL/TLS libraries.</span>
<span class="cm"> *</span>
<span class="cm"> */</span>
<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>

Binary file not shown.

View File

@ -177,7 +177,7 @@ header compression
<td>&nbsp;</td>
</tr>
<tr class="row-odd"><td>ALPN</td>
<td>&nbsp;</td>
<td>Done</td>
</tr>
</tbody>
</table>
@ -284,7 +284,7 @@ $ make</pre>
<div class="section" id="nghttp-client">
<h3>nghttp - client<a class="headerlink" href="#nghttp-client" title="Permalink to this headline"></a></h3>
<p><tt class="docutils literal"><span class="pre">nghttp</span></tt> is a HTTP/2.0 client. It can connect to the HTTP/2.0 server
with prior knowledge, HTTP Upgrade and NPN TLS extension.</p>
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
@ -401,7 +401,7 @@ Upgrade: HTTP-draft-09/2.0
multiplexes connections using non-blocking socket.</p>
<p>By default, it uses SSL/TLS connection. Use <tt class="docutils literal"><span class="pre">--no-tls</span></tt> option to
disable it.</p>
<p><tt class="docutils literal"><span class="pre">nghttpd</span></tt> only accept the HTTP/2.0 connection via NPN or direct
<p><tt class="docutils literal"><span class="pre">nghttpd</span></tt> only accept the HTTP/2.0 connection via NPN/ALPN or direct
HTTP/2.0 connection. No HTTP Upgrade is supported.</p>
<p><tt class="docutils literal"><span class="pre">-p</span></tt> option allows users to configure server push.</p>
<p>Just like <tt class="docutils literal"><span class="pre">nghttp</span></tt>, it has verbose output mode for framing

File diff suppressed because one or more lines are too long