nghttp2/apiref.html

3167 lines
239 KiB
HTML
Raw Normal View History

2013-07-28 14:26:41 +02:00
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2014-02-05 15:22:31 +01:00
<title>API Reference &mdash; nghttp2 0.4.0-DEV documentation</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
2013-07-28 14:26:41 +02:00
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
2014-02-24 17:49:22 +01:00
URL_ROOT:'./',
2014-02-05 15:22:31 +01:00
VERSION:'0.4.0-DEV',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
2014-02-16 07:26:13 +01:00
HAS_SOURCE: false
2013-07-28 14:26:41 +02:00
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<script type="text/javascript" src="_static/js/theme.js"></script>
2014-02-02 10:36:57 +01:00
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
2014-02-05 15:22:31 +01:00
<link rel="top" title="nghttp2 0.4.0-DEV documentation" href="index.html"/>
<link rel="next" title="nghttp2.h" href="nghttp2.h.html"/>
2014-04-20 16:36:21 +02:00
<link rel="prev" title="nghttpx - HOW-TO" href="nghttpx-howto.html"/>
2014-02-02 10:36:57 +01:00
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
2014-02-02 10:36:57 +01:00
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
2014-02-02 10:36:57 +01:00
<a href="index.html" class="fa fa-home"> nghttp2</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
2014-02-02 10:36:57 +01:00
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
2014-04-05 12:26:23 +02:00
<li class="toctree-l1"><a class="reference internal" href="package_README.html">nghttp2 - HTTP/2 C Library</a><ul>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#development-status">Development Status</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#public-test-server">Public Test Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="package_README.html#requirements">Requirements</a></li>
<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>
2014-03-03 17:17:25 +01:00
<li class="toctree-l2"><a class="reference internal" href="package_README.html#benchmarking-tool">Benchmarking tool</a></li>
2014-01-10 17:07:30 +01:00
<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>
2014-04-05 12:26:23 +02:00
<li class="toctree-l1"><a class="reference internal" href="tutorial-client.html">Tutorial: HTTP/2 client</a><ul>
2013-12-26 15:39:18 +01:00
<li class="toctree-l2"><a class="reference internal" href="tutorial-client.html#libevent-client-c">libevent-client.c</a></li>
</ul>
</li>
2014-04-05 12:26:23 +02:00
<li class="toctree-l1"><a class="reference internal" href="tutorial-server.html">Tutorial: HTTP/2 server</a><ul>
2013-12-26 15:39:18 +01:00
<li class="toctree-l2"><a class="reference internal" href="tutorial-server.html#libevent-server-c">libevent-server.c</a></li>
</ul>
</li>
2014-04-20 16:36:21 +02:00
<li class="toctree-l1"><a class="reference internal" href="nghttpx-howto.html">nghttpx - HOW-TO</a><ul>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#default-mode">Default mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#http-2-proxy-mode">HTTP/2 proxy mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#client-mode">Client mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#client-proxy-mode">Client proxy mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#http-2-bridge-mode">HTTP/2 bridge mode</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#disable-ssl-tls">Disable SSL/TLS</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#specifying-additional-ca-certificate">Specifying additional CA certificate</a></li>
<li class="toctree-l2"><a class="reference internal" href="nghttpx-howto.html#read-write-rate-limit">Read/write rate limit</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">API Reference</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#includes">Includes</a></li>
<li class="toctree-l2"><a class="reference internal" href="#remarks">Remarks</a></li>
<li class="toctree-l2"><a class="reference internal" href="#macros">Macros</a></li>
<li class="toctree-l2"><a class="reference internal" href="#enums">Enums</a></li>
<li class="toctree-l2"><a class="reference internal" href="#types-structs-unions-and-typedefs">Types (structs, unions and typedefs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#functions">Functions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2.h.html">nghttp2.h</a></li>
<li class="toctree-l1"><a class="reference internal" href="nghttp2ver.h.html">nghttp2ver.h</a></li>
2013-12-07 06:58:21 +01:00
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2">Source</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/tatsuhiro-t/nghttp2/issues">Issues</a></li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
2014-02-02 10:36:57 +01:00
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">nghttp2</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
2014-02-02 10:36:57 +01:00
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
2014-02-02 10:36:57 +01:00
<li>API Reference</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main">
2013-07-28 14:26:41 +02:00
<div class="section" id="api-reference">
<h1>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this headline"></a></h1>
<div class="section" id="includes">
<h2>Includes<a class="headerlink" href="#includes" title="Permalink to this headline"></a></h2>
<p>To use the public APIs, include <tt class="docutils literal"><span class="pre">nghttp2/nghttp2.h</span></tt>:</p>
<div class="highlight-c"><div class="highlight"><pre><span class="cp">#include &lt;nghttp2/nghttp2.h&gt;</span>
</pre></div>
</div>
2013-09-04 15:59:13 +02:00
<p>The header files are also available online: <a class="reference internal" href="nghttp2.h.html"><em>nghttp2.h</em></a> and
<a class="reference internal" href="nghttp2ver.h.html"><em>nghttp2ver.h</em></a>.</p>
2013-07-28 14:26:41 +02:00
</div>
<div class="section" id="remarks">
<h2>Remarks<a class="headerlink" href="#remarks" title="Permalink to this headline"></a></h2>
2014-02-24 17:49:22 +01:00
<p>Do not call <a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a>, <a class="reference internal" href="#c.nghttp2_session_mem_send" title="nghttp2_session_mem_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_send()</span></tt></a>,
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> or <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a> from the nghttp2
2014-02-18 16:17:10 +01:00
callback functions directly or indirectly. It will lead to the
crash. You can submit requests or frames in the callbacks then call
these functions outside the callbacks.</p>
2013-07-28 14:26:41 +02:00
</div>
<div class="section" id="macros">
<h2>Macros<a class="headerlink" href="#macros" title="Permalink to this headline"></a></h2>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_VERSION">
<tt class="descname">NGHTTP2_VERSION</tt><a class="headerlink" href="#c.NGHTTP2_VERSION" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Version number of the nghttp2 library release</p>
</dd></dl>
2013-09-04 15:59:13 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_VERSION_NUM">
<tt class="descname">NGHTTP2_VERSION_NUM</tt><a class="headerlink" href="#c.NGHTTP2_VERSION_NUM" title="Permalink to this definition"></a></dt>
2013-09-04 15:59:13 +02:00
<dd><p>Numerical representation of the version number of the nghttp2 library
release. This is a 24 bit number with 8 bits for major number, 8 bits
for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_PROTO_VERSION_ID">
<tt class="descname">NGHTTP2_PROTO_VERSION_ID</tt><a class="headerlink" href="#c.NGHTTP2_PROTO_VERSION_ID" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>The protocol version identification string of this library
supports. This identifier is used if HTTP/2 is used over TLS.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_PROTO_VERSION_ID_LEN">
<tt class="descname">NGHTTP2_PROTO_VERSION_ID_LEN</tt><a class="headerlink" href="#c.NGHTTP2_PROTO_VERSION_ID_LEN" title="Permalink to this definition"></a></dt>
<dd><p>The length of <a class="reference internal" href="#c.NGHTTP2_PROTO_VERSION_ID" title="NGHTTP2_PROTO_VERSION_ID"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_PROTO_VERSION_ID</span></tt></a>.</p>
2013-09-04 15:59:13 +02:00
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="macro">
<dt id="c.NGHTTP2_CLEARTEXT_PROTO_VERSION_ID">
<tt class="descname">NGHTTP2_CLEARTEXT_PROTO_VERSION_ID</tt><a class="headerlink" href="#c.NGHTTP2_CLEARTEXT_PROTO_VERSION_ID" title="Permalink to this definition"></a></dt>
<dd><p>The protocol version identification string of this library
supports. This identifier is used if HTTP/2 is used over cleartext
TCP.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_CLEARTEXT_PROTO_VERSION_ID_LEN">
<tt class="descname">NGHTTP2_CLEARTEXT_PROTO_VERSION_ID_LEN</tt><a class="headerlink" href="#c.NGHTTP2_CLEARTEXT_PROTO_VERSION_ID_LEN" title="Permalink to this definition"></a></dt>
<dd><p>The length of <a class="reference internal" href="#c.NGHTTP2_CLEARTEXT_PROTO_VERSION_ID" title="NGHTTP2_CLEARTEXT_PROTO_VERSION_ID"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_CLEARTEXT_PROTO_VERSION_ID</span></tt></a>.</p>
</dd></dl>
2013-09-04 15:59:13 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_VERSION_AGE">
<tt class="descname">NGHTTP2_VERSION_AGE</tt><a class="headerlink" href="#c.NGHTTP2_VERSION_AGE" title="Permalink to this definition"></a></dt>
<dd><p>The age of <a class="reference internal" href="#c.nghttp2_info" title="nghttp2_info"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_info</span></tt></a></p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-04-05 12:26:23 +02:00
<dt id="c.NGHTTP2_DEFAULT_WEIGHT">
<tt class="descname">NGHTTP2_DEFAULT_WEIGHT</tt><a class="headerlink" href="#c.NGHTTP2_DEFAULT_WEIGHT" title="Permalink to this definition"></a></dt>
2014-04-24 18:41:11 +02:00
<dd><p>The default weight of stream dependency.</p>
2014-04-05 12:26:23 +02:00
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_MAX_WEIGHT">
<tt class="descname">NGHTTP2_MAX_WEIGHT</tt><a class="headerlink" href="#c.NGHTTP2_MAX_WEIGHT" title="Permalink to this definition"></a></dt>
2014-04-24 18:41:11 +02:00
<dd><p>The maximum weight of stream dependency.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-04-05 12:26:23 +02:00
<dt id="c.NGHTTP2_MIN_WEIGHT">
<tt class="descname">NGHTTP2_MIN_WEIGHT</tt><a class="headerlink" href="#c.NGHTTP2_MIN_WEIGHT" title="Permalink to this definition"></a></dt>
2014-04-24 18:41:11 +02:00
<dd><p>The minimum weight of stream dependency.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
2013-08-08 18:52:42 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_MAX_WINDOW_SIZE">
<tt class="descname">NGHTTP2_MAX_WINDOW_SIZE</tt><a class="headerlink" href="#c.NGHTTP2_MAX_WINDOW_SIZE" title="Permalink to this definition"></a></dt>
2013-08-08 18:52:42 +02:00
<dd><p>The maximum window size</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_INITIAL_WINDOW_SIZE">
<tt class="descname">NGHTTP2_INITIAL_WINDOW_SIZE</tt><a class="headerlink" href="#c.NGHTTP2_INITIAL_WINDOW_SIZE" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The initial window size for stream level flow control.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE">
<tt class="descname">NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE</tt><a class="headerlink" href="#c.NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The initial window size for connection level flow control.</p>
</dd></dl>
2013-10-28 15:32:57 +01:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_MAX_HEADER_TABLE_SIZE">
<tt class="descname">NGHTTP2_MAX_HEADER_TABLE_SIZE</tt><a class="headerlink" href="#c.NGHTTP2_MAX_HEADER_TABLE_SIZE" title="Permalink to this definition"></a></dt>
2013-10-28 15:32:57 +01:00
<dd><p>The maximum header table size.</p>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="macro">
<dt id="c.NGHTTP2_CLIENT_CONNECTION_PREFACE">
<tt class="descname">NGHTTP2_CLIENT_CONNECTION_PREFACE</tt><a class="headerlink" href="#c.NGHTTP2_CLIENT_CONNECTION_PREFACE" title="Permalink to this definition"></a></dt>
<dd><p>The client connection preface.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_CLIENT_CONNECTION_PREFACE_LEN">
<tt class="descname">NGHTTP2_CLIENT_CONNECTION_PREFACE_LEN</tt><a class="headerlink" href="#c.NGHTTP2_CLIENT_CONNECTION_PREFACE_LEN" title="Permalink to this definition"></a></dt>
<dd><p>The length of <a class="reference internal" href="#c.NGHTTP2_CLIENT_CONNECTION_PREFACE" title="NGHTTP2_CLIENT_CONNECTION_PREFACE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_CLIENT_CONNECTION_PREFACE</span></tt></a>.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_CLIENT_CONNECTION_HEADER">
<tt class="descname">NGHTTP2_CLIENT_CONNECTION_HEADER</tt><a class="headerlink" href="#c.NGHTTP2_CLIENT_CONNECTION_HEADER" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>The client connection header. This macro is obsoleted by
NGHTTP2_CLIENT_CONNECTION_PREFACE.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_CLIENT_CONNECTION_HEADER_LEN">
<tt class="descname">NGHTTP2_CLIENT_CONNECTION_HEADER_LEN</tt><a class="headerlink" href="#c.NGHTTP2_CLIENT_CONNECTION_HEADER_LEN" title="Permalink to this definition"></a></dt>
<dd><p>The length of <a class="reference internal" href="#c.NGHTTP2_CLIENT_CONNECTION_HEADER" title="NGHTTP2_CLIENT_CONNECTION_HEADER"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_CLIENT_CONNECTION_HEADER</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS">
<tt class="descname">NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS</tt><a class="headerlink" href="#c.NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Default maximum concurrent streams.</p>
</dd></dl>
</div>
<div class="section" id="enums">
<h2>Enums<a class="headerlink" href="#enums" title="Permalink to this headline"></a></h2>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_error">
<tt class="descname">nghttp2_error</tt><a class="headerlink" href="#c.nghttp2_error" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Error codes used in this library. The code range is [-999, -500],
2013-07-28 14:26:41 +02:00
inclusive. The following values are defined:</p>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_INVALID_ARGUMENT">
<tt class="descname">NGHTTP2_ERR_INVALID_ARGUMENT</tt><a class="headerlink" href="#c.NGHTTP2_ERR_INVALID_ARGUMENT" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-501</span></tt>)
Invalid argument passed.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_UNSUPPORTED_VERSION">
<tt class="descname">NGHTTP2_ERR_UNSUPPORTED_VERSION</tt><a class="headerlink" href="#c.NGHTTP2_ERR_UNSUPPORTED_VERSION" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-503</span></tt>)
The specified protocol version is not supported.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_WOULDBLOCK">
<tt class="descname">NGHTTP2_ERR_WOULDBLOCK</tt><a class="headerlink" href="#c.NGHTTP2_ERR_WOULDBLOCK" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-504</span></tt>)
2014-02-24 17:49:22 +01:00
Used as a return value from <a class="reference internal" href="#c.nghttp2_send_callback" title="nghttp2_send_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_send_callback</span></tt></a> and
<a class="reference internal" href="#c.nghttp2_recv_callback" title="nghttp2_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_recv_callback</span></tt></a> to indicate that the operation
2013-07-28 14:26:41 +02:00
would block.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_PROTO">
<tt class="descname">NGHTTP2_ERR_PROTO</tt><a class="headerlink" href="#c.NGHTTP2_ERR_PROTO" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-505</span></tt>)
General protocol error</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_INVALID_FRAME">
<tt class="descname">NGHTTP2_ERR_INVALID_FRAME</tt><a class="headerlink" href="#c.NGHTTP2_ERR_INVALID_FRAME" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-506</span></tt>)
The frame is invalid.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_EOF">
<tt class="descname">NGHTTP2_ERR_EOF</tt><a class="headerlink" href="#c.NGHTTP2_ERR_EOF" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-507</span></tt>)
The peer performed a shutdown on the connection.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_DEFERRED">
<tt class="descname">NGHTTP2_ERR_DEFERRED</tt><a class="headerlink" href="#c.NGHTTP2_ERR_DEFERRED" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-508</span></tt>)
Used as a return value from
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_data_source_read_callback" title="nghttp2_data_source_read_callback"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_data_source_read_callback()</span></tt></a> to indicate that data
2014-04-08 17:17:05 +02:00
transfer is postponed. See
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_data_source_read_callback" title="nghttp2_data_source_read_callback"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_data_source_read_callback()</span></tt></a> for details.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE">
<tt class="descname">NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE</tt><a class="headerlink" href="#c.NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-509</span></tt>)
2014-04-08 17:17:05 +02:00
Stream ID has reached the maximum value. Therefore no stream ID
2013-07-28 14:26:41 +02:00
is available.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_STREAM_CLOSED">
<tt class="descname">NGHTTP2_ERR_STREAM_CLOSED</tt><a class="headerlink" href="#c.NGHTTP2_ERR_STREAM_CLOSED" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-510</span></tt>)
The stream is already closed; or the stream ID is invalid.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_STREAM_CLOSING">
<tt class="descname">NGHTTP2_ERR_STREAM_CLOSING</tt><a class="headerlink" href="#c.NGHTTP2_ERR_STREAM_CLOSING" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-511</span></tt>)
2014-04-08 17:17:05 +02:00
RST_STREAM has been added to the outbound queue. The stream is
in closing state.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_STREAM_SHUT_WR">
<tt class="descname">NGHTTP2_ERR_STREAM_SHUT_WR</tt><a class="headerlink" href="#c.NGHTTP2_ERR_STREAM_SHUT_WR" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-512</span></tt>)
The transmission is not allowed for this stream (e.g., a frame
with END_STREAM flag set has already sent).</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_INVALID_STREAM_ID">
<tt class="descname">NGHTTP2_ERR_INVALID_STREAM_ID</tt><a class="headerlink" href="#c.NGHTTP2_ERR_INVALID_STREAM_ID" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-513</span></tt>)
The stream ID is invalid.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_INVALID_STREAM_STATE">
<tt class="descname">NGHTTP2_ERR_INVALID_STREAM_STATE</tt><a class="headerlink" href="#c.NGHTTP2_ERR_INVALID_STREAM_STATE" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-514</span></tt>)
The state of the stream is not valid (e.g., DATA cannot be sent
to the stream if response HEADERS has not been sent).</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_DEFERRED_DATA_EXIST">
<tt class="descname">NGHTTP2_ERR_DEFERRED_DATA_EXIST</tt><a class="headerlink" href="#c.NGHTTP2_ERR_DEFERRED_DATA_EXIST" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-515</span></tt>)
Another DATA frame has already been deferred.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_START_STREAM_NOT_ALLOWED">
<tt class="descname">NGHTTP2_ERR_START_STREAM_NOT_ALLOWED</tt><a class="headerlink" href="#c.NGHTTP2_ERR_START_STREAM_NOT_ALLOWED" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-516</span></tt>)
2014-04-08 17:17:05 +02:00
Starting new stream is not allowed (e.g., GOAWAY has been sent
and/or received).</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_GOAWAY_ALREADY_SENT">
<tt class="descname">NGHTTP2_ERR_GOAWAY_ALREADY_SENT</tt><a class="headerlink" href="#c.NGHTTP2_ERR_GOAWAY_ALREADY_SENT" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-517</span></tt>)
GOAWAY has already been sent.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_INVALID_HEADER_BLOCK">
<tt class="descname">NGHTTP2_ERR_INVALID_HEADER_BLOCK</tt><a class="headerlink" href="#c.NGHTTP2_ERR_INVALID_HEADER_BLOCK" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-518</span></tt>)
2014-04-08 17:17:05 +02:00
The received frame contains the invalid header block (e.g., There
are duplicate header names; or the header names are not encoded
in US-ASCII character set and not lower cased; or the header name
is zero-length string; or the header value contains multiple
in-sequence NUL bytes).</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_INVALID_STATE">
<tt class="descname">NGHTTP2_ERR_INVALID_STATE</tt><a class="headerlink" href="#c.NGHTTP2_ERR_INVALID_STATE" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-519</span></tt>)
Indicates that the context is not suitable to perform the
requested operation.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_GZIP">
<tt class="descname">NGHTTP2_ERR_GZIP</tt><a class="headerlink" href="#c.NGHTTP2_ERR_GZIP" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-520</span></tt>)
The gzip error.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE">
<tt class="descname">NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE</tt><a class="headerlink" href="#c.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-521</span></tt>)
The user callback function failed due to the temporal error.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_FRAME_SIZE_ERROR">
<tt class="descname">NGHTTP2_ERR_FRAME_SIZE_ERROR</tt><a class="headerlink" href="#c.NGHTTP2_ERR_FRAME_SIZE_ERROR" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-522</span></tt>)
2013-10-28 15:32:57 +01:00
The length of the frame is invalid, either too large or too small.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_HEADER_COMP">
<tt class="descname">NGHTTP2_ERR_HEADER_COMP</tt><a class="headerlink" href="#c.NGHTTP2_ERR_HEADER_COMP" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-523</span></tt>)
Header block inflate/deflate error.</p>
</dd></dl>
2013-08-08 18:52:42 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_FLOW_CONTROL">
<tt class="descname">NGHTTP2_ERR_FLOW_CONTROL</tt><a class="headerlink" href="#c.NGHTTP2_ERR_FLOW_CONTROL" title="Permalink to this definition"></a></dt>
2013-08-08 18:52:42 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-524</span></tt>)
Flow control error</p>
</dd></dl>
2013-09-10 17:59:12 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_INSUFF_BUFSIZE">
<tt class="descname">NGHTTP2_ERR_INSUFF_BUFSIZE</tt><a class="headerlink" href="#c.NGHTTP2_ERR_INSUFF_BUFSIZE" title="Permalink to this definition"></a></dt>
2013-09-10 17:59:12 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-525</span></tt>)
Insufficient buffer size given to function.</p>
</dd></dl>
2013-10-03 18:33:21 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_PAUSE">
<tt class="descname">NGHTTP2_ERR_PAUSE</tt><a class="headerlink" href="#c.NGHTTP2_ERR_PAUSE" title="Permalink to this definition"></a></dt>
2013-10-03 18:33:21 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-526</span></tt>)
Callback was paused by the application</p>
</dd></dl>
2013-10-28 15:32:57 +01:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS">
<tt class="descname">NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS</tt><a class="headerlink" href="#c.NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS" title="Permalink to this definition"></a></dt>
2013-10-28 15:32:57 +01:00
<dd><p>(<tt class="docutils literal"><span class="pre">-527</span></tt>)
There are too many in-flight SETTING frame and no more
transmission of SETTINGS is allowed.</p>
</dd></dl>
2013-11-02 09:01:32 +01:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_PUSH_DISABLED">
<tt class="descname">NGHTTP2_ERR_PUSH_DISABLED</tt><a class="headerlink" href="#c.NGHTTP2_ERR_PUSH_DISABLED" title="Permalink to this definition"></a></dt>
2013-11-02 09:01:32 +01:00
<dd><p>(<tt class="docutils literal"><span class="pre">-528</span></tt>)
The server push is disabled.</p>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="macro">
<dt id="c.NGHTTP2_ERR_DATA_EXIST">
<tt class="descname">NGHTTP2_ERR_DATA_EXIST</tt><a class="headerlink" href="#c.NGHTTP2_ERR_DATA_EXIST" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">-529</span></tt>)
DATA frame for a given stream has been already submitted and has
not been fully processed yet.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_FATAL">
<tt class="descname">NGHTTP2_ERR_FATAL</tt><a class="headerlink" href="#c.NGHTTP2_ERR_FATAL" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-900</span></tt>)
2014-02-24 17:49:22 +01:00
The errors &lt; <a class="reference internal" href="#c.NGHTTP2_ERR_FATAL" title="NGHTTP2_ERR_FATAL"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_FATAL</span></tt></a> mean that the library is
2014-04-08 17:17:05 +02:00
under unexpected condition and processing was terminated (e.g.,
out of memory). If application receives this error code, it must
stop using that <a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_session</span></tt></a> object and only allowed
operation for that object is deallocate it using
<a class="reference internal" href="#c.nghttp2_session_del" title="nghttp2_session_del"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_del()</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_NOMEM">
<tt class="descname">NGHTTP2_ERR_NOMEM</tt><a class="headerlink" href="#c.NGHTTP2_ERR_NOMEM" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-901</span></tt>)
2014-04-08 17:17:05 +02:00
Out of memory. This is a fatal error.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ERR_CALLBACK_FAILURE">
<tt class="descname">NGHTTP2_ERR_CALLBACK_FAILURE</tt><a class="headerlink" href="#c.NGHTTP2_ERR_CALLBACK_FAILURE" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">-902</span></tt>)
2014-04-08 17:17:05 +02:00
The user callback function failed. This is a fatal error.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="type">
<dt id="c.nghttp2_nv_flag">
<tt class="descname">nghttp2_nv_flag</tt><a class="headerlink" href="#c.nghttp2_nv_flag" title="Permalink to this definition"></a></dt>
<dd><p>The flags for header field name/value pair.</p>
<dl class="macro">
<dt id="c.NGHTTP2_NV_FLAG_NONE">
<tt class="descname">NGHTTP2_NV_FLAG_NONE</tt><a class="headerlink" href="#c.NGHTTP2_NV_FLAG_NONE" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0</span></tt>)
No flag set.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_NV_FLAG_NO_INDEX">
<tt class="descname">NGHTTP2_NV_FLAG_NO_INDEX</tt><a class="headerlink" href="#c.NGHTTP2_NV_FLAG_NO_INDEX" title="Permalink to this definition"></a></dt>
2014-05-06 16:23:33 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x01</span></tt>)
2014-04-05 12:26:23 +02:00
Indicates that this name/value pair must not be indexed.</p>
</dd></dl>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame_type">
<tt class="descname">nghttp2_frame_type</tt><a class="headerlink" href="#c.nghttp2_frame_type" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>The control frame types in HTTP/2.</p>
2013-07-28 14:26:41 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_DATA">
<tt class="descname">NGHTTP2_DATA</tt><a class="headerlink" href="#c.NGHTTP2_DATA" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0</span></tt>)
The DATA frame.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_HEADERS">
<tt class="descname">NGHTTP2_HEADERS</tt><a class="headerlink" href="#c.NGHTTP2_HEADERS" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x01</span></tt>)
2013-07-28 14:26:41 +02:00
The HEADERS frame.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_PRIORITY">
<tt class="descname">NGHTTP2_PRIORITY</tt><a class="headerlink" href="#c.NGHTTP2_PRIORITY" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x02</span></tt>)
2013-07-28 14:26:41 +02:00
The PRIORITY frame.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_RST_STREAM">
<tt class="descname">NGHTTP2_RST_STREAM</tt><a class="headerlink" href="#c.NGHTTP2_RST_STREAM" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x03</span></tt>)
2013-07-28 14:26:41 +02:00
The RST_STREAM frame.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_SETTINGS">
<tt class="descname">NGHTTP2_SETTINGS</tt><a class="headerlink" href="#c.NGHTTP2_SETTINGS" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x04</span></tt>)
2013-07-28 14:26:41 +02:00
The SETTINGS frame.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_PUSH_PROMISE">
<tt class="descname">NGHTTP2_PUSH_PROMISE</tt><a class="headerlink" href="#c.NGHTTP2_PUSH_PROMISE" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x05</span></tt>)
2013-07-28 14:26:41 +02:00
The PUSH_PROMISE frame.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_PING">
<tt class="descname">NGHTTP2_PING</tt><a class="headerlink" href="#c.NGHTTP2_PING" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x06</span></tt>)
2013-07-28 14:26:41 +02:00
The PING frame.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_GOAWAY">
<tt class="descname">NGHTTP2_GOAWAY</tt><a class="headerlink" href="#c.NGHTTP2_GOAWAY" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x07</span></tt>)
2013-07-28 14:26:41 +02:00
The GOAWAY frame.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_WINDOW_UPDATE">
<tt class="descname">NGHTTP2_WINDOW_UPDATE</tt><a class="headerlink" href="#c.NGHTTP2_WINDOW_UPDATE" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x08</span></tt>)
2013-07-28 14:26:41 +02:00
The WINDOW_UPDATE frame.</p>
</dd></dl>
2014-01-26 15:37:13 +01:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_CONTINUATION">
<tt class="descname">NGHTTP2_CONTINUATION</tt><a class="headerlink" href="#c.NGHTTP2_CONTINUATION" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x09</span></tt>)
2014-01-26 15:37:13 +01:00
The CONTINUATION frame.</p>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="macro">
<dt id="c.NGHTTP2_ALTSVC">
<tt class="descname">NGHTTP2_ALTSVC</tt><a class="headerlink" href="#c.NGHTTP2_ALTSVC" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x0a</span></tt>)
The ALTSVC frame.</p>
</dd></dl>
2014-04-24 18:41:11 +02:00
<dl class="macro">
<dt id="c.NGHTTP2_BLOCKED">
<tt class="descname">NGHTTP2_BLOCKED</tt><a class="headerlink" href="#c.NGHTTP2_BLOCKED" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x0b</span></tt>)
The BLOCKED frame.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_flag">
<tt class="descname">nghttp2_flag</tt><a class="headerlink" href="#c.nghttp2_flag" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The flags for HTTP/2 frames. This enum defines all flags for all
frames.</p>
2013-07-28 14:26:41 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_FLAG_NONE">
<tt class="descname">NGHTTP2_FLAG_NONE</tt><a class="headerlink" href="#c.NGHTTP2_FLAG_NONE" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0</span></tt>)
No flag set.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_FLAG_END_STREAM">
<tt class="descname">NGHTTP2_FLAG_END_STREAM</tt><a class="headerlink" href="#c.NGHTTP2_FLAG_END_STREAM" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x01</span></tt>)
2013-07-28 14:26:41 +02:00
The END_STREAM flag.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_FLAG_END_HEADERS">
<tt class="descname">NGHTTP2_FLAG_END_HEADERS</tt><a class="headerlink" href="#c.NGHTTP2_FLAG_END_HEADERS" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x04</span></tt>)
2013-07-28 14:26:41 +02:00
The END_HEADERS flag.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_FLAG_ACK">
<tt class="descname">NGHTTP2_FLAG_ACK</tt><a class="headerlink" href="#c.NGHTTP2_FLAG_ACK" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x01</span></tt>)
2013-10-28 15:32:57 +01:00
The ACK flag.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
2014-02-16 07:51:22 +01:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_FLAG_END_SEGMENT">
<tt class="descname">NGHTTP2_FLAG_END_SEGMENT</tt><a class="headerlink" href="#c.NGHTTP2_FLAG_END_SEGMENT" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x02</span></tt>)
2014-02-16 07:51:22 +01:00
The END_SEGMENT flag.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_FLAG_PAD_LOW">
<tt class="descname">NGHTTP2_FLAG_PAD_LOW</tt><a class="headerlink" href="#c.NGHTTP2_FLAG_PAD_LOW" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x08</span></tt>)
2014-02-16 07:51:22 +01:00
The PAD_LOW flag.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_FLAG_PAD_HIGH">
<tt class="descname">NGHTTP2_FLAG_PAD_HIGH</tt><a class="headerlink" href="#c.NGHTTP2_FLAG_PAD_HIGH" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x10</span></tt>)
2014-02-16 07:51:22 +01:00
The PAD_HIGH flag.</p>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="macro">
2014-04-24 18:41:11 +02:00
<dt id="c.NGHTTP2_FLAG_PRIORITY">
<tt class="descname">NGHTTP2_FLAG_PRIORITY</tt><a class="headerlink" href="#c.NGHTTP2_FLAG_PRIORITY" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x20</span></tt>)
2014-04-24 18:41:11 +02:00
The PRIORITY flag.</p>
2014-04-05 12:26:23 +02:00
</dd></dl>
<dl class="macro">
2014-04-24 18:41:11 +02:00
<dt id="c.NGHTTP2_FLAG_COMPRESSED">
<tt class="descname">NGHTTP2_FLAG_COMPRESSED</tt><a class="headerlink" href="#c.NGHTTP2_FLAG_COMPRESSED" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x20</span></tt>)
THE COMPRESSED flag.</p>
2014-04-05 12:26:23 +02:00
</dd></dl>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_settings_id">
<tt class="descname">nghttp2_settings_id</tt><a class="headerlink" href="#c.nghttp2_settings_id" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The SETTINGS ID.</p>
2013-10-28 15:32:57 +01:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_SETTINGS_HEADER_TABLE_SIZE">
<tt class="descname">NGHTTP2_SETTINGS_HEADER_TABLE_SIZE</tt><a class="headerlink" href="#c.NGHTTP2_SETTINGS_HEADER_TABLE_SIZE" title="Permalink to this definition"></a></dt>
2013-10-28 15:32:57 +01:00
<dd><p>(<tt class="docutils literal"><span class="pre">1</span></tt>)
SETTINGS_HEADER_TABLE_SIZE</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_SETTINGS_ENABLE_PUSH">
<tt class="descname">NGHTTP2_SETTINGS_ENABLE_PUSH</tt><a class="headerlink" href="#c.NGHTTP2_SETTINGS_ENABLE_PUSH" title="Permalink to this definition"></a></dt>
2013-10-28 15:32:57 +01:00
<dd><p>(<tt class="docutils literal"><span class="pre">2</span></tt>)
SETTINGS_ENABLE_PUSH</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS">
<tt class="descname">NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS</tt><a class="headerlink" href="#c.NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS" title="Permalink to this definition"></a></dt>
2014-02-16 07:51:22 +01:00
<dd><p>(<tt class="docutils literal"><span class="pre">3</span></tt>)
2013-07-28 14:26:41 +02:00
SETTINGS_MAX_CONCURRENT_STREAMS</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE">
<tt class="descname">NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE</tt><a class="headerlink" href="#c.NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE" title="Permalink to this definition"></a></dt>
2014-02-16 07:51:22 +01:00
<dd><p>(<tt class="docutils literal"><span class="pre">4</span></tt>)
2013-07-28 14:26:41 +02:00
SETTINGS_INITIAL_WINDOW_SIZE</p>
</dd></dl>
2014-04-24 18:41:11 +02:00
<dl class="macro">
<dt id="c.NGHTTP2_SETTINGS_COMPRESS_DATA">
<tt class="descname">NGHTTP2_SETTINGS_COMPRESS_DATA</tt><a class="headerlink" href="#c.NGHTTP2_SETTINGS_COMPRESS_DATA" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">5</span></tt>)
SETTINGS_COMPRESS_DATA</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_SETTINGS_MAX">
<tt class="descname">NGHTTP2_SETTINGS_MAX</tt><a class="headerlink" href="#c.NGHTTP2_SETTINGS_MAX" title="Permalink to this definition"></a></dt>
2014-04-24 18:41:11 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">5</span></tt>)
2014-02-24 17:49:22 +01:00
Maximum ID of <a class="reference internal" href="#c.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>
2013-07-28 14:26:41 +02:00
</dd></dl>
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_error_code">
<tt class="descname">nghttp2_error_code</tt><a class="headerlink" href="#c.nghttp2_error_code" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The status codes for the RST_STREAM and GOAWAY frames.</p>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_NO_ERROR">
<tt class="descname">NGHTTP2_NO_ERROR</tt><a class="headerlink" href="#c.NGHTTP2_NO_ERROR" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0</span></tt>)
No errors.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_PROTOCOL_ERROR">
<tt class="descname">NGHTTP2_PROTOCOL_ERROR</tt><a class="headerlink" href="#c.NGHTTP2_PROTOCOL_ERROR" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">1</span></tt>)
PROTOCOL_ERROR</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_INTERNAL_ERROR">
<tt class="descname">NGHTTP2_INTERNAL_ERROR</tt><a class="headerlink" href="#c.NGHTTP2_INTERNAL_ERROR" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">2</span></tt>)
INTERNAL_ERROR</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_FLOW_CONTROL_ERROR">
<tt class="descname">NGHTTP2_FLOW_CONTROL_ERROR</tt><a class="headerlink" href="#c.NGHTTP2_FLOW_CONTROL_ERROR" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">3</span></tt>)
FLOW_CONTROL_ERROR</p>
</dd></dl>
2013-10-28 15:32:57 +01:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_SETTINGS_TIMEOUT">
<tt class="descname">NGHTTP2_SETTINGS_TIMEOUT</tt><a class="headerlink" href="#c.NGHTTP2_SETTINGS_TIMEOUT" title="Permalink to this definition"></a></dt>
2013-10-28 15:32:57 +01:00
<dd><p>(<tt class="docutils literal"><span class="pre">4</span></tt>)
SETTINGS_TIMEOUT</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_STREAM_CLOSED">
<tt class="descname">NGHTTP2_STREAM_CLOSED</tt><a class="headerlink" href="#c.NGHTTP2_STREAM_CLOSED" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">5</span></tt>)
STREAM_CLOSED</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_FRAME_SIZE_ERROR">
<tt class="descname">NGHTTP2_FRAME_SIZE_ERROR</tt><a class="headerlink" href="#c.NGHTTP2_FRAME_SIZE_ERROR" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">6</span></tt>)
2013-10-28 15:32:57 +01:00
FRAME_SIZE_ERROR</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_REFUSED_STREAM">
<tt class="descname">NGHTTP2_REFUSED_STREAM</tt><a class="headerlink" href="#c.NGHTTP2_REFUSED_STREAM" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">7</span></tt>)
REFUSED_STREAM</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_CANCEL">
<tt class="descname">NGHTTP2_CANCEL</tt><a class="headerlink" href="#c.NGHTTP2_CANCEL" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">8</span></tt>)
CANCEL</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_COMPRESSION_ERROR">
<tt class="descname">NGHTTP2_COMPRESSION_ERROR</tt><a class="headerlink" href="#c.NGHTTP2_COMPRESSION_ERROR" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">9</span></tt>)
COMPRESSION_ERROR</p>
</dd></dl>
2013-10-28 15:32:57 +01:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_CONNECT_ERROR">
<tt class="descname">NGHTTP2_CONNECT_ERROR</tt><a class="headerlink" href="#c.NGHTTP2_CONNECT_ERROR" title="Permalink to this definition"></a></dt>
2013-10-28 15:32:57 +01:00
<dd><p>(<tt class="docutils literal"><span class="pre">10</span></tt>)
CONNECT_ERROR</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_ENHANCE_YOUR_CALM">
<tt class="descname">NGHTTP2_ENHANCE_YOUR_CALM</tt><a class="headerlink" href="#c.NGHTTP2_ENHANCE_YOUR_CALM" title="Permalink to this definition"></a></dt>
2014-02-16 07:51:22 +01:00
<dd><p>(<tt class="docutils literal"><span class="pre">11</span></tt>)
2013-10-28 15:32:57 +01:00
ENHANCE_YOUR_CALM</p>
</dd></dl>
2014-02-16 07:51:22 +01:00
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_INADEQUATE_SECURITY">
<tt class="descname">NGHTTP2_INADEQUATE_SECURITY</tt><a class="headerlink" href="#c.NGHTTP2_INADEQUATE_SECURITY" title="Permalink to this definition"></a></dt>
2014-02-16 07:51:22 +01:00
<dd><p>(<tt class="docutils literal"><span class="pre">12</span></tt>)
INADEQUATE_SECURITY</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="type">
<dt id="c.nghttp2_data_flag">
<tt class="descname">nghttp2_data_flag</tt><a class="headerlink" href="#c.nghttp2_data_flag" title="Permalink to this definition"></a></dt>
<dd><p>The flags used to set in <em>data_flags</em> output parameter in
<a class="reference internal" href="#c.nghttp2_data_source_read_callback" title="nghttp2_data_source_read_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_data_source_read_callback</span></tt></a>.</p>
<dl class="macro">
<dt id="c.NGHTTP2_DATA_FLAG_NONE">
<tt class="descname">NGHTTP2_DATA_FLAG_NONE</tt><a class="headerlink" href="#c.NGHTTP2_DATA_FLAG_NONE" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0</span></tt>)
No flag set.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_DATA_FLAG_EOF">
<tt class="descname">NGHTTP2_DATA_FLAG_EOF</tt><a class="headerlink" href="#c.NGHTTP2_DATA_FLAG_EOF" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x01</span></tt>)
Indicates EOF was sensed.</p>
</dd></dl>
2014-04-24 18:41:11 +02:00
<dl class="macro">
<dt id="c.NGHTTP2_DATA_FLAG_COMPRESSED">
<tt class="descname">NGHTTP2_DATA_FLAG_COMPRESSED</tt><a class="headerlink" href="#c.NGHTTP2_DATA_FLAG_COMPRESSED" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0x02</span></tt>)
Indicates data was compressed by application.</p>
</dd></dl>
2014-04-05 12:26:23 +02:00
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_headers_category">
<tt class="descname">nghttp2_headers_category</tt><a class="headerlink" href="#c.nghttp2_headers_category" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The category of HEADERS, which indicates the role of the frame. In
2014-04-05 12:26:23 +02:00
HTTP/2 spec, request, response, push response and other arbitrary
2014-04-08 17:17:05 +02:00
headers (e.g., trailers) are all called just HEADERS. To give the
2013-07-28 14:26:41 +02:00
application the role of incoming HEADERS frame, we define several
categories.</p>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_HCAT_REQUEST">
<tt class="descname">NGHTTP2_HCAT_REQUEST</tt><a class="headerlink" href="#c.NGHTTP2_HCAT_REQUEST" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0</span></tt>)
The HEADERS frame is opening new stream, which is analogous to
SYN_STREAM in SPDY.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_HCAT_RESPONSE">
<tt class="descname">NGHTTP2_HCAT_RESPONSE</tt><a class="headerlink" href="#c.NGHTTP2_HCAT_RESPONSE" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">1</span></tt>)
The HEADERS frame is the first response headers, which is
analogous to SYN_REPLY in SPDY.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_HCAT_PUSH_RESPONSE">
<tt class="descname">NGHTTP2_HCAT_PUSH_RESPONSE</tt><a class="headerlink" href="#c.NGHTTP2_HCAT_PUSH_RESPONSE" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">2</span></tt>)
The HEADERS frame is the first headers sent against reserved
stream.</p>
</dd></dl>
<dl class="macro">
2014-02-24 17:49:22 +01:00
<dt id="c.NGHTTP2_HCAT_HEADERS">
<tt class="descname">NGHTTP2_HCAT_HEADERS</tt><a class="headerlink" href="#c.NGHTTP2_HCAT_HEADERS" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">3</span></tt>)
The HEADERS frame which does not apply for the above categories,
which is analogous to HEADERS in SPDY.</p>
</dd></dl>
</dd></dl>
2014-04-30 03:27:19 +02:00
<dl class="type">
<dt id="c.nghttp2_hd_inflate_flag">
<tt class="descname">nghttp2_hd_inflate_flag</tt><a class="headerlink" href="#c.nghttp2_hd_inflate_flag" title="Permalink to this definition"></a></dt>
<dd><p>The flags for header inflation.</p>
<dl class="macro">
<dt id="c.NGHTTP2_HD_INFLATE_NONE">
<tt class="descname">NGHTTP2_HD_INFLATE_NONE</tt><a class="headerlink" href="#c.NGHTTP2_HD_INFLATE_NONE" title="Permalink to this definition"></a></dt>
<dd><p>(<tt class="docutils literal"><span class="pre">0</span></tt>)
No flag set.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_HD_INFLATE_FINAL">
<tt class="descname">NGHTTP2_HD_INFLATE_FINAL</tt><a class="headerlink" href="#c.NGHTTP2_HD_INFLATE_FINAL" title="Permalink to this definition"></a></dt>
2014-05-06 16:23:33 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x01</span></tt>)
2014-04-30 03:27:19 +02:00
Indicates all headers were inflated.</p>
</dd></dl>
<dl class="macro">
<dt id="c.NGHTTP2_HD_INFLATE_EMIT">
<tt class="descname">NGHTTP2_HD_INFLATE_EMIT</tt><a class="headerlink" href="#c.NGHTTP2_HD_INFLATE_EMIT" title="Permalink to this definition"></a></dt>
2014-05-06 16:23:33 +02:00
<dd><p>(<tt class="docutils literal"><span class="pre">0x02</span></tt>)
2014-04-30 03:27:19 +02:00
Indicates a header was emitted.</p>
</dd></dl>
</dd></dl>
2013-07-28 14:26:41 +02:00
</div>
<div class="section" id="types-structs-unions-and-typedefs">
<h2>Types (structs, unions and typedefs)<a class="headerlink" href="#types-structs-unions-and-typedefs" title="Permalink to this headline"></a></h2>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session">
<tt class="descname">nghttp2_session</tt><a class="headerlink" href="#c.nghttp2_session" title="Permalink to this definition"></a></dt>
2014-04-05 12:26:23 +02:00
<dd><p>The primary structure to hold the resources needed for a HTTP/2
2014-04-08 17:17:05 +02:00
session. The details of this structure are intentionally hidden
2013-07-28 14:26:41 +02:00
from the public API.</p>
</dd></dl>
2013-09-04 15:59:13 +02:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_info">
<tt class="descname">nghttp2_info</tt><a class="headerlink" href="#c.nghttp2_info" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>This struct is what <a class="reference internal" href="#c.nghttp2_version" title="nghttp2_version"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_version()</span></tt></a> returns. It holds
2013-09-04 15:59:13 +02:00
information about the particular nghttp2 version.</p>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_info.age">
int <tt class="descname">age</tt><a class="headerlink" href="#c.nghttp2_info.age" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Age of this struct. This instance of nghttp2 sets it to
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.NGHTTP2_VERSION_AGE" title="NGHTTP2_VERSION_AGE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_VERSION_AGE</span></tt></a> but a future version may bump it and
2013-09-04 15:59:13 +02:00
add more struct fields at the bottom</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_info.version_num">
int <tt class="descname">version_num</tt><a class="headerlink" href="#c.nghttp2_info.version_num" title="Permalink to this definition"></a></dt>
<dd><p>the <a class="reference internal" href="#c.NGHTTP2_VERSION_NUM" title="NGHTTP2_VERSION_NUM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_VERSION_NUM</span></tt></a> number (since age ==1)</p>
2013-09-04 15:59:13 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_info.version_str">
const char *<tt class="descname">version_str</tt><a class="headerlink" href="#c.nghttp2_info.version_str" title="Permalink to this definition"></a></dt>
<dd><p>points to the <a class="reference internal" href="#c.NGHTTP2_VERSION" title="NGHTTP2_VERSION"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_VERSION</span></tt></a> string (since age ==1)</p>
2013-09-04 15:59:13 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_info.proto_str">
const char *<tt class="descname">proto_str</tt><a class="headerlink" href="#c.nghttp2_info.proto_str" title="Permalink to this definition"></a></dt>
<dd><p>points to the <a class="reference internal" href="#c.NGHTTP2_PROTO_VERSION_ID" title="NGHTTP2_PROTO_VERSION_ID"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_PROTO_VERSION_ID</span></tt></a> string this
2013-09-04 15:59:13 +02:00
instance implements (since age ==1)</p>
</dd></dl>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_nv">
<tt class="descname">nghttp2_nv</tt><a class="headerlink" href="#c.nghttp2_nv" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The name/value pair, which mainly used to represent header fields.</p>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_nv.name">
uint8_t *<tt class="descname">name</tt><a class="headerlink" href="#c.nghttp2_nv.name" title="Permalink to this definition"></a></dt>
2013-08-04 11:30:37 +02:00
<dd><p>The <em>name</em> byte string, which is not necessarily <tt class="docutils literal"><span class="pre">NULL</span></tt>
terminated.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_nv.value">
uint8_t *<tt class="descname">value</tt><a class="headerlink" href="#c.nghttp2_nv.value" title="Permalink to this definition"></a></dt>
2013-08-04 11:30:37 +02:00
<dd><p>The <em>value</em> byte string, which is not necessarily <tt class="docutils literal"><span class="pre">NULL</span></tt>
2013-07-28 14:26:41 +02:00
terminated.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_nv.namelen">
2014-05-06 16:23:33 +02:00
size_t <tt class="descname">namelen</tt><a class="headerlink" href="#c.nghttp2_nv.namelen" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The length of the <em>name</em>.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_nv.valuelen">
2014-05-06 16:23:33 +02:00
size_t <tt class="descname">valuelen</tt><a class="headerlink" href="#c.nghttp2_nv.valuelen" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The length of the <em>value</em>.</p>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="member">
<dt id="c.nghttp2_nv.flags">
uint8_t <tt class="descname">flags</tt><a class="headerlink" href="#c.nghttp2_nv.flags" title="Permalink to this definition"></a></dt>
<dd><p>Bitwise OR of one or more of <a class="reference internal" href="#c.nghttp2_nv_flag" title="nghttp2_nv_flag"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_nv_flag</span></tt></a>.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame_hd">
<tt class="descname">nghttp2_frame_hd</tt><a class="headerlink" href="#c.nghttp2_frame_hd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The frame header.</p>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame_hd.length">
size_t <tt class="descname">length</tt><a class="headerlink" href="#c.nghttp2_frame_hd.length" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The length field of this frame, excluding frame header.</p>
</dd></dl>
2014-01-26 15:37:13 +01:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame_hd.stream_id">
int32_t <tt class="descname">stream_id</tt><a class="headerlink" href="#c.nghttp2_frame_hd.stream_id" title="Permalink to this definition"></a></dt>
2014-01-26 15:37:13 +01:00
<dd><p>The stream identifier (aka, stream ID)</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame_hd.type">
uint8_t <tt class="descname">type</tt><a class="headerlink" href="#c.nghttp2_frame_hd.type" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The type of this frame. See <a class="reference internal" href="#c.nghttp2_frame" title="nghttp2_frame"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_frame()</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame_hd.flags">
uint8_t <tt class="descname">flags</tt><a class="headerlink" href="#c.nghttp2_frame_hd.flags" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The flags.</p>
</dd></dl>
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_data_source">
<tt class="descname">nghttp2_data_source</tt><a class="headerlink" href="#c.nghttp2_data_source" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>This union represents the some kind of data source passed to
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_data_source_read_callback" title="nghttp2_data_source_read_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_data_source_read_callback</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_data_source.fd">
int <tt class="descname">fd</tt><a class="headerlink" href="#c.nghttp2_data_source.fd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The integer field, suitable for a file descriptor.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_data_source.ptr">
void *<tt class="descname">ptr</tt><a class="headerlink" href="#c.nghttp2_data_source.ptr" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The pointer to an arbitrary object.</p>
</dd></dl>
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_data_source_read_callback">
2014-04-05 12:26:23 +02:00
typedef ssize_t <tt class="descname">(*nghttp2_data_source_read_callback)</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>, uint8_t<em>&nbsp;*buf</em>, size_t<em>&nbsp;length</em>, uint32_t<em>&nbsp;*data_flags</em>, <a class="reference internal" href="#c.nghttp2_data_source" title="nghttp2_data_source">nghttp2_data_source</a><em>&nbsp;*source</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_data_source_read_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked when the library wants to read data from
2014-04-08 17:17:05 +02:00
the <em>source</em>. The read data is sent in the stream <em>stream_id</em>.
The implementation of this function must read at most <em>length</em>
bytes of data from <em>source</em> (or possibly other places) and store
them in <em>buf</em> and return number of data stored in <em>buf</em>. If EOF is
2014-04-24 18:41:11 +02:00
reached, set <a class="reference internal" href="#c.NGHTTP2_DATA_FLAG_EOF" title="NGHTTP2_DATA_FLAG_EOF"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_DATA_FLAG_EOF</span></tt></a> flag in <em>*data_flags</em>.</p>
<p>To send compressed data payload without affecting content-length,
set <a class="reference internal" href="#c.NGHTTP2_DATA_FLAG_COMPRESSED" title="NGHTTP2_DATA_FLAG_COMPRESSED"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_DATA_FLAG_COMPRESSED</span></tt></a> flag in <em>*data_flags</em>.
Compression must be done by application prior to fill data in
<em>buf</em>.</p>
<p>If the application wants to postpone DATA frames (e.g.,
2014-04-08 17:17:05 +02:00
asynchronous I/O, or reading data blocks for long time), it is
achieved by returning <a class="reference internal" href="#c.NGHTTP2_ERR_DEFERRED" title="NGHTTP2_ERR_DEFERRED"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_DEFERRED</span></tt></a> without reading
any data in this invocation. The library removes DATA frame from
the outgoing queue temporarily. To move back deferred DATA frame
to outgoing queue, call <a class="reference internal" href="#c.nghttp2_session_resume_data" title="nghttp2_session_resume_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_resume_data()</span></tt></a>. In case
of error, there are 2 choices. Returning
<a class="reference internal" href="#c.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE" title="NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE</span></tt></a> will close the stream
by issuing RST_STREAM with <a class="reference internal" href="#c.NGHTTP2_INTERNAL_ERROR" title="NGHTTP2_INTERNAL_ERROR"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_INTERNAL_ERROR</span></tt></a>.
Returning <a class="reference internal" href="#c.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 signal the
entire session failure.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_data_provider">
<tt class="descname">nghttp2_data_provider</tt><a class="headerlink" href="#c.nghttp2_data_provider" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>This struct represents the data source and the way to read a chunk
of data from it.</p>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_data_provider.source">
<a class="reference internal" href="#c.nghttp2_data_source" title="nghttp2_data_source">nghttp2_data_source</a> <tt class="descname">source</tt><a class="headerlink" href="#c.nghttp2_data_provider.source" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The data source.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_data_provider.read_callback">
<a class="reference internal" href="#c.nghttp2_data_source_read_callback" title="nghttp2_data_source_read_callback">nghttp2_data_source_read_callback</a> <tt class="descname">read_callback</tt><a class="headerlink" href="#c.nghttp2_data_provider.read_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The callback function to read a chunk of data from the <em>source</em>.</p>
</dd></dl>
</dd></dl>
2014-01-27 17:20:50 +01:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_data">
<tt class="descname">nghttp2_data</tt><a class="headerlink" href="#c.nghttp2_data" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The DATA frame. The received data is delivered via
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.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>
2014-02-16 07:51:22 +01:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_data.padlen">
size_t <tt class="descname">padlen</tt><a class="headerlink" href="#c.nghttp2_data.padlen" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The length of the padding in this frame. This includes PAD_HIGH
2014-02-16 07:51:22 +01:00
and PAD_LOW.</p>
</dd></dl>
2014-01-27 17:20:50 +01:00
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="type">
<dt id="c.nghttp2_priority_spec">
<tt class="descname">nghttp2_priority_spec</tt><a class="headerlink" href="#c.nghttp2_priority_spec" title="Permalink to this definition"></a></dt>
2014-04-24 18:41:11 +02:00
<dd><p>The structure to specify stream dependency.</p>
2014-04-05 12:26:23 +02:00
<dl class="member">
2014-04-24 18:41:11 +02:00
<dt id="c.nghttp2_priority_spec.stream_id">
int32_t <tt class="descname">stream_id</tt><a class="headerlink" href="#c.nghttp2_priority_spec.stream_id" title="Permalink to this definition"></a></dt>
<dd><p>The stream ID of the stream to depend on. Specifying 0 makes
stream not depend any other stream.</p>
2014-04-05 12:26:23 +02:00
</dd></dl>
<dl class="member">
2014-04-24 18:41:11 +02:00
<dt id="c.nghttp2_priority_spec.weight">
int32_t <tt class="descname">weight</tt><a class="headerlink" href="#c.nghttp2_priority_spec.weight" title="Permalink to this definition"></a></dt>
<dd><p>The weight of this dependency.</p>
2014-04-05 12:26:23 +02:00
</dd></dl>
<dl class="member">
2014-04-24 18:41:11 +02:00
<dt id="c.nghttp2_priority_spec.exclusive">
uint8_t <tt class="descname">exclusive</tt><a class="headerlink" href="#c.nghttp2_priority_spec.exclusive" title="Permalink to this definition"></a></dt>
<dd><p>nonzero means exclusive dependency</p>
2014-04-05 12:26:23 +02:00
</dd></dl>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_headers">
<tt class="descname">nghttp2_headers</tt><a class="headerlink" href="#c.nghttp2_headers" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The HEADERS frame. It has the following members:</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_headers.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_headers.hd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The frame header.</p>
</dd></dl>
2014-02-16 07:51:22 +01:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_headers.padlen">
size_t <tt class="descname">padlen</tt><a class="headerlink" href="#c.nghttp2_headers.padlen" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The length of the padding in this frame. This includes PAD_HIGH
2014-02-16 07:51:22 +01:00
and PAD_LOW.</p>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="member">
<dt id="c.nghttp2_headers.pri_spec">
<a class="reference internal" href="#c.nghttp2_priority_spec" title="nghttp2_priority_spec">nghttp2_priority_spec</a> <tt class="descname">pri_spec</tt><a class="headerlink" href="#c.nghttp2_headers.pri_spec" title="Permalink to this definition"></a></dt>
<dd><p>The priority specification</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_headers.nva">
<a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a> *<tt class="descname">nva</tt><a class="headerlink" href="#c.nghttp2_headers.nva" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The name/value pairs.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_headers.nvlen">
size_t <tt class="descname">nvlen</tt><a class="headerlink" href="#c.nghttp2_headers.nvlen" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The number of name/value pairs in <em>nva</em>.</p>
</dd></dl>
2013-12-23 15:51:07 +01:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_headers.cat">
<a class="reference internal" href="#c.nghttp2_headers_category" title="nghttp2_headers_category">nghttp2_headers_category</a> <tt class="descname">cat</tt><a class="headerlink" href="#c.nghttp2_headers.cat" title="Permalink to this definition"></a></dt>
2013-12-23 15:51:07 +01:00
<dd><p>The category of this HEADERS frame.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_priority">
<tt class="descname">nghttp2_priority</tt><a class="headerlink" href="#c.nghttp2_priority" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The PRIORITY frame. It has the following members:</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_priority.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_priority.hd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The frame header.</p>
</dd></dl>
<dl class="member">
2014-04-05 12:26:23 +02:00
<dt id="c.nghttp2_priority.pri_spec">
<a class="reference internal" href="#c.nghttp2_priority_spec" title="nghttp2_priority_spec">nghttp2_priority_spec</a> <tt class="descname">pri_spec</tt><a class="headerlink" href="#c.nghttp2_priority.pri_spec" title="Permalink to this definition"></a></dt>
<dd><p>The priority specification.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_rst_stream">
<tt class="descname">nghttp2_rst_stream</tt><a class="headerlink" href="#c.nghttp2_rst_stream" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The RST_STREAM frame. It has the following members:</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_rst_stream.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_rst_stream.hd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The frame header.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_rst_stream.error_code">
<a class="reference internal" href="#c.nghttp2_error_code" title="nghttp2_error_code">nghttp2_error_code</a> <tt class="descname">error_code</tt><a class="headerlink" href="#c.nghttp2_rst_stream.error_code" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The error code. See <a class="reference internal" href="#c.nghttp2_error_code" title="nghttp2_error_code"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_error_code</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_settings_entry">
<tt class="descname">nghttp2_settings_entry</tt><a class="headerlink" href="#c.nghttp2_settings_entry" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The SETTINGS ID/Value pair. It has the following members:</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_settings_entry.settings_id">
int32_t <tt class="descname">settings_id</tt><a class="headerlink" href="#c.nghttp2_settings_entry.settings_id" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The SETTINGS ID. See <a class="reference internal" href="#c.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>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_settings_entry.value">
uint32_t <tt class="descname">value</tt><a class="headerlink" href="#c.nghttp2_settings_entry.value" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The value of this entry.</p>
</dd></dl>
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_settings">
<tt class="descname">nghttp2_settings</tt><a class="headerlink" href="#c.nghttp2_settings" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The SETTINGS frame. It has the following members:</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_settings.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_settings.hd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The frame header.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_settings.niv">
size_t <tt class="descname">niv</tt><a class="headerlink" href="#c.nghttp2_settings.niv" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The number of SETTINGS ID/Value pairs in <em>iv</em>.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_settings.iv">
<a class="reference internal" href="#c.nghttp2_settings_entry" title="nghttp2_settings_entry">nghttp2_settings_entry</a> *<tt class="descname">iv</tt><a class="headerlink" href="#c.nghttp2_settings.iv" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The pointer to the array of SETTINGS ID/Value pair.</p>
</dd></dl>
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_push_promise">
<tt class="descname">nghttp2_push_promise</tt><a class="headerlink" href="#c.nghttp2_push_promise" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The PUSH_PROMISE frame. It has the following members:</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_push_promise.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_push_promise.hd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The frame header.</p>
</dd></dl>
2014-02-16 07:51:22 +01:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_push_promise.padlen">
size_t <tt class="descname">padlen</tt><a class="headerlink" href="#c.nghttp2_push_promise.padlen" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The length of the padding in this frame. This includes PAD_HIGH
2014-02-16 07:51:22 +01:00
and PAD_LOW.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_push_promise.nva">
<a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a> *<tt class="descname">nva</tt><a class="headerlink" href="#c.nghttp2_push_promise.nva" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The name/value pairs.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_push_promise.nvlen">
size_t <tt class="descname">nvlen</tt><a class="headerlink" href="#c.nghttp2_push_promise.nvlen" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The number of name/value pairs in <em>nva</em>.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_push_promise.promised_stream_id">
int32_t <tt class="descname">promised_stream_id</tt><a class="headerlink" href="#c.nghttp2_push_promise.promised_stream_id" title="Permalink to this definition"></a></dt>
<dd><p>The promised stream ID</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_ping">
<tt class="descname">nghttp2_ping</tt><a class="headerlink" href="#c.nghttp2_ping" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The PING frame. It has the following members:</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_ping.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_ping.hd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The frame header.</p>
</dd></dl>
<dl class="member">
<dt>
<tt class="descname">uint8_t opaque_data[8]</tt></dt>
<dd><p>The opaque data</p>
</dd></dl>
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_goaway">
<tt class="descname">nghttp2_goaway</tt><a class="headerlink" href="#c.nghttp2_goaway" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The GOAWAY frame. It has the following members:</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_goaway.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_goaway.hd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The frame header.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_goaway.last_stream_id">
int32_t <tt class="descname">last_stream_id</tt><a class="headerlink" href="#c.nghttp2_goaway.last_stream_id" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The last stream stream ID.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_goaway.error_code">
<a class="reference internal" href="#c.nghttp2_error_code" title="nghttp2_error_code">nghttp2_error_code</a> <tt class="descname">error_code</tt><a class="headerlink" href="#c.nghttp2_goaway.error_code" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The error code. See <a class="reference internal" href="#c.nghttp2_error_code" title="nghttp2_error_code"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_error_code</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_goaway.opaque_data">
uint8_t *<tt class="descname">opaque_data</tt><a class="headerlink" href="#c.nghttp2_goaway.opaque_data" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The additional debug data</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_goaway.opaque_data_len">
size_t <tt class="descname">opaque_data_len</tt><a class="headerlink" href="#c.nghttp2_goaway.opaque_data_len" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The length of <em>opaque_data</em> member.</p>
</dd></dl>
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_window_update">
<tt class="descname">nghttp2_window_update</tt><a class="headerlink" href="#c.nghttp2_window_update" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>The WINDOW_UPDATE frame. It has the following members:</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_window_update.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_window_update.hd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The frame header.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_window_update.window_size_increment">
int32_t <tt class="descname">window_size_increment</tt><a class="headerlink" href="#c.nghttp2_window_update.window_size_increment" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The window size increment.</p>
</dd></dl>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="type">
<dt id="c.nghttp2_altsvc">
<tt class="descname">nghttp2_altsvc</tt><a class="headerlink" href="#c.nghttp2_altsvc" title="Permalink to this definition"></a></dt>
<dd><p>The ALTSVC frame. It has following members:</p>
<dl class="member">
<dt id="c.nghttp2_altsvc.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_altsvc.hd" title="Permalink to this definition"></a></dt>
<dd><p>The frame header.</p>
</dd></dl>
<dl class="member">
<dt id="c.nghttp2_altsvc.protocol_id">
uint8_t *<tt class="descname">protocol_id</tt><a class="headerlink" href="#c.nghttp2_altsvc.protocol_id" title="Permalink to this definition"></a></dt>
<dd><p>Protocol ID</p>
</dd></dl>
<dl class="member">
<dt id="c.nghttp2_altsvc.host">
uint8_t *<tt class="descname">host</tt><a class="headerlink" href="#c.nghttp2_altsvc.host" title="Permalink to this definition"></a></dt>
<dd><p>Host</p>
</dd></dl>
<dl class="member">
<dt id="c.nghttp2_altsvc.origin">
uint8_t *<tt class="descname">origin</tt><a class="headerlink" href="#c.nghttp2_altsvc.origin" title="Permalink to this definition"></a></dt>
<dd><p>Origin</p>
</dd></dl>
<dl class="member">
<dt id="c.nghttp2_altsvc.protocol_id_len">
size_t <tt class="descname">protocol_id_len</tt><a class="headerlink" href="#c.nghttp2_altsvc.protocol_id_len" title="Permalink to this definition"></a></dt>
<dd><p>The length of <em>protocol_id</em></p>
</dd></dl>
<dl class="member">
<dt id="c.nghttp2_altsvc.host_len">
size_t <tt class="descname">host_len</tt><a class="headerlink" href="#c.nghttp2_altsvc.host_len" title="Permalink to this definition"></a></dt>
<dd><p>The length of <em>host</em></p>
</dd></dl>
<dl class="member">
<dt id="c.nghttp2_altsvc.origin_len">
size_t <tt class="descname">origin_len</tt><a class="headerlink" href="#c.nghttp2_altsvc.origin_len" title="Permalink to this definition"></a></dt>
<dd><p>The length of <em>origin</em></p>
</dd></dl>
<dl class="member">
<dt id="c.nghttp2_altsvc.max_age">
uint32_t <tt class="descname">max_age</tt><a class="headerlink" href="#c.nghttp2_altsvc.max_age" title="Permalink to this definition"></a></dt>
<dd><p>Max-Age</p>
</dd></dl>
<dl class="member">
<dt id="c.nghttp2_altsvc.port">
uint16_t <tt class="descname">port</tt><a class="headerlink" href="#c.nghttp2_altsvc.port" title="Permalink to this definition"></a></dt>
<dd><p>Port</p>
</dd></dl>
</dd></dl>
2014-04-24 18:41:11 +02:00
<dl class="type">
<dt id="c.nghttp2_blocked">
<tt class="descname">nghttp2_blocked</tt><a class="headerlink" href="#c.nghttp2_blocked" title="Permalink to this definition"></a></dt>
<dd><p>The BLOCKED frame. It has following members:</p>
<dl class="member">
<dt id="c.nghttp2_blocked.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_blocked.hd" title="Permalink to this definition"></a></dt>
<dd><p>The frame header.</p>
</dd></dl>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame">
<tt class="descname">nghttp2_frame</tt><a class="headerlink" href="#c.nghttp2_frame" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>This union includes all frames to pass them to various function
2014-04-08 17:17:05 +02:00
calls as nghttp2_frame type. The CONTINUATION frame is omitted
from here because the library deals with it internally.</p>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame.hd">
<a class="reference internal" href="#c.nghttp2_frame_hd" title="nghttp2_frame_hd">nghttp2_frame_hd</a> <tt class="descname">hd</tt><a class="headerlink" href="#c.nghttp2_frame.hd" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The frame header, which is convenient to inspect frame header.</p>
</dd></dl>
2014-01-27 17:20:50 +01:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame.data">
<a class="reference internal" href="#c.nghttp2_data" title="nghttp2_data">nghttp2_data</a> <tt class="descname">data</tt><a class="headerlink" href="#c.nghttp2_frame.data" title="Permalink to this definition"></a></dt>
2014-01-27 17:20:50 +01:00
<dd><p>The DATA frame.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame.headers">
<a class="reference internal" href="#c.nghttp2_headers" title="nghttp2_headers">nghttp2_headers</a> <tt class="descname">headers</tt><a class="headerlink" href="#c.nghttp2_frame.headers" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The HEADERS frame.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame.priority">
<a class="reference internal" href="#c.nghttp2_priority" title="nghttp2_priority">nghttp2_priority</a> <tt class="descname">priority</tt><a class="headerlink" href="#c.nghttp2_frame.priority" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The PRIORITY frame.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame.rst_stream">
<a class="reference internal" href="#c.nghttp2_rst_stream" title="nghttp2_rst_stream">nghttp2_rst_stream</a> <tt class="descname">rst_stream</tt><a class="headerlink" href="#c.nghttp2_frame.rst_stream" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The RST_STREAM frame.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame.settings">
<a class="reference internal" href="#c.nghttp2_settings" title="nghttp2_settings">nghttp2_settings</a> <tt class="descname">settings</tt><a class="headerlink" href="#c.nghttp2_frame.settings" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The SETTINGS frame.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame.push_promise">
<a class="reference internal" href="#c.nghttp2_push_promise" title="nghttp2_push_promise">nghttp2_push_promise</a> <tt class="descname">push_promise</tt><a class="headerlink" href="#c.nghttp2_frame.push_promise" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The PUSH_PROMISE frame.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame.ping">
<a class="reference internal" href="#c.nghttp2_ping" title="nghttp2_ping">nghttp2_ping</a> <tt class="descname">ping</tt><a class="headerlink" href="#c.nghttp2_frame.ping" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The PING frame.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame.goaway">
<a class="reference internal" href="#c.nghttp2_goaway" title="nghttp2_goaway">nghttp2_goaway</a> <tt class="descname">goaway</tt><a class="headerlink" href="#c.nghttp2_frame.goaway" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The GOAWAY frame.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_frame.window_update">
<a class="reference internal" href="#c.nghttp2_window_update" title="nghttp2_window_update">nghttp2_window_update</a> <tt class="descname">window_update</tt><a class="headerlink" href="#c.nghttp2_frame.window_update" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The WINDOW_UPDATE frame.</p>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="member">
<dt id="c.nghttp2_frame.altsvc">
<a class="reference internal" href="#c.nghttp2_altsvc" title="nghttp2_altsvc">nghttp2_altsvc</a> <tt class="descname">altsvc</tt><a class="headerlink" href="#c.nghttp2_frame.altsvc" title="Permalink to this definition"></a></dt>
<dd><p>The ALTSVC frame.</p>
</dd></dl>
2014-04-24 18:41:11 +02:00
<dl class="member">
<dt id="c.nghttp2_frame.blocked">
<a class="reference internal" href="#c.nghttp2_blocked" title="nghttp2_blocked">nghttp2_blocked</a> <tt class="descname">blocked</tt><a class="headerlink" href="#c.nghttp2_frame.blocked" title="Permalink to this definition"></a></dt>
<dd><p>The BLOCKED frame.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_send_callback">
typedef ssize_t <tt class="descname">(*nghttp2_send_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const uint8_t<em>&nbsp;*data</em>, size_t<em>&nbsp;length</em>, int<em>&nbsp;flags</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_send_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked when <em>session</em> wants to send data to the
2014-04-08 17:17:05 +02:00
remote peer. The implementation of this function must send at most
<em>length</em> bytes of data stored in <em>data</em>. The <em>flags</em> is currently
2013-07-28 14:26:41 +02:00
not used and always 0. It must return the number of bytes sent if
it succeeds. If it cannot send any single byte without blocking,
2014-04-08 17:17:05 +02:00
it must return <a class="reference internal" href="#c.NGHTTP2_ERR_WOULDBLOCK" title="NGHTTP2_ERR_WOULDBLOCK"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_WOULDBLOCK</span></tt></a>. For other errors,
it must return <a class="reference internal" href="#c.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>. The
<em>user_data</em> pointer is the third argument passed in to the call to
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#c.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>.</p>
2014-02-18 16:17:10 +01:00
<p>This callback is required if the application uses
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> to send data to the remote endpoint. If
the application uses solely <a class="reference internal" href="#c.nghttp2_session_mem_send" title="nghttp2_session_mem_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_send()</span></tt></a> instead,
this callback function is unnecessary.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_recv_callback">
typedef ssize_t <tt class="descname">(*nghttp2_recv_callback)</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;*buf</em>, size_t<em>&nbsp;length</em>, int<em>&nbsp;flags</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_recv_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked when <em>session</em> wants to receive data from
2014-04-08 17:17:05 +02:00
the remote peer. The implementation of this function must read at
most <em>length</em> bytes of data and store it in <em>buf</em>. The <em>flags</em> is
currently not used and always 0. It must return the number of
bytes written in <em>buf</em> if it succeeds. If it cannot read any
single byte without blocking, it must return
<a class="reference internal" href="#c.NGHTTP2_ERR_WOULDBLOCK" title="NGHTTP2_ERR_WOULDBLOCK"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_WOULDBLOCK</span></tt></a>. If it gets EOF before it reads any
single byte, it must return <a class="reference internal" href="#c.NGHTTP2_ERR_EOF" title="NGHTTP2_ERR_EOF"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_EOF</span></tt></a>. For other
errors, it must return <a class="reference internal" href="#c.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 0 is treated as <a class="reference internal" href="#c.NGHTTP2_ERR_WOULDBLOCK" title="NGHTTP2_ERR_WOULDBLOCK"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_WOULDBLOCK</span></tt></a>. The
<em>user_data</em> pointer is the third argument passed in to the call to
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#c.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>.</p>
2014-02-18 16:17:10 +01:00
<p>This callback is required if the application uses
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> to receive data from the remote endpoint.
If the application uses solely <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a>
2014-02-18 16:17:10 +01:00
instead, this callback function is unnecessary.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_on_frame_recv_callback">
typedef int <tt class="descname">(*nghttp2_on_frame_recv_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#c.nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_on_frame_recv_callback" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Callback function invoked by <a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> when a frame
is received. The <em>user_data</em> pointer is the third argument passed
2014-02-24 17:49:22 +01:00
in to the call to <a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#c.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>.</p>
2014-01-17 16:36:03 +01:00
<p>If frame is HEADERS or PUSH_PROMISE, the <tt class="docutils literal"><span class="pre">nva</span></tt> and <tt class="docutils literal"><span class="pre">nvlen</span></tt>
member of their data structure are always <tt class="docutils literal"><span class="pre">NULL</span></tt> and 0
2014-04-08 17:17:05 +02:00
respectively. The header name/value pairs are emitted via
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_on_header_callback" title="nghttp2_on_header_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_header_callback</span></tt></a>.</p>
2014-01-29 13:57:16 +01:00
<p>For HEADERS, PUSH_PROMISE and DATA frames, this callback may be
called after stream is closed (see
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.nghttp2_on_stream_close_callback" title="nghttp2_on_stream_close_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_stream_close_callback</span></tt></a>). The application should
2014-01-29 13:57:16 +01:00
check that stream is still alive using its own stream management or
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_get_stream_user_data" title="nghttp2_session_get_stream_user_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_get_stream_user_data()</span></tt></a>.</p>
2014-04-08 17:17:05 +02:00
<p>Only HEADERS and DATA frame can signal the end of incoming data.
If <tt class="docutils literal"><span class="pre">frame-&gt;hd.flags</span> <span class="pre">&amp;</span> <span class="pre">NGHTTP2_FLAG_END_STREAM</span></tt> is nonzero, the
2014-01-29 13:57:16 +01:00
<em>frame</em> is the last frame from the remote peer in this stream.</p>
2014-04-08 17:17:05 +02:00
<p>The implementation of this function must return 0 if it succeeds.
If nonzero value is returned, it is treated as fatal error and
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a> functions
immediately return <a class="reference internal" href="#c.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>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_on_invalid_frame_recv_callback">
typedef int <tt class="descname">(*nghttp2_on_invalid_frame_recv_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#c.nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, <a class="reference internal" href="#c.nghttp2_error_code" title="nghttp2_error_code">nghttp2_error_code</a><em>&nbsp;error_code</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_on_invalid_frame_recv_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked by <a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> when an
2014-04-08 17:17:05 +02:00
invalid non-DATA frame is received. The <em>error_code</em> is one of the
<a class="reference internal" href="#c.nghttp2_error_code" title="nghttp2_error_code"><tt class="xref c c-macro docutils literal"><span class="pre">nghttp2_error_code</span></tt></a> and indicates the error. When this
2013-07-28 14:26:41 +02:00
callback function is invoked, the library automatically submits
2014-04-08 17:17:05 +02:00
either RST_STREAM or GOAWAY frame. The <em>user_data</em> pointer is the
2013-09-07 16:46:28 +02:00
third argument passed in to the call to
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#c.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>.</p>
2014-01-17 16:36:03 +01:00
<p>If frame is HEADERS or PUSH_PROMISE, the <tt class="docutils literal"><span class="pre">nva</span></tt> and <tt class="docutils literal"><span class="pre">nvlen</span></tt>
member of their data structure are always <tt class="docutils literal"><span class="pre">NULL</span></tt> and 0
respectively.</p>
2014-04-08 17:17:05 +02:00
<p>The implementation of this function must return 0 if it succeeds.
If nonzero is returned, it is treated as fatal error and
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
immediately return <a class="reference internal" href="#c.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>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_on_data_chunk_recv_callback">
typedef int <tt class="descname">(*nghttp2_on_data_chunk_recv_callback)</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>, int32_t<em>&nbsp;stream_id</em>, const uint8_t<em>&nbsp;*data</em>, size_t<em>&nbsp;len</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_on_data_chunk_recv_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked when a chunk of data in DATA frame is
2014-04-08 17:17:05 +02:00
received. The <em>stream_id</em> is the stream ID this DATA frame belongs
to. The <em>flags</em> is the flags of DATA frame which this data chunk
is contained. <tt class="docutils literal"><span class="pre">(flags</span> <span class="pre">&amp;</span> <span class="pre">NGHTTP2_FLAG_END_STREAM)</span> <span class="pre">!=</span> <span class="pre">0</span></tt> does not
necessarily mean this chunk of data is the last one in the stream.
You should use <a class="reference internal" href="#c.nghttp2_on_frame_recv_callback" title="nghttp2_on_frame_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_frame_recv_callback</span></tt></a> to know all
data frames are received. The <em>user_data</em> pointer is the third
argument passed in to the call to <a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#c.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>.</p>
2014-02-24 17:49:22 +01:00
<p>If the application uses <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a>, it can return
<a class="reference internal" href="#c.NGHTTP2_ERR_PAUSE" title="NGHTTP2_ERR_PAUSE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PAUSE</span></tt></a> to make <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a>
2014-01-17 16:17:15 +01:00
return without processing further input bytes. The memory by
pointed by the <em>data</em> is retained until
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a> or <a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> is called.
The application must retain the input bytes which was used to
produce the <em>data</em> parameter, because it may refer to the memory
2014-01-17 16:17:15 +01:00
region included in the input bytes.</p>
2014-04-08 17:17:05 +02:00
<p>The implementation of this function must return 0 if it succeeds.
If nonzero is returned, it is treated as fatal error and
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a> functions
immediately return <a class="reference internal" href="#c.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>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_before_frame_send_callback">
typedef int <tt class="descname">(*nghttp2_before_frame_send_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#c.nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_before_frame_send_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked before the non-DATA frame <em>frame</em> is
2014-04-08 17:17:05 +02:00
sent. This may be useful, for example, to know the stream ID of
2013-07-28 14:26:41 +02:00
HEADERS and PUSH_PROMISE frame (see also
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_get_stream_user_data" title="nghttp2_session_get_stream_user_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_get_stream_user_data()</span></tt></a>), which is not assigned
2014-04-08 17:17:05 +02:00
when it was queued. The <em>user_data</em> pointer is the third argument
2014-02-24 17:49:22 +01:00
passed in to the call to <a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#c.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>.</p>
2014-04-08 17:17:05 +02:00
<p>The implementation of this function must return 0 if it succeeds.
If nonzero is returned, it is treated as fatal error and
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
immediately return <a class="reference internal" href="#c.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>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_on_frame_send_callback">
typedef int <tt class="descname">(*nghttp2_on_frame_send_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#c.nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_on_frame_send_callback" title="Permalink to this definition"></a></dt>
2014-01-27 17:20:50 +01:00
<dd><p>Callback function invoked after the frame <em>frame</em> is sent. The
<em>user_data</em> pointer is the third argument passed in to the call to
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#c.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>.</p>
2014-04-08 17:17:05 +02:00
<p>The implementation of this function must return 0 if it succeeds.
If nonzero is returned, it is treated as fatal error and
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
immediately return <a class="reference internal" href="#c.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>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_on_frame_not_send_callback">
typedef int <tt class="descname">(*nghttp2_on_frame_not_send_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#c.nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, int<em>&nbsp;lib_error_code</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_on_frame_not_send_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked after the non-DATA frame <em>frame</em> is not
2014-04-08 17:17:05 +02:00
sent because of the error. The error is indicated by the
2013-07-28 14:26:41 +02:00
<em>lib_error_code</em>, which is one of the values defined in
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.nghttp2_error" title="nghttp2_error"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_error</span></tt></a>. The <em>user_data</em> pointer is the third
2014-02-24 17:49:22 +01:00
argument passed in to the call to <a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
<a class="reference internal" href="#c.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>.</p>
2014-04-08 17:17:05 +02:00
<p>The implementation of this function must return 0 if it succeeds.
If nonzero is returned, it is treated as fatal error and
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
immediately return <a class="reference internal" href="#c.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>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_on_stream_close_callback">
typedef int <tt class="descname">(*nghttp2_on_stream_close_callback)</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>, <a class="reference internal" href="#c.nghttp2_error_code" title="nghttp2_error_code">nghttp2_error_code</a><em>&nbsp;error_code</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_on_stream_close_callback" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Callback function invoked when the stream <em>stream_id</em> is closed.
The reason of closure is indicated by the <em>error_code</em>. The
2014-02-24 17:49:22 +01:00
stream_user_data, which was specified in <a class="reference internal" href="#c.nghttp2_submit_request" title="nghttp2_submit_request"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_request()</span></tt></a>
2014-04-08 17:17:05 +02:00
or <a class="reference internal" href="#c.nghttp2_submit_headers" title="nghttp2_submit_headers"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_headers()</span></tt></a>, is still available in this function.
The <em>user_data</em> pointer is the third argument passed in to the call
to <a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.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>.</p>
2014-04-08 17:17:05 +02:00
<p>This function is also called for a stream in reserved state.</p>
<p>The implementation of this function must return 0 if it succeeds.
If nonzero is returned, it is treated as fatal error and
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
immediately return <a class="reference internal" href="#c.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>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_on_unknown_frame_recv_callback">
typedef int <tt class="descname">(*nghttp2_on_unknown_frame_recv_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const uint8_t<em>&nbsp;*head</em>, size_t<em>&nbsp;headlen</em>, const uint8_t<em>&nbsp;*payload</em>, size_t<em>&nbsp;payloadlen</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_on_unknown_frame_recv_callback" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Callback function invoked when the received frame type is unknown.
The <em>head</em> is the pointer to the header of the received frame. The
<em>headlen</em> is the length of the <em>head</em>. According to the spec, the
<em>headlen</em> is always 8. In other words, the <em>head</em> is the first 8
bytes of the received frame. The <em>payload</em> is the pointer to the
data portion of the received frame. The <em>payloadlen</em> is the length
of the <em>payload</em>. This is the data after the length field. The
<em>user_data</em> pointer is the third argument passed in to the call to
<a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a> or <a class="reference internal" href="#c.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>.</p>
<p>The implementation of this function must return 0 if it succeeds.
If nonzero is returned, it is treated as fatal error and
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> functions
immediately return <a class="reference internal" href="#c.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>
2013-07-28 14:26:41 +02:00
</dd></dl>
2014-01-29 13:57:16 +01:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_on_begin_headers_callback">
typedef int <tt class="descname">(*nghttp2_on_begin_headers_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#c.nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_on_begin_headers_callback" title="Permalink to this definition"></a></dt>
2014-01-29 13:57:16 +01:00
<dd><p>Callback function invoked when the reception of header block in
2014-04-08 17:17:05 +02:00
HEADERS or PUSH_PROMISE is started. Each header name/value pair
2014-02-24 17:49:22 +01:00
will be emitted by <a class="reference internal" href="#c.nghttp2_on_header_callback" title="nghttp2_on_header_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_header_callback</span></tt></a>.</p>
2014-01-29 13:57:16 +01:00
<p>The <tt class="docutils literal"><span class="pre">frame-&gt;hd.flags</span></tt> may not have
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.NGHTTP2_FLAG_END_HEADERS" title="NGHTTP2_FLAG_END_HEADERS"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_END_HEADERS</span></tt></a> flag set, which indicates that one
2014-04-08 17:17:05 +02:00
or more CONTINUATION frames are involved. But the application does
2014-01-29 13:57:16 +01:00
not need to care about that because the header name/value pairs are
emitted transparently regardless of CONTINUATION frames.</p>
<p>The implementation of this function must return 0 if it succeeds or
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.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>. If nonzero value other than
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.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> is returned, it is treated as
2014-04-08 17:17:05 +02:00
if <a class="reference internal" href="#c.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> is returned. If
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.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> is returned,
<a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a> function will immediately return
<a class="reference internal" href="#c.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>
2014-01-29 13:57:16 +01:00
</dd></dl>
2014-01-16 18:42:44 +01:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_on_header_callback">
2014-04-05 12:26:23 +02:00
typedef int <tt class="descname">(*nghttp2_on_header_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#c.nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, const uint8_t<em>&nbsp;*name</em>, size_t<em>&nbsp;namelen</em>, const uint8_t<em>&nbsp;*value</em>, size_t<em>&nbsp;valuelen</em>, uint8_t<em>&nbsp;flags</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_on_header_callback" title="Permalink to this definition"></a></dt>
2014-01-16 18:42:44 +01:00
<dd><p>Callback function invoked when a header name/value pair is received
2014-04-05 12:26:23 +02:00
for the <em>frame</em>. The <em>name</em> of length <em>namelen</em> is header name.
The <em>value</em> of length <em>valuelen</em> is header value. The <em>flags</em> is
bitwise OR of one or more of <a class="reference internal" href="#c.nghttp2_nv_flag" title="nghttp2_nv_flag"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_nv_flag</span></tt></a>.</p>
<p>If <a class="reference internal" href="#c.NGHTTP2_NV_FLAG_NO_INDEX" title="NGHTTP2_NV_FLAG_NO_INDEX"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_NV_FLAG_NO_INDEX</span></tt></a> is set in <em>flags</em>, the receiver
must not index this name/value pair when forwarding it to the next
hop.</p>
<p>When this callback is invoked, <tt class="docutils literal"><span class="pre">frame-&gt;hd.type</span></tt> is either
<a class="reference internal" href="#c.NGHTTP2_HEADERS" title="NGHTTP2_HEADERS"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_HEADERS</span></tt></a> or <a class="reference internal" href="#c.NGHTTP2_PUSH_PROMISE" title="NGHTTP2_PUSH_PROMISE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_PUSH_PROMISE</span></tt></a>. After all
header name/value pairs are processed with this callback, and no
error has been detected, <a class="reference internal" href="#c.nghttp2_on_frame_recv_callback" title="nghttp2_on_frame_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_frame_recv_callback</span></tt></a>
will be invoked. If there is an error in decompression,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_on_frame_recv_callback" title="nghttp2_on_frame_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_frame_recv_callback</span></tt></a> for the <em>frame</em> will not be
2014-01-29 13:57:16 +01:00
invoked.</p>
2014-04-08 17:17:05 +02:00
<p>The <em>name</em> may be <tt class="docutils literal"><span class="pre">NULL</span></tt> if the <em>namelen</em> is 0. The same thing
2014-01-16 18:42:44 +01:00
can be said about the <em>value</em>.</p>
2014-02-01 13:24:57 +01:00
<p>Please note that nghttp2 library does not perform any validity
2014-04-08 17:17:05 +02:00
check against the <em>name</em> and the <em>value</em>. For example, the
2014-02-01 13:24:57 +01:00
<em>namelen</em> could be 0, and/or the <em>value</em> contains <tt class="docutils literal"><span class="pre">0x0a</span></tt> or
2014-04-08 17:17:05 +02:00
<tt class="docutils literal"><span class="pre">0x0d</span></tt>. The application must check them if it matters. The
2014-02-24 17:49:22 +01:00
helper function <a class="reference internal" href="#c.nghttp2_check_header_name" title="nghttp2_check_header_name"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_check_header_name()</span></tt></a> and
<a class="reference internal" href="#c.nghttp2_check_header_value" title="nghttp2_check_header_value"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_check_header_value()</span></tt></a> provide simple validation against
2014-02-01 13:24:57 +01:00
HTTP2 header field construction rule.</p>
<p>One more thing to note is that the <em>value</em> may contain <tt class="docutils literal"><span class="pre">NULL</span></tt>
2014-04-08 17:17:05 +02:00
(<tt class="docutils literal"><span class="pre">0x00</span></tt>) characters. It is used to concatenate header values
which share the same header field name. The application should
split these values if it wants to get individual value. This
2014-02-01 13:24:57 +01:00
concatenation is used in order to keep the ordering of headers.</p>
2014-02-24 17:49:22 +01:00
<p>If the application uses <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a>, it can return
<a class="reference internal" href="#c.NGHTTP2_ERR_PAUSE" title="NGHTTP2_ERR_PAUSE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PAUSE</span></tt></a> to make <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a>
2014-01-17 16:17:15 +01:00
return without processing further input bytes. The memory pointed
by <em>frame</em>, <em>name</em> and <em>value</em> parameters are retained until
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a> or <a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> is called.
The application must retain the input bytes which was used to
produce these parameters, because it may refer to the memory region
included in the input bytes.</p>
2014-02-24 17:49:22 +01:00
<p>Returning <a class="reference internal" href="#c.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE" title="NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE</span></tt></a> will close
2014-01-27 17:20:50 +01:00
the stream by issuing RST_STREAM with
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.NGHTTP2_INTERNAL_ERROR" title="NGHTTP2_INTERNAL_ERROR"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_INTERNAL_ERROR</span></tt></a>. In this case,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_on_frame_recv_callback" title="nghttp2_on_frame_recv_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_frame_recv_callback</span></tt></a> will not be invoked.</p>
2014-04-08 17:17:05 +02:00
<p>The implementation of this function must return 0 if it succeeds.
It may return <a class="reference internal" href="#c.NGHTTP2_ERR_PAUSE" title="NGHTTP2_ERR_PAUSE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PAUSE</span></tt></a> or
<a class="reference internal" href="#c.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE" title="NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE</span></tt></a>. For other critical
failures, it must return <a class="reference internal" href="#c.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>. If
2014-01-27 17:20:50 +01:00
the other nonzero value is returned, it is treated as
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.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>. If
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.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> is returned,
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a> functions
immediately return <a class="reference internal" href="#c.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>
2014-01-16 18:42:44 +01:00
</dd></dl>
2014-02-16 07:51:22 +01:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_select_padding_callback">
typedef ssize_t <tt class="descname">(*nghttp2_select_padding_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#c.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="#c.nghttp2_select_padding_callback" title="Permalink to this definition"></a></dt>
2014-02-16 07:51:22 +01:00
<dd><p>Callback function invoked when the library asks application how
2014-04-08 17:17:05 +02:00
many padding bytes are 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="#c.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
2014-02-16 07:51:22 +01:00
<tt class="docutils literal"><span class="pre">frame-&gt;hd.length</span></tt> means no padding is added. Returning
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.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="#c.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="#c.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>
2014-02-16 07:51:22 +01:00
</dd></dl>
2014-04-27 09:33:36 +02:00
<dl class="type">
<dt id="c.nghttp2_adjust_priority_callback">
typedef int <tt class="descname">(*nghttp2_adjust_priority_callback)</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#c.nghttp2_frame" title="nghttp2_frame">nghttp2_frame</a><em>&nbsp;*frame</em>, <a class="reference internal" href="#c.nghttp2_priority_spec" title="nghttp2_priority_spec">nghttp2_priority_spec</a><em>&nbsp;*pri_spec</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_adjust_priority_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked to adjust priority value for request
HEADERS. This callback is called only for request HEADERS (which
means, <tt class="xref c c-func docutils literal"><span class="pre">frame-&gt;hd.type</span> <span class="pre">==</span> <span class="pre">NGHTTP2_HEADERS</span> <span class="pre">&amp;&amp;</span> <span class="pre">frame-&gt;headers.cat</span> <span class="pre">==</span>
<span class="pre">NGHTTP2_HCAT_REQUEST()</span></tt> hold) and before
<tt class="xref c c-type docutils literal"><span class="pre">nghttp2_before_frame_send_callback()</span></tt>. The application can
adjust priority value <em>pri_spec</em>. Initially, <em>pri_spec</em> is filled
with the current priority value, which is equal to
<tt class="xref c c-func docutils literal"><span class="pre">frame-&gt;headers.pri_spec()</span></tt>. If the application doesn&#8217;t alter
priority value, just return 0 without updating <em>pri_spec</em>.</p>
<p>Since the application doesn&#8217;t know stream ID when it submits
requests, it may not be able to add correct priority value to
HEADERS frame and forced to use follwing PRIORITY frame. The
purpose of this callback is give the chance to the application to
adjust priority value with the latest information it has just
before transmission so that correct priority is included in HEADERS
frame and it doesn&#8217;t have to send additional PRIORITY frame.</p>
<p>Returning <a class="reference internal" href="#c.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="#c.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="#c.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>
2013-07-28 14:26:41 +02:00
<dl class="type">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks">
<tt class="descname">nghttp2_session_callbacks</tt><a class="headerlink" href="#c.nghttp2_session_callbacks" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback functions.</p>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.send_callback">
<a class="reference internal" href="#c.nghttp2_send_callback" title="nghttp2_send_callback">nghttp2_send_callback</a> <tt class="descname">send_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.send_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked when the <em>session</em> wants to send data
2014-04-08 17:17:05 +02:00
to the remote peer. This callback is not necessary if the
application uses solely <a class="reference internal" href="#c.nghttp2_session_mem_send" title="nghttp2_session_mem_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_send()</span></tt></a> to serialize
data to transmit.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.recv_callback">
<a class="reference internal" href="#c.nghttp2_recv_callback" title="nghttp2_recv_callback">nghttp2_recv_callback</a> <tt class="descname">recv_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.recv_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked when the <em>session</em> wants to receive
2014-04-08 17:17:05 +02:00
data from the remote peer. This callback is not necessary if the
application uses solely <a class="reference internal" href="#c.nghttp2_session_mem_recv" title="nghttp2_session_mem_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_recv()</span></tt></a> to process
received data.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.on_frame_recv_callback">
<a class="reference internal" href="#c.nghttp2_on_frame_recv_callback" title="nghttp2_on_frame_recv_callback">nghttp2_on_frame_recv_callback</a> <tt class="descname">on_frame_recv_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.on_frame_recv_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked by <a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> when a
2014-01-27 17:20:50 +01:00
frame is received.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.on_invalid_frame_recv_callback">
<a class="reference internal" href="#c.nghttp2_on_invalid_frame_recv_callback" title="nghttp2_on_invalid_frame_recv_callback">nghttp2_on_invalid_frame_recv_callback</a> <tt class="descname">on_invalid_frame_recv_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.on_invalid_frame_recv_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked by <a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> when an
2013-07-28 14:26:41 +02:00
invalid non-DATA frame is received.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.on_data_chunk_recv_callback">
<a class="reference internal" href="#c.nghttp2_on_data_chunk_recv_callback" title="nghttp2_on_data_chunk_recv_callback">nghttp2_on_data_chunk_recv_callback</a> <tt class="descname">on_data_chunk_recv_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.on_data_chunk_recv_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked when a chunk of data in DATA frame is
received.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.before_frame_send_callback">
<a class="reference internal" href="#c.nghttp2_before_frame_send_callback" title="nghttp2_before_frame_send_callback">nghttp2_before_frame_send_callback</a> <tt class="descname">before_frame_send_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.before_frame_send_callback" title="Permalink to this definition"></a></dt>
2014-01-27 17:20:50 +01:00
<dd><p>Callback function invoked before a non-DATA frame is sent.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.on_frame_send_callback">
<a class="reference internal" href="#c.nghttp2_on_frame_send_callback" title="nghttp2_on_frame_send_callback">nghttp2_on_frame_send_callback</a> <tt class="descname">on_frame_send_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.on_frame_send_callback" title="Permalink to this definition"></a></dt>
2014-01-27 17:20:50 +01:00
<dd><p>Callback function invoked after a frame is sent.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.on_frame_not_send_callback">
<a class="reference internal" href="#c.nghttp2_on_frame_not_send_callback" title="nghttp2_on_frame_not_send_callback">nghttp2_on_frame_not_send_callback</a> <tt class="descname">on_frame_not_send_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.on_frame_not_send_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>The callback function invoked when a non-DATA frame is not sent
because of an error.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.on_stream_close_callback">
<a class="reference internal" href="#c.nghttp2_on_stream_close_callback" title="nghttp2_on_stream_close_callback">nghttp2_on_stream_close_callback</a> <tt class="descname">on_stream_close_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.on_stream_close_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked when the stream is closed.</p>
</dd></dl>
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.on_unknown_frame_recv_callback">
<a class="reference internal" href="#c.nghttp2_on_unknown_frame_recv_callback" title="nghttp2_on_unknown_frame_recv_callback">nghttp2_on_unknown_frame_recv_callback</a> <tt class="descname">on_unknown_frame_recv_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.on_unknown_frame_recv_callback" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Callback function invoked when the received frame type is
unknown.</p>
</dd></dl>
2014-01-29 13:57:16 +01:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.on_begin_headers_callback">
<a class="reference internal" href="#c.nghttp2_on_begin_headers_callback" title="nghttp2_on_begin_headers_callback">nghttp2_on_begin_headers_callback</a> <tt class="descname">on_begin_headers_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.on_begin_headers_callback" title="Permalink to this definition"></a></dt>
2014-01-29 13:57:16 +01:00
<dd><p>Callback function invoked when the reception of header block in
HEADERS or PUSH_PROMISE is started.</p>
</dd></dl>
2014-01-16 18:42:44 +01:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.on_header_callback">
<a class="reference internal" href="#c.nghttp2_on_header_callback" title="nghttp2_on_header_callback">nghttp2_on_header_callback</a> <tt class="descname">on_header_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.on_header_callback" title="Permalink to this definition"></a></dt>
2014-01-16 18:42:44 +01:00
<dd><p>Callback function invoked when a header name/value pair is
received.</p>
</dd></dl>
2014-02-16 07:51:22 +01:00
<dl class="member">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_callbacks.select_padding_callback">
<a class="reference internal" href="#c.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="#c.nghttp2_session_callbacks.select_padding_callback" title="Permalink to this definition"></a></dt>
2014-02-16 07:51:22 +01:00
<dd><p>Callback function invoked when the library asks application how
2014-04-08 17:17:05 +02:00
many padding bytes are required for the transmission of the given
frame.</p>
2014-02-16 07:51:22 +01:00
</dd></dl>
2014-04-27 09:33:36 +02:00
<dl class="member">
<dt id="c.nghttp2_session_callbacks.adjust_priority_callback">
<a class="reference internal" href="#c.nghttp2_adjust_priority_callback" title="nghttp2_adjust_priority_callback">nghttp2_adjust_priority_callback</a> <tt class="descname">adjust_priority_callback</tt><a class="headerlink" href="#c.nghttp2_session_callbacks.adjust_priority_callback" title="Permalink to this definition"></a></dt>
<dd><p>Callback function invoked to adjust priority value just before
request HEADERS is serialized to the wire format.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
</dd></dl>
2013-11-07 16:22:38 +01:00
<dl class="type">
2014-04-05 12:26:23 +02:00
<dt id="c.nghttp2_option">
<tt class="descname">nghttp2_option</tt><a class="headerlink" href="#c.nghttp2_option" title="Permalink to this definition"></a></dt>
<dd><p>Configuration options for <a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_session</span></tt></a>. The details of
this structure are intentionally hidden from the public API.</p>
2013-11-07 16:22:38 +01:00
</dd></dl>
2014-04-30 03:27:19 +02:00
<dl class="type">
<dt id="c.nghttp2_hd_inflater">
<tt class="descname">nghttp2_hd_inflater</tt><a class="headerlink" href="#c.nghttp2_hd_inflater" title="Permalink to this definition"></a></dt>
<dd><p>HPACK inflater object.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
</div>
<div class="section" id="functions">
<h2>Functions<a class="headerlink" href="#functions" title="Permalink to this headline"></a></h2>
2014-04-05 12:26:23 +02:00
<dl class="function">
<dt id="c.nghttp2_option_new">
int <tt class="descname">nghttp2_option_new</tt><big>(</big><a class="reference internal" href="#c.nghttp2_option" title="nghttp2_option">nghttp2_option</a><em>&nbsp;**option_ptr</em><big>)</big><a class="headerlink" href="#c.nghttp2_option_new" title="Permalink to this definition"></a></dt>
<dd><p>Initializes <em>*option_ptr</em> with default values.</p>
<p>When the application finished using this object, it can use
<a class="reference internal" href="#c.nghttp2_option_del" title="nghttp2_option_del"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_option_del()</span></tt></a> to free its memory.</p>
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_option_del">
void <tt class="descname">nghttp2_option_del</tt><big>(</big><a class="reference internal" href="#c.nghttp2_option" title="nghttp2_option">nghttp2_option</a><em>&nbsp;*option</em><big>)</big><a class="headerlink" href="#c.nghttp2_option_del" title="Permalink to this definition"></a></dt>
<dd><p>Frees any resources allocated for <em>option</em>. If <em>option</em> is
<tt class="docutils literal"><span class="pre">NULL</span></tt>, this function does nothing.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_option_set_no_auto_stream_window_update">
void <tt class="descname">nghttp2_option_set_no_auto_stream_window_update</tt><big>(</big><a class="reference internal" href="#c.nghttp2_option" title="nghttp2_option">nghttp2_option</a><em>&nbsp;*option</em>, int<em>&nbsp;val</em><big>)</big><a class="headerlink" href="#c.nghttp2_option_set_no_auto_stream_window_update" title="Permalink to this definition"></a></dt>
<dd><p>This option prevents the library from sending WINDOW_UPDATE for a
2014-04-08 17:17:05 +02:00
stream automatically. If this option is set to nonzero, the
2014-04-05 12:26:23 +02:00
library won&#8217;t send WINDOW_UPDATE for a stream and the application
is responsible for sending WINDOW_UPDATE using
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.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>. By default, this option is set to
2014-04-05 12:26:23 +02:00
zero.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_option_set_no_auto_connection_window_update">
void <tt class="descname">nghttp2_option_set_no_auto_connection_window_update</tt><big>(</big><a class="reference internal" href="#c.nghttp2_option" title="nghttp2_option">nghttp2_option</a><em>&nbsp;*option</em>, int<em>&nbsp;val</em><big>)</big><a class="headerlink" href="#c.nghttp2_option_set_no_auto_connection_window_update" title="Permalink to this definition"></a></dt>
<dd><p>This option prevents the library from sending WINDOW_UPDATE for a
2014-04-08 17:17:05 +02:00
connection automatically. If this option is set to nonzero, the
2014-04-05 12:26:23 +02:00
library won&#8217;t send WINDOW_UPDATE for a connection and the
2014-04-08 17:17:05 +02:00
application is responsible for sending WINDOW_UPDATE with stream ID
0 using <a class="reference internal" href="#c.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>. By default, this option is
set to zero.</p>
2014-04-05 12:26:23 +02:00
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_option_set_peer_max_concurrent_streams">
void <tt class="descname">nghttp2_option_set_peer_max_concurrent_streams</tt><big>(</big><a class="reference internal" href="#c.nghttp2_option" title="nghttp2_option">nghttp2_option</a><em>&nbsp;*option</em>, uint32_t<em>&nbsp;val</em><big>)</big><a class="headerlink" href="#c.nghttp2_option_set_peer_max_concurrent_streams" title="Permalink to this definition"></a></dt>
<dd><p>This option sets the SETTINGS_MAX_CONCURRENT_STREAMS value of
2014-04-08 17:17:05 +02:00
remote endpoint as if it is received in SETTINGS frame. Without
2014-04-05 12:26:23 +02:00
specifying this option, before the local endpoint receives
SETTINGS_MAX_CONCURRENT_STREAMS in SETTINGS frame from remote
2014-04-08 17:17:05 +02:00
endpoint, SETTINGS_MAX_CONCURRENT_STREAMS is unlimited. This may
cause problem if local endpoint submits lots of requests initially
and sending them at once to the remote peer may lead to the
rejection of some requests. Specifying this option to the sensible
value, say 100, may avoid this kind of issue. This value will be
overwritten if the local endpoint receives
2014-04-05 12:26:23 +02:00
SETTINGS_MAX_CONCURRENT_STREAMS from the remote endpoint.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_client_new">
int <tt class="descname">nghttp2_session_client_new</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;**session_ptr</em>, const <a class="reference internal" href="#c.nghttp2_session_callbacks" title="nghttp2_session_callbacks">nghttp2_session_callbacks</a><em>&nbsp;*callbacks</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_client_new" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Initializes <em>*session_ptr</em> for client use. The all members of
<em>callbacks</em> are copied to <em>*session_ptr</em>. Therefore <em>*session_ptr</em>
does not store <em>callbacks</em>. The <em>user_data</em> is an arbitrary user
2013-07-28 14:26:41 +02:00
supplied data, which will be passed to the callback functions.</p>
2014-02-24 17:49:22 +01:00
<p>The <a class="reference internal" href="#c.nghttp2_session_callbacks.send_callback" title="nghttp2_session_callbacks.send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.send_callback</span></tt></a> must be
specified. If the application code uses <a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a>,
the <a class="reference internal" href="#c.nghttp2_session_callbacks.recv_callback" title="nghttp2_session_callbacks.recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.recv_callback</span></tt></a> must be
2014-04-08 17:17:05 +02:00
specified. The other members of <em>callbacks</em> can be <tt class="docutils literal"><span class="pre">NULL</span></tt>.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_server_new">
int <tt class="descname">nghttp2_session_server_new</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;**session_ptr</em>, const <a class="reference internal" href="#c.nghttp2_session_callbacks" title="nghttp2_session_callbacks">nghttp2_session_callbacks</a><em>&nbsp;*callbacks</em>, void<em>&nbsp;*user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_server_new" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Initializes <em>*session_ptr</em> for server use. The all members of
2013-07-28 14:26:41 +02:00
<em>callbacks</em> are copied to <em>*session_ptr</em>. Therefore <em>*session_ptr</em>
2014-04-08 17:17:05 +02:00
does not store <em>callbacks</em>. The <em>user_data</em> is an arbitrary user
2013-07-28 14:26:41 +02:00
supplied data, which will be passed to the callback functions.</p>
2014-02-24 17:49:22 +01:00
<p>The <a class="reference internal" href="#c.nghttp2_session_callbacks.send_callback" title="nghttp2_session_callbacks.send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.send_callback</span></tt></a> must be
specified. If the application code uses <a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a>,
the <a class="reference internal" href="#c.nghttp2_session_callbacks.recv_callback" title="nghttp2_session_callbacks.recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.recv_callback</span></tt></a> must be
2014-04-08 17:17:05 +02:00
specified. The other members of <em>callbacks</em> can be <tt class="docutils literal"><span class="pre">NULL</span></tt>.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_client_new2">
2014-04-05 12:26:23 +02:00
int <tt class="descname">nghttp2_session_client_new2</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;**session_ptr</em>, const <a class="reference internal" href="#c.nghttp2_session_callbacks" title="nghttp2_session_callbacks">nghttp2_session_callbacks</a><em>&nbsp;*callbacks</em>, void<em>&nbsp;*user_data</em>, const <a class="reference internal" href="#c.nghttp2_option" title="nghttp2_option">nghttp2_option</a><em>&nbsp;*option</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_client_new2" title="Permalink to this definition"></a></dt>
2014-02-24 17:49:22 +01:00
<dd><p>Like <a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a>, but with additional options
2014-04-05 12:26:23 +02:00
specified in the <em>option</em>.</p>
<p>The <em>option</em> can be <tt class="docutils literal"><span class="pre">NULL</span></tt> and the call is equivalent to
<a class="reference internal" href="#c.nghttp2_session_client_new" title="nghttp2_session_client_new"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_client_new()</span></tt></a>.</p>
<p>This function does not take ownership <em>option</em>. The application is
responsible for freeing <em>option</em> if it finishes using the object.</p>
<p>The library code does not refer to <em>option</em> after this function
returns.</p>
2013-11-07 16:22:38 +01:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-11-07 16:22:38 +01:00
<dd>Out of memory.</dd>
</dl>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_server_new2">
2014-04-05 12:26:23 +02:00
int <tt class="descname">nghttp2_session_server_new2</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;**session_ptr</em>, const <a class="reference internal" href="#c.nghttp2_session_callbacks" title="nghttp2_session_callbacks">nghttp2_session_callbacks</a><em>&nbsp;*callbacks</em>, void<em>&nbsp;*user_data</em>, const <a class="reference internal" href="#c.nghttp2_option" title="nghttp2_option">nghttp2_option</a><em>&nbsp;*option</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_server_new2" title="Permalink to this definition"></a></dt>
2014-02-24 17:49:22 +01:00
<dd><p>Like <a class="reference internal" href="#c.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>, but with additional options
2014-04-05 12:26:23 +02:00
specified in the <em>option</em>.</p>
<p>The <em>option</em> can be <tt class="docutils literal"><span class="pre">NULL</span></tt> and the call is equivalent to
<a class="reference internal" href="#c.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>.</p>
<p>This function does not take ownership <em>option</em>. The application is
responsible for freeing <em>option</em> if it finishes using the object.</p>
<p>The library code does not refer to <em>option</em> after this function
returns.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-11-07 16:22:38 +01:00
<dd>Out of memory.</dd>
2013-07-28 14:26:41 +02:00
</dl>
</dd></dl>
2013-11-07 16:22:38 +01:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_del">
void <tt class="descname">nghttp2_session_del</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_del" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Frees any resources allocated for <em>session</em>. If <em>session</em> is
2013-11-07 16:22:38 +01:00
<tt class="docutils literal"><span class="pre">NULL</span></tt>, this function does nothing.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_send">
int <tt class="descname">nghttp2_session_send</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_send" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Sends pending frames to the remote peer.</p>
<p>This function retrieves the highest prioritized frame from the
2014-04-08 17:17:05 +02:00
outbound queue and sends it to the remote peer. It does this as
2013-07-28 14:26:41 +02:00
many as possible until the user callback
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.send_callback" title="nghttp2_session_callbacks.send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.send_callback</span></tt></a> returns
<a class="reference internal" href="#c.NGHTTP2_ERR_WOULDBLOCK" title="NGHTTP2_ERR_WOULDBLOCK"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_WOULDBLOCK</span></tt></a> or the outbound queue becomes empty.
2013-07-28 14:26:41 +02:00
This function calls several callback functions which are passed
2014-04-08 17:17:05 +02:00
when initializing the <em>session</em>. Here is the simple time chart
2013-07-28 14:26:41 +02:00
which tells when each callback is invoked:</p>
<ol class="arabic simple">
<li>Get the next frame to send from outbound queue.</li>
<li>Prepare transmission of the frame.</li>
<li>If the control frame cannot be sent because some preconditions
2014-04-08 17:17:05 +02:00
are not met (e.g., request HEADERS cannot be sent after GOAWAY),
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_frame_not_send_callback" title="nghttp2_session_callbacks.on_frame_not_send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_frame_not_send_callback</span></tt></a>
is invoked. Abort the following steps.</li>
2014-04-27 09:33:36 +02:00
<li>If the frame is request HEADERS,
<a class="reference internal" href="#c.nghttp2_session_callbacks.adjust_priority_callback" title="nghttp2_session_callbacks.adjust_priority_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.adjust_priority_callback</span></tt></a> is
invoked.</li>
2014-04-08 17:17:05 +02:00
<li>If the frame is HEADERS, PUSH_PROMISE or DATA,
<a class="reference internal" href="#c.nghttp2_session_callbacks.select_padding_callback" title="nghttp2_session_callbacks.select_padding_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.select_padding_callback</span></tt></a> is
invoked.</li>
<li>If the frame is request HEADERS, the stream is opened here.</li>
2014-02-24 17:49:22 +01:00
<li><a class="reference internal" href="#c.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> is
2013-07-28 14:26:41 +02:00
invoked.</li>
2014-02-24 17:49:22 +01:00
<li><a class="reference internal" href="#c.nghttp2_session_callbacks.send_callback" title="nghttp2_session_callbacks.send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.send_callback</span></tt></a> is invoked one
2013-07-28 14:26:41 +02:00
or more times to send the frame.</li>
2014-02-24 17:49:22 +01:00
<li><a class="reference internal" href="#c.nghttp2_session_callbacks.on_frame_send_callback" title="nghttp2_session_callbacks.on_frame_send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_frame_send_callback</span></tt></a> is
2013-07-28 14:26:41 +02:00
invoked.</li>
<li>If the transmission of the frame triggers closure of the stream,
the stream is closed and
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_stream_close_callback" title="nghttp2_session_callbacks.on_stream_close_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_stream_close_callback</span></tt></a> is
2013-07-28 14:26:41 +02:00
invoked.</li>
</ol>
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.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></dt>
2013-07-28 14:26:41 +02:00
<dd>The callback function failed.</dd>
</dl>
</dd></dl>
2014-02-18 16:17:10 +01:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_mem_send">
ssize_t <tt class="descname">nghttp2_session_mem_send</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const uint8_t<em>&nbsp;**data_ptr</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_mem_send" title="Permalink to this definition"></a></dt>
2014-02-18 16:17:10 +01:00
<dd><p>Returns the serialized data to send.</p>
2014-04-08 17:17:05 +02:00
<p>This function behaves like <a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a> except that it
does not use <a class="reference internal" href="#c.nghttp2_session_callbacks.send_callback" title="nghttp2_session_callbacks.send_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.send_callback</span></tt></a> to
transmit data. Instead, it assigns the pointer to the serialized
data to the <em>*data_ptr</em> and returns its length. The other
callbacks are called in the same way as they are in
<a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a>.</p>
2014-02-18 16:17:10 +01:00
<p>If no data is available to send, this function returns 0.</p>
2014-04-08 17:17:05 +02:00
<p>This function may not return all serialized data in one invocation.
To get all data, call this function repeatedly until it returns 0
or one of negative error codes.</p>
2014-02-18 16:17:10 +01:00
<p>The assigned <em>*data_ptr</em> is valid until the next call of
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_mem_send" title="nghttp2_session_mem_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_mem_send()</span></tt></a> or <a class="reference internal" href="#c.nghttp2_session_send" title="nghttp2_session_send"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_send()</span></tt></a>.</p>
2014-02-18 16:17:10 +01:00
<p>The caller must send all data before sending the next chunk of
data.</p>
<p>This function returns the length of the data pointed by the
<em>*data_ptr</em> if it succeeds, or one of the following negative error
codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2014-02-18 16:17:10 +01:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_recv">
int <tt class="descname">nghttp2_session_recv</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_recv" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Receives frames from the remote peer.</p>
<p>This function receives as many frames as possible until the user
2014-02-24 17:49:22 +01:00
callback <a class="reference internal" href="#c.nghttp2_session_callbacks.recv_callback" title="nghttp2_session_callbacks.recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.recv_callback</span></tt></a> returns
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.NGHTTP2_ERR_WOULDBLOCK" title="NGHTTP2_ERR_WOULDBLOCK"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_WOULDBLOCK</span></tt></a>. This function calls several
2013-07-28 14:26:41 +02:00
callback functions which are passed when initializing the
2014-04-08 17:17:05 +02:00
<em>session</em>. Here is the simple time chart which tells when each
2013-07-28 14:26:41 +02:00
callback is invoked:</p>
<ol class="arabic simple">
2014-02-24 17:49:22 +01:00
<li><a class="reference internal" href="#c.nghttp2_session_callbacks.recv_callback" title="nghttp2_session_callbacks.recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.recv_callback</span></tt></a> is invoked one
2013-07-28 14:26:41 +02:00
or more times to receive frame header.</li>
2013-12-08 16:07:37 +01:00
<li>If the frame is DATA frame:<ol class="arabic">
2014-02-24 17:49:22 +01:00
<li><a class="reference internal" href="#c.nghttp2_session_callbacks.recv_callback" title="nghttp2_session_callbacks.recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.recv_callback</span></tt></a> is invoked
2013-12-08 16:07:37 +01:00
to receive DATA payload. For each chunk of data,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_data_chunk_recv_callback" title="nghttp2_session_callbacks.on_data_chunk_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_data_chunk_recv_callback</span></tt></a>
2013-12-08 16:07:37 +01:00
is invoked.</li>
<li>If one DATA frame is completely received,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_frame_recv_callback" title="nghttp2_session_callbacks.on_frame_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_frame_recv_callback</span></tt></a> is
2014-04-08 17:17:05 +02:00
invoked. If the reception of the frame triggers the
2013-07-28 14:26:41 +02:00
closure of the stream,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_stream_close_callback" title="nghttp2_session_callbacks.on_stream_close_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_stream_close_callback</span></tt></a>
2013-12-08 16:07:37 +01:00
is invoked.</li>
2013-07-28 14:26:41 +02:00
</ol>
2013-12-08 16:07:37 +01:00
</li>
<li>If the frame is the control frame:<ol class="arabic">
2014-02-24 17:49:22 +01:00
<li><a class="reference internal" href="#c.nghttp2_session_callbacks.recv_callback" title="nghttp2_session_callbacks.recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.recv_callback</span></tt></a> is invoked
2013-12-08 16:07:37 +01:00
one or more times to receive whole frame.</li>
2014-01-29 13:57:16 +01:00
<li>If the received frame is valid, then following actions are
2014-04-08 17:17:05 +02:00
taken. If the frame is either HEADERS or PUSH_PROMISE,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_begin_headers_callback" title="nghttp2_session_callbacks.on_begin_headers_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_begin_headers_callback</span></tt></a>
2014-04-08 17:17:05 +02:00
is invoked. Then
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_header_callback" title="nghttp2_session_callbacks.on_header_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_header_callback</span></tt></a> is
2014-04-08 17:17:05 +02:00
invoked for each header name/value pair. After all name/value
2014-01-29 13:57:16 +01:00
pairs are emitted successfully,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_frame_recv_callback" title="nghttp2_session_callbacks.on_frame_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_frame_recv_callback</span></tt></a> is
2014-01-29 13:57:16 +01:00
invoked. For other frames,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_frame_recv_callback" title="nghttp2_session_callbacks.on_frame_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_frame_recv_callback</span></tt></a> is
2014-01-29 13:57:16 +01:00
invoked.
If the reception of the frame triggers the closure of the
stream,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_stream_close_callback" title="nghttp2_session_callbacks.on_stream_close_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_stream_close_callback</span></tt></a>
2013-12-08 16:07:37 +01:00
is invoked.</li>
<li>If the received frame is unpacked but is interpreted as
invalid,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_invalid_frame_recv_callback" title="nghttp2_session_callbacks.on_invalid_frame_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_invalid_frame_recv_callback</span></tt></a>
2013-12-08 16:07:37 +01:00
is invoked.</li>
<li>If the received frame type is unknown,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_unknown_frame_recv_callback" title="nghttp2_session_callbacks.on_unknown_frame_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_unknown_frame_recv_callback</span></tt></a>
2013-12-08 16:07:37 +01:00
is invoked.</li>
</ol>
</li>
</ol>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_EOF" title="NGHTTP2_ERR_EOF"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_EOF</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>The remote peer did shutdown on the connection.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.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></dt>
2013-07-28 14:26:41 +02:00
<dd>The callback function failed.</dd>
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_mem_recv">
ssize_t <tt class="descname">nghttp2_session_mem_recv</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const uint8_t<em>&nbsp;*in</em>, size_t<em>&nbsp;inlen</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_mem_recv" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Processes data <em>in</em> as an input from the remote endpoint. The
2013-07-28 14:26:41 +02:00
<em>inlen</em> indicates the number of bytes in the <em>in</em>.</p>
2014-02-24 17:49:22 +01:00
<p>This function behaves like <a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a> except that it
does not use <a class="reference internal" href="#c.nghttp2_session_callbacks.recv_callback" title="nghttp2_session_callbacks.recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.recv_callback</span></tt></a> to
2013-07-28 14:26:41 +02:00
receive data; the <em>in</em> is the only data for the invocation of this
2014-04-08 17:17:05 +02:00
function. If all bytes are processed, this function returns. The
2013-07-28 14:26:41 +02:00
other callbacks are called in the same way as they are in
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_recv" title="nghttp2_session_recv"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_recv()</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
<p>In the current implementation, this function always tries to
2013-10-03 18:33:21 +02:00
processes all input data unless either an error occurs or
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.NGHTTP2_ERR_PAUSE" title="NGHTTP2_ERR_PAUSE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PAUSE</span></tt></a> is returned from
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_header_callback" title="nghttp2_session_callbacks.on_header_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_header_callback</span></tt></a> or
<a class="reference internal" href="#c.nghttp2_session_callbacks.on_data_chunk_recv_callback" title="nghttp2_session_callbacks.on_data_chunk_recv_callback"><tt class="xref c c-member docutils literal"><span class="pre">nghttp2_session_callbacks.on_data_chunk_recv_callback</span></tt></a>.
If <a class="reference internal" href="#c.NGHTTP2_ERR_PAUSE" title="NGHTTP2_ERR_PAUSE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PAUSE</span></tt></a> is used, the return value includes the
2013-10-03 18:33:21 +02:00
number of bytes which was used to produce the data or frame for the
callback.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns the number of processed bytes, or one of the
following negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.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></dt>
2013-10-03 18:33:21 +02:00
<dd>The callback function failed.</dd>
</dl>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_resume_data">
int <tt class="descname">nghttp2_session_resume_data</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_resume_data" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Puts back previously deferred DATA frame in the stream <em>stream_id</em>
to the outbound queue.</p>
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.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>
2014-04-05 12:26:23 +02:00
<dd>The stream does not exist; or no deferred data exist; or data
was deferred by flow control.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_want_read">
int <tt class="descname">nghttp2_session_want_read</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_want_read" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Returns nonzero value if <em>session</em> wants to receive data from the
remote peer.</p>
2014-02-24 17:49:22 +01:00
<p>If both <a class="reference internal" href="#c.nghttp2_session_want_read" title="nghttp2_session_want_read"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_want_read()</span></tt></a> and
<a class="reference internal" href="#c.nghttp2_session_want_write" title="nghttp2_session_want_write"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_want_write()</span></tt></a> return 0, the application should
2013-07-28 14:26:41 +02:00
drop the connection.</p>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_want_write">
int <tt class="descname">nghttp2_session_want_write</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_want_write" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Returns nonzero value if <em>session</em> wants to send data to the remote
peer.</p>
2014-02-24 17:49:22 +01:00
<p>If both <a class="reference internal" href="#c.nghttp2_session_want_read" title="nghttp2_session_want_read"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_want_read()</span></tt></a> and
<a class="reference internal" href="#c.nghttp2_session_want_write" title="nghttp2_session_want_write"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_want_write()</span></tt></a> return 0, the application should
2013-07-28 14:26:41 +02:00
drop the connection.</p>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_get_stream_user_data">
void* <tt class="descname">nghttp2_session_get_stream_user_data</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_user_data" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Returns stream_user_data for the stream <em>stream_id</em>. The
2014-02-24 17:49:22 +01:00
stream_user_data is provided by <a class="reference internal" href="#c.nghttp2_submit_request" title="nghttp2_submit_request"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_request()</span></tt></a>,
<a class="reference internal" href="#c.nghttp2_submit_headers" title="nghttp2_submit_headers"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_headers()</span></tt></a> or
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.nghttp2_session_set_stream_user_data" title="nghttp2_session_set_stream_user_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_set_stream_user_data()</span></tt></a>. Unless it is set using
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_set_stream_user_data" title="nghttp2_session_set_stream_user_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_set_stream_user_data()</span></tt></a>, if the stream is
2013-12-23 15:51:07 +01:00
initiated by the remote endpoint, stream_user_data is always
2014-04-08 17:17:05 +02:00
<tt class="docutils literal"><span class="pre">NULL</span></tt>. If the stream does not exist, this function returns
2013-12-23 15:51:07 +01:00
<tt class="docutils literal"><span class="pre">NULL</span></tt>.</p>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_set_stream_user_data">
int <tt class="descname">nghttp2_session_set_stream_user_data</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>, void<em>&nbsp;*stream_user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_set_stream_user_data" title="Permalink to this definition"></a></dt>
2013-12-23 15:51:07 +01:00
<dd><p>Sets the <em>stream_user_data</em> to the stream denoted by the
2014-04-08 17:17:05 +02:00
<em>stream_id</em>. If a stream user data is already set to the stream,
it is replaced with the <em>stream_user_data</em>. It is valid to specify
2013-12-23 15:51:07 +01:00
<tt class="docutils literal"><span class="pre">NULL</span></tt> in the <em>stream_user_data</em>, which nullifies the associated
data pointer.</p>
2013-12-24 16:31:37 +01:00
<p>It is valid to set the <em>stream_user_data</em> to the stream reserved by
PUSH_PROMISE frame.</p>
2013-12-23 15:51:07 +01:00
<p>This function returns 0 if it succeeds, or one of following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.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>
2013-12-23 15:51:07 +01:00
<dd>The stream does not exist</dd>
</dl>
2013-07-28 14:26:41 +02:00
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_get_outbound_queue_size">
size_t <tt class="descname">nghttp2_session_get_outbound_queue_size</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_get_outbound_queue_size" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Returns the number of frames in the outbound queue. This does not
2013-07-28 14:26:41 +02:00
include the deferred DATA frames.</p>
</dd></dl>
2013-10-29 17:04:28 +01:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_get_stream_effective_recv_data_length">
int32_t <tt class="descname">nghttp2_session_get_stream_effective_recv_data_length</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_effective_recv_data_length" title="Permalink to this definition"></a></dt>
2013-10-29 17:04:28 +01:00
<dd><p>Returns the number of DATA payload in bytes received without
2014-04-08 17:17:05 +02:00
WINDOW_UPDATE transmission for the stream <em>stream_id</em>. The local
2013-10-29 17:04:28 +01:00
(receive) window size can be adjusted by
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.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 takes into account
that and returns effective data length. In particular, if the
2013-10-29 17:04:28 +01:00
local window size is reduced by submitting negative
2014-02-24 17:49:22 +01:00
window_size_increment with <a class="reference internal" href="#c.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
2013-10-29 17:04:28 +01:00
function returns the number of bytes less than actually received.</p>
<p>This function returns -1 if it fails.</p>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_get_stream_effective_local_window_size">
int32_t <tt class="descname">nghttp2_session_get_stream_effective_local_window_size</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_effective_local_window_size" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Returns the local (receive) window size for the stream <em>stream_id</em>.
The local window size can be adjusted by
<a class="reference internal" href="#c.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 takes into account
2013-10-29 17:04:28 +01:00
that and returns effective window size.</p>
<p>This function returns -1 if it fails.</p>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_get_effective_recv_data_length">
int32_t <tt class="descname">nghttp2_session_get_effective_recv_data_length</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_get_effective_recv_data_length" title="Permalink to this definition"></a></dt>
2013-10-29 17:04:28 +01:00
<dd><p>Returns the number of DATA payload in bytes received without
2014-04-08 17:17:05 +02:00
WINDOW_UPDATE transmission for a connection. The local (receive)
window size can be adjusted by <a class="reference internal" href="#c.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 takes into account 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="#c.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>
2013-10-29 17:04:28 +01:00
<p>This function returns -1 if it fails.</p>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_get_effective_local_window_size">
int32_t <tt class="descname">nghttp2_session_get_effective_local_window_size</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_get_effective_local_window_size" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Returns the local (receive) window size for a connection. The
local window size can be adjusted by
<a class="reference internal" href="#c.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 takes into account
2013-10-29 17:04:28 +01:00
that and returns effective window size.</p>
<p>This function returns -1 if it fails.</p>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="function">
<dt id="c.nghttp2_session_get_stream_remote_window_size">
int32_t <tt class="descname">nghttp2_session_get_stream_remote_window_size</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_window_size" title="Permalink to this definition"></a></dt>
<dd><p>Returns the remote window size for a given stream <em>stream_id</em>.
This is the amount of flow-controlled payload (e.g., DATA) that the
local endpoint can send without WINDOW_UPDATE.</p>
<p>This function returns -1 if it fails.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<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>
2013-12-26 15:39:18 +01:00
<dd><p>Signals the session so that the connection should be terminated.</p>
<p>GOAWAY frame with the given <em>error_code</em> will be submitted if it
2014-04-08 17:17:05 +02:00
has not been transmitted. After the transmission, both
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_want_read" title="nghttp2_session_want_read"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_want_read()</span></tt></a> and <a class="reference internal" href="#c.nghttp2_session_want_write" title="nghttp2_session_want_write"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_want_write()</span></tt></a>
2014-04-08 17:17:05 +02:00
return 0. If GOAWAY frame has already transmitted at the time when
2014-02-24 17:49:22 +01:00
this function is invoked, <a class="reference internal" href="#c.nghttp2_session_want_read" title="nghttp2_session_want_read"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_want_read()</span></tt></a> and
<a class="reference internal" href="#c.nghttp2_session_want_write" title="nghttp2_session_want_write"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_want_write()</span></tt></a> returns 0 immediately after this
2013-12-26 15:39:18 +01:00
function succeeds.</p>
2013-07-28 14:26:41 +02:00
<p>This function should be called when the connection should be
2014-04-08 17:17:05 +02:00
terminated after sending GOAWAY. If the remaining streams should
be processed after GOAWAY, use <a class="reference internal" href="#c.nghttp2_submit_goaway" title="nghttp2_submit_goaway"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_goaway()</span></tt></a> instead.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
2014-05-06 16:23:33 +02:00
<dl class="function">
<dt id="c.nghttp2_session_get_remote_settings">
uint32_t <tt class="descname">nghttp2_session_get_remote_settings</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, <a class="reference internal" href="#c.nghttp2_settings_id" title="nghttp2_settings_id">nghttp2_settings_id</a><em>&nbsp;id</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_get_remote_settings" title="Permalink to this definition"></a></dt>
<dd><p>Returns the value of SETTINGS <em>id</em> notified by a remote endpoint.</p>
</dd></dl>
2013-08-03 13:03:39 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_session_upgrade">
int <tt class="descname">nghttp2_session_upgrade</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const uint8_t<em>&nbsp;*settings_payload</em>, size_t<em>&nbsp;settings_payloadlen</em>, void<em>&nbsp;*stream_user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_session_upgrade" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Performs post-process of HTTP Upgrade request. This function can
be called from both client and server, but the behavior is very
2013-08-03 13:03:39 +02:00
different in each other.</p>
<p>If called from client side, the <em>settings_payload</em> must be the
2013-08-04 11:30:37 +02:00
value sent in <tt class="docutils literal"><span class="pre">HTTP2-Settings</span></tt> header field and must be decoded
2014-04-08 17:17:05 +02:00
by base64url decoder. The <em>settings_payloadlen</em> is the length of
<em>settings_payload</em>. The <em>settings_payload</em> is unpacked and its
setting values will be submitted using <a class="reference internal" href="#c.nghttp2_submit_settings" title="nghttp2_submit_settings"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_settings()</span></tt></a>.
This means that the client application code does not need to submit
SETTINGS by itself. The stream with stream ID=1 is opened and the
<em>stream_user_data</em> is used for its stream_user_data. The opened
stream becomes half-closed (local) state.</p>
2013-08-03 13:03:39 +02:00
<p>If called from server side, the <em>settings_payload</em> must be the
2013-08-04 11:30:37 +02:00
value received in <tt class="docutils literal"><span class="pre">HTTP2-Settings</span></tt> header field and must be
2014-04-08 17:17:05 +02:00
decoded by base64url decoder. The <em>settings_payloadlen</em> is the
length of <em>settings_payload</em>. It is treated as if the SETTINGS
frame with that payload is received. Thus, callback functions for
the reception of SETTINGS frame will be invoked. The stream with
stream ID=1 is opened. The <em>stream_user_data</em> is ignored. The
2013-08-04 11:30:37 +02:00
opened stream becomes half-closed (remote).</p>
2013-08-03 13:03:39 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-08-03 13:03:39 +02:00
<dd>Out of memory.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.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>
2013-08-03 13:03:39 +02:00
<dd>The <em>settings_payload</em> is badly formed.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_PROTO" title="NGHTTP2_ERR_PROTO"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PROTO</span></tt></a></dt>
2014-04-05 12:26:23 +02:00
<dd>The stream ID 1 is already used or closed; or is not available.</dd>
2013-08-03 13:03:39 +02:00
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_pack_settings_payload">
ssize_t <tt class="descname">nghttp2_pack_settings_payload</tt><big>(</big>uint8_t<em>&nbsp;*buf</em>, size_t<em>&nbsp;buflen</em>, const <a class="reference internal" href="#c.nghttp2_settings_entry" title="nghttp2_settings_entry">nghttp2_settings_entry</a><em>&nbsp;*iv</em>, size_t<em>&nbsp;niv</em><big>)</big><a class="headerlink" href="#c.nghttp2_pack_settings_payload" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Serializes the SETTINGS values <em>iv</em> in the <em>buf</em>. The size of the
<em>buf</em> is specified by <em>buflen</em>. The number of entries in the <em>iv</em>
array is given by <em>niv</em>. The required space in <em>buf</em> for the <em>niv</em>
2013-09-10 17:59:12 +02:00
entries is <tt class="docutils literal"><span class="pre">8*niv</span></tt> bytes and if the given buffer is too small, an
2014-04-08 17:17:05 +02:00
error is returned. This function is used mainly for creating a
2013-09-10 17:59:12 +02:00
SETTINGS payload to be sent with the <tt class="docutils literal"><span class="pre">HTTP2-Settings</span></tt> header
2014-04-08 17:17:05 +02:00
field in an HTTP Upgrade request. The data written in <em>buf</em> is NOT
2013-08-04 11:30:37 +02:00
base64url encoded and the application is responsible for encoding.</p>
2013-08-03 13:03:39 +02:00
<p>This function returns the number of bytes written in <em>buf</em>, or one
of the following negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.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>
2013-08-03 13:03:39 +02:00
<dd>The <em>iv</em> contains duplicate settings ID or invalid value.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_INSUFF_BUFSIZE" title="NGHTTP2_ERR_INSUFF_BUFSIZE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_INSUFF_BUFSIZE</span></tt></a></dt>
2013-09-10 17:59:12 +02:00
<dd>The provided <em>buflen</em> size is too small to hold the output.</dd>
2013-08-03 13:03:39 +02:00
</dl>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_strerror">
const char* <tt class="descname">nghttp2_strerror</tt><big>(</big>int<em>&nbsp;lib_error_code</em><big>)</big><a class="headerlink" href="#c.nghttp2_strerror" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Returns string describing the <em>lib_error_code</em>. The
2014-02-24 17:49:22 +01:00
<em>lib_error_code</em> must be one of the <a class="reference internal" href="#c.nghttp2_error" title="nghttp2_error"><tt class="xref c c-macro docutils literal"><span class="pre">nghttp2_error</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="function">
2014-04-24 18:41:11 +02:00
<dt id="c.nghttp2_priority_spec_init">
void <tt class="descname">nghttp2_priority_spec_init</tt><big>(</big><a class="reference internal" href="#c.nghttp2_priority_spec" title="nghttp2_priority_spec">nghttp2_priority_spec</a><em>&nbsp;*pri_spec</em>, int32_t<em>&nbsp;stream_id</em>, int32_t<em>&nbsp;weight</em>, int<em>&nbsp;exclusive</em><big>)</big><a class="headerlink" href="#c.nghttp2_priority_spec_init" title="Permalink to this definition"></a></dt>
<dd><p>Initializes <em>pri_spec</em> with the <em>stream_id</em> of the stream to depend
on with <em>weight</em> and its exclusive flag. If <em>exclusive</em> is
nonzero, exclusive flag is set.</p>
2014-04-05 12:26:23 +02:00
<p>The <em>weight</em> must be in [<a class="reference internal" href="#c.NGHTTP2_MIN_WEIGHT" title="NGHTTP2_MIN_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MIN_WEIGHT</span></tt></a>,
2014-04-24 18:41:11 +02:00
<a class="reference internal" href="#c.NGHTTP2_MAX_WEIGHT" title="NGHTTP2_MAX_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MAX_WEIGHT</span></tt></a>], inclusive.</p>
2014-04-05 12:26:23 +02:00
</dd></dl>
<dl class="function">
2014-04-24 18:41:11 +02:00
<dt id="c.nghttp2_priority_spec_default_init">
void <tt class="descname">nghttp2_priority_spec_default_init</tt><big>(</big><a class="reference internal" href="#c.nghttp2_priority_spec" title="nghttp2_priority_spec">nghttp2_priority_spec</a><em>&nbsp;*pri_spec</em><big>)</big><a class="headerlink" href="#c.nghttp2_priority_spec_default_init" title="Permalink to this definition"></a></dt>
<dd><p>Initializes <em>pri_spec</em> with the default values. The default values
are: stream_id = 0, weight = <a class="reference internal" href="#c.NGHTTP2_DEFAULT_WEIGHT" title="NGHTTP2_DEFAULT_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_DEFAULT_WEIGHT</span></tt></a> and
exclusive = 0.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_priority_spec_check_default">
int <tt class="descname">nghttp2_priority_spec_check_default</tt><big>(</big>const <a class="reference internal" href="#c.nghttp2_priority_spec" title="nghttp2_priority_spec">nghttp2_priority_spec</a><em>&nbsp;*pri_spec</em><big>)</big><a class="headerlink" href="#c.nghttp2_priority_spec_check_default" title="Permalink to this definition"></a></dt>
<dd><p>Returns nonzero if the <em>pri_spec</em> is filled with default values.</p>
2014-04-05 12:26:23 +02:00
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_submit_request">
2014-04-05 12:26:23 +02:00
int <tt class="descname">nghttp2_submit_request</tt><big>(</big><a class="reference internal" href="#c.nghttp2_session" title="nghttp2_session">nghttp2_session</a><em>&nbsp;*session</em>, const <a class="reference internal" href="#c.nghttp2_priority_spec" title="nghttp2_priority_spec">nghttp2_priority_spec</a><em>&nbsp;*pri_spec</em>, const <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*nva</em>, size_t<em>&nbsp;nvlen</em>, const <a class="reference internal" href="#c.nghttp2_data_provider" title="nghttp2_data_provider">nghttp2_data_provider</a><em>&nbsp;*data_prd</em>, void<em>&nbsp;*stream_user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_request" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Submits HEADERS frame and optionally one or more DATA frames.</p>
2014-04-05 12:26:23 +02:00
<p>The <em>pri_spec</em> is priority specification of this request. <tt class="docutils literal"><span class="pre">NULL</span></tt>
2014-04-24 18:41:11 +02:00
means the default priority (see
<a class="reference internal" href="#c.nghttp2_priority_spec_default_init" title="nghttp2_priority_spec_default_init"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_priority_spec_default_init()</span></tt></a>). To specify the priority,
use <a class="reference internal" href="#c.nghttp2_priority_spec_init" title="nghttp2_priority_spec_init"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_priority_spec_init()</span></tt></a>. If <em>pri_spec</em> is not <tt class="docutils literal"><span class="pre">NULL</span></tt>,
2014-04-05 12:26:23 +02:00
this function will copy its data members.</p>
2014-04-24 18:41:11 +02:00
<p>The <tt class="xref c c-func docutils literal"><span class="pre">pri_spec-&gt;weight()</span></tt> must be in [<a class="reference internal" href="#c.NGHTTP2_MIN_WEIGHT" title="NGHTTP2_MIN_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MIN_WEIGHT</span></tt></a>,
<a class="reference internal" href="#c.NGHTTP2_MAX_WEIGHT" title="NGHTTP2_MAX_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MAX_WEIGHT</span></tt></a>], inclusive. If <tt class="xref c c-func docutils literal"><span class="pre">pri_spec-&gt;weight()</span></tt> is
strictly less than <a class="reference internal" href="#c.NGHTTP2_MIN_WEIGHT" title="NGHTTP2_MIN_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MIN_WEIGHT</span></tt></a>, it becomes
<a class="reference internal" href="#c.NGHTTP2_MIN_WEIGHT" title="NGHTTP2_MIN_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MIN_WEIGHT</span></tt></a>. If it is strictly greater than
<a class="reference internal" href="#c.NGHTTP2_MAX_WEIGHT" title="NGHTTP2_MAX_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MAX_WEIGHT</span></tt></a>, it becomes <a class="reference internal" href="#c.NGHTTP2_MAX_WEIGHT" title="NGHTTP2_MAX_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MAX_WEIGHT</span></tt></a>.</p>
2014-02-24 17:49:22 +01:00
<p>The <em>nva</em> is an array of name/value pair <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_nv</span></tt></a> with
2014-04-08 17:17:05 +02:00
<em>nvlen</em> elements. The value is opaque sequence of bytes and
therefore can contain NULL byte (0x0). If the application requires
2013-12-18 16:06:52 +01:00
that the ordering of values for a single header field name
appearing in different header fields, it has to concatenate them
using NULL byte (0x0) before passing them to this function.</p>
2014-04-05 12:26:23 +02:00
<p>HTTP/2 specification has requirement about header fields in the
2014-04-08 17:17:05 +02:00
request HEADERS. See the specification for more details.</p>
2013-12-08 16:07:37 +01:00
<p>This function creates copies of all name/value pairs in <em>nva</em>. It
also lower-cases all names in <em>nva</em>.</p>
2013-07-28 14:26:41 +02:00
<p>If <em>data_prd</em> is not <tt class="docutils literal"><span class="pre">NULL</span></tt>, it provides data which will be sent
2014-04-08 17:17:05 +02:00
in subsequent DATA frames. In this case, a method that allows
2013-07-28 14:26:41 +02:00
request message bodies
(<a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9">http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9</a>) must
2014-04-08 17:17:05 +02:00
be specified with <tt class="docutils literal"><span class="pre">:method</span></tt> key in <em>nva</em> (e.g. <tt class="docutils literal"><span class="pre">POST</span></tt>). 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 have END_STREAM set. The <em>stream_user_data</em> is data
2013-07-28 14:26:41 +02:00
associated to the stream opened by this request and can be an
arbitrary pointer, which can be retrieved later by
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_get_stream_user_data" title="nghttp2_session_get_stream_user_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_get_stream_user_data()</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
<p>Since the library reorders the frames and tries to send the highest
2014-04-05 12:26:23 +02:00
prioritized one first and the HTTP/2 specification requires the
2013-07-28 14:26:41 +02:00
stream ID must be strictly increasing, the stream ID of this
request cannot be known until it is about to sent. To know the
stream ID of the request, the application can use
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.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 HEADERS
frame, the argument frame has the stream ID assigned. Also since
2013-07-28 14:26:41 +02:00
the stream is already opened,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_session_get_stream_user_data" title="nghttp2_session_get_stream_user_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_get_stream_user_data()</span></tt></a> can be used to get
2013-07-28 14:26:41 +02:00
<em>stream_user_data</em> to identify which HEADERS we are processing.</p>
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-09-10 17:59:12 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_submit_response">
int <tt class="descname">nghttp2_submit_response</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>, const <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*nva</em>, size_t<em>&nbsp;nvlen</em>, const <a class="reference internal" href="#c.nghttp2_data_provider" title="nghttp2_data_provider">nghttp2_data_provider</a><em>&nbsp;*data_prd</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_response" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Submits response HEADERS frame and optionally one or more DATA
frames against the stream <em>stream_id</em>.</p>
2014-02-24 17:49:22 +01:00
<p>The <em>nva</em> is an array of name/value pair <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_nv</span></tt></a> with
2014-04-08 17:17:05 +02:00
<em>nvlen</em> elements. The value is opaque sequence of bytes and
therefore can contain NULL byte (0x0). If the application requires
2013-12-18 16:06:52 +01:00
that the ordering of values for a single header field name
appearing in different header fields, it has to concatenate them
using NULL byte (0x0) before passing them to this function.</p>
2014-04-05 12:26:23 +02:00
<p>HTTP/2 specification has requirement about header fields in the
2014-04-08 17:17:05 +02:00
response HEADERS. See the specification for more details.</p>
2013-12-08 16:07:37 +01:00
<p>This function creates copies of all name/value pairs in <em>nva</em>. It
also lower-cases all names in <em>nva</em>.</p>
2013-07-28 14:26:41 +02:00
<p>If <em>data_prd</em> is not <tt class="docutils literal"><span class="pre">NULL</span></tt>, it provides data which will be sent
in subsequent DATA frames. This function does not take ownership
2014-04-08 17:17:05 +02:00
of the <em>data_prd</em>. The function copies the members of the
2013-07-28 14:26:41 +02:00
<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>
2014-04-08 17:17:05 +02:00
<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="#c.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> must be reserved using
<a class="reference internal" href="#c.nghttp2_submit_push_promise" title="nghttp2_submit_push_promise"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_push_promise()</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_submit_headers">
2014-04-05 12:26:23 +02:00
int <tt class="descname">nghttp2_submit_headers</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>, int32_t<em>&nbsp;stream_id</em>, const <a class="reference internal" href="#c.nghttp2_priority_spec" title="nghttp2_priority_spec">nghttp2_priority_spec</a><em>&nbsp;*pri_spec</em>, const <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*nva</em>, size_t<em>&nbsp;nvlen</em>, void<em>&nbsp;*stream_user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_headers" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Submits HEADERS frame. The <em>flags</em> is bitwise OR of the
following values:</p>
<ul class="simple">
2014-02-24 17:49:22 +01:00
<li><a class="reference internal" href="#c.NGHTTP2_FLAG_END_STREAM" title="NGHTTP2_FLAG_END_STREAM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_END_STREAM</span></tt></a></li>
2013-07-28 14:26:41 +02:00
</ul>
2014-02-24 17:49:22 +01:00
<p>If <em>flags</em> includes <a class="reference internal" href="#c.NGHTTP2_FLAG_END_STREAM" title="NGHTTP2_FLAG_END_STREAM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_END_STREAM</span></tt></a>, this frame has
2014-02-21 13:31:00 +01:00
END_STREAM flag set.</p>
<p>The library handles the CONTINUATION frame internally and it
correctly sets END_HEADERS to the last sequence of the PUSH_PROMISE
or CONTINUATION frame.</p>
2013-07-28 14:26:41 +02:00
<p>If the <em>stream_id</em> is -1, this frame is assumed as request (i.e.,
2014-04-08 17:17:05 +02:00
request HEADERS frame which opens new stream). In this case, the
actual stream ID is assigned just before the frame is sent. For
2013-07-28 14:26:41 +02:00
response, specify stream ID in <em>stream_id</em>.</p>
2014-04-05 12:26:23 +02:00
<p>The <em>pri_spec</em> is priority specification of this request. <tt class="docutils literal"><span class="pre">NULL</span></tt>
2014-04-24 18:41:11 +02:00
means the default priority (see
<a class="reference internal" href="#c.nghttp2_priority_spec_default_init" title="nghttp2_priority_spec_default_init"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_priority_spec_default_init()</span></tt></a>). To specify the priority,
use <a class="reference internal" href="#c.nghttp2_priority_spec_init" title="nghttp2_priority_spec_init"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_priority_spec_init()</span></tt></a>. If <em>pri_spec</em> is not <tt class="docutils literal"><span class="pre">NULL</span></tt>,
2014-04-05 12:26:23 +02:00
this function will copy its data members.</p>
2014-04-24 18:41:11 +02:00
<p>The <tt class="xref c c-func docutils literal"><span class="pre">pri_spec-&gt;weight()</span></tt> must be in [<a class="reference internal" href="#c.NGHTTP2_MIN_WEIGHT" title="NGHTTP2_MIN_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MIN_WEIGHT</span></tt></a>,
<a class="reference internal" href="#c.NGHTTP2_MAX_WEIGHT" title="NGHTTP2_MAX_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MAX_WEIGHT</span></tt></a>], inclusive. If <tt class="xref c c-func docutils literal"><span class="pre">pri_spec-&gt;weight()</span></tt> is
strictly less than <a class="reference internal" href="#c.NGHTTP2_MIN_WEIGHT" title="NGHTTP2_MIN_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MIN_WEIGHT</span></tt></a>, it becomes
<a class="reference internal" href="#c.NGHTTP2_MIN_WEIGHT" title="NGHTTP2_MIN_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MIN_WEIGHT</span></tt></a>. If it is strictly greater than
<a class="reference internal" href="#c.NGHTTP2_MAX_WEIGHT" title="NGHTTP2_MAX_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MAX_WEIGHT</span></tt></a>, it becomes <a class="reference internal" href="#c.NGHTTP2_MAX_WEIGHT" title="NGHTTP2_MAX_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MAX_WEIGHT</span></tt></a>.</p>
2014-02-24 17:49:22 +01:00
<p>The <em>nva</em> is an array of name/value pair <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_nv</span></tt></a> with
2014-04-08 17:17:05 +02:00
<em>nvlen</em> elements. The value is opaque sequence of bytes and
therefore can contain NULL byte (0x0). If the application requires
2013-12-18 16:06:52 +01:00
that the ordering of values for a single header field name
appearing in different header fields, it has to concatenate them
using NULL byte (0x0) before passing them to this function.</p>
2013-12-08 16:07:37 +01:00
<p>This function creates copies of all name/value pairs in <em>nva</em>. It
also lower-cases all names in <em>nva</em>.</p>
2013-07-28 14:26:41 +02:00
<p>The <em>stream_user_data</em> is a pointer to an arbitrary data which is
2014-04-08 17:17:05 +02:00
associated to the stream this frame will open. Therefore it is
only used if this frame opens streams, in other words, it changes
stream state from idle or reserved to open.</p>
2013-07-28 14:26:41 +02:00
<p>This function is low-level in a sense that the application code can
2014-04-08 17:17:05 +02:00
specify flags directly. For usual HTTP request,
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.nghttp2_submit_request" title="nghttp2_submit_request"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_submit_request()</span></tt></a> is useful.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_submit_data">
int <tt class="descname">nghttp2_submit_data</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>, int32_t<em>&nbsp;stream_id</em>, const <a class="reference internal" href="#c.nghttp2_data_provider" title="nghttp2_data_provider">nghttp2_data_provider</a><em>&nbsp;*data_prd</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_data" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Submits one or more DATA frames to the stream <em>stream_id</em>. The
2014-04-08 17:17:05 +02:00
data to be sent are provided by <em>data_prd</em>. If <em>flags</em> contains
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.NGHTTP2_FLAG_END_STREAM" title="NGHTTP2_FLAG_END_STREAM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_END_STREAM</span></tt></a>, the last DATA frame has END_STREAM
2014-04-08 17:17:05 +02:00
flag set. If <em>flags</em> contains <a class="reference internal" href="#c.NGHTTP2_FLAG_END_SEGMENT" title="NGHTTP2_FLAG_END_SEGMENT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_END_SEGMENT</span></tt></a>,
the last DATA frame has END_SEGMENT flag set.</p>
<p>This function does not take ownership of the <em>data_prd</em>. The
2013-07-28 14:26:41 +02:00
function copies the members of the <em>data_prd</em>.</p>
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
2014-04-05 12:26:23 +02:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_DATA_EXIST" title="NGHTTP2_ERR_DATA_EXIST"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_DATA_EXIST</span></tt></a></dt>
<dd>DATA has been already submitted and not fully processed yet.</dd>
2013-07-28 14:26:41 +02:00
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_submit_priority">
2014-04-05 12:26:23 +02:00
int <tt class="descname">nghttp2_submit_priority</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>, int32_t<em>&nbsp;stream_id</em>, const <a class="reference internal" href="#c.nghttp2_priority_spec" title="nghttp2_priority_spec">nghttp2_priority_spec</a><em>&nbsp;*pri_spec</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_priority" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Submits PRIORITY frame to change the priority of stream <em>stream_id</em>
2014-04-05 12:26:23 +02:00
to the priority specification <em>pri_spec</em>.</p>
2013-10-25 18:17:09 +02:00
<p>The <em>flags</em> is currently ignored and should be
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.NGHTTP2_FLAG_NONE" title="NGHTTP2_FLAG_NONE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_NONE</span></tt></a>.</p>
2014-04-05 12:26:23 +02:00
<p>The <em>pri_spec</em> is priority specification of this request. <tt class="docutils literal"><span class="pre">NULL</span></tt>
2014-04-24 18:41:11 +02:00
is not allowed for this function. To specify the priority, use
<a class="reference internal" href="#c.nghttp2_priority_spec_init" title="nghttp2_priority_spec_init"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_priority_spec_init()</span></tt></a>. This function will copy its data
members.</p>
<p>The <tt class="xref c c-func docutils literal"><span class="pre">pri_spec-&gt;weight()</span></tt> must be in [<a class="reference internal" href="#c.NGHTTP2_MIN_WEIGHT" title="NGHTTP2_MIN_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MIN_WEIGHT</span></tt></a>,
<a class="reference internal" href="#c.NGHTTP2_MAX_WEIGHT" title="NGHTTP2_MAX_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MAX_WEIGHT</span></tt></a>], inclusive. If <tt class="xref c c-func docutils literal"><span class="pre">pri_spec-&gt;weight()</span></tt> is
strictly less than <a class="reference internal" href="#c.NGHTTP2_MIN_WEIGHT" title="NGHTTP2_MIN_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MIN_WEIGHT</span></tt></a>, it becomes
<a class="reference internal" href="#c.NGHTTP2_MIN_WEIGHT" title="NGHTTP2_MIN_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MIN_WEIGHT</span></tt></a>. If it is strictly greater than
<a class="reference internal" href="#c.NGHTTP2_MAX_WEIGHT" title="NGHTTP2_MAX_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MAX_WEIGHT</span></tt></a>, it becomes <a class="reference internal" href="#c.NGHTTP2_MAX_WEIGHT" title="NGHTTP2_MAX_WEIGHT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_MAX_WEIGHT</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.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>
2014-04-24 18:41:11 +02:00
<dd>The <em>pri_spec</em> is NULL; or trying to depend on itself.</dd>
2013-07-28 14:26:41 +02:00
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_submit_rst_stream">
int <tt class="descname">nghttp2_submit_rst_stream</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>, int32_t<em>&nbsp;stream_id</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_submit_rst_stream" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Submits RST_STREAM frame to cancel/reject the stream <em>stream_id</em>
with the error code <em>error_code</em>.</p>
2013-10-25 18:17:09 +02:00
<p>The <em>flags</em> is currently ignored and should be
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.NGHTTP2_FLAG_NONE" title="NGHTTP2_FLAG_NONE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_NONE</span></tt></a>.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_submit_settings">
int <tt class="descname">nghttp2_submit_settings</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 <a class="reference internal" href="#c.nghttp2_settings_entry" title="nghttp2_settings_entry">nghttp2_settings_entry</a><em>&nbsp;*iv</em>, size_t<em>&nbsp;niv</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_settings" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Stores local settings and submits SETTINGS frame. The <em>iv</em> is the
pointer to the array of <a class="reference internal" href="#c.nghttp2_settings_entry" title="nghttp2_settings_entry"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_settings_entry</span></tt></a>. The <em>niv</em>
2014-02-24 17:49:22 +01:00
indicates the number of <a class="reference internal" href="#c.nghttp2_settings_entry" title="nghttp2_settings_entry"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_settings_entry</span></tt></a>.</p>
2013-10-25 18:17:09 +02:00
<p>The <em>flags</em> is currently ignored and should be
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.NGHTTP2_FLAG_NONE" title="NGHTTP2_FLAG_NONE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_NONE</span></tt></a>.</p>
2014-04-08 17:17:05 +02:00
<p>This function does not take ownership of the <em>iv</em>. This function
2013-07-28 14:26:41 +02:00
copies all the elements in the <em>iv</em>.</p>
2013-08-08 18:52:42 +02:00
<p>While updating individual stream&#8217;s local window size, if the window
size becomes strictly larger than NGHTTP2_MAX_WINDOW_SIZE,
RST_STREAM is issued against such a stream.</p>
2014-02-24 17:49:22 +01:00
<p>SETTINGS with <a class="reference internal" href="#c.NGHTTP2_FLAG_ACK" title="NGHTTP2_FLAG_ACK"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_ACK</span></tt></a> is automatically submitted
2013-10-28 15:32:57 +01:00
by the library and application could not send it at its will.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.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>
2014-02-16 07:51:22 +01:00
<dd>The <em>iv</em> contains invalid value (e.g., initial window size
strictly greater than (1 &lt;&lt; 31) - 1.</dd>
2014-04-05 12:26:23 +02:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS" title="NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS</span></tt></a></dt>
<dd>There is already another in-flight SETTINGS. Note that the
current implementation only allows 1 in-flight SETTINGS frame
without ACK flag set.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_submit_push_promise">
int <tt class="descname">nghttp2_submit_push_promise</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>, int32_t<em>&nbsp;stream_id</em>, const <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*nva</em>, size_t<em>&nbsp;nvlen</em>, void<em>&nbsp;*promised_stream_user_data</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_push_promise" title="Permalink to this definition"></a></dt>
2014-02-21 13:31:00 +01:00
<dd><p>Submits PUSH_PROMISE frame.</p>
2014-04-08 17:17:05 +02:00
<p>The <em>flags</em> is currently ignored. The library handles the
2014-02-21 13:31:00 +01:00
CONTINUATION frame internally and it correctly sets END_HEADERS to
the last sequence of the PUSH_PROMISE or CONTINUATION frame.</p>
2013-07-28 14:26:41 +02:00
<p>The <em>stream_id</em> must be client initiated stream ID.</p>
2014-02-24 17:49:22 +01:00
<p>The <em>nva</em> is an array of name/value pair <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_nv</span></tt></a> with
2014-04-08 17:17:05 +02:00
<em>nvlen</em> elements. The value is opaque sequence of bytes and
therefore can contain NULL byte (0x0). If the application requires
2013-12-18 16:06:52 +01:00
that the ordering of values for a single header field name
appearing in different header fields, it has to concatenate them
using NULL byte (0x0) before passing them to this function.</p>
2013-12-08 16:07:37 +01:00
<p>This function creates copies of all name/value pairs in <em>nva</em>. It
also lower-cases all names in <em>nva</em>.</p>
2014-02-24 17:49:22 +01:00
<p>The <em>promised_stream_user_data</em> is a pointer to an arbitrary data
which is associated to the promised stream this frame will open and
2014-04-08 17:17:05 +02:00
make it in reserved state. It is available using
<a class="reference internal" href="#c.nghttp2_session_get_stream_user_data" title="nghttp2_session_get_stream_user_data"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_session_get_stream_user_data()</span></tt></a>. The application can
2014-02-24 17:49:22 +01:00
access it in <a class="reference internal" href="#c.nghttp2_before_frame_send_callback" title="nghttp2_before_frame_send_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_before_frame_send_callback</span></tt></a> and
<a class="reference internal" href="#c.nghttp2_on_frame_send_callback" title="nghttp2_on_frame_send_callback"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_on_frame_send_callback</span></tt></a> of this frame.</p>
2013-07-28 14:26:41 +02:00
<p>Since the library reorders the frames and tries to send the highest
2014-04-05 12:26:23 +02:00
prioritized one first and the HTTP/2 specification requires the
2013-07-28 14:26:41 +02:00
stream ID must be strictly increasing, the promised stream ID
cannot be known until it is about to sent. To know the promised
stream ID, the application can use
2014-04-08 17:17:05 +02:00
<a class="reference internal" href="#c.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 is not allowed to use this function.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
2014-04-08 17:17:05 +02:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_PROTO" title="NGHTTP2_ERR_PROTO"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PROTO</span></tt></a></dt>
<dd>This function was invoked when <em>session</em> is initialized as
client.</dd>
2013-07-28 14:26:41 +02:00
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<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>
2014-04-08 17:17:05 +02:00
<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
2013-07-28 14:26:41 +02:00
in this case.</p>
2013-10-25 18:17:09 +02:00
<p>The <em>flags</em> is currently ignored and should be
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.NGHTTP2_FLAG_NONE" title="NGHTTP2_FLAG_NONE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_NONE</span></tt></a>.</p>
2013-08-04 11:30:37 +02:00
<p>If the <em>opaque_data</em> is non <tt class="docutils literal"><span class="pre">NULL</span></tt>, then it should point to the 8
2013-07-28 14:26:41 +02:00
bytes array of memory to specify opaque data to send with PING
2014-04-08 17:17:05 +02:00
frame. If the <em>opaque_data</em> is <tt class="docutils literal"><span class="pre">NULL</span></tt>, zero-cleared 8 bytes will
2013-08-04 11:30:37 +02:00
be sent as opaque data.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_submit_goaway">
2014-04-05 12:26:23 +02:00
int <tt class="descname">nghttp2_submit_goaway</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>, <a class="reference internal" href="#c.nghttp2_error_code" title="nghttp2_error_code">nghttp2_error_code</a><em>&nbsp;error_code</em>, const uint8_t<em>&nbsp;*opaque_data</em>, size_t<em>&nbsp;opaque_data_len</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_goaway" title="Permalink to this definition"></a></dt>
2013-07-28 14:26:41 +02:00
<dd><p>Submits GOAWAY frame with the error code <em>error_code</em>.</p>
2013-10-25 18:17:09 +02:00
<p>The <em>flags</em> is currently ignored and should be
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.NGHTTP2_FLAG_NONE" title="NGHTTP2_FLAG_NONE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_NONE</span></tt></a>.</p>
2013-08-04 11:30:37 +02:00
<p>If the <em>opaque_data</em> is not <tt class="docutils literal"><span class="pre">NULL</span></tt> and <em>opaque_data_len</em> is not
zero, those data will be sent as additional debug data. The
library makes a copy of the memory region pointed by <em>opaque_data</em>
with the length <em>opaque_data_len</em>, so the caller does not need to
2014-04-08 17:17:05 +02:00
keep this memory after the return of this function. If the
2013-08-04 11:30:37 +02:00
<em>opaque_data_len</em> is 0, the <em>opaque_data</em> could be <tt class="docutils literal"><span class="pre">NULL</span></tt>.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
2014-04-05 12:26:23 +02:00
<dt>NGHTTP2_ERR_INVALID_ARGUMENT</dt>
<dd>The <em>opaque_data_len</em> is too large.</dd>
2013-07-28 14:26:41 +02:00
</dl>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_submit_window_update">
int <tt class="descname">nghttp2_submit_window_update</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>, int32_t<em>&nbsp;stream_id</em>, int32_t<em>&nbsp;window_size_increment</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_window_update" title="Permalink to this definition"></a></dt>
2013-08-08 18:52:42 +02:00
<dd><p>Submits WINDOW_UPDATE frame.</p>
2013-10-25 18:17:09 +02:00
<p>The <em>flags</em> is currently ignored and should be
2014-02-24 17:49:22 +01:00
<a class="reference internal" href="#c.NGHTTP2_FLAG_NONE" title="NGHTTP2_FLAG_NONE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_NONE</span></tt></a>.</p>
2013-08-08 18:52:42 +02:00
<p>If the <em>window_size_increment</em> is positive, the WINDOW_UPDATE with
2014-04-08 17:17:05 +02:00
that value as window_size_increment is queued. If the
2013-08-08 18:52:42 +02:00
<em>window_size_increment</em> is larger than the received bytes from the
remote endpoint, the local window size is increased by that
difference.</p>
<p>If the <em>window_size_increment</em> is negative, the local window size
is decreased by -<em>window_size_increment</em>. If
2014-04-05 12:26:23 +02:00
<tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_OPT_NO_AUTO_STREAM_WINDOW_UPDATE</span></tt> (or
<tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_OPT_NO_AUTO_CONNECTION_WINDOW_UPDATE</span></tt> if <em>stream_id</em>
2013-08-08 18:52:42 +02:00
is 0) is not set and the library decided that the WINDOW_UPDATE
should be submitted, then WINDOW_UPDATE is queued with the current
received bytes count.</p>
2013-10-25 18:17:09 +02:00
<p>If the <em>window_size_increment</em> is 0, the function does nothing and
returns 0.</p>
2013-07-28 14:26:41 +02:00
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_FLOW_CONTROL" title="NGHTTP2_ERR_FLOW_CONTROL"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_FLOW_CONTROL</span></tt></a></dt>
2013-08-08 18:52:42 +02:00
<dd>The local window size overflow or gets negative.</dd>
2014-02-24 17:49:22 +01:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
2013-07-28 14:26:41 +02:00
<dd>Out of memory.</dd>
</dl>
</dd></dl>
2014-04-05 12:26:23 +02:00
<dl class="function">
<dt id="c.nghttp2_submit_altsvc">
int <tt class="descname">nghttp2_submit_altsvc</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>, int32_t<em>&nbsp;stream_id</em>, uint32_t<em>&nbsp;max_age</em>, uint16_t<em>&nbsp;port</em>, const uint8_t<em>&nbsp;*protocol_id</em>, size_t<em>&nbsp;protocol_id_len</em>, const uint8_t<em>&nbsp;*host</em>, size_t<em>&nbsp;host_len</em>, const uint8_t<em>&nbsp;*origin</em>, size_t<em>&nbsp;origin_len</em><big>)</big><a class="headerlink" href="#c.nghttp2_submit_altsvc" title="Permalink to this definition"></a></dt>
<dd><p>Submits ALTSVC frame with given parameters.</p>
<p>The <em>flags</em> is currently ignored and should be
<a class="reference internal" href="#c.NGHTTP2_FLAG_NONE" title="NGHTTP2_FLAG_NONE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_FLAG_NONE</span></tt></a>.</p>
<p>Only the server can send the ALTSVC frame. If <em>session</em> is
initialized as client, this function fails and returns
<a class="reference internal" href="#c.NGHTTP2_ERR_INVALID_STATE" title="NGHTTP2_ERR_INVALID_STATE"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_INVALID_STATE</span></tt></a>.</p>
<p>If the <em>protocol_id_len</em> is 0, the <em>protocol_id</em> could be <tt class="docutils literal"><span class="pre">NULL</span></tt>.</p>
<p>If the <em>host_len</em> is 0, the <em>host</em> could be <tt class="docutils literal"><span class="pre">NULL</span></tt>.</p>
<p>If the <em>origin_len</em> is 0, the <em>origin</em> could be <tt class="docutils literal"><span class="pre">NULL</span></tt>.</p>
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_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>
2014-04-08 17:17:05 +02:00
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_PROTO" title="NGHTTP2_ERR_PROTO"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_PROTO</span></tt></a></dt>
2014-04-05 12:26:23 +02:00
<dd>The function is invoked with <em>session</em> which was initialized as
client.</dd>
<dt><a class="reference internal" href="#c.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 combined length of <em>protocol_id_len</em>, <em>host_len</em> and
<em>origin_len</em> is is too large.</dd>
</dl>
</dd></dl>
2013-08-28 17:32:28 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_nv_compare_name">
int <tt class="descname">nghttp2_nv_compare_name</tt><big>(</big>const <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*lhs</em>, const <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*rhs</em><big>)</big><a class="headerlink" href="#c.nghttp2_nv_compare_name" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Compares <tt class="docutils literal"><span class="pre">lhs-&gt;name</span></tt> of length <tt class="docutils literal"><span class="pre">lhs-&gt;namelen</span></tt> bytes and
<tt class="docutils literal"><span class="pre">rhs-&gt;name</span></tt> of length <tt class="docutils literal"><span class="pre">rhs-&gt;namelen</span></tt> bytes. Returns negative
integer if <tt class="docutils literal"><span class="pre">lhs-&gt;name</span></tt> is found to be less than <tt class="docutils literal"><span class="pre">rhs-&gt;name</span></tt>; or
returns positive integer if <tt class="docutils literal"><span class="pre">lhs-&gt;name</span></tt> is found to be greater
than <tt class="docutils literal"><span class="pre">rhs-&gt;name</span></tt>; or returns 0 otherwise.</p>
2013-08-28 17:32:28 +02:00
</dd></dl>
2013-07-28 14:26:41 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.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="#c.nghttp2_select_next_protocol" title="Permalink to this definition"></a></dt>
2014-01-01 17:03:29 +01:00
<dd><p>A helper function for dealing with NPN in client side or ALPN in
2014-04-08 17:17:05 +02:00
server side. The <em>in</em> contains peer&#8217;s protocol list in preferable
2014-01-01 17:03:29 +01:00
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>
2013-07-28 14:26:41 +02:00
<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>
<span class="n">in</span><span class="p">[</span><span class="mf">19..26</span><span class="p">]</span> <span class="o">=</span> <span class="s">&quot;http/1.1&quot;</span>
<span class="n">inlen</span> <span class="o">=</span> <span class="mi">27</span>
</pre></div>
</div>
<p>The selection algorithm is as follows:</p>
<ol class="arabic simple">
2014-04-05 12:26:23 +02:00
<li>If peer&#8217;s list contains HTTP/2 protocol the library supports,
2014-01-01 17:03:29 +01:00
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
2014-04-08 17:17:05 +02:00
<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
2013-07-28 14:26:41 +02:00
untouched.</li>
</ol>
<p>Selecting <tt class="docutils literal"><span class="pre">HTTP-draft-04/2.0</span></tt> means that <tt class="docutils literal"><span class="pre">HTTP-draft-04/2.0</span></tt> is
2014-04-08 17:17:05 +02:00
written into <em>*out</em> and its length (which is 17) is assigned to
<em>*outlen</em>.</p>
2014-02-05 15:22:31 +01:00
<p>For ALPN, refer to
2014-04-08 17:17:05 +02:00
<a class="reference external" href="https://tools.ietf.org/html/draft-ietf-tls-applayerprotoneg-05">https://tools.ietf.org/html/draft-ietf-tls-applayerprotoneg-05</a></p>
2013-07-28 14:26:41 +02:00
<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>
2014-01-01 17:03:29 +01:00
<p>For NPN, to use this method you should do something like:</p>
2013-07-28 14:26:41 +02:00
<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>
<span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span>
<span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">inlen</span><span class="p">,</span>
<span class="kt">void</span> <span class="o">*</span><span class="n">arg</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="n">rv</span> <span class="o">=</span> <span class="n">nghttp2_select_next_protocol</span><span class="p">(</span><span class="n">out</span><span class="p">,</span> <span class="n">outlen</span><span class="p">,</span> <span class="n">in</span><span class="p">,</span> <span class="n">inlen</span><span class="p">);</span>
<span class="k">if</span><span class="p">(</span><span class="n">rv</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
<span class="p">((</span><span class="n">MyType</span><span class="o">*</span><span class="p">)</span><span class="n">arg</span><span class="p">)</span><span class="o">-&gt;</span><span class="n">http2_selected</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">return</span> <span class="n">SSL_TLSEXT_ERR_OK</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">...</span>
<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>
</dd></dl>
2013-09-04 15:59:13 +02:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_version">
<a class="reference internal" href="#c.nghttp2_info" title="nghttp2_info">nghttp2_info</a> *<tt class="descname">nghttp2_version</tt><big>(</big>int<em>&nbsp;least_version</em><big>)</big><a class="headerlink" href="#c.nghttp2_version" title="Permalink to this definition"></a></dt>
2014-04-08 17:17:05 +02:00
<dd><p>Returns a pointer to a nghttp2_info struct with version information
about the run-time library in use. The <em>least_version</em> argument
can be set to a 24 bit numerical value for the least accepted
version number and if the condition is not met, this function will
return a <tt class="docutils literal"><span class="pre">NULL</span></tt>. Pass in 0 to skip the version checking.</p>
2013-09-04 15:59:13 +02:00
</dd></dl>
2014-01-18 17:17:41 +01:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_is_fatal">
int <tt class="descname">nghttp2_is_fatal</tt><big>(</big>int<em>&nbsp;lib_error</em><big>)</big><a class="headerlink" href="#c.nghttp2_is_fatal" title="Permalink to this definition"></a></dt>
<dd><p>Returns nonzero if the <a class="reference internal" href="#c.nghttp2_error" title="nghttp2_error"><tt class="xref c c-type docutils literal"><span class="pre">nghttp2_error</span></tt></a> library error code
2014-01-18 17:17:41 +01:00
<em>lib_error</em> is fatal.</p>
</dd></dl>
2014-02-01 13:24:57 +01:00
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_check_header_name">
int <tt class="descname">nghttp2_check_header_name</tt><big>(</big>const uint8_t<em>&nbsp;*name</em>, size_t<em>&nbsp;len</em><big>)</big><a class="headerlink" href="#c.nghttp2_check_header_name" title="Permalink to this definition"></a></dt>
2014-02-01 13:24:57 +01:00
<dd><p>Returns nonzero if HTTP header field name <em>name</em> of length <em>len</em> is
valid according to
<a class="reference external" href="http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25#section-3.2">http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25#section-3.2</a></p>
<p>Because this is a header field name in HTTP2, the upper cased alphabet
is treated as error.</p>
</dd></dl>
<dl class="function">
2014-02-24 17:49:22 +01:00
<dt id="c.nghttp2_check_header_value">
int <tt class="descname">nghttp2_check_header_value</tt><big>(</big>const uint8_t<em>&nbsp;*value</em>, size_t<em>&nbsp;len</em><big>)</big><a class="headerlink" href="#c.nghttp2_check_header_value" title="Permalink to this definition"></a></dt>
2014-02-01 13:24:57 +01:00
<dd><p>Returns nonzero if HTTP header field value <em>value</em> of length <em>len</em>
is valid according to
<a class="reference external" href="http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25#section-3.2">http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25#section-3.2</a></p>
<p>Because this is HTTP2 header field value, it can contain NULL
character (0x00).</p>
</dd></dl>
2014-04-30 03:27:19 +02:00
<dl class="function">
<dt id="c.nghttp2_hd_inflate_new">
int <tt class="descname">nghttp2_hd_inflate_new</tt><big>(</big><a class="reference internal" href="#c.nghttp2_hd_inflater" title="nghttp2_hd_inflater">nghttp2_hd_inflater</a><em>&nbsp;**inflater_ptr</em><big>)</big><a class="headerlink" href="#c.nghttp2_hd_inflate_new" title="Permalink to this definition"></a></dt>
<dd><p>Initializes <em>*inflater_ptr</em> for inflating name/values pairs.</p>
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_hd_inflate_del">
void <tt class="descname">nghttp2_hd_inflate_del</tt><big>(</big><a class="reference internal" href="#c.nghttp2_hd_inflater" title="nghttp2_hd_inflater">nghttp2_hd_inflater</a><em>&nbsp;*inflater</em><big>)</big><a class="headerlink" href="#c.nghttp2_hd_inflate_del" title="Permalink to this definition"></a></dt>
<dd><p>Deallocates any resources allocated for <em>inflater</em>.</p>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_hd_inflate_change_table_size">
int <tt class="descname">nghttp2_hd_inflate_change_table_size</tt><big>(</big><a class="reference internal" href="#c.nghttp2_hd_inflater" title="nghttp2_hd_inflater">nghttp2_hd_inflater</a><em>&nbsp;*inflater</em>, size_t<em>&nbsp;settings_hd_table_bufsize_max</em><big>)</big><a class="headerlink" href="#c.nghttp2_hd_inflate_change_table_size" title="Permalink to this definition"></a></dt>
2014-05-06 16:23:33 +02:00
<dd><p>Changes header table size in the <em>inflater</em>. This may trigger
2014-04-30 03:27:19 +02:00
eviction in the dynamic table.</p>
<p>The <em>settings_hd_table_bufsize_max</em> should be the value transmitted
in SETTINGS_HEADER_TABLE_SIZE.</p>
<p>This function returns 0 if it succeeds, or one of the following
negative error codes:</p>
<dl class="docutils">
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
<dd>Out of memory.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_hd_inflate_hd">
ssize_t <tt class="descname">nghttp2_hd_inflate_hd</tt><big>(</big><a class="reference internal" href="#c.nghttp2_hd_inflater" title="nghttp2_hd_inflater">nghttp2_hd_inflater</a><em>&nbsp;*inflater</em>, <a class="reference internal" href="#c.nghttp2_nv" title="nghttp2_nv">nghttp2_nv</a><em>&nbsp;*nv_out</em>, int<em>&nbsp;*inflate_flags</em>, uint8_t<em>&nbsp;*in</em>, size_t<em>&nbsp;inlen</em>, int<em>&nbsp;in_final</em><big>)</big><a class="headerlink" href="#c.nghttp2_hd_inflate_hd" title="Permalink to this definition"></a></dt>
2014-05-06 16:23:33 +02:00
<dd><p>Inflates name/value block stored in <em>in</em> with length <em>inlen</em>. This
function performs decompression. For each successful emission of
2014-04-30 03:27:19 +02:00
header name/value pair, <a class="reference internal" href="#c.NGHTTP2_HD_INFLATE_EMIT" title="NGHTTP2_HD_INFLATE_EMIT"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_HD_INFLATE_EMIT</span></tt></a> is set in
<em>*inflate_flags</em> and name/value pair is assigned to the <em>nv_out</em>
2014-05-06 16:23:33 +02:00
and the function returns. The caller must not free the members of
2014-04-30 03:27:19 +02:00
<em>nv_out</em>.</p>
2014-05-06 16:23:33 +02:00
<p>The <em>nv_out</em> may include pointers to the memory region in the <em>in</em>.
The caller must retain the <em>in</em> while the <em>nv_out</em> is used.</p>
2014-04-30 03:27:19 +02:00
<p>The application should call this function repeatedly until the
2014-04-30 03:29:43 +02:00
<tt class="docutils literal"><span class="pre">(*inflate_flags)</span> <span class="pre">&amp;</span> <span class="pre">NGHTTP2_HD_INFLATE_FINAL</span></tt> is nonzero and
2014-05-06 16:23:33 +02:00
return value is non-negative. This means the all input values are
processed successfully. Then the application must call
2014-04-30 03:27:19 +02:00
<a class="reference internal" href="#c.nghttp2_hd_inflate_end_headers" title="nghttp2_hd_inflate_end_headers"><tt class="xref c c-func docutils literal"><span class="pre">nghttp2_hd_inflate_end_headers()</span></tt></a> to prepare for the next header
block input.</p>
2014-05-06 16:23:33 +02:00
<p>The caller can feed complete compressed header block. It also can
feed it in several chunks. The caller must set <em>in_final</em> to
2014-04-30 03:27:19 +02:00
nonzero if the given input is the last block of the compressed
header.</p>
<p>This function returns the number of bytes processed if it succeeds,
or one of the following negative error codes:</p>
<dl class="docutils">
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_NOMEM" title="NGHTTP2_ERR_NOMEM"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_NOMEM</span></tt></a></dt>
<dd>Out of memory.</dd>
<dt><a class="reference internal" href="#c.NGHTTP2_ERR_HEADER_COMP" title="NGHTTP2_ERR_HEADER_COMP"><tt class="xref c c-macro docutils literal"><span class="pre">NGHTTP2_ERR_HEADER_COMP</span></tt></a></dt>
<dd>Inflation process has failed.</dd>
</dl>
2014-04-30 03:50:10 +02:00
<p>Example follows:</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="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>
<span class="kt">int</span> <span class="n">inflate_flags</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="n">rv</span> <span class="o">=</span> <span class="n">nghttp2_hd_inflate_hd</span><span class="p">(</span><span class="n">hd_inflater</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">nv</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">inflate_flags</span><span class="p">,</span>
<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="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">in</span> <span class="o">+=</span> <span class="n">rv</span><span class="p">;</span>
<span class="n">inlen</span> <span class="o">-=</span> <span class="n">rv</span><span class="p">;</span>
<span class="k">if</span><span class="p">(</span><span class="n">inflate_flags</span> <span class="o">&amp;</span> <span class="n">NGHTTP2_HD_INFLATE_EMIT</span><span class="p">)</span> <span class="p">{</span>
<span class="n">fwrite</span><span class="p">(</span><span class="n">nv</span><span class="p">.</span><span class="n">name</span><span class="p">,</span> <span class="n">nv</span><span class="p">.</span><span class="n">namelen</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">stderr</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;: &quot;</span><span class="p">);</span>
<span class="n">fwrite</span><span class="p">(</span><span class="n">nv</span><span class="p">.</span><span class="n">value</span><span class="p">,</span> <span class="n">nv</span><span class="p">.</span><span class="n">valuelen</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">stderr</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;</span><span class="se">\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">if</span><span class="p">(</span><span class="n">inflate_flags</span> <span class="o">&amp;</span> <span class="n">NGHTTP2_HD_INFLATE_FINAL</span><span class="p">)</span> <span class="p">{</span>
<span class="n">nghttp2_hd_inflate_end_headers</span><span class="p">(</span><span class="n">hd_inflater</span><span class="p">);</span>
<span class="k">break</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">if</span><span class="p">((</span><span class="n">inflate_flags</span> <span class="o">&amp;</span> <span class="n">NGHTTP2_HD_INFLATE_EMIT</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span> <span class="o">&amp;&amp;</span>
<span class="n">inlen</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="k">break</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
2014-04-30 03:27:19 +02:00
</dd></dl>
<dl class="function">
<dt id="c.nghttp2_hd_inflate_end_headers">
int <tt class="descname">nghttp2_hd_inflate_end_headers</tt><big>(</big><a class="reference internal" href="#c.nghttp2_hd_inflater" title="nghttp2_hd_inflater">nghttp2_hd_inflater</a><em>&nbsp;*inflater</em><big>)</big><a class="headerlink" href="#c.nghttp2_hd_inflate_end_headers" title="Permalink to this definition"></a></dt>
<dd><p>Signals the end of decompression for one header block.</p>
<p>This function returns 0 if it succeeds. Currently this function
always succeeds.</p>
</dd></dl>
2013-07-28 14:26:41 +02:00
</div>
</div>
2014-02-02 10:36:57 +01:00
</div>
<footer>
2014-02-02 10:36:57 +01:00
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
2014-02-05 15:22:31 +01:00
<a href="nghttp2.h.html" class="btn btn-neutral float-right" title="nghttp2.h"/>Next <span class="fa fa-arrow-circle-right"></span></a>
2014-04-20 16:36:21 +02:00
<a href="nghttpx-howto.html" class="btn btn-neutral" title="nghttpx - HOW-TO"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
2013-07-28 14:26:41 +02:00
<hr/>
2014-02-02 10:36:57 +01:00
<div role="contentinfo">
<p>
&copy; Copyright 2012, 2014, Tatsuhiro Tsujikawa.
</p>
</div>
2014-02-02 10:36:57 +01:00
<a href="https://github.com/snide/sphinx_rtd_theme">Sphinx theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>
</footer>
2013-07-28 14:26:41 +02:00
</div>
</div>
</section>
</div>
</body>
2013-07-28 14:26:41 +02:00
</html>