diff options
author | Craig Tiller <ctiller@google.com> | 2015-11-20 12:02:17 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-11-20 12:02:17 -0800 |
commit | b2b4261631fcd6e43344feb7dec45eff5ddbc8a8 (patch) | |
tree | a6be9f523c8973864fbdfb3e3d3b70d7f2b129ca /test/core/end2end/fixtures | |
parent | ebdef9d674b33e7bd117e2a4a2da7762c35bbdfc (diff) |
Remove metadata context entirely
Diffstat (limited to 'test/core/end2end/fixtures')
-rw-r--r-- | test/core/end2end/fixtures/h2_sockpair+trace.c | 27 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_sockpair.c | 27 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_sockpair_1byte.c | 27 | ||||
-rw-r--r-- | test/core/end2end/fixtures/h2_uchannel.c | 23 |
4 files changed, 38 insertions, 66 deletions
diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.c index 1f5051f0ab..ccc8631d94 100644 --- a/test/core/end2end/fixtures/h2_sockpair+trace.c +++ b/test/core/end2end/fixtures/h2_sockpair+trace.c @@ -57,14 +57,13 @@ /* chttp2 transport that is immediately available (used for testing connected_channel without a client_channel */ -static void server_setup_transport(void *ts, grpc_transport *transport, - grpc_mdctx *mdctx) { +static void server_setup_transport(void *ts, grpc_transport *transport) { grpc_end2end_test_fixture *f = ts; static grpc_channel_filter const *extra_filters[] = { &grpc_http_server_filter}; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_server_setup_transport(&exec_ctx, f->server, transport, extra_filters, - GPR_ARRAY_SIZE(extra_filters), mdctx, + GPR_ARRAY_SIZE(extra_filters), grpc_server_get_channel_args(f->server)); grpc_exec_ctx_finish(&exec_ctx); } @@ -75,17 +74,15 @@ typedef struct { } sp_client_setup; static void client_setup_transport(grpc_exec_ctx *exec_ctx, void *ts, - grpc_transport *transport, - grpc_mdctx *mdctx) { + grpc_transport *transport) { sp_client_setup *cs = ts; const grpc_channel_filter *filters[] = {&grpc_http_client_filter, &grpc_compress_filter, &grpc_connected_channel_filter}; size_t nfilters = sizeof(filters) / sizeof(*filters); - grpc_channel *channel = - grpc_channel_create_from_filters(exec_ctx, "socketpair-target", filters, - nfilters, cs->client_args, mdctx, 1); + grpc_channel *channel = grpc_channel_create_from_filters( + exec_ctx, "socketpair-target", filters, nfilters, cs->client_args, 1); cs->f->client = channel; @@ -112,13 +109,12 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_endpoint_pair *sfd = f->fixture_data; grpc_transport *transport; - grpc_mdctx *mdctx = grpc_mdctx_create(); sp_client_setup cs; cs.client_args = client_args; cs.f = f; - transport = grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, - mdctx, 1); - client_setup_transport(&exec_ctx, &cs, transport, mdctx); + transport = + grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1); + client_setup_transport(&exec_ctx, &cs, transport); GPR_ASSERT(f->client); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL, 0); grpc_exec_ctx_finish(&exec_ctx); @@ -128,15 +124,14 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_endpoint_pair *sfd = f->fixture_data; - grpc_mdctx *mdctx = grpc_mdctx_create(); grpc_transport *transport; GPR_ASSERT(!f->server); f->server = grpc_server_create_from_filters(NULL, 0, server_args); grpc_server_register_completion_queue(f->server, f->cq, NULL); grpc_server_start(f->server); - transport = grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, - mdctx, 0); - server_setup_transport(f, transport, mdctx); + transport = + grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0); + server_setup_transport(f, transport); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL, 0); grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/end2end/fixtures/h2_sockpair.c b/test/core/end2end/fixtures/h2_sockpair.c index b61fe98610..a6a84c9b1a 100644 --- a/test/core/end2end/fixtures/h2_sockpair.c +++ b/test/core/end2end/fixtures/h2_sockpair.c @@ -56,14 +56,13 @@ /* chttp2 transport that is immediately available (used for testing connected_channel without a client_channel */ -static void server_setup_transport(void *ts, grpc_transport *transport, - grpc_mdctx *mdctx) { +static void server_setup_transport(void *ts, grpc_transport *transport) { grpc_end2end_test_fixture *f = ts; static grpc_channel_filter const *extra_filters[] = { &grpc_http_server_filter}; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_server_setup_transport(&exec_ctx, f->server, transport, extra_filters, - GPR_ARRAY_SIZE(extra_filters), mdctx, + GPR_ARRAY_SIZE(extra_filters), grpc_server_get_channel_args(f->server)); grpc_exec_ctx_finish(&exec_ctx); } @@ -74,17 +73,15 @@ typedef struct { } sp_client_setup; static void client_setup_transport(grpc_exec_ctx *exec_ctx, void *ts, - grpc_transport *transport, - grpc_mdctx *mdctx) { + grpc_transport *transport) { sp_client_setup *cs = ts; const grpc_channel_filter *filters[] = {&grpc_http_client_filter, &grpc_compress_filter, &grpc_connected_channel_filter}; size_t nfilters = sizeof(filters) / sizeof(*filters); - grpc_channel *channel = - grpc_channel_create_from_filters(exec_ctx, "socketpair-target", filters, - nfilters, cs->client_args, mdctx, 1); + grpc_channel *channel = grpc_channel_create_from_filters( + exec_ctx, "socketpair-target", filters, nfilters, cs->client_args, 1); cs->f->client = channel; @@ -111,13 +108,12 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_endpoint_pair *sfd = f->fixture_data; grpc_transport *transport; - grpc_mdctx *mdctx = grpc_mdctx_create(); sp_client_setup cs; cs.client_args = client_args; cs.f = f; - transport = grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, - mdctx, 1); - client_setup_transport(&exec_ctx, &cs, transport, mdctx); + transport = + grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1); + client_setup_transport(&exec_ctx, &cs, transport); GPR_ASSERT(f->client); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL, 0); grpc_exec_ctx_finish(&exec_ctx); @@ -127,15 +123,14 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_endpoint_pair *sfd = f->fixture_data; - grpc_mdctx *mdctx = grpc_mdctx_create(); grpc_transport *transport; GPR_ASSERT(!f->server); f->server = grpc_server_create_from_filters(NULL, 0, server_args); grpc_server_register_completion_queue(f->server, f->cq, NULL); grpc_server_start(f->server); - transport = grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, - mdctx, 0); - server_setup_transport(f, transport, mdctx); + transport = + grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0); + server_setup_transport(f, transport); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL, 0); grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c index 9f0fd2ea9a..4b8f9054ef 100644 --- a/test/core/end2end/fixtures/h2_sockpair_1byte.c +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.c @@ -56,14 +56,13 @@ /* chttp2 transport that is immediately available (used for testing connected_channel without a client_channel */ -static void server_setup_transport(void *ts, grpc_transport *transport, - grpc_mdctx *mdctx) { +static void server_setup_transport(void *ts, grpc_transport *transport) { grpc_end2end_test_fixture *f = ts; static grpc_channel_filter const *extra_filters[] = { &grpc_http_server_filter}; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_server_setup_transport(&exec_ctx, f->server, transport, extra_filters, - GPR_ARRAY_SIZE(extra_filters), mdctx, + GPR_ARRAY_SIZE(extra_filters), grpc_server_get_channel_args(f->server)); grpc_exec_ctx_finish(&exec_ctx); } @@ -74,17 +73,15 @@ typedef struct { } sp_client_setup; static void client_setup_transport(grpc_exec_ctx *exec_ctx, void *ts, - grpc_transport *transport, - grpc_mdctx *mdctx) { + grpc_transport *transport) { sp_client_setup *cs = ts; const grpc_channel_filter *filters[] = {&grpc_http_client_filter, &grpc_compress_filter, &grpc_connected_channel_filter}; size_t nfilters = sizeof(filters) / sizeof(*filters); - grpc_channel *channel = - grpc_channel_create_from_filters(exec_ctx, "socketpair-target", filters, - nfilters, cs->client_args, mdctx, 1); + grpc_channel *channel = grpc_channel_create_from_filters( + exec_ctx, "socketpair-target", filters, nfilters, cs->client_args, 1); cs->f->client = channel; @@ -111,13 +108,12 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture *f, grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_endpoint_pair *sfd = f->fixture_data; grpc_transport *transport; - grpc_mdctx *mdctx = grpc_mdctx_create(); sp_client_setup cs; cs.client_args = client_args; cs.f = f; - transport = grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, - mdctx, 1); - client_setup_transport(&exec_ctx, &cs, transport, mdctx); + transport = + grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1); + client_setup_transport(&exec_ctx, &cs, transport); GPR_ASSERT(f->client); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL, 0); grpc_exec_ctx_finish(&exec_ctx); @@ -127,15 +123,14 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture *f, grpc_channel_args *server_args) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_endpoint_pair *sfd = f->fixture_data; - grpc_mdctx *mdctx = grpc_mdctx_create(); grpc_transport *transport; GPR_ASSERT(!f->server); f->server = grpc_server_create_from_filters(NULL, 0, server_args); grpc_server_register_completion_queue(f->server, f->cq, NULL); grpc_server_start(f->server); - transport = grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, - mdctx, 0); - server_setup_transport(f, transport, mdctx); + transport = + grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0); + server_setup_transport(f, transport); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL, 0); grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/end2end/fixtures/h2_uchannel.c b/test/core/end2end/fixtures/h2_uchannel.c index 5fed175f9d..ee4a60c29a 100644 --- a/test/core/end2end/fixtures/h2_uchannel.c +++ b/test/core/end2end/fixtures/h2_uchannel.c @@ -66,8 +66,6 @@ typedef struct { grpc_endpoint *tcp; - grpc_mdctx *mdctx; - grpc_closure connected; } connector; @@ -79,7 +77,6 @@ static void connector_ref(grpc_connector *con) { static void connector_unref(grpc_exec_ctx *exec_ctx, grpc_connector *con) { connector *c = (connector *)con; if (gpr_unref(&c->refs)) { - grpc_mdctx_unref(c->mdctx); gpr_free(c); } } @@ -89,8 +86,8 @@ static void connected(grpc_exec_ctx *exec_ctx, void *arg, int success) { grpc_closure *notify; grpc_endpoint *tcp = c->tcp; if (tcp != NULL) { - c->result->transport = grpc_create_chttp2_transport( - exec_ctx, c->args.channel_args, tcp, c->mdctx, 1); + c->result->transport = + grpc_create_chttp2_transport(exec_ctx, c->args.channel_args, tcp, 1); grpc_chttp2_transport_start_reading(exec_ctx, c->result->transport, NULL, 0); GPR_ASSERT(c->result->transport); @@ -130,7 +127,6 @@ static const grpc_connector_vtable connector_vtable = { typedef struct { grpc_subchannel_factory base; gpr_refcount refs; - grpc_mdctx *mdctx; grpc_channel_args *merge_args; grpc_channel *master; grpc_subchannel **sniffed_subchannel; @@ -147,7 +143,6 @@ static void subchannel_factory_unref(grpc_exec_ctx *exec_ctx, if (gpr_unref(&f->refs)) { GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, f->master, "subchannel_factory"); grpc_channel_args_destroy(f->merge_args); - grpc_mdctx_unref(f->mdctx); gpr_free(f); } } @@ -162,10 +157,7 @@ static grpc_subchannel *subchannel_factory_create_subchannel( grpc_subchannel *s; memset(c, 0, sizeof(*c)); c->base.vtable = &connector_vtable; - c->mdctx = f->mdctx; - grpc_mdctx_ref(c->mdctx); gpr_ref_init(&c->refs, 1); - args->mdctx = f->mdctx; args->args = final_args; args->master = f->master; s = grpc_subchannel_create(&c->base, args); @@ -188,22 +180,19 @@ grpc_channel *channel_create(const char *target, const grpc_channel_args *args, const grpc_channel_filter *filters[MAX_FILTERS]; grpc_resolver *resolver; subchannel_factory *f; - grpc_mdctx *mdctx = grpc_mdctx_create(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; size_t n = 0; filters[n++] = &grpc_client_channel_filter; GPR_ASSERT(n <= MAX_FILTERS); - channel = grpc_channel_create_from_filters(&exec_ctx, target, filters, n, - args, mdctx, 1); + channel = + grpc_channel_create_from_filters(&exec_ctx, target, filters, n, args, 1); f = gpr_malloc(sizeof(*f)); f->sniffed_subchannel = sniffed_subchannel; f->base.vtable = &test_subchannel_factory_vtable; gpr_ref_init(&f->refs, 1); - grpc_mdctx_ref(mdctx); - f->mdctx = mdctx; f->merge_args = grpc_channel_args_copy(args); f->master = channel; GRPC_CHANNEL_INTERNAL_REF(f->master, "test_subchannel_factory"); @@ -263,9 +252,7 @@ static void chttp2_init_client_micro_fullstack(grpc_end2end_test_fixture *f, /* here sniffed_subchannel should be ready to use */ GPR_ASSERT(conn_state == GRPC_CHANNEL_IDLE); GPR_ASSERT(ffd->sniffed_subchannel != NULL); - f->client = grpc_client_uchannel_create( - ffd->sniffed_subchannel, client_args, - grpc_channel_get_metadata_context(ffd->master_channel)); + f->client = grpc_client_uchannel_create(ffd->sniffed_subchannel, client_args); grpc_client_uchannel_set_subchannel(f->client, ffd->sniffed_subchannel); gpr_log(GPR_INFO, "CHANNEL WRAPPING SUBCHANNEL: %p(%p)", f->client, ffd->sniffed_subchannel); |