Update doc

This commit is contained in:
Tatsuhiro Tsujikawa 2014-07-04 00:48:28 +09:00
parent f9437ecf48
commit f6c288b05b
6 changed files with 56 additions and 13 deletions

View File

@ -2364,6 +2364,20 @@ local endpoint can send without WINDOW_UPDATE.</p>
<p>This function returns -1 if it fails.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_session_get_stream_local_close">
int <tt class="descname">nghttp2_session_get_stream_local_close</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a>*<em>&nbsp;session</em>, int32_t<em>&nbsp;stream_id</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_get_stream_local_close" title="Permalink to this definition"></a></dt>
<dd><p>Returns 1 if local peer half closed the given stream <em>stream_id</em>.
Returns 0 if it did not. Returns -1 if no such stream exists.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_session_get_stream_remote_close">
int <tt class="descname">nghttp2_session_get_stream_remote_close</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a>*<em>&nbsp;session</em>, int32_t<em>&nbsp;stream_id</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_get_stream_remote_close" title="Permalink to this definition"></a></dt>
<dd><p>Returns 1 if remote peer half closed the given stream <em>stream_id</em>.
Returns 0 if it did not. Returns -1 if no such stream exists.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_session_terminate_session">
int <tt class="descname">nghttp2_session_terminate_session</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_error_code" title="nghttp2_error_code">nghttp2_error_code</a><em>&nbsp;error_code</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_terminate_session" title="Permalink to this definition"></a></dt>
@ -2792,7 +2806,7 @@ called for this frame.</p>
<dl class="function">
<dt id="c.nghttp2_submit_ping">
int <tt class="descname">nghttp2_submit_ping</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, uint8_t<em>&nbsp;flags</em>, uint8_t<em>&nbsp;*opaque_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_ping" title="Permalink to this definition"></a></dt>
int <tt class="descname">nghttp2_submit_ping</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, uint8_t<em>&nbsp;flags</em>, const uint8_t<em>&nbsp;*opaque_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_ping" title="Permalink to this definition"></a></dt>
<dd><p>Submits PING frame. You don&#8217;t have to send PING back when you
received PING frame. The library automatically submits PING frame
in this case.</p>
@ -3148,7 +3162,7 @@ or one of the following negative error codes:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="kt">int</span> <span class="nf">inflate_header_block</span><span class="p">(</span><span class="n">nghttp2_hd_inflater</span> <span class="o">*</span><span class="n">hd_inflater</span><span class="p">,</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="n">inlen</span><span class="p">,</span> <span class="kt">int</span> <span class="n">final</span><span class="p">)</span>
<span class="p">{</span>
<span class="kt">int</span> <span class="n">rv</span><span class="p">;</span>
<span class="kt">ssize_t</span> <span class="n">rv</span><span class="p">;</span>
<span class="k">for</span><span class="p">(;;)</span> <span class="p">{</span>
<span class="n">nghttp2_nv</span> <span class="n">nv</span><span class="p">;</span>
@ -3158,7 +3172,7 @@ or one of the following negative error codes:</p>
<span class="n">in</span><span class="p">,</span> <span class="n">inlen</span><span class="p">,</span> <span class="n">final</span><span class="p">);</span>
<span class="k">if</span><span class="p">(</span><span class="n">rv</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">&quot;inflate failed with error code %d&quot;</span><span class="p">,</span> <span class="n">rv</span><span class="p">);</span>
<span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">&quot;inflate failed with error code %zd&quot;</span><span class="p">,</span> <span class="n">rv</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>

View File

@ -869,12 +869,12 @@
<dt><a href="apiref.html#c.nghttp2_info.proto_str">nghttp2_info.proto_str (C member)</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<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>
@ -1248,6 +1248,14 @@
</dt>
<dt><a href="apiref.html#c.nghttp2_session_get_stream_local_close">nghttp2_session_get_stream_local_close (C function)</a>
</dt>
<dt><a href="apiref.html#c.nghttp2_session_get_stream_remote_close">nghttp2_session_get_stream_remote_close (C function)</a>
</dt>
<dt><a href="apiref.html#c.nghttp2_session_get_stream_remote_window_size">nghttp2_session_get_stream_remote_window_size (C function)</a>
</dt>

View File

@ -2153,6 +2153,25 @@
<span class="kt">int32_t</span> <span class="nf">nghttp2_session_get_stream_remote_window_size</span><span class="p">(</span><span class="n">nghttp2_session</span><span class="o">*</span> <span class="n">session</span><span class="p">,</span>
<span class="kt">int32_t</span> <span class="n">stream_id</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * Returns 1 if local peer half closed the given stream |stream_id|.</span>
<span class="cm"> * Returns 0 if it did not. Returns -1 if no such stream exists.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">nghttp2_session_get_stream_local_close</span><span class="p">(</span><span class="n">nghttp2_session</span><span class="o">*</span> <span class="n">session</span><span class="p">,</span>
<span class="kt">int32_t</span> <span class="n">stream_id</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
<span class="cm"> * Returns 1 if remote peer half closed the given stream |stream_id|.</span>
<span class="cm"> * Returns 0 if it did not. Returns -1 if no such stream exists.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">nghttp2_session_get_stream_remote_close</span><span class="p">(</span><span class="n">nghttp2_session</span><span class="o">*</span> <span class="n">session</span><span class="p">,</span>
<span class="kt">int32_t</span> <span class="n">stream_id</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
<span class="cm"> *</span>
@ -2698,7 +2717,7 @@
<span class="cm"> * Out of memory.</span>
<span class="cm"> */</span>
<span class="kt">int</span> <span class="nf">nghttp2_submit_ping</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">uint8_t</span> <span class="o">*</span><span class="n">opaque_data</span><span class="p">);</span>
<span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">opaque_data</span><span class="p">);</span>
<span class="cm">/**</span>
<span class="cm"> * @function</span>
@ -3147,7 +3166,7 @@
<span class="cm"> * int inflate_header_block(nghttp2_hd_inflater *hd_inflater,</span>
<span class="cm"> * uint8_t *in, size_t inlen, int final)</span>
<span class="cm"> * {</span>
<span class="cm"> * int rv;</span>
<span class="cm"> * ssize_t rv;</span>
<span class="cm"> *</span>
<span class="cm"> * for(;;) {</span>
<span class="cm"> * nghttp2_nv nv;</span>
@ -3157,7 +3176,7 @@
<span class="cm"> * in, inlen, final);</span>
<span class="cm"> *</span>
<span class="cm"> * if(rv &lt; 0) {</span>
<span class="cm"> * fprintf(stderr, &quot;inflate failed with error code %d&quot;, rv);</span>
<span class="cm"> * fprintf(stderr, &quot;inflate failed with error code %zd&quot;, rv);</span>
<span class="cm"> * return -1;</span>
<span class="cm"> * }</span>
<span class="cm"> *</span>

View File

@ -307,7 +307,7 @@ that server, invoke nghttpx like this:</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You may need <tt class="docutils literal"><span class="pre">-k</span></tt> option if HTTP/2 server&#8217;ss certificate is
<p class="last">You may need <tt class="docutils literal"><span class="pre">-k</span></tt> option if HTTP/2 server&#8217;s certificate is
self-signed. But please note that it is insecure.</p>
</div>
<p>Then you can use curl to issue HTTP request via HTTP/2 proxy:</p>
@ -320,10 +320,12 @@ proxy.</p>
<div class="section" id="http-2-bridge-mode">
<h2>HTTP/2 bridge mode<a class="headerlink" href="#http-2-bridge-mode" title="Permalink to this headline"></a></h2>
<p>If nghttpx is invoked with <tt class="docutils literal"><span class="pre">--http2-bridge</span></tt> option, it operates in
HTTP/2 bridge mode. The supported protocols in frontend and backend
connections are the same in <a class="reference internal" href="#default-mode">default mode</a>.</p>
HTTP/2 bridge mode. The supported protocols in frontend connections
are the same in <a class="reference internal" href="#default-mode">default mode</a>. The protocol in backend is HTTP/2
only.</p>
<p>With <tt class="docutils literal"><span class="pre">--frontend-no-tls</span></tt> option, SSL/TLS is turned off in frontend
connection, so the connection gets insecure.</p>
connection, so the connection gets insecure. To disable SSL/TLS in
backend connection, use <tt class="docutils literal"><span class="pre">--backend-no-tls</span></tt> option.</p>
<p>The backend server is supporsed to be a HTTP/2 web server or HTTP/2
proxy. Since HTTP/2 requests opaque between proxied and non-proxied
request, the backend server may be proxy or just web server depending

Binary file not shown.

File diff suppressed because one or more lines are too long