diff --git a/README.rst b/README.rst index cfc21b6e..07db75fe 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,19 @@ nghttp2 - HTTP/2.0 C Library This is an experimental implementation of Hypertext Transfer Protocol version 2.0. +This branch explores upcoming HPACK changes: + +* Unified request/response static header table +* Insert index 0 and remove the last one +* Drop substitution +* Huffman encoding + +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 ------------------ diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index ead216c6..58b8fd11 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-draft-06/2.0" +#define NGHTTP2_PROTO_VERSION_ID "HTTP-nghttp2hpack-06/2.0" /** * @macro * * The length of :macro:`NGHTTP2_PROTO_VERSION_ID`. */ -#define NGHTTP2_PROTO_VERSION_ID_LEN 17 +#define NGHTTP2_PROTO_VERSION_ID_LEN 24 struct nghttp2_session; /** diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 24193327..a704460d 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -1018,11 +1018,11 @@ int HttpServer::run() verify_callback); } - proto_list[0] = 17; + proto_list[0] = NGHTTP2_PROTO_VERSION_ID_LEN; memcpy(&proto_list[1], NGHTTP2_PROTO_VERSION_ID, NGHTTP2_PROTO_VERSION_ID_LEN); next_proto.first = proto_list; - next_proto.second = 18; + next_proto.second = proto_list[0] + 1; SSL_CTX_set_next_protos_advertised_cb(ssl_ctx, next_proto_cb, &next_proto); } diff --git a/tests/nghttp2_npn_test.c b/tests/nghttp2_npn_test.c index f0c9842b..f97b59f2 100644 --- a/tests/nghttp2_npn_test.c +++ b/tests/nghttp2_npn_test.c @@ -32,15 +32,15 @@ static void http2(void) { const unsigned char p[] = { 8, 'h', 't', 't', 'p', '/', '1', '.', '1', - 17, 'H', 'T', 'T', 'P', '-', 'd', 'r', 'a', 'f', 't', '-', '0', '6', '/', + 24, 'H', 'T', 'T', 'P', '-', 'n', 'g', 'h', 't', 't', 'p', '2', 'h', 'p', 'a', 'c', 'k', '-', '0', '6', '/', '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(17 == outlen); - CU_ASSERT(memcmp("HTTP-draft-06/2.0", out, outlen) == 0); + CU_ASSERT(24 == outlen); + CU_ASSERT(memcmp(NGHTTP2_PROTO_VERSION_ID, out, outlen) == 0); } static void http11(void)