Change protocol identifier to h2-10
This commit is contained in:
parent
9d8cf9de5d
commit
196406da0e
|
@ -40,13 +40,13 @@ extern "C" {
|
||||||
*
|
*
|
||||||
* The protocol version identification of this library supports.
|
* 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
|
* @macro
|
||||||
*
|
*
|
||||||
* The length of :macro:`NGHTTP2_PROTO_VERSION_ID`.
|
* 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;
|
struct nghttp2_session;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,14 +33,13 @@ static void http2(void)
|
||||||
{
|
{
|
||||||
const unsigned char p[] = {
|
const unsigned char p[] = {
|
||||||
8, 'h', 't', 't', 'p', '/', '1', '.', '1',
|
8, 'h', 't', 't', 'p', '/', '1', '.', '1',
|
||||||
17, 'H', 'T', 'T', 'P', '-', 'd', 'r', 'a', 'f', 't', '-', '0', '9', '/',
|
5, 'h', '2', '-', '1', '0',
|
||||||
'2', '.', '0',
|
|
||||||
6, 's', 'p', 'd', 'y', '/', '3'
|
6, 's', 'p', 'd', 'y', '/', '3'
|
||||||
};
|
};
|
||||||
unsigned char outlen;
|
unsigned char outlen;
|
||||||
unsigned char* out;
|
unsigned char* out;
|
||||||
CU_ASSERT(1 == nghttp2_select_next_protocol(&out, &outlen, p, sizeof(p)));
|
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);
|
CU_ASSERT(memcmp(NGHTTP2_PROTO_VERSION_ID, out, outlen) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue