From 683253e334bfde1910438daf2b78c75d05a01461 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 27 Oct 2013 23:16:49 +0900 Subject: [PATCH] Declare HTTP-draft-07/2.0 --- README.rst | 34 ++++++++++++---------------------- lib/includes/nghttp2/nghttp2.h | 4 ++-- tests/nghttp2_npn_test.c | 7 ++++--- 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/README.rst b/README.rst index e4fbbcc6..112e2a8a 100644 --- a/README.rst +++ b/README.rst @@ -4,40 +4,30 @@ nghttp2 - HTTP/2.0 C Library This is an experimental implementation of Hypertext Transfer Protocol version 2.0. -This branch implements HPACK-draft-04 -(http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-04). - There are command-line header compression test tools in hdtest directory. Check out deflatehd and inflatehd commands. -With these changes, the implemented protocol is not compatible with -HTTP-draft-06/2.0. Therefore, this branch uses -HTTP-nghttp2hpack-06/2.0 as protocol identifier. The following section -does not reflect this protocl identifier change. Read it by replacing -HTTP-draft-06/2.0 with HTTP-nghttp2hpack-06/2.0. - Development Status ------------------ -We started to implement HTTP-draft-06/2.0 -(http://tools.ietf.org/html/draft-ietf-httpbis-http2-06) and the +We started to implement HTTP-draft-07/2.0 +(http://tools.ietf.org/html/draft-ietf-httpbis-http2-07) and the header compression -(http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-03). +(http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07). The nghttp2 code base was forked from spdylay project. -=================== ================= -Features HTTP-draft-06/2.0 -=================== ================= -Flow Control Done -Header Compression Done -Reprioritization Done +========================== ================= +Features HTTP-draft-07/2.0 +========================== ================= +:authority Done +HPACK-draft-04 Done +SETTINGS_HEADER_TABLE_SIZE Done +SETTINGS_ENABLE_PUSH +FRAME_SIZE_ERROR Done Header Continuation -Server Push Done -HTTP Upgrade Done ALPN -NPN Done -=================== ================= +========================== ================= Public Test Server ------------------ diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 77babf61..8674ce26 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -40,13 +40,13 @@ extern "C" { * * The protocol version identification of this library supports. */ -#define NGHTTP2_PROTO_VERSION_ID "HTTP-nghttp2hpack-06/2.0" +#define NGHTTP2_PROTO_VERSION_ID "HTTP-draft-07/2.0" /** * @macro * * The length of :macro:`NGHTTP2_PROTO_VERSION_ID`. */ -#define NGHTTP2_PROTO_VERSION_ID_LEN 24 +#define NGHTTP2_PROTO_VERSION_ID_LEN 17 struct nghttp2_session; /** diff --git a/tests/nghttp2_npn_test.c b/tests/nghttp2_npn_test.c index f97b59f2..72d3e3b3 100644 --- a/tests/nghttp2_npn_test.c +++ b/tests/nghttp2_npn_test.c @@ -24,22 +24,23 @@ */ #include "nghttp2_npn_test.h" +#include + #include #include -#include static void http2(void) { const unsigned char p[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '1', - 24, 'H', 'T', 'T', 'P', '-', 'n', 'g', 'h', 't', 't', 'p', '2', 'h', 'p', 'a', 'c', 'k', '-', '0', '6', '/', + 17, 'H', 'T', 'T', 'P', '-', 'd', 'r', 'a', 'f', 't', '-', '0', '7', '/', '2', '.', '0', 6, 's', 'p', 'd', 'y', '/', '3' }; unsigned char outlen; unsigned char* out; CU_ASSERT(1 == nghttp2_select_next_protocol(&out, &outlen, p, sizeof(p))); - CU_ASSERT(24 == outlen); + CU_ASSERT(17 == outlen); CU_ASSERT(memcmp(NGHTTP2_PROTO_VERSION_ID, out, outlen) == 0); }