Commit 27b3091a authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Update README.rst

parent 62b73133
...@@ -442,21 +442,18 @@ deflatehd - header compressor ...@@ -442,21 +442,18 @@ deflatehd - header compressor
The ``deflatehd`` reads JSON data or HTTP/1-style header fields from The ``deflatehd`` reads JSON data or HTTP/1-style header fields from
stdin and outputs compressed header block in JSON. stdin and outputs compressed header block in JSON.
For the JSON input, the root JSON object must contain ``context`` key, For the JSON input, the root JSON object must include ``cases``
which indicates which compression context is used. If it is key. Its value has to include the sequence of input header set. They
``request``, request compression context is used. Otherwise, response share the same compression context and are processed in the order they
compression context is used. The value of ``cases`` key contains the appear. Each item in the sequence is a JSON object and it must
sequence of input header set. They share the same compression context include ``headers`` key. Its value is an array of a JSON object ,
and are processed in the order they appear. Each item in the sequence which includes exactly one name/value pair.
is a JSON object and it must have at least ``headers`` key. Its value
is an array of a JSON object containing exactly one name/value pair.
Example: Example:
.. code-block:: json .. code-block:: json
{ {
"context": "request",
"cases": "cases":
[ [
{ {
...@@ -487,9 +484,7 @@ Example:: ...@@ -487,9 +484,7 @@ Example::
:method: POST :method: POST
user-agent: nghttp2 user-agent: nghttp2
The output is JSON object. It contains ``context`` key and its value The output is JSON object. It should include ``cases`` key and its
is ``request`` if the compression context is request, otherwise
``response``. The root JSON object also contains ``cases`` key and its
value is an array of JSON object, which has at least following keys: value is an array of JSON object, which has at least following keys:
seq seq
...@@ -518,7 +513,6 @@ Examples: ...@@ -518,7 +513,6 @@ Examples:
.. code-block:: json .. code-block:: json
{ {
"context": "request",
"cases": "cases":
[ [
{ {
...@@ -580,9 +574,9 @@ The output can be used as the input for ``inflatehd`` and ...@@ -580,9 +574,9 @@ The output can be used as the input for ``inflatehd`` and
``deflatehd``. ``deflatehd``.
With ``-d`` option, the extra ``header_table`` key is added and its With ``-d`` option, the extra ``header_table`` key is added and its
associated value contains the state of dyanmic header table after the associated value includes the state of dyanmic header table after the
corresponding header set was processed. The value contains following corresponding header set was processed. The value includes at least
keys: following keys:
entries entries
The entry in the header table. If ``referenced`` is ``true``, it The entry in the header table. If ``referenced`` is ``true``, it
...@@ -618,7 +612,6 @@ Example: ...@@ -618,7 +612,6 @@ Example:
.. code-block:: json .. code-block:: json
{ {
"context": "request",
"cases": "cases":
[ [
{ {
...@@ -774,21 +767,17 @@ inflatehd - header decompressor ...@@ -774,21 +767,17 @@ inflatehd - header decompressor
The ``inflatehd`` reads JSON data from stdin and outputs decompressed The ``inflatehd`` reads JSON data from stdin and outputs decompressed
name/value pairs in JSON. name/value pairs in JSON.
The root JSON object must contain ``context`` key, which indicates The root JSON object must include ``cases`` key. Its value has to
which compression context is used. If it is ``request``, request include the sequence of compressed header block. They share the same
compression context is used. Otherwise, response compression context compression context and are processed in the order they appear. Each
is used. The value of ``cases`` key contains the sequence of item in the sequence is a JSON object and it must have at least
compressed header block. They share the same compression context and ``wire`` key. Its value is a compressed header block in hex string.
are processed in the order they appear. Each item in the sequence is a
JSON object and it must have at least ``wire`` key. Its value is a
string containing compressed header block in hex string.
Example: Example:
.. code-block:: json .. code-block:: json
{ {
"context": "request",
"cases": "cases":
[ [
{ "wire": "8285" }, { "wire": "8285" },
...@@ -796,16 +785,14 @@ Example: ...@@ -796,16 +785,14 @@ Example:
] ]
} }
The output is JSON object. It contains ``context`` key and its value The output is JSON object. It should include ``cases`` key and its
is ``request`` if the compression context is request, otherwise
``response``. The root JSON object also contains ``cases`` key and its
value is an array of JSON object, which has at least following keys: value is an array of JSON object, which has at least following keys:
seq seq
The index of header set in the input. The index of header set in the input.
headers headers
The JSON array contains decompressed name/value pairs. The JSON array includes decompressed name/value pairs.
wire wire
The compressed header block in hex string. The compressed header block in hex string.
...@@ -819,7 +806,6 @@ Example: ...@@ -819,7 +806,6 @@ Example:
.. code-block:: json .. code-block:: json
{ {
"context": "request",
"cases": "cases":
[ [
{ {
...@@ -874,7 +860,7 @@ The output can be used as the input for ``deflatehd`` and ...@@ -874,7 +860,7 @@ The output can be used as the input for ``deflatehd`` and
``inflatehd``. ``inflatehd``.
With ``-d`` option, the extra ``header_table`` key is added and its With ``-d`` option, the extra ``header_table`` key is added and its
associated value contains the state of dyanmic header table after the associated value includes the state of dyanmic header table after the
corresponding header set was processed. The format is the same as corresponding header set was processed. The format is the same as
``deflatehd``. ``deflatehd``.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment