From 425a54a9380083e77742508d5fcb171f193c2171 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 1 Feb 2014 21:24:57 +0900 Subject: [PATCH] Update doc --- _sources/apiref.txt | 34 ++++++++++++++++++++++++++++++++++ apiref.html | 32 ++++++++++++++++++++++++++++++++ genindex.html | 12 ++++++++++-- nghttp2.h.html | 38 ++++++++++++++++++++++++++++++++++++++ objects.inv | Bin 2114 -> 2129 bytes searchindex.js | 2 +- 6 files changed, 115 insertions(+), 3 deletions(-) diff --git a/_sources/apiref.txt b/_sources/apiref.txt index e7604e82..a41bb6bf 100644 --- a/_sources/apiref.txt +++ b/_sources/apiref.txt @@ -997,6 +997,20 @@ Types (structs, unions and typedefs) The *name* may be ``NULL`` if the *namelen* is 0. The same thing can be said about the *value*. + Please note that nghttp2 library does not perform any validity + check against the *name* and the *value*. For example, the + *namelen* could be 0, and/or the *value* contains ``0x0a`` or + ``0x0d``. The application must check them if it matters. The + helper function `nghttp2_check_header_name()` and + `nghttp2_check_header_value()` provide simple validation against + HTTP2 header field construction rule. + + One more thing to note is that the *value* may contain ``NULL`` + (``0x00``) 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 + concatenation is used in order to keep the ordering of headers. + If the application uses `nghttp2_session_mem_recv()`, it can return :macro:`NGHTTP2_ERR_PAUSE` to make `nghttp2_session_mem_recv()` return without processing further input bytes. The memory pointed @@ -2007,4 +2021,24 @@ Functions Returns nonzero if the :type:`nghttp2_error` library error code *lib_error* is fatal. +.. function:: int nghttp2_check_header_name(const uint8_t *name, size_t len) + + + Returns nonzero if HTTP header field name *name* of length *len* is + valid according to + http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25#section-3.2 + + Because this is a header field name in HTTP2, the upper cased alphabet + is treated as error. + +.. function:: int nghttp2_check_header_value(const uint8_t *value, size_t len) + + + Returns nonzero if HTTP header field value *value* of length *len* + is valid according to + http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25#section-3.2 + + Because this is HTTP2 header field value, it can contain NULL + character (0x00). + diff --git a/apiref.html b/apiref.html index 38eb1f40..e53e67ed 100644 --- a/apiref.html +++ b/apiref.html @@ -1502,6 +1502,18 @@ is an error in decompression, invoked.

The name may be NULL if the namelen is 0. The same thing can be said about the value.

+

Please note that nghttp2 library does not perform any validity +check against the name and the value. For example, the +namelen could be 0, and/or the value contains 0x0a or +0x0d. The application must check them if it matters. The +helper function nghttp2_check_header_name() and +nghttp2_check_header_value() provide simple validation against +HTTP2 header field construction rule.

+

One more thing to note is that the value may contain NULL +(0x00) 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 +concatenation is used in order to keep the ordering of headers.

If the application uses nghttp2_session_mem_recv(), it can return NGHTTP2_ERR_PAUSE to make nghttp2_session_mem_recv() return without processing further input bytes. The memory pointed @@ -2532,6 +2544,26 @@ int nghttp2_is_fatal(int lib_error lib_error is fatal.

+
+
+int nghttp2_check_header_name(const uint8_t *name, size_t len)
+

Returns nonzero if HTTP header field name name of length len is +valid according to +http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25#section-3.2

+

Because this is a header field name in HTTP2, the upper cased alphabet +is treated as error.

+
+ +
+
+int nghttp2_check_header_value(const uint8_t *value, size_t len)
+

Returns nonzero if HTTP header field value value of length len +is valid according to +http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25#section-3.2

+

Because this is HTTP2 header field value, it can contain NULL +character (0x00).

+
+ diff --git a/genindex.html b/genindex.html index 182375d0..f0a27133 100644 --- a/genindex.html +++ b/genindex.html @@ -151,6 +151,14 @@ +
nghttp2_check_header_name (C function) +
+ + +
nghttp2_check_header_value (C function) +
+ +
NGHTTP2_CLIENT_CONNECTION_HEADER (C macro)
@@ -602,12 +610,12 @@
nghttp2_nv.value (C member)
+ +
nghttp2_nv.valuelen (C member)
-
-
nghttp2_nv_compare_name (C function)
diff --git a/nghttp2.h.html b/nghttp2.h.html index 859c7f89..95d38e16 100644 --- a/nghttp2.h.html +++ b/nghttp2.h.html @@ -1242,6 +1242,20 @@ * The |name| may be ``NULL`` if the |namelen| is 0. The same thing * can be said about the |value|. * + * Please note that nghttp2 library does not perform any validity + * check against the |name| and the |value|. For example, the + * |namelen| could be 0, and/or the |value| contains ``0x0a`` or + * ``0x0d``. The application must check them if it matters. The + * helper function `nghttp2_check_header_name()` and + * `nghttp2_check_header_value()` provide simple validation against + * HTTP2 header field construction rule. + * + * One more thing to note is that the |value| may contain ``NULL`` + * (``0x00``) 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 + * concatenation is used in order to keep the ordering of headers. + * * If the application uses `nghttp2_session_mem_recv()`, it can return * :enum:`NGHTTP2_ERR_PAUSE` to make `nghttp2_session_mem_recv()` * return without processing further input bytes. The memory pointed @@ -2448,6 +2462,30 @@ */ int nghttp2_is_fatal(int lib_error); +/** + * @function + * + * Returns nonzero if HTTP header field name |name| of length |len| is + * valid according to + * http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25#section-3.2 + * + * Because this is a header field name in HTTP2, the upper cased alphabet + * is treated as error. + */ +int nghttp2_check_header_name(const uint8_t *name, size_t len); + +/** + * @function + * + * Returns nonzero if HTTP header field value |value| of length |len| + * is valid according to + * http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-25#section-3.2 + * + * Because this is HTTP2 header field value, it can contain NULL + * character (0x00). + */ +int nghttp2_check_header_value(const uint8_t *value, size_t len); + #ifdef __cplusplus } #endif diff --git a/objects.inv b/objects.inv index 32755a762e2a3ba9f03c737d85a30c502f91fe80..618ff7d2912a1ccaa19621b8c80eeddc22a11471 100644 GIT binary patch delta 2023 zcmVZBR=PO(_vkg`0Wp=cY-Bd7mc%;+Ws4&Pj)fgBa?sUF> zt^i@M-PV;et1h>Z(S4qCu5`%bB#YUvSyjhh({RJm+2=2_;{EfX|3cf>hxD)6Dvz6# z%}oBUPdk=fStS13ujn4FSXf5;>4V+>`p3NPfpxfJpR(P)u78UMnin;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