Updated latest initial static header table

This commit is contained in:
Tatsuhiro Tsujikawa 2013-10-16 00:09:00 +09:00
parent 50cdcca911
commit ed43635c7b
2 changed files with 62 additions and 68 deletions

View File

@ -31,67 +31,61 @@
#include "nghttp2_helper.h" #include "nghttp2_helper.h"
static const char *static_table[] = { static const char *static_table[] = {
":scheme", "http", /* 0 */ ":method", "GET",
":scheme", "https", /* 1 */ ":method", "POST",
":host", "", /* 2 */ ":scheme", "http",
":path", "/", /* 3 */ ":scheme", "https",
":method", "GET", /* 4 */ ":path", "/",
"accept", "", /* 5 */ ":status", "200",
"accept-charset", "", /* 6 */ ":authority", "",
"accept-encoding", "", /* 7 */ "accept-charset", "",
"accept-language", "", /* 8 */ "accept-encoding", "",
"cookie", "", /* 9 */ "accept-language", "",
"if-modified-since", "", /* 10 */ "accept-ranges", "",
"user-agent", "", /* 11 */ "accept", "",
"referer", "", /* 12 */ "access-control-allow-origin", "",
"authorization", "", /* 13 */ "age", "",
"allow", "", /* 14 */ "allow", "",
"cache-control", "", /* 15 */ "authorization", "",
"connection", "", /* 16 */ "cache-control", "",
"content-length", "", /* 17 */ "connection", "",
"content-type", "", /* 18 */ "content-disposition", "",
"date", "", /* 19 */ "content-encoding", "",
"expect", "", /* 20 */ "content-language", "",
"from", "", /* 21 */ "content-length", "",
"if-match", "", /* 22 */ "content-location", "",
"if-none-match", "", /* 23 */ "content-range", "",
"if-range", "", /* 24 */ "content-type", "",
"if-unmodified-since", "", /* 25 */ "cookie", "",
"max-forwards", "", /* 26 */ "date", "",
"proxy-authorization", "", /* 27 */ "etag", "",
"range", "", /* 28 */ "expect", "",
"via", "", /* 29 */ "expires", "",
/* 30 */ "from", "",
":status", "200", /* 31 */ "host", "",
"age", "", /* 32 */ "if-match", "",
"cache-control", "", /* 33 */ "if-modified-since", "",
"content-length", "", /* 34 */ "if-none-match", "",
"content-type", "", /* 35 */ "if-range", "",
"date", "", /* 36 */ "if-unmodified-since", "",
"etag", "", /* 37 */ "last-modified", "",
"expires", "", /* 38 */ "link", "",
"last-modified", "", /* 39 */ "location", "",
"server", "", /* 40 */ "max-forwards", "",
"set-cookie", "", /* 41 */ "proxy-authenticate", "",
"vary", "", /* 42 */ "proxy-authorization", "",
"via", "", /* 43 */ "range", "",
"access-control-allow-origin", "", /* 44 */ "referer", "",
"accept-ranges", "", /* 45 */ "refresh", "",
"allow", "", /* 46 */ "retry-after", "",
"connection", "", /* 47 */ "server", "",
"content-disposition", "", /* 48 */ "set-cookie", "",
"content-encoding", "", /* 49 */ "strict-transport-security", "",
"content-language", "", /* 50 */ "transfer-encoding", "",
"content-location", "", /* 51 */ "user-agent", "",
"content-range", "", /* 52 */ "vary", "",
"link", "", /* 53 */ "via", "",
"location", "", /* 54 */ "www-authenticate", "",
"proxy-authenticate", "",
"refresh", "",
"retry-after", "",
"strict-transport-security", "",
"transfer-encoding", "",
"www-authenticate", "",
NULL NULL
}; };

View File

@ -245,7 +245,7 @@ void test_nghttp2_hd_inflate_indname_inc(void)
nghttp2_nv *resnva; nghttp2_nv *resnva;
nghttp2_hd_inflate_init(&inflater, NGHTTP2_HD_SIDE_SERVER); nghttp2_hd_inflate_init(&inflater, NGHTTP2_HD_SIDE_SERVER);
CU_ASSERT(0 == nghttp2_hd_emit_indname_block(&buf, &buflen, &offset, 11, CU_ASSERT(0 == nghttp2_hd_emit_indname_block(&buf, &buflen, &offset, 51,
nv.value, nv.valuelen, 1, nv.value, nv.valuelen, 1,
NGHTTP2_HD_SIDE_CLIENT)); NGHTTP2_HD_SIDE_CLIENT));
CU_ASSERT(1 == nghttp2_hd_inflate_hd(&inflater, &resnva, buf, offset)); CU_ASSERT(1 == nghttp2_hd_inflate_hd(&inflater, &resnva, buf, offset));
@ -270,22 +270,22 @@ void test_nghttp2_hd_inflate_indname_inc_eviction(void)
nghttp2_hd_inflate_init(&inflater, NGHTTP2_HD_SIDE_SERVER); nghttp2_hd_inflate_init(&inflater, NGHTTP2_HD_SIDE_SERVER);
memset(value, '0', sizeof(value)); memset(value, '0', sizeof(value));
CU_ASSERT(0 == nghttp2_hd_emit_indname_block(&buf, &buflen, &offset, 2, CU_ASSERT(0 == nghttp2_hd_emit_indname_block(&buf, &buflen, &offset, 7,
value, sizeof(value), 1, value, sizeof(value), 1,
NGHTTP2_HD_SIDE_CLIENT)); NGHTTP2_HD_SIDE_CLIENT));
CU_ASSERT(0 == nghttp2_hd_emit_indname_block(&buf, &buflen, &offset, 3, CU_ASSERT(0 == nghttp2_hd_emit_indname_block(&buf, &buflen, &offset, 8,
value, sizeof(value), 1, value, sizeof(value), 1,
NGHTTP2_HD_SIDE_CLIENT)); NGHTTP2_HD_SIDE_CLIENT));
CU_ASSERT(0 == nghttp2_hd_emit_indname_block(&buf, &buflen, &offset, 4, CU_ASSERT(0 == nghttp2_hd_emit_indname_block(&buf, &buflen, &offset, 9,
value, sizeof(value), 1, value, sizeof(value), 1,
NGHTTP2_HD_SIDE_CLIENT)); NGHTTP2_HD_SIDE_CLIENT));
CU_ASSERT(0 == nghttp2_hd_emit_indname_block(&buf, &buflen, &offset, 5, CU_ASSERT(0 == nghttp2_hd_emit_indname_block(&buf, &buflen, &offset, 10,
value, sizeof(value), 1, value, sizeof(value), 1,
NGHTTP2_HD_SIDE_CLIENT)); NGHTTP2_HD_SIDE_CLIENT));
CU_ASSERT(4 == nghttp2_hd_inflate_hd(&inflater, &resnva, buf, offset)); CU_ASSERT(4 == nghttp2_hd_inflate_hd(&inflater, &resnva, buf, offset));
CU_ASSERT(5 == resnva[0].namelen); CU_ASSERT(14 == resnva[0].namelen);
CU_ASSERT(0 == memcmp(":host", resnva[0].name, resnva[0].namelen)); CU_ASSERT(0 == memcmp("accept-charset", resnva[0].name, resnva[0].namelen));
CU_ASSERT(sizeof(value) == resnva[0].valuelen); CU_ASSERT(sizeof(value) == resnva[0].valuelen);
nghttp2_nv_array_del(resnva); nghttp2_nv_array_del(resnva);