Change protocol identifier to h2-10

This commit is contained in:
Tatsuhiro Tsujikawa 2014-02-05 23:37:27 +09:00
parent 9d8cf9de5d
commit 196406da0e
2 changed files with 4 additions and 5 deletions

View File

@ -40,13 +40,13 @@ extern "C" {
*
* The protocol version identification of this library supports.
*/
#define NGHTTP2_PROTO_VERSION_ID "HTTP-draft-09/2.0"
#define NGHTTP2_PROTO_VERSION_ID "h2-10"
/**
* @macro
*
* The length of :macro:`NGHTTP2_PROTO_VERSION_ID`.
*/
#define NGHTTP2_PROTO_VERSION_ID_LEN 17
#define NGHTTP2_PROTO_VERSION_ID_LEN 5
struct nghttp2_session;
/**

View File

@ -33,14 +33,13 @@ 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', '9', '/',
'2', '.', '0',
5, 'h', '2', '-', '1', '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(NGHTTP2_PROTO_VERSION_ID_LEN == outlen);
CU_ASSERT(memcmp(NGHTTP2_PROTO_VERSION_ID, out, outlen) == 0);
}