diff options
Diffstat (limited to 'src/core/lib/transport/service_config.c')
-rw-r--r-- | src/core/lib/transport/service_config.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/core/lib/transport/service_config.c b/src/core/lib/transport/service_config.c index 2e2b59e3f7..552d3ec856 100644 --- a/src/core/lib/transport/service_config.c +++ b/src/core/lib/transport/service_config.c @@ -146,7 +146,8 @@ static char* parse_json_method_name(grpc_json* json) { // each name found, incrementing \a idx for each entry added. // Returns false on error. static bool parse_json_method_config( - grpc_json* json, void* (*create_value)(const grpc_json* method_config_json), + grpc_exec_ctx* exec_ctx, grpc_json* json, + void* (*create_value)(const grpc_json* method_config_json), const grpc_mdstr_hash_table_vtable* vtable, grpc_mdstr_hash_table_entry* entries, size_t* idx) { // Construct value. @@ -176,13 +177,13 @@ static bool parse_json_method_config( } success = true; done: - vtable->destroy_value(method_config); + vtable->destroy_value(exec_ctx, method_config); gpr_strvec_destroy(&paths); return success; } grpc_mdstr_hash_table* grpc_service_config_create_method_config_table( - const grpc_service_config* service_config, + grpc_exec_ctx* exec_ctx, const grpc_service_config* service_config, void* (*create_value)(const grpc_json* method_config_json), const grpc_mdstr_hash_table_vtable* vtable) { const grpc_json* json = service_config->json_tree; @@ -205,8 +206,8 @@ grpc_mdstr_hash_table* grpc_service_config_create_method_config_table( size_t idx = 0; for (grpc_json* method = field->child; method != NULL; method = method->next) { - if (!parse_json_method_config(method, create_value, vtable, entries, - &idx)) { + if (!parse_json_method_config(exec_ctx, method, create_value, vtable, + entries, &idx)) { return NULL; } } @@ -219,15 +220,16 @@ grpc_mdstr_hash_table* grpc_service_config_create_method_config_table( method_config_table = grpc_mdstr_hash_table_create(num_entries, entries); // Clean up. for (size_t i = 0; i < num_entries; ++i) { - GRPC_MDSTR_UNREF(entries[i].key); - vtable->destroy_value(entries[i].value); + GRPC_MDSTR_UNREF(exec_ctx, entries[i].key); + vtable->destroy_value(exec_ctx, entries[i].value); } gpr_free(entries); } return method_config_table; } -void* grpc_method_config_table_get(const grpc_mdstr_hash_table* table, +void* grpc_method_config_table_get(grpc_exec_ctx* exec_ctx, + const grpc_mdstr_hash_table* table, const grpc_mdstr* path) { void* value = grpc_mdstr_hash_table_get(table, path); // If we didn't find a match for the path, try looking for a wildcard @@ -243,7 +245,7 @@ void* grpc_method_config_table_get(const grpc_mdstr_hash_table* table, grpc_mdstr* wildcard_path = grpc_mdstr_from_string(buf); gpr_free(buf); value = grpc_mdstr_hash_table_get(table, wildcard_path); - GRPC_MDSTR_UNREF(wildcard_path); + GRPC_MDSTR_UNREF(exec_ctx, wildcard_path); } return value; } |