From d8fe334d5b92ef50e44c75ac19d8dced53efc476 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Sat, 15 Oct 2016 15:25:51 -0700 Subject: [PATCH 1/2] s/lb-cost/lb-cost-bin --- src/core/ext/load_reporting/load_reporting.h | 2 +- src/core/lib/transport/static_metadata.c | 2 +- src/core/lib/transport/static_metadata.h | 8 ++++---- test/core/end2end/fuzzers/hpack.dictionary | 4 ++-- tools/codegen/core/gen_static_metadata.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/ext/load_reporting/load_reporting.h b/src/core/ext/load_reporting/load_reporting.h index e13097654d5..a157844734e 100644 --- a/src/core/ext/load_reporting/load_reporting.h +++ b/src/core/ext/load_reporting/load_reporting.h @@ -51,7 +51,7 @@ * The value corresponding to this key is an opaque binary blob reported by the * backend as part of its trailing metadata containing cost information for the * call. */ -#define GRPC_LB_COST_MD_KEY "lb-cost" +#define GRPC_LB_COST_MD_KEY "lb-cost-bin" /** Identifiers for the invocation point of the users LR callback */ typedef enum grpc_load_reporting_source { diff --git a/src/core/lib/transport/static_metadata.c b/src/core/lib/transport/static_metadata.c index f019ef156a7..8b22592b45d 100644 --- a/src/core/lib/transport/static_metadata.c +++ b/src/core/lib/transport/static_metadata.c @@ -126,7 +126,7 @@ const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = { "if-range", "if-unmodified-since", "last-modified", - "lb-cost", + "lb-cost-bin", "lb-token", "link", "location", diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h index e0a8196419e..28ad6f2961a 100644 --- a/src/core/lib/transport/static_metadata.h +++ b/src/core/lib/transport/static_metadata.h @@ -175,8 +175,8 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; #define GRPC_MDSTR_IF_UNMODIFIED_SINCE (&grpc_static_mdstr_table[62]) /* "last-modified" */ #define GRPC_MDSTR_LAST_MODIFIED (&grpc_static_mdstr_table[63]) -/* "lb-cost" */ -#define GRPC_MDSTR_LB_COST (&grpc_static_mdstr_table[64]) +/* "lb-cost-bin" */ +#define GRPC_MDSTR_LB_COST_BIN (&grpc_static_mdstr_table[64]) /* "lb-token" */ #define GRPC_MDSTR_LB_TOKEN (&grpc_static_mdstr_table[65]) /* "link" */ @@ -337,8 +337,8 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT]; #define GRPC_MDELEM_IF_UNMODIFIED_SINCE_EMPTY (&grpc_static_mdelem_table[44]) /* "last-modified": "" */ #define GRPC_MDELEM_LAST_MODIFIED_EMPTY (&grpc_static_mdelem_table[45]) -/* "lb-cost": "" */ -#define GRPC_MDELEM_LB_COST_EMPTY (&grpc_static_mdelem_table[46]) +/* "lb-cost-bin": "" */ +#define GRPC_MDELEM_LB_COST_BIN_EMPTY (&grpc_static_mdelem_table[46]) /* "lb-token": "" */ #define GRPC_MDELEM_LB_TOKEN_EMPTY (&grpc_static_mdelem_table[47]) /* "link": "" */ diff --git a/test/core/end2end/fuzzers/hpack.dictionary b/test/core/end2end/fuzzers/hpack.dictionary index 181bbe845e1..12db0ff0248 100644 --- a/test/core/end2end/fuzzers/hpack.dictionary +++ b/test/core/end2end/fuzzers/hpack.dictionary @@ -63,7 +63,7 @@ "\x08if-range" "\x13if-unmodified-since" "\x0Dlast-modified" -"\x07lb-cost" +"\x0Blb-cost-bin" "\x08lb-token" "\x04link" "\x08location" @@ -138,7 +138,7 @@ "\x00\x08if-range\x00" "\x00\x13if-unmodified-since\x00" "\x00\x0Dlast-modified\x00" -"\x00\x07lb-cost\x00" +"\x00\x0Blb-cost-bin\x00" "\x00\x08lb-token\x00" "\x00\x04link\x00" "\x00\x08location\x00" diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py index 6f8cad279c8..cf3762dbb8d 100755 --- a/tools/codegen/core/gen_static_metadata.py +++ b/tools/codegen/core/gen_static_metadata.py @@ -110,7 +110,7 @@ CONFIG = [ ('if-unmodified-since', ''), ('last-modified', ''), ('lb-token', ''), - ('lb-cost', ''), + ('lb-cost-bin', ''), ('link', ''), ('location', ''), ('max-forwards', ''), From 7ab83b59bedbb9bfd0917a7f5429e3150751e3d6 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 17 Oct 2016 12:43:10 -0700 Subject: [PATCH 2/2] fixed missing variable rename --- src/core/ext/load_reporting/load_reporting_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/load_reporting/load_reporting_filter.c b/src/core/ext/load_reporting/load_reporting_filter.c index 22bf36367f6..eeae2400fbc 100644 --- a/src/core/ext/load_reporting/load_reporting_filter.c +++ b/src/core/ext/load_reporting/load_reporting_filter.c @@ -193,7 +193,7 @@ static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) { grpc_call_element *elem = user_data; call_data *calld = elem->call_data; - if (md->key == GRPC_MDSTR_LB_COST) { + if (md->key == GRPC_MDSTR_LB_COST_BIN) { calld->trailing_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value)); return NULL; }