From 942568bc9d7f606a24c2f5f1cb922c3c3c57be9c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 18 Apr 2016 22:19:00 -0700 Subject: [PATCH] Better dictionary --- test/core/end2end/fuzzers/hpack.dictionary | 79 ++++++++++++++++++++++ tools/codegen/core/gen_static_metadata.py | 3 + 2 files changed, 82 insertions(+) diff --git a/test/core/end2end/fuzzers/hpack.dictionary b/test/core/end2end/fuzzers/hpack.dictionary index 78c4fa24032..b081368ff6d 100644 --- a/test/core/end2end/fuzzers/hpack.dictionary +++ b/test/core/end2end/fuzzers/hpack.dictionary @@ -89,3 +89,82 @@ "\x04vary" "\x03via" "\x10www-authenticate" +"\x00\x0Eaccept-charset\x00" +"\x00\x06accept\x00" +"\x00\x0Faccept-encoding\x00" +"\x00\x0Faccept-encoding\x0Dgzip, deflate" +"\x00\x0Faccept-language\x00" +"\x00\x0Daccept-ranges\x00" +"\x00\x1Baccess-control-allow-origin\x00" +"\x00\x03age\x00" +"\x00\x05allow\x00" +"\x00\x0A:authority\x00" +"\x00\x0Dauthorization\x00" +"\x00\x0Dcache-control\x00" +"\x00\x13content-disposition\x00" +"\x00\x10content-encoding\x00" +"\x00\x10content-language\x00" +"\x00\x0Econtent-length\x00" +"\x00\x10content-location\x00" +"\x00\x0Dcontent-range\x00" +"\x00\x0Ccontent-type\x10application/grpc" +"\x00\x0Ccontent-type\x00" +"\x00\x06cookie\x00" +"\x00\x04date\x00" +"\x00\x04etag\x00" +"\x00\x06expect\x00" +"\x00\x07expires\x00" +"\x00\x04from\x00" +"\x00\x14grpc-accept-encoding\x07deflate" +"\x00\x14grpc-accept-encoding\x0Cdeflate,gzip" +"\x00\x14grpc-accept-encoding\x04gzip" +"\x00\x14grpc-accept-encoding\x08identity" +"\x00\x14grpc-accept-encoding\x10identity,deflate" +"\x00\x14grpc-accept-encoding\x15identity,deflate,gzip" +"\x00\x14grpc-accept-encoding\x0Didentity,gzip" +"\x00\x0Dgrpc-encoding\x07deflate" +"\x00\x0Dgrpc-encoding\x04gzip" +"\x00\x0Dgrpc-encoding\x08identity" +"\x00\x0Bgrpc-status\x010" +"\x00\x0Bgrpc-status\x011" +"\x00\x0Bgrpc-status\x012" +"\x00\x04host\x00" +"\x00\x08if-match\x00" +"\x00\x11if-modified-since\x00" +"\x00\x0Dif-none-match\x00" +"\x00\x08if-range\x00" +"\x00\x13if-unmodified-since\x00" +"\x00\x0Dlast-modified\x00" +"\x00\x04link\x00" +"\x00\x08location\x00" +"\x00\x0Cmax-forwards\x00" +"\x00\x07:method\x03GET" +"\x00\x07:method\x04POST" +"\x00\x07:method\x03PUT" +"\x00\x05:path\x01/" +"\x00\x05:path\x0B/index.html" +"\x00\x12proxy-authenticate\x00" +"\x00\x13proxy-authorization\x00" +"\x00\x05range\x00" +"\x00\x07referer\x00" +"\x00\x07refresh\x00" +"\x00\x0Bretry-after\x00" +"\x00\x07:scheme\x04grpc" +"\x00\x07:scheme\x04http" +"\x00\x07:scheme\x05https" +"\x00\x06server\x00" +"\x00\x0Aset-cookie\x00" +"\x00\x07:status\x03200" +"\x00\x07:status\x03204" +"\x00\x07:status\x03206" +"\x00\x07:status\x03304" +"\x00\x07:status\x03400" +"\x00\x07:status\x03404" +"\x00\x07:status\x03500" +"\x00\x19strict-transport-security\x00" +"\x00\x02te\x08trailers" +"\x00\x11transfer-encoding\x00" +"\x00\x0Auser-agent\x00" +"\x00\x04vary\x00" +"\x00\x03via\x00" +"\x00\x10www-authenticate\x00" diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py index e7b9c358088..b38555e3553 100755 --- a/tools/codegen/core/gen_static_metadata.py +++ b/tools/codegen/core/gen_static_metadata.py @@ -289,6 +289,9 @@ print >>C print >>D, '# hpack fuzzing dictionary' for i, elem in enumerate(all_strs): print >>D, '%s' % (esc_dict([len(elem)] + [ord(c) for c in elem])) +for i, elem in enumerate(all_elems): + print >>D, '%s' % (esc_dict([0, len(elem[0])] + [ord(c) for c in elem[0]] + + [len(elem[1])] + [ord(c) for c in elem[1]])) print >>H, '#define GRPC_STATIC_MDELEM_COUNT %d' % len(all_elems) print >>H, 'extern grpc_mdelem grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];'