Change metadata names used by the instrumentation.

pull/10405/head
Bogdan Drutu 8 years ago
parent 2d89ac4429
commit c2b1f1672d
  1. 765
      src/core/lib/transport/static_metadata.c
  2. 186
      src/core/lib/transport/static_metadata.h
  3. 5
      test/core/end2end/fuzzers/hpack.dictionary
  4. 343
      tools/codegen/core/gen_static_metadata.py

File diff suppressed because it is too large Load Diff

@ -44,7 +44,7 @@
#include "src/core/lib/transport/metadata.h" #include "src/core/lib/transport/metadata.h"
#define GRPC_STATIC_MDSTR_COUNT 97 #define GRPC_STATIC_MDSTR_COUNT 98
extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]; extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT];
/* ":path" */ /* ":path" */
#define GRPC_MDSTR_PATH (grpc_static_slice_table[0]) #define GRPC_MDSTR_PATH (grpc_static_slice_table[0])
@ -68,182 +68,184 @@ extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT];
#define GRPC_MDSTR_GRPC_ENCODING (grpc_static_slice_table[9]) #define GRPC_MDSTR_GRPC_ENCODING (grpc_static_slice_table[9])
/* "grpc-accept-encoding" */ /* "grpc-accept-encoding" */
#define GRPC_MDSTR_GRPC_ACCEPT_ENCODING (grpc_static_slice_table[10]) #define GRPC_MDSTR_GRPC_ACCEPT_ENCODING (grpc_static_slice_table[10])
/* "grpc-server-stats-bin" */
#define GRPC_MDSTR_GRPC_SERVER_STATS_BIN (grpc_static_slice_table[11])
/* "grpc-tags-bin" */
#define GRPC_MDSTR_GRPC_TAGS_BIN (grpc_static_slice_table[12])
/* "grpc-trace-bin" */
#define GRPC_MDSTR_GRPC_TRACE_BIN (grpc_static_slice_table[13])
/* "content-type" */ /* "content-type" */
#define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table[11]) #define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table[14])
/* "grpc-internal-encoding-request" */ /* "grpc-internal-encoding-request" */
#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST (grpc_static_slice_table[12]) #define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST (grpc_static_slice_table[15])
/* "user-agent" */ /* "user-agent" */
#define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table[13]) #define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table[16])
/* "host" */ /* "host" */
#define GRPC_MDSTR_HOST (grpc_static_slice_table[14]) #define GRPC_MDSTR_HOST (grpc_static_slice_table[17])
/* "lb-token" */ /* "lb-token" */
#define GRPC_MDSTR_LB_TOKEN (grpc_static_slice_table[15]) #define GRPC_MDSTR_LB_TOKEN (grpc_static_slice_table[18])
/* "grpc-timeout" */ /* "grpc-timeout" */
#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table[16]) #define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table[19])
/* "grpc-tracing-bin" */
#define GRPC_MDSTR_GRPC_TRACING_BIN (grpc_static_slice_table[17])
/* "grpc-stats-bin" */
#define GRPC_MDSTR_GRPC_STATS_BIN (grpc_static_slice_table[18])
/* "" */ /* "" */
#define GRPC_MDSTR_EMPTY (grpc_static_slice_table[19]) #define GRPC_MDSTR_EMPTY (grpc_static_slice_table[20])
/* "grpc.wait_for_ready" */ /* "grpc.wait_for_ready" */
#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table[20]) #define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table[21])
/* "grpc.timeout" */ /* "grpc.timeout" */
#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table[21]) #define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table[22])
/* "grpc.max_request_message_bytes" */ /* "grpc.max_request_message_bytes" */
#define GRPC_MDSTR_GRPC_DOT_MAX_REQUEST_MESSAGE_BYTES \ #define GRPC_MDSTR_GRPC_DOT_MAX_REQUEST_MESSAGE_BYTES \
(grpc_static_slice_table[22]) (grpc_static_slice_table[23])
/* "grpc.max_response_message_bytes" */ /* "grpc.max_response_message_bytes" */
#define GRPC_MDSTR_GRPC_DOT_MAX_RESPONSE_MESSAGE_BYTES \ #define GRPC_MDSTR_GRPC_DOT_MAX_RESPONSE_MESSAGE_BYTES \
(grpc_static_slice_table[23]) (grpc_static_slice_table[24])
/* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */ /* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */
#define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \ #define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \
(grpc_static_slice_table[24]) (grpc_static_slice_table[25])
/* "0" */ /* "0" */
#define GRPC_MDSTR_0 (grpc_static_slice_table[25]) #define GRPC_MDSTR_0 (grpc_static_slice_table[26])
/* "1" */ /* "1" */
#define GRPC_MDSTR_1 (grpc_static_slice_table[26]) #define GRPC_MDSTR_1 (grpc_static_slice_table[27])
/* "2" */ /* "2" */
#define GRPC_MDSTR_2 (grpc_static_slice_table[27]) #define GRPC_MDSTR_2 (grpc_static_slice_table[28])
/* "identity" */ /* "identity" */
#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[28]) #define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[29])
/* "gzip" */ /* "gzip" */
#define GRPC_MDSTR_GZIP (grpc_static_slice_table[29]) #define GRPC_MDSTR_GZIP (grpc_static_slice_table[30])
/* "deflate" */ /* "deflate" */
#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[30]) #define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[31])
/* "trailers" */ /* "trailers" */
#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[31]) #define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[32])
/* "application/grpc" */ /* "application/grpc" */
#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[32]) #define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table[33])
/* "POST" */ /* "POST" */
#define GRPC_MDSTR_POST (grpc_static_slice_table[33]) #define GRPC_MDSTR_POST (grpc_static_slice_table[34])
/* "200" */ /* "200" */
#define GRPC_MDSTR_200 (grpc_static_slice_table[34]) #define GRPC_MDSTR_200 (grpc_static_slice_table[35])
/* "404" */ /* "404" */
#define GRPC_MDSTR_404 (grpc_static_slice_table[35]) #define GRPC_MDSTR_404 (grpc_static_slice_table[36])
/* "http" */ /* "http" */
#define GRPC_MDSTR_HTTP (grpc_static_slice_table[36]) #define GRPC_MDSTR_HTTP (grpc_static_slice_table[37])
/* "https" */ /* "https" */
#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[37]) #define GRPC_MDSTR_HTTPS (grpc_static_slice_table[38])
/* "grpc" */ /* "grpc" */
#define GRPC_MDSTR_GRPC (grpc_static_slice_table[38]) #define GRPC_MDSTR_GRPC (grpc_static_slice_table[39])
/* "GET" */ /* "GET" */
#define GRPC_MDSTR_GET (grpc_static_slice_table[39]) #define GRPC_MDSTR_GET (grpc_static_slice_table[40])
/* "PUT" */ /* "PUT" */
#define GRPC_MDSTR_PUT (grpc_static_slice_table[40]) #define GRPC_MDSTR_PUT (grpc_static_slice_table[41])
/* "/" */ /* "/" */
#define GRPC_MDSTR_SLASH (grpc_static_slice_table[41]) #define GRPC_MDSTR_SLASH (grpc_static_slice_table[42])
/* "/index.html" */ /* "/index.html" */
#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[42]) #define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table[43])
/* "204" */ /* "204" */
#define GRPC_MDSTR_204 (grpc_static_slice_table[43]) #define GRPC_MDSTR_204 (grpc_static_slice_table[44])
/* "206" */ /* "206" */
#define GRPC_MDSTR_206 (grpc_static_slice_table[44]) #define GRPC_MDSTR_206 (grpc_static_slice_table[45])
/* "304" */ /* "304" */
#define GRPC_MDSTR_304 (grpc_static_slice_table[45]) #define GRPC_MDSTR_304 (grpc_static_slice_table[46])
/* "400" */ /* "400" */
#define GRPC_MDSTR_400 (grpc_static_slice_table[46]) #define GRPC_MDSTR_400 (grpc_static_slice_table[47])
/* "500" */ /* "500" */
#define GRPC_MDSTR_500 (grpc_static_slice_table[47]) #define GRPC_MDSTR_500 (grpc_static_slice_table[48])
/* "accept-charset" */ /* "accept-charset" */
#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[48]) #define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[49])
/* "accept-encoding" */ /* "accept-encoding" */
#define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table[49]) #define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table[50])
/* "gzip, deflate" */ /* "gzip, deflate" */
#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[50]) #define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table[51])
/* "accept-language" */ /* "accept-language" */
#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[51]) #define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[52])
/* "accept-ranges" */ /* "accept-ranges" */
#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[52]) #define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[53])
/* "accept" */ /* "accept" */
#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[53]) #define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[54])
/* "access-control-allow-origin" */ /* "access-control-allow-origin" */
#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[54]) #define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table[55])
/* "age" */ /* "age" */
#define GRPC_MDSTR_AGE (grpc_static_slice_table[55]) #define GRPC_MDSTR_AGE (grpc_static_slice_table[56])
/* "allow" */ /* "allow" */
#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[56]) #define GRPC_MDSTR_ALLOW (grpc_static_slice_table[57])
/* "authorization" */ /* "authorization" */
#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[57]) #define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[58])
/* "cache-control" */ /* "cache-control" */
#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[58]) #define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[59])
/* "content-disposition" */ /* "content-disposition" */
#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[59]) #define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[60])
/* "content-encoding" */ /* "content-encoding" */
#define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table[60]) #define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table[61])
/* "content-language" */ /* "content-language" */
#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[61]) #define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[62])
/* "content-length" */ /* "content-length" */
#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[62]) #define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[63])
/* "content-location" */ /* "content-location" */
#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[63]) #define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[64])
/* "content-range" */ /* "content-range" */
#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[64]) #define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[65])
/* "cookie" */ /* "cookie" */
#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[65]) #define GRPC_MDSTR_COOKIE (grpc_static_slice_table[66])
/* "date" */ /* "date" */
#define GRPC_MDSTR_DATE (grpc_static_slice_table[66]) #define GRPC_MDSTR_DATE (grpc_static_slice_table[67])
/* "etag" */ /* "etag" */
#define GRPC_MDSTR_ETAG (grpc_static_slice_table[67]) #define GRPC_MDSTR_ETAG (grpc_static_slice_table[68])
/* "expect" */ /* "expect" */
#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[68]) #define GRPC_MDSTR_EXPECT (grpc_static_slice_table[69])
/* "expires" */ /* "expires" */
#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[69]) #define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[70])
/* "from" */ /* "from" */
#define GRPC_MDSTR_FROM (grpc_static_slice_table[70]) #define GRPC_MDSTR_FROM (grpc_static_slice_table[71])
/* "if-match" */ /* "if-match" */
#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[71]) #define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table[72])
/* "if-modified-since" */ /* "if-modified-since" */
#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[72]) #define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table[73])
/* "if-none-match" */ /* "if-none-match" */
#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[73]) #define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[74])
/* "if-range" */ /* "if-range" */
#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[74]) #define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table[75])
/* "if-unmodified-since" */ /* "if-unmodified-since" */
#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[75]) #define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[76])
/* "last-modified" */ /* "last-modified" */
#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[76]) #define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[77])
/* "link" */ /* "link" */
#define GRPC_MDSTR_LINK (grpc_static_slice_table[77]) #define GRPC_MDSTR_LINK (grpc_static_slice_table[78])
/* "location" */ /* "location" */
#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[78]) #define GRPC_MDSTR_LOCATION (grpc_static_slice_table[79])
/* "max-forwards" */ /* "max-forwards" */
#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[79]) #define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[80])
/* "proxy-authenticate" */ /* "proxy-authenticate" */
#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[80]) #define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[81])
/* "proxy-authorization" */ /* "proxy-authorization" */
#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[81]) #define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[82])
/* "range" */ /* "range" */
#define GRPC_MDSTR_RANGE (grpc_static_slice_table[82]) #define GRPC_MDSTR_RANGE (grpc_static_slice_table[83])
/* "referer" */ /* "referer" */
#define GRPC_MDSTR_REFERER (grpc_static_slice_table[83]) #define GRPC_MDSTR_REFERER (grpc_static_slice_table[84])
/* "refresh" */ /* "refresh" */
#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[84]) #define GRPC_MDSTR_REFRESH (grpc_static_slice_table[85])
/* "retry-after" */ /* "retry-after" */
#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[85]) #define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[86])
/* "server" */ /* "server" */
#define GRPC_MDSTR_SERVER (grpc_static_slice_table[86]) #define GRPC_MDSTR_SERVER (grpc_static_slice_table[87])
/* "set-cookie" */ /* "set-cookie" */
#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[87]) #define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table[88])
/* "strict-transport-security" */ /* "strict-transport-security" */
#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[88]) #define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[89])
/* "transfer-encoding" */ /* "transfer-encoding" */
#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[89]) #define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[90])
/* "vary" */ /* "vary" */
#define GRPC_MDSTR_VARY (grpc_static_slice_table[90]) #define GRPC_MDSTR_VARY (grpc_static_slice_table[91])
/* "via" */ /* "via" */
#define GRPC_MDSTR_VIA (grpc_static_slice_table[91]) #define GRPC_MDSTR_VIA (grpc_static_slice_table[92])
/* "www-authenticate" */ /* "www-authenticate" */
#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[92]) #define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[93])
/* "identity,deflate" */ /* "identity,deflate" */
#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table[93]) #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table[94])
/* "identity,gzip" */ /* "identity,gzip" */
#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[94]) #define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[95])
/* "deflate,gzip" */ /* "deflate,gzip" */
#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table[95]) #define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table[96])
/* "identity,deflate,gzip" */ /* "identity,deflate,gzip" */
#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \ #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
(grpc_static_slice_table[96]) (grpc_static_slice_table[97])
extern const grpc_slice_refcount_vtable grpc_static_metadata_vtable; extern const grpc_slice_refcount_vtable grpc_static_metadata_vtable;
extern grpc_slice_refcount extern grpc_slice_refcount
@ -512,6 +514,9 @@ typedef enum {
GRPC_BATCH_GRPC_PAYLOAD_BIN, GRPC_BATCH_GRPC_PAYLOAD_BIN,
GRPC_BATCH_GRPC_ENCODING, GRPC_BATCH_GRPC_ENCODING,
GRPC_BATCH_GRPC_ACCEPT_ENCODING, GRPC_BATCH_GRPC_ACCEPT_ENCODING,
GRPC_BATCH_GRPC_SERVER_STATS_BIN,
GRPC_BATCH_GRPC_TAGS_BIN,
GRPC_BATCH_GRPC_TRACE_BIN,
GRPC_BATCH_CONTENT_TYPE, GRPC_BATCH_CONTENT_TYPE,
GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST, GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST,
GRPC_BATCH_USER_AGENT, GRPC_BATCH_USER_AGENT,
@ -534,6 +539,9 @@ typedef union {
struct grpc_linked_mdelem *grpc_payload_bin; struct grpc_linked_mdelem *grpc_payload_bin;
struct grpc_linked_mdelem *grpc_encoding; struct grpc_linked_mdelem *grpc_encoding;
struct grpc_linked_mdelem *grpc_accept_encoding; struct grpc_linked_mdelem *grpc_accept_encoding;
struct grpc_linked_mdelem *grpc_server_stats_bin;
struct grpc_linked_mdelem *grpc_tags_bin;
struct grpc_linked_mdelem *grpc_trace_bin;
struct grpc_linked_mdelem *content_type; struct grpc_linked_mdelem *content_type;
struct grpc_linked_mdelem *grpc_internal_encoding_request; struct grpc_linked_mdelem *grpc_internal_encoding_request;
struct grpc_linked_mdelem *user_agent; struct grpc_linked_mdelem *user_agent;

@ -10,14 +10,15 @@
"\x10grpc-payload-bin" "\x10grpc-payload-bin"
"\x0Dgrpc-encoding" "\x0Dgrpc-encoding"
"\x14grpc-accept-encoding" "\x14grpc-accept-encoding"
"\x15grpc-server-stats-bin"
"\x0Dgrpc-tags-bin"
"\x0Egrpc-trace-bin"
"\x0Ccontent-type" "\x0Ccontent-type"
"\x1Egrpc-internal-encoding-request" "\x1Egrpc-internal-encoding-request"
"\x0Auser-agent" "\x0Auser-agent"
"\x04host" "\x04host"
"\x08lb-token" "\x08lb-token"
"\x0Cgrpc-timeout" "\x0Cgrpc-timeout"
"\x10grpc-tracing-bin"
"\x0Egrpc-stats-bin"
"\x00" "\x00"
"\x13grpc.wait_for_ready" "\x13grpc.wait_for_ready"
"\x0Cgrpc.timeout" "\x0Cgrpc.timeout"

@ -56,8 +56,9 @@ CONFIG = [
':authority', ':authority',
'grpc-message', 'grpc-message',
'grpc-status', 'grpc-status',
'grpc-tracing-bin', 'grpc-server-stats-bin',
'grpc-stats-bin', 'grpc-tags-bin',
'grpc-trace-bin',
'', '',
# channel arg keys # channel arg keys
'grpc.wait_for_ready', 'grpc.wait_for_ready',
@ -154,6 +155,9 @@ METADATA_BATCH_CALLOUTS = [
'grpc-payload-bin', 'grpc-payload-bin',
'grpc-encoding', 'grpc-encoding',
'grpc-accept-encoding', 'grpc-accept-encoding',
'grpc-server-stats-bin',
'grpc-tags-bin',
'grpc-trace-bin',
'content-type', 'content-type',
'grpc-internal-encoding-request', 'grpc-internal-encoding-request',
'user-agent', 'user-agent',
@ -167,6 +171,7 @@ COMPRESSION_ALGORITHMS = [
'gzip', 'gzip',
] ]
# utility: mangle the name of a config # utility: mangle the name of a config
def mangle(elem, name=None): def mangle(elem, name=None):
xl = { xl = {
@ -177,43 +182,56 @@ def mangle(elem, name=None):
',': 'comma', ',': 'comma',
' ': '_', ' ': '_',
} }
def m0(x): def m0(x):
if not x: return 'empty' if not x:
return 'empty'
r = '' r = ''
for c in x: for c in x:
put = xl.get(c, c.lower()) put = xl.get(c, c.lower())
if not put: continue if not put:
continue
last_is_underscore = r[-1] == '_' if r else True last_is_underscore = r[-1] == '_' if r else True
if last_is_underscore and put == '_': continue if last_is_underscore and put == '_':
continue
elif len(put) > 1: elif len(put) > 1:
if not last_is_underscore: r += '_' if not last_is_underscore:
r += '_'
r += put r += put
r += '_' r += '_'
else: else:
r += put r += put
if r[-1] == '_': r = r[:-1] if r[-1] == '_':
r = r[:-1]
return r return r
def n(default, name=name): def n(default, name=name):
if name is None: return 'grpc_%s_' % default if name is None:
if name == '': return '' return 'grpc_%s_' % default
if name == '':
return ''
return 'grpc_%s_' % name return 'grpc_%s_' % name
if isinstance(elem, tuple): if isinstance(elem, tuple):
return '%s%s_%s' % (n('mdelem'), m0(elem[0]), m0(elem[1])) return '%s%s_%s' % (n('mdelem'), m0(elem[0]), m0(elem[1]))
else: else:
return '%s%s' % (n('mdstr'), m0(elem)) return '%s%s' % (n('mdstr'), m0(elem))
# utility: generate some hash value for a string # utility: generate some hash value for a string
def fake_hash(elem): def fake_hash(elem):
return hashlib.md5(elem).hexdigest()[0:8] return hashlib.md5(elem).hexdigest()[0:8]
# utility: print a big comment block into a set of files # utility: print a big comment block into a set of files
def put_banner(files, banner): def put_banner(files, banner):
for f in files: for f in files:
print >>f, '/*' print >> f, '/*'
for line in banner: for line in banner:
print >>f, ' * %s' % line print >> f, ' * %s' % line
print >>f, ' */' print >> f, ' */'
print >>f print >> f
# build a list of all the strings we need # build a list of all the strings we need
all_strs = list() all_strs = list()
@ -236,7 +254,7 @@ for elem in CONFIG:
if elem not in all_strs: if elem not in all_strs:
all_strs.append(elem) all_strs.append(elem)
compression_elems = [] compression_elems = []
for mask in range(1, 1<<len(COMPRESSION_ALGORITHMS)): for mask in range(1, 1 << len(COMPRESSION_ALGORITHMS)):
val = ','.join(COMPRESSION_ALGORITHMS[alg] val = ','.join(COMPRESSION_ALGORITHMS[alg]
for alg in range(0, len(COMPRESSION_ALGORITHMS)) for alg in range(0, len(COMPRESSION_ALGORITHMS))
if (1 << alg) & mask) if (1 << alg) & mask)
@ -267,18 +285,25 @@ if args:
else: else:
D = open('/dev/null', 'w') D = open('/dev/null', 'w')
else: else:
H = open(os.path.join( H = open(
os.path.dirname(sys.argv[0]), '../../../src/core/lib/transport/static_metadata.h'), 'w') os.path.join(
C = open(os.path.join( os.path.dirname(sys.argv[0]),
os.path.dirname(sys.argv[0]), '../../../src/core/lib/transport/static_metadata.c'), 'w') '../../../src/core/lib/transport/static_metadata.h'), 'w')
D = open(os.path.join( C = open(
os.path.dirname(sys.argv[0]), '../../../test/core/end2end/fuzzers/hpack.dictionary'), 'w') os.path.join(
os.path.dirname(sys.argv[0]),
'../../../src/core/lib/transport/static_metadata.c'), 'w')
D = open(
os.path.join(
os.path.dirname(sys.argv[0]),
'../../../test/core/end2end/fuzzers/hpack.dictionary'), 'w')
# copy-paste copyright notice from this file # copy-paste copyright notice from this file
with open(sys.argv[0]) as my_source: with open(sys.argv[0]) as my_source:
copyright = [] copyright = []
for line in my_source: for line in my_source:
if line[0] != '#': break if line[0] != '#':
break
for line in my_source: for line in my_source:
if line[0] == '#': if line[0] == '#':
copyright.append(line) copyright.append(line)
@ -287,10 +312,9 @@ with open(sys.argv[0]) as my_source:
if line[0] != '#': if line[0] != '#':
break break
copyright.append(line) copyright.append(line)
put_banner([H,C], [line[2:].rstrip() for line in copyright]) put_banner([H, C], [line[2:].rstrip() for line in copyright])
hex_bytes = [ord(c) for c in 'abcdefABCDEF0123456789']
hex_bytes = [ord(c) for c in "abcdefABCDEF0123456789"]
def esc_dict(line): def esc_dict(line):
@ -302,11 +326,11 @@ def esc_dict(line):
else: else:
out += "\\\"" out += "\\\""
else: else:
out += "\\x%02X" % c out += '\\x%02X' % c
return out + "\"" return out + "\""
put_banner([H,C],
"""WARNING: Auto-generated code. put_banner([H, C], """WARNING: Auto-generated code.
To make changes to this file, change To make changes to this file, change
tools/codegen/core/gen_static_metadata.py, and then re-run it. tools/codegen/core/gen_static_metadata.py, and then re-run it.
@ -315,108 +339,143 @@ See metadata.h for an explanation of the interface here, and metadata.c for
an explanation of what's going on. an explanation of what's going on.
""".splitlines()) """.splitlines())
print >>H, '#ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H' print >> H, '#ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H'
print >>H, '#define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H' print >> H, '#define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H'
print >>H print >> H
print >>H, '#include "src/core/lib/transport/metadata.h"' print >> H, '#include "src/core/lib/transport/metadata.h"'
print >>H print >> H
print >>C, '#include "src/core/lib/transport/static_metadata.h"' print >> C, '#include "src/core/lib/transport/static_metadata.h"'
print >>C print >> C
print >>C, '#include "src/core/lib/slice/slice_internal.h"' print >> C, '#include "src/core/lib/slice/slice_internal.h"'
print >>C print >> C
str_ofs = 0 str_ofs = 0
id2strofs = {} id2strofs = {}
for i, elem in enumerate(all_strs): for i, elem in enumerate(all_strs):
id2strofs[i] = str_ofs id2strofs[i] = str_ofs
str_ofs += len(elem); str_ofs += len(elem)
def slice_def(i): def slice_def(i):
return '{.refcount = &grpc_static_metadata_refcounts[%d], .data.refcounted = {g_bytes+%d, %d}}' % (i, id2strofs[i], len(all_strs[i])) return ('{.refcount = &grpc_static_metadata_refcounts[%d], .data.refcounted ='
' {g_bytes+%d, %d}}') % (
i, id2strofs[i], len(all_strs[i]))
# validate configuration # validate configuration
for elem in METADATA_BATCH_CALLOUTS: for elem in METADATA_BATCH_CALLOUTS:
assert elem in all_strs assert elem in all_strs
print >>H, '#define GRPC_STATIC_MDSTR_COUNT %d' % len(all_strs) print >> H, '#define GRPC_STATIC_MDSTR_COUNT %d' % len(all_strs)
print >>H, 'extern const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT];' print >> H, ('extern const grpc_slice '
'grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT];')
for i, elem in enumerate(all_strs): for i, elem in enumerate(all_strs):
print >>H, '/* "%s" */' % elem print >> H, '/* "%s" */' % elem
print >>H, '#define %s (grpc_static_slice_table[%d])' % (mangle(elem).upper(), i) print >> H, '#define %s (grpc_static_slice_table[%d])' % (
print >>H mangle(elem).upper(), i)
print >>C, 'static uint8_t g_bytes[] = {%s};' % (','.join('%d' % ord(c) for c in ''.join(all_strs))) print >> H
print >>C print >> C, 'static uint8_t g_bytes[] = {%s};' % (
print >>C, 'static void static_ref(void *unused) {}' ','.join('%d' % ord(c) for c in ''.join(all_strs)))
print >>C, 'static void static_unref(grpc_exec_ctx *exec_ctx, void *unused) {}' print >> C
print >>C, 'static const grpc_slice_refcount_vtable static_sub_vtable = {static_ref, static_unref, grpc_slice_default_eq_impl, grpc_slice_default_hash_impl};'; print >> C, 'static void static_ref(void *unused) {}'
print >>H, 'extern const grpc_slice_refcount_vtable grpc_static_metadata_vtable;'; print >> C, 'static void static_unref(grpc_exec_ctx *exec_ctx, void *unused) {}'
print >>C, 'const grpc_slice_refcount_vtable grpc_static_metadata_vtable = {static_ref, static_unref, grpc_static_slice_eq, grpc_static_slice_hash};'; print >> C, ('static const grpc_slice_refcount_vtable static_sub_vtable = '
print >>C, 'static grpc_slice_refcount static_sub_refcnt = {&static_sub_vtable, &static_sub_refcnt};'; '{static_ref, static_unref, grpc_slice_default_eq_impl, '
print >>H, 'extern grpc_slice_refcount grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT];' 'grpc_slice_default_hash_impl};')
print >>C, 'grpc_slice_refcount grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT] = {' print >> H, ('extern const grpc_slice_refcount_vtable '
'grpc_static_metadata_vtable;')
print >> C, ('const grpc_slice_refcount_vtable grpc_static_metadata_vtable = '
'{static_ref, static_unref, grpc_static_slice_eq, '
'grpc_static_slice_hash};')
print >> C, ('static grpc_slice_refcount static_sub_refcnt = '
'{&static_sub_vtable, &static_sub_refcnt};')
print >> H, ('extern grpc_slice_refcount '
'grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT];')
print >> C, ('grpc_slice_refcount '
'grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT] = {')
for i, elem in enumerate(all_strs): for i, elem in enumerate(all_strs):
print >>C, ' {&grpc_static_metadata_vtable, &static_sub_refcnt},' print >> C, ' {&grpc_static_metadata_vtable, &static_sub_refcnt},'
print >>C, '};' print >> C, '};'
print >>C print >> C
print >>H, '#define GRPC_IS_STATIC_METADATA_STRING(slice) \\' print >> H, '#define GRPC_IS_STATIC_METADATA_STRING(slice) \\'
print >>H, ' ((slice).refcount != NULL && (slice).refcount->vtable == &grpc_static_metadata_vtable)' print >> H, (' ((slice).refcount != NULL && (slice).refcount->vtable == '
print >>H '&grpc_static_metadata_vtable)')
print >>C, 'const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = {' print >> H
print >> C, ('const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]'
' = {')
for i, elem in enumerate(all_strs): for i, elem in enumerate(all_strs):
print >>C, slice_def(i) + ',' print >> C, slice_def(i) + ','
print >>C, '};' print >> C, '};'
print >>C print >> C
print >>H, '#define GRPC_STATIC_METADATA_INDEX(static_slice) \\' print >> H, '#define GRPC_STATIC_METADATA_INDEX(static_slice) \\'
print >>H, ' ((int)((static_slice).refcount - grpc_static_metadata_refcounts))' print >> H, (' ((int)((static_slice).refcount - '
print >>H 'grpc_static_metadata_refcounts))')
print >> H
print >>D, '# hpack fuzzing dictionary'
print >> D, '# hpack fuzzing dictionary'
for i, elem in enumerate(all_strs): for i, elem in enumerate(all_strs):
print >>D, '%s' % (esc_dict([len(elem)] + [ord(c) for c in elem])) print >> D, '%s' % (esc_dict([len(elem)] + [ord(c) for c in elem]))
for i, elem in enumerate(all_elems): for i, elem in enumerate(all_elems):
print >>D, '%s' % (esc_dict([0, len(elem[0])] + [ord(c) for c in elem[0]] + 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]])) [len(elem[1])] + [ord(c) for c in elem[1]]))
print >>H, '#define GRPC_STATIC_MDELEM_COUNT %d' % len(all_elems) print >> H, '#define GRPC_STATIC_MDELEM_COUNT %d' % len(all_elems)
print >>H, 'extern grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];' print >> H, ('extern grpc_mdelem_data '
print >>H, 'extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];' 'grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];')
print >> H, ('extern uintptr_t '
'grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];')
for i, elem in enumerate(all_elems): for i, elem in enumerate(all_elems):
print >>H, '/* "%s": "%s" */' % elem print >> H, '/* "%s": "%s" */' % elem
print >>H, '#define %s (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[%d], GRPC_MDELEM_STORAGE_STATIC))' % (mangle(elem).upper(), i) print >> H, ('#define %s (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[%d], '
print >>H 'GRPC_MDELEM_STORAGE_STATIC))') % (
print >>C, 'uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = {' mangle(elem).upper(), i)
print >>C, ' %s' % ','.join('%d' % static_userdata.get(elem, 0) for elem in all_elems) print >> H
print >>C, '};' print >> C, ('uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] '
print >>C '= {')
print >> C, ' %s' % ','.join('%d' % static_userdata.get(elem, 0)
for elem in all_elems)
print >> C, '};'
print >> C
def str_idx(s): def str_idx(s):
for i, s2 in enumerate(all_strs): for i, s2 in enumerate(all_strs):
if s == s2: if s == s2:
return i return i
def md_idx(m): def md_idx(m):
for i, m2 in enumerate(all_elems): for i, m2 in enumerate(all_elems):
if m == m2: if m == m2:
return i return i
def offset_trials(mink): def offset_trials(mink):
yield 0 yield 0
for i in range(1, 100): for i in range(1, 100):
for mul in [-1, 1]: for mul in [-1, 1]:
yield mul * i yield mul * i
def perfect_hash(keys, name): def perfect_hash(keys, name):
p = perfection.hash_parameters(keys) p = perfection.hash_parameters(keys)
def f(i, p=p): def f(i, p=p):
i += p.offset i += p.offset
x = i % p.t x = i % p.t
y = i / p.t y = i / p.t
return x + p.r[y] return x + p.r[y]
return { return {
'PHASHRANGE': p.t - 1 + max(p.r), 'PHASHRANGE':
'PHASHNKEYS': len(p.slots), p.t - 1 + max(p.r),
'pyfunc': f, 'PHASHNKEYS':
'code': """ len(p.slots),
'pyfunc':
f,
'code':
"""
static const int8_t %(name)s_r[] = {%(r)s}; static const int8_t %(name)s_r[] = {%(r)s};
static uint32_t %(name)s_phash(uint32_t i) { static uint32_t %(name)s_phash(uint32_t i) {
i %(offset_sign)s= %(offset)d; i %(offset_sign)s= %(offset)d;
@ -430,71 +489,77 @@ static uint32_t %(name)s_phash(uint32_t i) {
return h; return h;
} }
""" % { """ % {
'name': name, 'name': name,
'r': ','.join('%d' % (r if r is not None else 0) for r in p.r), 'r': ','.join('%d' % (r if r is not None else 0) for r in p.r),
't': p.t, 't': p.t,
'offset': abs(p.offset), 'offset': abs(p.offset),
'offset_sign': '+' if p.offset > 0 else '-' 'offset_sign': '+' if p.offset > 0 else '-'
} }
} }
elem_keys = [str_idx(elem[0]) * len(all_strs) + str_idx(elem[1]) for elem in all_elems] elem_keys = [
elem_hash = perfect_hash(elem_keys, "elems") str_idx(elem[0]) * len(all_strs) + str_idx(elem[1]) for elem in all_elems
print >>C, elem_hash['code'] ]
elem_hash = perfect_hash(elem_keys, 'elems')
print >> C, elem_hash['code']
keys = [0] * int(elem_hash['PHASHRANGE']) keys = [0] * int(elem_hash['PHASHRANGE'])
idxs = [255] * int(elem_hash['PHASHNKEYS']) idxs = [255] * int(elem_hash['PHASHNKEYS'])
for i, k in enumerate(elem_keys): for i, k in enumerate(elem_keys):
h = elem_hash['pyfunc'](k) h = elem_hash['pyfunc'](k)
assert keys[h] == 0 assert keys[h] == 0
keys[h] = k keys[h] = k
idxs[h] = i idxs[h] = i
print >>C, 'static const uint16_t elem_keys[] = {%s};' % ','.join('%d' % k for k in keys) print >> C, 'static const uint16_t elem_keys[] = {%s};' % ','.join(
print >>C, 'static const uint8_t elem_idxs[] = {%s};' % ','.join('%d' % i for i in idxs) '%d' % k for k in keys)
print >>C print >> C, 'static const uint8_t elem_idxs[] = {%s};' % ','.join(
'%d' % i for i in idxs)
print >>H, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b);' print >> C
print >>C, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) {'
print >>C, ' if (a == -1 || b == -1) return GRPC_MDNULL;' print >> H, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b);'
print >>C, ' uint32_t k = (uint32_t)(a * %d + b);' % len(all_strs) print >> C, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) {'
print >>C, ' uint32_t h = elems_phash(k);' print >> C, ' if (a == -1 || b == -1) return GRPC_MDNULL;'
print >>C, ' return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k ? GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[elem_idxs[h]], GRPC_MDELEM_STORAGE_STATIC) : GRPC_MDNULL;' print >> C, ' uint32_t k = (uint32_t)(a * %d + b);' % len(all_strs)
print >>C, '}' print >> C, ' uint32_t h = elems_phash(k);'
print >>C print >> C, ' return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k ? GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[elem_idxs[h]], GRPC_MDELEM_STORAGE_STATIC) : GRPC_MDNULL;'
print >> C, '}'
print >>C, 'grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {' print >> C
print >> C, 'grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {'
for a, b in all_elems: for a, b in all_elems:
print >>C, '{%s,%s},' % (slice_def(str_idx(a)), slice_def(str_idx(b))) print >> C, '{%s,%s},' % (slice_def(str_idx(a)), slice_def(str_idx(b)))
print >>C, '};' print >> C, '};'
print >>H, 'typedef enum {' print >> H, 'typedef enum {'
for elem in METADATA_BATCH_CALLOUTS: for elem in METADATA_BATCH_CALLOUTS:
print >>H, ' %s,' % mangle(elem, 'batch').upper() print >> H, ' %s,' % mangle(elem, 'batch').upper()
print >>H, ' GRPC_BATCH_CALLOUTS_COUNT' print >> H, ' GRPC_BATCH_CALLOUTS_COUNT'
print >>H, '} grpc_metadata_batch_callouts_index;' print >> H, '} grpc_metadata_batch_callouts_index;'
print >>H print >> H
print >>H, 'typedef union {' print >> H, 'typedef union {'
print >>H, ' struct grpc_linked_mdelem *array[GRPC_BATCH_CALLOUTS_COUNT];' print >> H, ' struct grpc_linked_mdelem *array[GRPC_BATCH_CALLOUTS_COUNT];'
print >>H, ' struct {' print >> H, ' struct {'
for elem in METADATA_BATCH_CALLOUTS: for elem in METADATA_BATCH_CALLOUTS:
print >>H, ' struct grpc_linked_mdelem *%s;' % mangle(elem, '').lower() print >> H, ' struct grpc_linked_mdelem *%s;' % mangle(elem, '').lower()
print >>H, ' } named;' print >> H, ' } named;'
print >>H, '} grpc_metadata_batch_callouts;' print >> H, '} grpc_metadata_batch_callouts;'
print >>H print >> H
print >>H, '#define GRPC_BATCH_INDEX_OF(slice) \\' print >> H, '#define GRPC_BATCH_INDEX_OF(slice) \\'
print >>H, ' (GRPC_IS_STATIC_METADATA_STRING((slice)) ? (grpc_metadata_batch_callouts_index)GPR_CLAMP(GRPC_STATIC_METADATA_INDEX((slice)), 0, GRPC_BATCH_CALLOUTS_COUNT) : GRPC_BATCH_CALLOUTS_COUNT)' print >> H, ' (GRPC_IS_STATIC_METADATA_STRING((slice)) ? (grpc_metadata_batch_callouts_index)GPR_CLAMP(GRPC_STATIC_METADATA_INDEX((slice)), 0, GRPC_BATCH_CALLOUTS_COUNT) : GRPC_BATCH_CALLOUTS_COUNT)'
print >>H print >> H
print >>H, 'extern const uint8_t grpc_static_accept_encoding_metadata[%d];' % (1 << len(COMPRESSION_ALGORITHMS)) print >> H, 'extern const uint8_t grpc_static_accept_encoding_metadata[%d];' % (
print >>C, 'const uint8_t grpc_static_accept_encoding_metadata[%d] = {' % (1 << len(COMPRESSION_ALGORITHMS)) 1 << len(COMPRESSION_ALGORITHMS))
print >>C, '0,%s' % ','.join('%d' % md_idx(elem) for elem in compression_elems) print >> C, 'const uint8_t grpc_static_accept_encoding_metadata[%d] = {' % (
print >>C, '};' 1 << len(COMPRESSION_ALGORITHMS))
print >>C print >> C, '0,%s' % ','.join('%d' % md_idx(elem) for elem in compression_elems)
print >> C, '};'
print >>H, '#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]], GRPC_MDELEM_STORAGE_STATIC))' print >> C
print >>H, '#endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */' print >> H, '#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[grpc_static_accept_encoding_metadata[(algs)]], GRPC_MDELEM_STORAGE_STATIC))'
print >> H, '#endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */'
H.close() H.close()
C.close() C.close()

Loading…
Cancel
Save