From 321881d07f7806601bbf6d7929f4e4e58bc1e913 Mon Sep 17 00:00:00 2001 From: Sree Kuchibhotla Date: Mon, 27 Feb 2017 11:25:28 -0800 Subject: Change Core to use the new completion_queue_create API --- test/core/end2end/fuzzers/api_fuzzer.c | 28 +++++++++++++++++----------- test/core/end2end/fuzzers/client_fuzzer.c | 3 ++- test/core/end2end/fuzzers/server_fuzzer.c | 3 ++- 3 files changed, 21 insertions(+), 13 deletions(-) (limited to 'test/core/end2end/fuzzers') diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index 0de8b9459a..61f972e65e 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -314,8 +314,9 @@ static grpc_call_credentials *read_call_creds(input_stream *inp) { cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT; const char *access_token = read_cred_artifact(&ctx, inp, NULL, 0); grpc_call_credentials *out = - access_token == NULL ? NULL : grpc_access_token_credentials_create( - access_token, NULL); + access_token == NULL + ? NULL + : grpc_access_token_credentials_create(access_token, NULL); cred_artifact_ctx_finish(&ctx); return out; } @@ -409,8 +410,9 @@ void my_resolve_address(grpc_exec_ctx *exec_ctx, const char *addr, r->on_done = on_done; r->addrs = addresses; grpc_timer_init( - exec_ctx, &r->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_seconds(1, GPR_TIMESPAN)), + exec_ctx, &r->timer, + gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_seconds(1, GPR_TIMESPAN)), grpc_closure_create(finish_resolve, r, grpc_schedule_on_exec_ctx), gpr_now(GPR_CLOCK_MONOTONIC)); } @@ -471,8 +473,9 @@ static void sched_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure, fc->ep = ep; fc->deadline = deadline; grpc_timer_init( - exec_ctx, &fc->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_millis(1, GPR_TIMESPAN)), + exec_ctx, &fc->timer, + gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_millis(1, GPR_TIMESPAN)), grpc_closure_create(do_connect, fc, grpc_schedule_on_exec_ctx), gpr_now(GPR_CLOCK_MONOTONIC)); } @@ -735,7 +738,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { g_active_call = new_call(NULL, ROOT); g_resource_quota = grpc_resource_quota_create("api_fuzzer"); - grpc_completion_queue *cq = grpc_completion_queue_create(NULL); + grpc_completion_queue *cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); while (!is_eof(&inp) || g_channel != NULL || g_server != NULL || pending_channel_watches > 0 || pending_pings > 0 || @@ -748,8 +752,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (g_server != NULL) { if (!server_shutdown) { grpc_server_shutdown_and_notify( - g_server, cq, create_validator(assert_success_and_decrement, - &pending_server_shutdowns)); + g_server, cq, + create_validator(assert_success_and_decrement, + &pending_server_shutdowns)); server_shutdown = true; pending_server_shutdowns++; } else if (pending_server_shutdowns == 0) { @@ -854,8 +859,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { case 5: { if (g_server != NULL) { grpc_server_shutdown_and_notify( - g_server, cq, create_validator(assert_success_and_decrement, - &pending_server_shutdowns)); + g_server, cq, + create_validator(assert_success_and_decrement, + &pending_server_shutdowns)); pending_server_shutdowns++; server_shutdown = true; } else { diff --git a/test/core/end2end/fuzzers/client_fuzzer.c b/test/core/end2end/fuzzers/client_fuzzer.c index e7e7dbefd0..6b8c09cdf4 100644 --- a/test/core/end2end/fuzzers/client_fuzzer.c +++ b/test/core/end2end/fuzzers/client_fuzzer.c @@ -65,7 +65,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_mock_endpoint_create(discard_write, resource_quota); grpc_resource_quota_unref_internal(&exec_ctx, resource_quota); - grpc_completion_queue *cq = grpc_completion_queue_create(NULL); + grpc_completion_queue *cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_transport *transport = grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 1); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL); diff --git a/test/core/end2end/fuzzers/server_fuzzer.c b/test/core/end2end/fuzzers/server_fuzzer.c index 186542d4b2..76fe97ec0f 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.c +++ b/test/core/end2end/fuzzers/server_fuzzer.c @@ -67,7 +67,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_slice_from_copied_buffer((const char *)data, size)); grpc_server *server = grpc_server_create(NULL, NULL); - grpc_completion_queue *cq = grpc_completion_queue_create(NULL); + grpc_completion_queue *cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); grpc_server_register_completion_queue(server, cq, NULL); // TODO(ctiller): add registered methods (one for POST, one for PUT) // void *registered_method = -- cgit v1.2.3 From 1dbd981cf8be17db0268e96c2e2a0647b7d53385 Mon Sep 17 00:00:00 2001 From: Sree Kuchibhotla Date: Fri, 3 Mar 2017 14:27:44 -0800 Subject: Prefix grpc_cq_polling_type enums with GRPC_CQ_ --- include/grpc++/impl/codegen/client_unary_call.h | 2 +- include/grpc++/impl/codegen/completion_queue.h | 2 +- include/grpc++/impl/codegen/sync_stream.h | 6 ++--- include/grpc/grpc.h | 14 +++++----- src/core/lib/surface/completion_queue.c | 4 +-- src/cpp/server/server_cc.cc | 4 +-- test/core/bad_client/bad_client.c | 6 +++-- test/core/bad_ssl/bad_ssl_test.c | 2 +- test/core/bad_ssl/server_common.c | 11 ++++---- test/core/client_channel/lb_policies_test.c | 7 ++--- .../set_initial_connect_string_test.c | 3 ++- test/core/end2end/bad_server_response_test.c | 3 ++- test/core/end2end/connection_refused_test.c | 3 ++- test/core/end2end/dualstack_socket_test.c | 6 +++-- test/core/end2end/fixtures/h2_census.c | 5 ++-- test/core/end2end/fixtures/h2_compress.c | 5 ++-- test/core/end2end/fixtures/h2_fakesec.c | 5 ++-- test/core/end2end/fixtures/h2_fd.c | 5 ++-- test/core/end2end/fixtures/h2_full+pipe.c | 5 ++-- test/core/end2end/fixtures/h2_full+trace.c | 12 +++++---- test/core/end2end/fixtures/h2_full.c | 5 ++-- test/core/end2end/fixtures/h2_http_proxy.c | 5 ++-- test/core/end2end/fixtures/h2_load_reporting.c | 5 ++-- test/core/end2end/fixtures/h2_oauth2.c | 5 ++-- test/core/end2end/fixtures/h2_proxy.c | 5 ++-- test/core/end2end/fixtures/h2_sockpair+trace.c | 5 ++-- test/core/end2end/fixtures/h2_sockpair.c | 5 ++-- test/core/end2end/fixtures/h2_sockpair_1byte.c | 5 ++-- test/core/end2end/fixtures/h2_ssl.c | 5 ++-- test/core/end2end/fixtures/h2_ssl_cert.c | 5 ++-- test/core/end2end/fixtures/h2_ssl_proxy.c | 5 ++-- test/core/end2end/fixtures/h2_uds.c | 12 +++++---- test/core/end2end/fixtures/proxy.c | 3 ++- test/core/end2end/fuzzers/api_fuzzer.c | 2 +- test/core/end2end/fuzzers/client_fuzzer.c | 2 +- test/core/end2end/fuzzers/server_fuzzer.c | 2 +- test/core/end2end/goaway_server_test.c | 3 ++- test/core/end2end/invalid_call_argument_test.c | 4 +-- test/core/end2end/multiple_server_queues_test.c | 7 ++--- test/core/end2end/no_server_test.c | 3 ++- test/core/fling/client.c | 3 ++- test/core/fling/server.c | 12 +++++---- test/core/handshake/client_ssl.c | 2 +- test/core/handshake/server_ssl.c | 2 +- test/core/memory_usage/client.c | 8 +++--- test/core/memory_usage/server.c | 12 +++++---- test/core/surface/alarm_test.c | 3 ++- test/core/surface/completion_queue_test.c | 31 +++++++++++----------- .../core/surface/completion_queue_threading_test.c | 5 ++-- test/core/surface/concurrent_connectivity_test.c | 7 ++--- test/core/surface/lame_client_test.c | 3 ++- test/core/surface/sequential_connectivity_test.c | 4 +-- test/core/surface/server_chttp2_test.c | 2 +- test/core/surface/server_test.c | 6 ++--- test/cpp/grpclb/grpclb_test.cc | 13 +++++---- test/cpp/microbenchmarks/bm_call_create.cc | 2 +- test/cpp/microbenchmarks/bm_cq.cc | 12 ++++----- 57 files changed, 189 insertions(+), 141 deletions(-) (limited to 'test/core/end2end/fuzzers') diff --git a/include/grpc++/impl/codegen/client_unary_call.h b/include/grpc++/impl/codegen/client_unary_call.h index bf18a7d644..d8085a0a7f 100644 --- a/include/grpc++/impl/codegen/client_unary_call.h +++ b/include/grpc++/impl/codegen/client_unary_call.h @@ -52,7 +52,7 @@ template Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, ClientContext* context, const InputMessage& request, OutputMessage* result) { - CompletionQueue cq(GRPC_CQ_PLUCK, DEFAULT_POLLING); + CompletionQueue cq(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING); Call call(channel->CreateCall(method, context, &cq)); CallOpSet, diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h index a7125e6af3..f34b82dad2 100644 --- a/include/grpc++/impl/codegen/completion_queue.h +++ b/include/grpc++/impl/codegen/completion_queue.h @@ -103,7 +103,7 @@ class CompletionQueue : private GrpcLibraryCodegen { public: /// Default constructor. Implicitly creates a \a grpc_completion_queue /// instance. - CompletionQueue() : CompletionQueue(GRPC_CQ_NEXT, DEFAULT_POLLING) {} + CompletionQueue() : CompletionQueue(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING) {} /// Wrap \a take, taking ownership of the instance. /// diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h index d3a6c7ff89..c09ab5e647 100644 --- a/include/grpc++/impl/codegen/sync_stream.h +++ b/include/grpc++/impl/codegen/sync_stream.h @@ -138,7 +138,7 @@ class ClientReader final : public ClientReaderInterface { ClientReader(ChannelInterface* channel, const RpcMethod& method, ClientContext* context, const W& request) : context_(context), - cq_(GRPC_CQ_PLUCK, DEFAULT_POLLING), + cq_(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING), call_(channel->CreateCall(method, context, &cq_)) { CallOpSet @@ -212,7 +212,7 @@ class ClientWriter : public ClientWriterInterface { ClientWriter(ChannelInterface* channel, const RpcMethod& method, ClientContext* context, R* response) : context_(context), - cq_(GRPC_CQ_PLUCK, DEFAULT_POLLING), + cq_(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING), call_(channel->CreateCall(method, context, &cq_)) { finish_ops_.RecvMessage(response); finish_ops_.AllowNoMessage(); @@ -297,7 +297,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface { ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method, ClientContext* context) : context_(context), - cq_(GRPC_CQ_PLUCK, DEFAULT_POLLING), + cq_(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING), call_(channel->CreateCall(method, context, &cq_)) { CallOpSet ops; ops.SendInitialMetadata(context->send_initial_metadata_, diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index 0e4711fa1f..29fd3048fc 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -108,23 +108,23 @@ typedef enum { I/O progress can only be made when grpc_completion_queue_next() or grpc_completion_queue_pluck() are called on the completion queue (unless the - grpc_cq_polling_type is NON_POLLING) and hence it is very important to - actively call these APIs */ + grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important + to actively call these APIs */ typedef enum { /** The completion queue will have an associated pollset and there is no restriction on the type of file descriptors the pollset may contain */ - DEFAULT_POLLING, + GRPC_CQ_DEFAULT_POLLING, - /** Similar to DEFAULT_POLLING except that the completion queues will not - contain any 'listening file descriptors' (i.e file descriptors used to + /** Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will + not contain any 'listening file descriptors' (i.e file descriptors used to listen to incoming channels */ - NON_LISTENING, + GRPC_CQ_NON_LISTENING, /** The completion queue will not have an associated pollset. Note that grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still be called to pop events from the completion queue; it is not required to call them actively to make I/O progress */ - NON_POLLING + GRPC_CQ_NON_POLLING } grpc_cq_polling_type; /** Create a completion queue */ diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c index d45e265d5c..ad9d7b20b0 100644 --- a/src/core/lib/surface/completion_queue.c +++ b/src/core/lib/surface/completion_queue.c @@ -717,12 +717,12 @@ grpc_completion_queue *grpc_cq_from_pollset(grpc_pollset *ps) { void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc) { /* TODO: sreek - use cc->polling_type field here and add a validation check (i.e grpc_cq_mark_non_listening_server_cq can only be called on a cc whose - polling_type is set to NON_LISTENING */ + polling_type is set to GRPC_CQ_NON_LISTENING */ cc->is_non_listening_server_cq = 1; } bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc) { - /* TODO (sreek) - return (cc->polling_type == NON_LISTENING) */ + /* TODO (sreek) - return (cc->polling_type == GRPC_CQ_NON_LISTENING) */ return (cc->is_non_listening_server_cq == 1); } diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 1b7ca82be0..50c4cafa7a 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -154,8 +154,8 @@ class Server::SyncRequest final : public CompletionQueueTag { } void SetupRequest() { - // TODO: sreek - Double check if this should be GRPC_CQ_PLUCK - cq_ = grpc_completion_queue_create(GRPC_CQ_PLUCK, DEFAULT_POLLING, nullptr); + cq_ = grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, + nullptr); } void TeardownRequest() { diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c index a6e859d06e..2ecb75883b 100644 --- a/test/core/bad_client/bad_client.c +++ b/test/core/bad_client/bad_client.c @@ -125,7 +125,8 @@ void grpc_run_bad_client_test( /* Create server, completion events */ a.server = grpc_server_create(NULL, NULL); - a.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + a.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); gpr_event_init(&a.done_thd); gpr_event_init(&a.done_write); a.validator = server_validator; @@ -197,7 +198,8 @@ void grpc_run_bad_client_test( grpc_exec_ctx_finish(&exec_ctx); } - shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + shutdown_cq = + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); grpc_server_shutdown_and_notify(a.server, shutdown_cq, NULL); GPR_ASSERT(grpc_completion_queue_pluck( shutdown_cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL) diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c index 4d34f8a9ea..e0f1d2789f 100644 --- a/test/core/bad_ssl/bad_ssl_test.c +++ b/test/core/bad_ssl/bad_ssl_test.c @@ -62,7 +62,7 @@ static void run_test(const char *target, size_t nops) { grpc_call_error error; gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); cq_verifier *cqv = cq_verifier_create(cq); grpc_op ops[6]; diff --git a/test/core/bad_ssl/server_common.c b/test/core/bad_ssl/server_common.c index 42a8d4ede8..b112ae4e78 100644 --- a/test/core/bad_ssl/server_common.c +++ b/test/core/bad_ssl/server_common.c @@ -68,7 +68,7 @@ void bad_ssl_run(grpc_server *server) { grpc_metadata_array request_metadata_recv; grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_completion_queue *shutdown_cq; grpc_call_details_init(&call_details); @@ -85,8 +85,8 @@ void bad_ssl_run(grpc_server *server) { while (!shutdown_finished) { if (got_sigint && !shutdown_started) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK, + GRPC_CQ_NON_POLLING, NULL); grpc_server_shutdown_and_notify(server, shutdown_cq, NULL); GPR_ASSERT( grpc_completion_queue_pluck(shutdown_cq, NULL, @@ -97,8 +97,9 @@ void bad_ssl_run(grpc_server *server) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); switch (ev.type) { case GRPC_OP_COMPLETE: diff --git a/test/core/client_channel/lb_policies_test.c b/test/core/client_channel/lb_policies_test.c index 8bbcfe987e..f440e3348c 100644 --- a/test/core/client_channel/lb_policies_test.c +++ b/test/core/client_channel/lb_policies_test.c @@ -67,7 +67,7 @@ typedef struct servers_fixture { typedef struct request_sequences { size_t n; /* number of iterations */ int *connections; /* indexed by the interation number, value is the index of - the server it connected to or -1 if none */ + the server it connected to or -1 if none */ int *connectivity_states; /* indexed by the interation number, value is the client connectivity state */ } request_sequences; @@ -197,9 +197,10 @@ static servers_fixture *setup_servers(const char *server_host, /* Create servers. */ f->servers = gpr_malloc(sizeof(grpc_server *) * num_servers); f->servers_hostports = gpr_malloc(sizeof(char *) * num_servers); - f->cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f->cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f->shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); for (i = 0; i < num_servers; i++) { grpc_metadata_array_init(&f->request_metadata_recv[i]); gpr_join_host_port(&f->servers_hostports[i], server_host, diff --git a/test/core/client_channel/set_initial_connect_string_test.c b/test/core/client_channel/set_initial_connect_string_test.c index 38f2fbac62..999c89bdbd 100644 --- a/test/core/client_channel/set_initial_connect_string_test.c +++ b/test/core/client_channel/set_initial_connect_string_test.c @@ -130,7 +130,8 @@ static gpr_timespec n_sec_deadline(int seconds) { } static void start_rpc(int use_creds, int target_port) { - state.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + state.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); if (use_creds) { state.creds = grpc_fake_transport_security_credentials_create(); } else { diff --git a/test/core/end2end/bad_server_response_test.c b/test/core/end2end/bad_server_response_test.c index 67f5bdbac8..e4dc3831dc 100644 --- a/test/core/end2end/bad_server_response_test.c +++ b/test/core/end2end/bad_server_response_test.c @@ -178,7 +178,8 @@ static void start_rpc(int target_port, grpc_status_code expected_status, cq_verifier *cqv; grpc_slice details; - state.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + state.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); cqv = cq_verifier_create(state.cq); gpr_join_host_port(&state.target, "127.0.0.1", target_port); state.channel = grpc_insecure_channel_create(state.target, NULL, NULL); diff --git a/test/core/end2end/connection_refused_test.c b/test/core/end2end/connection_refused_test.c index 617828f954..fe203ddf4d 100644 --- a/test/core/end2end/connection_refused_test.c +++ b/test/core/end2end/connection_refused_test.c @@ -69,7 +69,8 @@ static void run_test(bool wait_for_ready, bool use_service_config) { grpc_metadata_array_init(&trailing_metadata_recv); - cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); cqv = cq_verifier_create(cq); /* if using service config, create channel args */ diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index 5125be9b94..19f947865a 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -108,7 +108,8 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_call_details_init(&call_details); /* Create server. */ - cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); server = grpc_server_create(NULL, NULL); grpc_server_register_completion_queue(server, cq, NULL); GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port( @@ -260,7 +261,8 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_channel_destroy(client); /* Destroy server. */ - shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + shutdown_cq = + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), grpc_timeout_seconds_to_deadline(5), diff --git a/test/core/end2end/fixtures/h2_census.c b/test/core/end2end/fixtures/h2_census.c index a1fae013c2..1077e063b8 100644 --- a/test/core/end2end/fixtures/h2_census.c +++ b/test/core/end2end/fixtures/h2_census.c @@ -65,9 +65,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_compress.c b/test/core/end2end/fixtures/h2_compress.c index 7a2aa7ff7f..a985faeb5a 100644 --- a/test/core/end2end/fixtures/h2_compress.c +++ b/test/core/end2end/fixtures/h2_compress.c @@ -69,9 +69,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( memset(&f, 0, sizeof(f)); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_fakesec.c b/test/core/end2end/fixtures/h2_fakesec.c index 0ccdef9767..59ae3f0cb3 100644 --- a/test/core/end2end/fixtures/h2_fakesec.c +++ b/test/core/end2end/fixtures/h2_fakesec.c @@ -60,9 +60,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_fd.c b/test/core/end2end/fixtures/h2_fd.c index d97b693e33..b01b52c996 100644 --- a/test/core/end2end/fixtures/h2_fd.c +++ b/test/core/end2end/fixtures/h2_fd.c @@ -70,9 +70,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = fixture_data; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); create_sockets(fixture_data->fd_pair); diff --git a/test/core/end2end/fixtures/h2_full+pipe.c b/test/core/end2end/fixtures/h2_full+pipe.c index 833b8278cc..6add99707f 100644 --- a/test/core/end2end/fixtures/h2_full+pipe.c +++ b/test/core/end2end/fixtures/h2_full+pipe.c @@ -70,9 +70,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_full+trace.c b/test/core/end2end/fixtures/h2_full+trace.c index a44587cd15..c24bacc42f 100644 --- a/test/core/end2end/fixtures/h2_full+trace.c +++ b/test/core/end2end/fixtures/h2_full+trace.c @@ -70,9 +70,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } @@ -104,9 +105,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_full.c b/test/core/end2end/fixtures/h2_full.c index bfb300e42f..901a419f25 100644 --- a/test/core/end2end/fixtures/h2_full.c +++ b/test/core/end2end/fixtures/h2_full.c @@ -64,9 +64,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_http_proxy.c b/test/core/end2end/fixtures/h2_http_proxy.c index 2c0dc84d40..5285068797 100644 --- a/test/core/end2end/fixtures/h2_http_proxy.c +++ b/test/core/end2end/fixtures/h2_http_proxy.c @@ -69,9 +69,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( ffd->proxy = grpc_end2end_http_proxy_create(); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_load_reporting.c b/test/core/end2end/fixtures/h2_load_reporting.c index 664c7ba9d4..5b8721adbd 100644 --- a/test/core/end2end/fixtures/h2_load_reporting.c +++ b/test/core/end2end/fixtures/h2_load_reporting.c @@ -67,9 +67,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_oauth2.c b/test/core/end2end/fixtures/h2_oauth2.c index 73928759fe..19920473ff 100644 --- a/test/core/end2end/fixtures/h2_oauth2.c +++ b/test/core/end2end/fixtures/h2_oauth2.c @@ -113,9 +113,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_proxy.c b/test/core/end2end/fixtures/h2_proxy.c index 016ba41fbd..5a64a10918 100644 --- a/test/core/end2end/fixtures/h2_proxy.c +++ b/test/core/end2end/fixtures/h2_proxy.c @@ -79,9 +79,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.c index 445f8a2dd1..069b880238 100644 --- a/test/core/end2end/fixtures/h2_sockpair+trace.c +++ b/test/core/end2end/fixtures/h2_sockpair+trace.c @@ -94,9 +94,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture"); *sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 65536); diff --git a/test/core/end2end/fixtures/h2_sockpair.c b/test/core/end2end/fixtures/h2_sockpair.c index 66c05c5562..c19d485403 100644 --- a/test/core/end2end/fixtures/h2_sockpair.c +++ b/test/core/end2end/fixtures/h2_sockpair.c @@ -88,9 +88,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture"); *sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 65536); diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c index 2d845f369b..05883b5ef4 100644 --- a/test/core/end2end/fixtures/h2_sockpair_1byte.c +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.c @@ -88,9 +88,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture"); *sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 1); diff --git a/test/core/end2end/fixtures/h2_ssl.c b/test/core/end2end/fixtures/h2_ssl.c index d73944fe6c..d704b97e1c 100644 --- a/test/core/end2end/fixtures/h2_ssl.c +++ b/test/core/end2end/fixtures/h2_ssl.c @@ -64,9 +64,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_ssl_cert.c b/test/core/end2end/fixtures/h2_ssl_cert.c index c8bd7153c2..c3d25ac836 100644 --- a/test/core/end2end/fixtures/h2_ssl_cert.c +++ b/test/core/end2end/fixtures/h2_ssl_cert.c @@ -67,9 +67,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.c b/test/core/end2end/fixtures/h2_ssl_proxy.c index 22fbeb1a83..61bcfebbbe 100644 --- a/test/core/end2end/fixtures/h2_ssl_proxy.c +++ b/test/core/end2end/fixtures/h2_ssl_proxy.c @@ -100,9 +100,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_uds.c b/test/core/end2end/fixtures/h2_uds.c index 4e2b5f0ba5..820c587bee 100644 --- a/test/core/end2end/fixtures/h2_uds.c +++ b/test/core/end2end/fixtures/h2_uds.c @@ -70,9 +70,10 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( unique++); f.fixture_data = ffd; - f.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + f.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); return f; } @@ -103,9 +104,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack_uds", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/proxy.c b/test/core/end2end/fixtures/proxy.c index 7f23eef66a..7d306c6032 100644 --- a/test/core/end2end/fixtures/proxy.c +++ b/test/core/end2end/fixtures/proxy.c @@ -104,7 +104,8 @@ grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def, gpr_log(GPR_DEBUG, "PROXY ADDR:%s BACKEND:%s", proxy->proxy_port, proxy->server_port); - proxy->cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + proxy->cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); proxy->server = def->create_server(proxy->proxy_port, server_args); proxy->client = def->create_client(proxy->server_port, client_args); diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index 61f972e65e..278b6dbae0 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -739,7 +739,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { g_resource_quota = grpc_resource_quota_create("api_fuzzer"); grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); while (!is_eof(&inp) || g_channel != NULL || g_server != NULL || pending_channel_watches > 0 || pending_pings > 0 || diff --git a/test/core/end2end/fuzzers/client_fuzzer.c b/test/core/end2end/fuzzers/client_fuzzer.c index 6b8c09cdf4..46acf7d70a 100644 --- a/test/core/end2end/fuzzers/client_fuzzer.c +++ b/test/core/end2end/fuzzers/client_fuzzer.c @@ -66,7 +66,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_resource_quota_unref_internal(&exec_ctx, resource_quota); grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_transport *transport = grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 1); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL); diff --git a/test/core/end2end/fuzzers/server_fuzzer.c b/test/core/end2end/fuzzers/server_fuzzer.c index 76fe97ec0f..33c8ed4e72 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.c +++ b/test/core/end2end/fuzzers/server_fuzzer.c @@ -68,7 +68,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_server *server = grpc_server_create(NULL, NULL); grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_server_register_completion_queue(server, cq, NULL); // TODO(ctiller): add registered methods (one for POST, one for PUT) // void *registered_method = diff --git a/test/core/end2end/goaway_server_test.c b/test/core/end2end/goaway_server_test.c index 85d54c16e5..92ea7a72ef 100644 --- a/test/core/end2end/goaway_server_test.c +++ b/test/core/end2end/goaway_server_test.c @@ -121,7 +121,8 @@ int main(int argc, char **argv) { grpc_metadata_array_init(&request_metadata2); grpc_call_details_init(&request_details2); - cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); cqv = cq_verifier_create(cq); /* reserve two ports */ diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c index 0563127af8..7aa8d98933 100644 --- a/test/core/end2end/invalid_call_argument_test.c +++ b/test/core/end2end/invalid_call_argument_test.c @@ -74,7 +74,7 @@ static void prepare_test(int is_client) { grpc_metadata_array_init(&g_state.trailing_metadata_recv); g_state.deadline = grpc_timeout_seconds_to_deadline(2); g_state.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); g_state.cqv = cq_verifier_create(g_state.cq); g_state.details = grpc_empty_slice(); memset(g_state.ops, 0, sizeof(g_state.ops)); @@ -134,7 +134,7 @@ static void cleanup_test() { if (!g_state.is_client) { shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); grpc_call_destroy(g_state.server_call); grpc_server_shutdown_and_notify(g_state.server, shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), diff --git a/test/core/end2end/multiple_server_queues_test.c b/test/core/end2end/multiple_server_queues_test.c index 94e615f1aa..7da5ee55ae 100644 --- a/test/core/end2end/multiple_server_queues_test.c +++ b/test/core/end2end/multiple_server_queues_test.c @@ -42,9 +42,10 @@ int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); - cq1 = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); - cq2 = grpc_completion_queue_create(GRPC_CQ_NEXT, NON_LISTENING, NULL); - cq3 = grpc_completion_queue_create(GRPC_CQ_NEXT, NON_POLLING, NULL); + cq1 = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cq2 = grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_NON_LISTENING, NULL); + cq3 = grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_NON_POLLING, NULL); server = grpc_server_create(NULL, NULL); grpc_server_register_completion_queue(server, cq1, NULL); diff --git a/test/core/end2end/no_server_test.c b/test/core/end2end/no_server_test.c index e16c129d67..fd8a2f8a39 100644 --- a/test/core/end2end/no_server_test.c +++ b/test/core/end2end/no_server_test.c @@ -59,7 +59,8 @@ int main(int argc, char **argv) { grpc_metadata_array_init(&trailing_metadata_recv); - cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); cqv = cq_verifier_create(cq); /* create a call, channel to a non existant server */ diff --git a/test/core/fling/client.c b/test/core/fling/client.c index 188696c189..a9f6a3d516 100644 --- a/test/core/fling/client.c +++ b/test/core/fling/client.c @@ -208,7 +208,8 @@ int main(int argc, char **argv) { } channel = grpc_insecure_channel_create(target, NULL, NULL); - cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); the_buffer = grpc_raw_byte_buffer_create(&slice, (size_t)payload_size); histogram = gpr_histogram_create(0.01, 60e9); diff --git a/test/core/fling/server.c b/test/core/fling/server.c index 3d20d22aaa..02168c4ea9 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -215,7 +215,8 @@ int main(int argc, char **argv) { } gpr_log(GPR_INFO, "creating server on: %s", addr); - cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); if (secure) { grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key, test_server1_cert}; @@ -244,8 +245,8 @@ int main(int argc, char **argv) { if (got_sigint && !shutdown_started) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK, + GRPC_CQ_NON_POLLING, NULL); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); GPR_ASSERT( @@ -258,8 +259,9 @@ int main(int argc, char **argv) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); s = ev.tag; switch (ev.type) { diff --git a/test/core/handshake/client_ssl.c b/test/core/handshake/client_ssl.c index 72e8ffe02a..5ebbc42609 100644 --- a/test/core/handshake/client_ssl.c +++ b/test/core/handshake/client_ssl.c @@ -290,7 +290,7 @@ static bool client_ssl_test(char *server_alpn_preferred) { int retries = 10; grpc_connectivity_state state = GRPC_CHANNEL_IDLE; grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); while (state != GRPC_CHANNEL_READY && retries-- > 0) { grpc_channel_watch_connectivity_state( diff --git a/test/core/handshake/server_ssl.c b/test/core/handshake/server_ssl.c index f61ad786bc..6ac22eaae5 100644 --- a/test/core/handshake/server_ssl.c +++ b/test/core/handshake/server_ssl.c @@ -105,7 +105,7 @@ static void server_thread(void *arg) { free(addr); grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_server_register_completion_queue(server, cq, NULL); grpc_server_start(server); diff --git a/test/core/memory_usage/client.c b/test/core/memory_usage/client.c index ef18ac03e8..b2bc269136 100644 --- a/test/core/memory_usage/client.c +++ b/test/core/memory_usage/client.c @@ -222,7 +222,8 @@ int main(int argc, char **argv) { calls[k].details = grpc_empty_slice(); } - cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); struct grpc_memory_counters client_channel_start = grpc_memory_counters_snapshot(); @@ -260,8 +261,9 @@ int main(int argc, char **argv) { do { event = grpc_completion_queue_next( - cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(10000, GPR_TIMESPAN)), + cq, + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(10000, GPR_TIMESPAN)), NULL); } while (event.type != GRPC_QUEUE_TIMEOUT); diff --git a/test/core/memory_usage/server.c b/test/core/memory_usage/server.c index 6b61ecabba..9f4c7fd22c 100644 --- a/test/core/memory_usage/server.c +++ b/test/core/memory_usage/server.c @@ -189,7 +189,8 @@ int main(int argc, char **argv) { } gpr_log(GPR_INFO, "creating server on: %s", addr); - cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); struct grpc_memory_counters before_server_create = grpc_memory_counters_snapshot(); @@ -232,8 +233,8 @@ int main(int argc, char **argv) { if (got_sigint && !shutdown_started) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK, + GRPC_CQ_NON_POLLING, NULL); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); GPR_ASSERT( grpc_completion_queue_pluck(shutdown_cq, tag(1000), @@ -244,8 +245,9 @@ int main(int argc, char **argv) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); fling_call *s = ev.tag; switch (ev.type) { diff --git a/test/core/surface/alarm_test.c b/test/core/surface/alarm_test.c index 7419d388a3..2c555db5dd 100644 --- a/test/core/surface/alarm_test.c +++ b/test/core/surface/alarm_test.c @@ -58,7 +58,8 @@ static void test_alarm(void) { grpc_completion_queue *cc; LOG_TEST("test_alarm"); - cc = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cc = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); { /* regular expiry */ grpc_event ev; diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index f76074f207..c90e72cde6 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -76,8 +76,8 @@ static void shutdown_and_destroy(grpc_completion_queue *cc) { /* ensure we can create and destroy a completion channel */ static void test_no_op(void) { grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK}; - grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, - NON_POLLING}; + grpc_cq_polling_type polling_types[] = { + GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; LOG_TEST("test_no_op"); for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) { @@ -90,7 +90,8 @@ static void test_no_op(void) { static void test_pollset_conversion(void) { grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK}; - grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING}; + grpc_cq_polling_type polling_types[] = {GRPC_CQ_DEFAULT_POLLING, + GRPC_CQ_NON_LISTENING}; grpc_completion_queue *cq; LOG_TEST("test_pollset_conversion"); @@ -106,8 +107,8 @@ static void test_pollset_conversion(void) { } static void test_wait_empty(void) { - grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, - NON_POLLING}; + grpc_cq_polling_type polling_types[] = { + GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue *cc; grpc_event event; @@ -128,8 +129,8 @@ static void test_cq_end_op(void) { grpc_event ev; grpc_completion_queue *cc; grpc_cq_completion completion; - grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, - NON_POLLING}; + grpc_cq_polling_type polling_types[] = { + GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx; @@ -156,8 +157,8 @@ static void test_cq_end_op(void) { } static void test_shutdown_then_next_polling(void) { - grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, - NON_POLLING}; + grpc_cq_polling_type polling_types[] = { + GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue *cc; grpc_event event; LOG_TEST("test_shutdown_then_next_polling"); @@ -173,8 +174,8 @@ static void test_shutdown_then_next_polling(void) { } static void test_shutdown_then_next_with_timeout(void) { - grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, - NON_POLLING}; + grpc_cq_polling_type polling_types[] = { + GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue *cc; grpc_event event; LOG_TEST("test_shutdown_then_next_with_timeout"); @@ -195,8 +196,8 @@ static void test_pluck(void) { grpc_completion_queue *cc; void *tags[128]; grpc_cq_completion completions[GPR_ARRAY_SIZE(tags)]; - grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, - NON_POLLING}; + grpc_cq_polling_type polling_types[] = { + GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx; unsigned i, j; @@ -244,8 +245,8 @@ static void test_pluck(void) { } static void test_pluck_after_shutdown(void) { - grpc_cq_polling_type polling_types[] = {DEFAULT_POLLING, NON_LISTENING, - NON_POLLING}; + grpc_cq_polling_type polling_types[] = { + GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_event ev; grpc_completion_queue *cc; diff --git a/test/core/surface/completion_queue_threading_test.c b/test/core/surface/completion_queue_threading_test.c index b101cd13f7..6a23aee537 100644 --- a/test/core/surface/completion_queue_threading_test.c +++ b/test/core/surface/completion_queue_threading_test.c @@ -101,7 +101,8 @@ static void test_too_many_plucks(void) { LOG_TEST("test_too_many_plucks"); - cc = grpc_completion_queue_create(GRPC_CQ_PLUCK, DEFAULT_POLLING, NULL); + cc = grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, + NULL); gpr_thd_options_set_joinable(&thread_options); for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -228,7 +229,7 @@ static void test_threading(size_t producers, size_t consumers) { gpr_event phase1 = GPR_EVENT_INIT; gpr_event phase2 = GPR_EVENT_INIT; grpc_completion_queue *cc = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); size_t i; size_t total_consumed = 0; static int optid = 101; diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c index 3758b86fab..69f00f4d48 100644 --- a/test/core/surface/concurrent_connectivity_test.c +++ b/test/core/surface/concurrent_connectivity_test.c @@ -66,8 +66,8 @@ static int detag(void *p) { return (int)(uintptr_t)p; } void create_loop_destroy(void *addr) { for (int i = 0; i < NUM_OUTER_LOOPS; ++i) { - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create( + GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_channel *chan = grpc_insecure_channel_create((char *)addr, NULL, NULL); for (int j = 0; j < NUM_INNER_LOOPS; ++j) { @@ -196,7 +196,8 @@ int main(int argc, char **argv) { gpr_asprintf(&args.addr, "localhost:%d", port); args.server = grpc_server_create(NULL, NULL); grpc_server_add_insecure_http2_port(args.server, args.addr); - args.cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + args.cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_server_register_completion_queue(args.server, args.cq, NULL); grpc_server_start(args.server); gpr_thd_new(&server, server_thread, &args, &options); diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c index 0cb183a4f0..6531e5eb18 100644 --- a/test/core/surface/lame_client_test.c +++ b/test/core/surface/lame_client_test.c @@ -108,7 +108,8 @@ int main(int argc, char **argv) { GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN == grpc_channel_check_connectivity_state(chan, 0)); - cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_slice host = grpc_slice_from_static_string("anywhere"); call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, diff --git a/test/core/surface/sequential_connectivity_test.c b/test/core/surface/sequential_connectivity_test.c index 37678a40d9..1880c0b859 100644 --- a/test/core/surface/sequential_connectivity_test.c +++ b/test/core/surface/sequential_connectivity_test.c @@ -77,7 +77,7 @@ static void run_test(const test_fixture *fixture) { grpc_server *server = grpc_server_create(NULL, NULL); fixture->add_server_port(server, addr); grpc_completion_queue *server_cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_server_register_completion_queue(server, server_cq, NULL); grpc_server_start(server); @@ -88,7 +88,7 @@ static void run_test(const test_fixture *fixture) { gpr_thd_new(&server_thread, server_thread_func, &sta, &thdopt); grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_channel *channels[NUM_CONNECTIONS]; for (size_t i = 0; i < NUM_CONNECTIONS; i++) { channels[i] = fixture->create_channel(addr); diff --git a/test/core/surface/server_chttp2_test.c b/test/core/surface/server_chttp2_test.c index 9fac63418f..47e8eeab1e 100644 --- a/test/core/surface/server_chttp2_test.c +++ b/test/core/surface/server_chttp2_test.c @@ -61,7 +61,7 @@ void test_add_same_port_twice() { int port = grpc_pick_unused_port_or_die(); char *addr = NULL; grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); grpc_server *server = grpc_server_create(&args, NULL); grpc_server_credentials *fake_creds = grpc_fake_transport_security_server_credentials_create(); diff --git a/test/core/surface/server_test.c b/test/core/surface/server_test.c index aa54794d14..e488966b93 100644 --- a/test/core/surface/server_test.c +++ b/test/core/surface/server_test.c @@ -71,7 +71,7 @@ void test_register_method_fail(void) { void test_request_call_on_no_server_cq(void) { grpc_completion_queue *cc = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_server *server = grpc_server_create(NULL, NULL); GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE == grpc_server_request_call(server, NULL, NULL, NULL, cc, cc, NULL)); @@ -93,7 +93,7 @@ void test_bind_server_twice(void) { grpc_server *server1 = grpc_server_create(&args, NULL); grpc_server *server2 = grpc_server_create(&args, NULL); grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); int port = grpc_pick_unused_port_or_die(); gpr_asprintf(&addr, "[::]:%d", port); grpc_server_register_completion_queue(server1, cq, NULL); @@ -131,7 +131,7 @@ void test_bind_server_to_addr(const char *host, bool secure) { GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr)); } grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); grpc_server_register_completion_queue(server, cq, NULL); grpc_server_start(server); grpc_server_shutdown_and_notify(server, cq, NULL); diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index 7fd31a2dbf..71370ad3b4 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -354,8 +354,9 @@ static void start_backend_server(server_fixture *sf) { } GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); const string expected_token = - strlen(sf->lb_token_prefix) == 0 ? "" : sf->lb_token_prefix + - std::to_string(sf->port); + strlen(sf->lb_token_prefix) == 0 + ? "" + : sf->lb_token_prefix + std::to_string(sf->port); GPR_ASSERT(contains_metadata(&request_metadata_recv, "lb-token", expected_token.c_str())); @@ -593,7 +594,8 @@ static void setup_client(const server_fixture *lb_server, grpc_channel_args_copy_and_add(NULL, &expected_target_arg, 1); gpr_free(expected_target_names); - cf->cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + cf->cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); cf->server_uri = lb_uri; grpc_channel_credentials *fake_creds = grpc_fake_transport_security_credentials_create(); @@ -616,7 +618,8 @@ static void teardown_client(client_fixture *cf) { static void setup_server(const char *host, server_fixture *sf) { int assigned_port; - sf->cq = grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + sf->cq = + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); const char *colon_idx = strchr(host, ':'); if (colon_idx) { const char *port_str = colon_idx + 1; @@ -645,7 +648,7 @@ static void teardown_server(server_fixture *sf) { gpr_log(GPR_INFO, "Server[%s] shutting down", sf->servers_hostport); grpc_completion_queue *shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, NON_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); grpc_server_shutdown_and_notify(sf->server, shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), grpc_timeout_seconds_to_deadline(5), diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc index 21e3374f91..b8aa87dfb3 100644 --- a/test/cpp/microbenchmarks/bm_call_create.cc +++ b/test/cpp/microbenchmarks/bm_call_create.cc @@ -91,7 +91,7 @@ template static void BM_CallCreateDestroy(benchmark::State &state) { Fixture fixture; grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); void *method_hdl = grpc_channel_register_call(fixture.channel(), "/foo/bar", NULL, NULL); diff --git a/test/cpp/microbenchmarks/bm_cq.cc b/test/cpp/microbenchmarks/bm_cq.cc index c7bd8743a5..6fda0081ae 100644 --- a/test/cpp/microbenchmarks/bm_cq.cc +++ b/test/cpp/microbenchmarks/bm_cq.cc @@ -68,8 +68,8 @@ static void BM_CreateDestroyCore(benchmark::State& state) { while (state.KeepRunning()) { // TODO: sreek Make this a templatized benchmark and pass completion type // and polling type as parameters - grpc_completion_queue_destroy( - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL)); + grpc_completion_queue_destroy(grpc_completion_queue_create( + GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL)); } } BENCHMARK(BM_CreateDestroyCore); @@ -104,7 +104,7 @@ static void BM_Pass1Core(benchmark::State& state) { // TODO: sreek Make this templatized benchmark and pass polling_type as a // param grpc_completion_queue* cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { grpc_cq_completion completion; @@ -122,8 +122,8 @@ BENCHMARK(BM_Pass1Core); static void BM_Pluck1Core(benchmark::State& state) { // TODO: sreek Make this templatized benchmark and pass polling_type as a // param - grpc_completion_queue* cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, DEFAULT_POLLING, NULL); + grpc_completion_queue* cq = grpc_completion_queue_create( + GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, NULL); gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { grpc_cq_completion completion; @@ -142,7 +142,7 @@ static void BM_EmptyCore(benchmark::State& state) { // TODO: sreek Make this a templatized benchmark and pass polling_type as a // param grpc_completion_queue* cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, DEFAULT_POLLING, NULL); + grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); gpr_timespec deadline = gpr_inf_past(GPR_CLOCK_MONOTONIC); while (state.KeepRunning()) { grpc_completion_queue_next(cq, deadline, NULL); -- cgit v1.2.3 From 752be9ceeba1e3958229b2ab0a9d59c072eebb7c Mon Sep 17 00:00:00 2001 From: Sree Kuchibhotla Date: Fri, 3 Mar 2017 14:36:02 -0800 Subject: clang format code --- src/core/lib/surface/completion_queue.c | 10 ++++------ src/core/lib/surface/server.c | 10 ++++------ test/core/bad_ssl/server_common.c | 5 ++--- test/core/end2end/fixtures/h2_census.c | 7 +++---- test/core/end2end/fixtures/h2_compress.c | 7 +++---- test/core/end2end/fixtures/h2_full+trace.c | 7 +++---- test/core/end2end/fixtures/h2_full.c | 7 +++---- test/core/end2end/fixtures/h2_proxy.c | 9 ++++----- test/core/end2end/fixtures/h2_ssl_cert.c | 20 +++++++++----------- test/core/end2end/fixtures/h2_uds.c | 7 +++---- test/core/end2end/fuzzers/api_fuzzer.c | 25 ++++++++++--------------- test/core/end2end/tests/call_creds.c | 5 +++-- test/core/fling/server.c | 5 ++--- test/core/memory_usage/client.c | 5 ++--- test/core/memory_usage/server.c | 5 ++--- test/cpp/grpclb/grpclb_test.cc | 5 ++--- 16 files changed, 59 insertions(+), 80 deletions(-) (limited to 'test/core/end2end/fuzzers') diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c index ad9d7b20b0..e571733a20 100644 --- a/src/core/lib/surface/completion_queue.c +++ b/src/core/lib/surface/completion_queue.c @@ -381,9 +381,8 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc, "deadline=gpr_timespec { tv_sec: %" PRId64 ", tv_nsec: %d, clock_type: %d }, " "reserved=%p)", - 5, - (cc, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, - reserved)); + 5, (cc, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, + reserved)); GPR_ASSERT(!reserved); dump_pending_tags(cc); @@ -557,9 +556,8 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, "deadline=gpr_timespec { tv_sec: %" PRId64 ", tv_nsec: %d, clock_type: %d }, " "reserved=%p)", - 6, - (cc, tag, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, - reserved)); + 6, (cc, tag, deadline.tv_sec, deadline.tv_nsec, + (int)deadline.clock_type, reserved)); } GPR_ASSERT(!reserved); diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index 13f7321fac..7dd320a75b 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -1431,9 +1431,8 @@ grpc_call_error grpc_server_request_call( "grpc_server_request_call(" "server=%p, call=%p, details=%p, initial_metadata=%p, " "cq_bound_to_call=%p, cq_for_notification=%p, tag=%p)", - 7, - (server, call, details, initial_metadata, cq_bound_to_call, - cq_for_notification, tag)); + 7, (server, call, details, initial_metadata, cq_bound_to_call, + cq_for_notification, tag)); size_t cq_idx; for (cq_idx = 0; cq_idx < server->cq_count; cq_idx++) { if (server->cqs[cq_idx] == cq_for_notification) { @@ -1475,9 +1474,8 @@ grpc_call_error grpc_server_request_registered_call( "server=%p, rmp=%p, call=%p, deadline=%p, initial_metadata=%p, " "optional_payload=%p, cq_bound_to_call=%p, cq_for_notification=%p, " "tag=%p)", - 9, - (server, rmp, call, deadline, initial_metadata, optional_payload, - cq_bound_to_call, cq_for_notification, tag)); + 9, (server, rmp, call, deadline, initial_metadata, optional_payload, + cq_bound_to_call, cq_for_notification, tag)); size_t cq_idx; for (cq_idx = 0; cq_idx < server->cq_count; cq_idx++) { diff --git a/test/core/bad_ssl/server_common.c b/test/core/bad_ssl/server_common.c index b112ae4e78..1176c079b2 100644 --- a/test/core/bad_ssl/server_common.c +++ b/test/core/bad_ssl/server_common.c @@ -97,9 +97,8 @@ void bad_ssl_run(grpc_server *server) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, - gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); switch (ev.type) { case GRPC_OP_COMPLETE: diff --git a/test/core/end2end/fixtures/h2_census.c b/test/core/end2end/fixtures/h2_census.c index 1077e063b8..35a52fa9a9 100644 --- a/test/core/end2end/fixtures/h2_census.c +++ b/test/core/end2end/fixtures/h2_census.c @@ -122,10 +122,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack+census", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack+census", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_compress.c b/test/core/end2end/fixtures/h2_compress.c index a985faeb5a..e627007151 100644 --- a/test/core/end2end/fixtures/h2_compress.c +++ b/test/core/end2end/fixtures/h2_compress.c @@ -122,10 +122,9 @@ void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack_compression", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack_compression", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack_compression, chttp2_init_client_fullstack_compression, chttp2_init_server_fullstack_compression, diff --git a/test/core/end2end/fixtures/h2_full+trace.c b/test/core/end2end/fixtures/h2_full+trace.c index c24bacc42f..25a76ca266 100644 --- a/test/core/end2end/fixtures/h2_full+trace.c +++ b/test/core/end2end/fixtures/h2_full+trace.c @@ -105,10 +105,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_full.c b/test/core/end2end/fixtures/h2_full.c index 901a419f25..435d9dfd45 100644 --- a/test/core/end2end/fixtures/h2_full.c +++ b/test/core/end2end/fixtures/h2_full.c @@ -99,10 +99,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_proxy.c b/test/core/end2end/fixtures/h2_proxy.c index 5a64a10918..55eec11b81 100644 --- a/test/core/end2end/fixtures/h2_proxy.c +++ b/test/core/end2end/fixtures/h2_proxy.c @@ -116,11 +116,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack+proxy", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_REQUEST_PROXYING | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack+proxy", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_REQUEST_PROXYING | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_ssl_cert.c b/test/core/end2end/fixtures/h2_ssl_cert.c index c3d25ac836..cf3bc45741 100644 --- a/test/core/end2end/fixtures/h2_ssl_cert.c +++ b/test/core/end2end/fixtures/h2_ssl_cert.c @@ -206,17 +206,15 @@ CLIENT_INIT(BAD_CERT_PAIR) typedef enum { SUCCESS, FAIL } test_result; -#define SSL_TEST(request_type, cert_type, result) \ - { \ - {TEST_NAME(request_type, cert_type, result), \ - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | \ - FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \ - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL, \ - chttp2_create_fixture_secure_fullstack, \ - CLIENT_INIT_NAME(cert_type), \ - SERVER_INIT_NAME(request_type), \ - chttp2_tear_down_secure_fullstack}, \ - result \ +#define SSL_TEST(request_type, cert_type, result) \ + { \ + {TEST_NAME(request_type, cert_type, result), \ + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | \ + FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \ + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL, \ + chttp2_create_fixture_secure_fullstack, CLIENT_INIT_NAME(cert_type), \ + SERVER_INIT_NAME(request_type), chttp2_tear_down_secure_fullstack}, \ + result \ } /* All test configurations */ diff --git a/test/core/end2end/fixtures/h2_uds.c b/test/core/end2end/fixtures/h2_uds.c index 820c587bee..8f043566b1 100644 --- a/test/core/end2end/fixtures/h2_uds.c +++ b/test/core/end2end/fixtures/h2_uds.c @@ -104,10 +104,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack_uds", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index 278b6dbae0..88026d9815 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -314,9 +314,8 @@ static grpc_call_credentials *read_call_creds(input_stream *inp) { cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT; const char *access_token = read_cred_artifact(&ctx, inp, NULL, 0); grpc_call_credentials *out = - access_token == NULL - ? NULL - : grpc_access_token_credentials_create(access_token, NULL); + access_token == NULL ? NULL : grpc_access_token_credentials_create( + access_token, NULL); cred_artifact_ctx_finish(&ctx); return out; } @@ -410,9 +409,8 @@ void my_resolve_address(grpc_exec_ctx *exec_ctx, const char *addr, r->on_done = on_done; r->addrs = addresses; grpc_timer_init( - exec_ctx, &r->timer, - gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_seconds(1, GPR_TIMESPAN)), + exec_ctx, &r->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_seconds(1, GPR_TIMESPAN)), grpc_closure_create(finish_resolve, r, grpc_schedule_on_exec_ctx), gpr_now(GPR_CLOCK_MONOTONIC)); } @@ -473,9 +471,8 @@ static void sched_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure, fc->ep = ep; fc->deadline = deadline; grpc_timer_init( - exec_ctx, &fc->timer, - gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_millis(1, GPR_TIMESPAN)), + exec_ctx, &fc->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_millis(1, GPR_TIMESPAN)), grpc_closure_create(do_connect, fc, grpc_schedule_on_exec_ctx), gpr_now(GPR_CLOCK_MONOTONIC)); } @@ -752,9 +749,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (g_server != NULL) { if (!server_shutdown) { grpc_server_shutdown_and_notify( - g_server, cq, - create_validator(assert_success_and_decrement, - &pending_server_shutdowns)); + g_server, cq, create_validator(assert_success_and_decrement, + &pending_server_shutdowns)); server_shutdown = true; pending_server_shutdowns++; } else if (pending_server_shutdowns == 0) { @@ -859,9 +855,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { case 5: { if (g_server != NULL) { grpc_server_shutdown_and_notify( - g_server, cq, - create_validator(assert_success_and_decrement, - &pending_server_shutdowns)); + g_server, cq, create_validator(assert_success_and_decrement, + &pending_server_shutdowns)); pending_server_shutdowns++; server_shutdown = true; } else { diff --git a/test/core/end2end/tests/call_creds.c b/test/core/end2end/tests/call_creds.c index 2a9269345e..52e7a2a7e4 100644 --- a/test/core/end2end/tests/call_creds.c +++ b/test/core/end2end/tests/call_creds.c @@ -91,8 +91,9 @@ static void drain_cq(grpc_completion_queue *cq) { static void shutdown_server(grpc_end2end_test_fixture *f) { if (!f->server) return; grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000)); - GPR_ASSERT(grpc_completion_queue_pluck( - f->shutdown_cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) + GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000), + grpc_timeout_seconds_to_deadline(5), + NULL) .type == GRPC_OP_COMPLETE); grpc_server_destroy(f->server); f->server = NULL; diff --git a/test/core/fling/server.c b/test/core/fling/server.c index 02168c4ea9..4a47fe4cf5 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -259,9 +259,8 @@ int main(int argc, char **argv) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, - gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); s = ev.tag; switch (ev.type) { diff --git a/test/core/memory_usage/client.c b/test/core/memory_usage/client.c index b2bc269136..d3eb5ac7c2 100644 --- a/test/core/memory_usage/client.c +++ b/test/core/memory_usage/client.c @@ -261,9 +261,8 @@ int main(int argc, char **argv) { do { event = grpc_completion_queue_next( - cq, - gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(10000, GPR_TIMESPAN)), + cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(10000, GPR_TIMESPAN)), NULL); } while (event.type != GRPC_QUEUE_TIMEOUT); diff --git a/test/core/memory_usage/server.c b/test/core/memory_usage/server.c index 9f4c7fd22c..437b5473df 100644 --- a/test/core/memory_usage/server.c +++ b/test/core/memory_usage/server.c @@ -245,9 +245,8 @@ int main(int argc, char **argv) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, - gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); fling_call *s = ev.tag; switch (ev.type) { diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index 71370ad3b4..c9c569cfbe 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -354,9 +354,8 @@ static void start_backend_server(server_fixture *sf) { } GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); const string expected_token = - strlen(sf->lb_token_prefix) == 0 - ? "" - : sf->lb_token_prefix + std::to_string(sf->port); + strlen(sf->lb_token_prefix) == 0 ? "" : sf->lb_token_prefix + + std::to_string(sf->port); GPR_ASSERT(contains_metadata(&request_metadata_recv, "lb-token", expected_token.c_str())); -- cgit v1.2.3 From b5b6bfd89b642c6a3de305b985d736fd2bd93bab Mon Sep 17 00:00:00 2001 From: Sree Kuchibhotla Date: Wed, 22 Mar 2017 02:32:01 -0700 Subject: Updates C Core --- include/grpc/grpc.h | 2 +- src/core/lib/surface/completion_queue_factory.c | 4 +- test/core/bad_client/bad_client.c | 6 +-- test/core/bad_ssl/bad_ssl_test.c | 3 +- test/core/bad_ssl/server_common.c | 11 ++--- test/core/client_channel/lb_policies_test.c | 12 ++--- .../set_initial_connect_string_test.c | 3 +- test/core/end2end/bad_server_response_test.c | 3 +- test/core/end2end/connection_refused_test.c | 3 +- test/core/end2end/dualstack_socket_test.c | 6 +-- test/core/end2end/fixtures/h2_census.c | 13 +++-- test/core/end2end/fixtures/h2_compress.c | 13 +++-- test/core/end2end/fixtures/h2_fakesec.c | 6 +-- test/core/end2end/fixtures/h2_fd.c | 6 +-- test/core/end2end/fixtures/h2_full+pipe.c | 13 +++-- test/core/end2end/fixtures/h2_full+trace.c | 13 +++-- test/core/end2end/fixtures/h2_full.c | 13 +++-- test/core/end2end/fixtures/h2_http_proxy.c | 13 +++-- test/core/end2end/fixtures/h2_load_reporting.c | 6 +-- test/core/end2end/fixtures/h2_oauth2.c | 6 +-- test/core/end2end/fixtures/h2_proxy.c | 15 +++--- test/core/end2end/fixtures/h2_sockpair+trace.c | 6 +-- test/core/end2end/fixtures/h2_sockpair.c | 6 +-- test/core/end2end/fixtures/h2_sockpair_1byte.c | 6 +-- test/core/end2end/fixtures/h2_ssl.c | 6 +-- test/core/end2end/fixtures/h2_ssl_cert.c | 26 +++++----- test/core/end2end/fixtures/h2_ssl_proxy.c | 6 +-- test/core/end2end/fixtures/h2_uds.c | 13 +++-- test/core/end2end/fixtures/proxy.c | 3 +- test/core/end2end/fuzzers/api_fuzzer.c | 28 ++++++----- test/core/end2end/fuzzers/client_fuzzer.c | 3 +- test/core/end2end/fuzzers/server_fuzzer.c | 3 +- test/core/end2end/goaway_server_test.c | 3 +- test/core/end2end/invalid_call_argument_test.c | 6 +-- test/core/end2end/multiple_server_queues_test.c | 20 ++++++-- test/core/end2end/no_server_test.c | 3 +- test/core/fling/client.c | 3 +- test/core/fling/server.c | 11 ++--- test/core/handshake/client_ssl.c | 3 +- test/core/handshake/server_ssl.c | 3 +- test/core/memory_usage/client.c | 8 ++-- test/core/memory_usage/server.c | 11 ++--- test/core/surface/alarm_test.c | 3 +- test/core/surface/completion_queue_test.c | 55 ++++++++++++++++++---- .../core/surface/completion_queue_threading_test.c | 6 +-- test/core/surface/concurrent_connectivity_test.c | 6 +-- test/core/surface/lame_client_test.c | 3 +- test/core/surface/sequential_connectivity_test.c | 5 +- test/core/surface/server_chttp2_test.c | 3 +- test/core/surface/server_test.c | 9 ++-- 50 files changed, 214 insertions(+), 223 deletions(-) (limited to 'test/core/end2end/fuzzers') diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h index bddb0c77ec..d2c18795ea 100644 --- a/include/grpc/grpc.h +++ b/include/grpc/grpc.h @@ -134,7 +134,7 @@ typedef struct grpc_completion_queue_attributes { structure in future. */ int version; /* Set to GRPC_CQ_CURRENT_VERSION */ - grpc_cq_completion_type cq_type; + grpc_cq_completion_type cq_completion_type; grpc_cq_polling_type cq_polling_type; } grpc_completion_queue_attributes; diff --git a/src/core/lib/surface/completion_queue_factory.c b/src/core/lib/surface/completion_queue_factory.c index 0d789e0f2f..d68b84eddd 100644 --- a/src/core/lib/surface/completion_queue_factory.c +++ b/src/core/lib/surface/completion_queue_factory.c @@ -43,7 +43,7 @@ static grpc_completion_queue* default_create( const grpc_completion_queue_factory* factory, const grpc_completion_queue_attributes* attr) { - return grpc_completion_queue_create_internal(attr->cq_type, + return grpc_completion_queue_create_internal(attr->cq_completion_type, attr->cq_polling_type); } @@ -79,7 +79,7 @@ grpc_completion_queue* grpc_completion_queue_create_for_next(void* reserved) { grpc_completion_queue* grpc_completion_queue_create_for_pluck(void* reserved) { GPR_ASSERT(!reserved); - grpc_completion_queue_attributes attr = {1, GRPC_CQ_NEXT, + grpc_completion_queue_attributes attr = {1, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING}; return g_default_cq_factory.vtable->create(&g_default_cq_factory, &attr); } diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c index 2ecb75883b..cf3d9f6c6a 100644 --- a/test/core/bad_client/bad_client.c +++ b/test/core/bad_client/bad_client.c @@ -125,8 +125,7 @@ void grpc_run_bad_client_test( /* Create server, completion events */ a.server = grpc_server_create(NULL, NULL); - a.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + a.cq = grpc_completion_queue_create_for_next(NULL); gpr_event_init(&a.done_thd); gpr_event_init(&a.done_write); a.validator = server_validator; @@ -198,8 +197,7 @@ void grpc_run_bad_client_test( grpc_exec_ctx_finish(&exec_ctx); } - shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); grpc_server_shutdown_and_notify(a.server, shutdown_cq, NULL); GPR_ASSERT(grpc_completion_queue_pluck( shutdown_cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL) diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c index e0f1d2789f..b961ffacd7 100644 --- a/test/core/bad_ssl/bad_ssl_test.c +++ b/test/core/bad_ssl/bad_ssl_test.c @@ -61,8 +61,7 @@ static void run_test(const char *target, size_t nops) { grpc_status_code status; grpc_call_error error; gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); cq_verifier *cqv = cq_verifier_create(cq); grpc_op ops[6]; diff --git a/test/core/bad_ssl/server_common.c b/test/core/bad_ssl/server_common.c index 1176c079b2..67404711cd 100644 --- a/test/core/bad_ssl/server_common.c +++ b/test/core/bad_ssl/server_common.c @@ -67,8 +67,7 @@ void bad_ssl_run(grpc_server *server) { grpc_call_details call_details; grpc_metadata_array request_metadata_recv; - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); grpc_completion_queue *shutdown_cq; grpc_call_details_init(&call_details); @@ -85,8 +84,7 @@ void bad_ssl_run(grpc_server *server) { while (!shutdown_finished) { if (got_sigint && !shutdown_started) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK, - GRPC_CQ_NON_POLLING, NULL); + shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); grpc_server_shutdown_and_notify(server, shutdown_cq, NULL); GPR_ASSERT( grpc_completion_queue_pluck(shutdown_cq, NULL, @@ -97,8 +95,9 @@ void bad_ssl_run(grpc_server *server) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); switch (ev.type) { case GRPC_OP_COMPLETE: diff --git a/test/core/client_channel/lb_policies_test.c b/test/core/client_channel/lb_policies_test.c index f440e3348c..433f77db82 100644 --- a/test/core/client_channel/lb_policies_test.c +++ b/test/core/client_channel/lb_policies_test.c @@ -65,9 +65,9 @@ typedef struct servers_fixture { } servers_fixture; typedef struct request_sequences { - size_t n; /* number of iterations */ - int *connections; /* indexed by the interation number, value is the index of - the server it connected to or -1 if none */ + size_t n; /* number of iterations */ + int *connections; /* indexed by the interation number, value is the index of + the server it connected to or -1 if none */ int *connectivity_states; /* indexed by the interation number, value is the client connectivity state */ } request_sequences; @@ -197,10 +197,8 @@ static servers_fixture *setup_servers(const char *server_host, /* Create servers. */ f->servers = gpr_malloc(sizeof(grpc_server *) * num_servers); f->servers_hostports = gpr_malloc(sizeof(char *) * num_servers); - f->cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f->shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f->cq = grpc_completion_queue_create_for_next(NULL); + f->shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); for (i = 0; i < num_servers; i++) { grpc_metadata_array_init(&f->request_metadata_recv[i]); gpr_join_host_port(&f->servers_hostports[i], server_host, diff --git a/test/core/client_channel/set_initial_connect_string_test.c b/test/core/client_channel/set_initial_connect_string_test.c index 999c89bdbd..7f38418ea7 100644 --- a/test/core/client_channel/set_initial_connect_string_test.c +++ b/test/core/client_channel/set_initial_connect_string_test.c @@ -130,8 +130,7 @@ static gpr_timespec n_sec_deadline(int seconds) { } static void start_rpc(int use_creds, int target_port) { - state.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + state.cq = grpc_completion_queue_create_for_next(NULL); if (use_creds) { state.creds = grpc_fake_transport_security_credentials_create(); } else { diff --git a/test/core/end2end/bad_server_response_test.c b/test/core/end2end/bad_server_response_test.c index e4dc3831dc..96052ed7fd 100644 --- a/test/core/end2end/bad_server_response_test.c +++ b/test/core/end2end/bad_server_response_test.c @@ -178,8 +178,7 @@ static void start_rpc(int target_port, grpc_status_code expected_status, cq_verifier *cqv; grpc_slice details; - state.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + state.cq = grpc_completion_queue_create_for_next(NULL); cqv = cq_verifier_create(state.cq); gpr_join_host_port(&state.target, "127.0.0.1", target_port); state.channel = grpc_insecure_channel_create(state.target, NULL, NULL); diff --git a/test/core/end2end/connection_refused_test.c b/test/core/end2end/connection_refused_test.c index fe203ddf4d..4d9908fba6 100644 --- a/test/core/end2end/connection_refused_test.c +++ b/test/core/end2end/connection_refused_test.c @@ -69,8 +69,7 @@ static void run_test(bool wait_for_ready, bool use_service_config) { grpc_metadata_array_init(&trailing_metadata_recv); - cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cq = grpc_completion_queue_create_for_next(NULL); cqv = cq_verifier_create(cq); /* if using service config, create channel args */ diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index 19f947865a..c61ea6d260 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -108,8 +108,7 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_call_details_init(&call_details); /* Create server. */ - cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cq = grpc_completion_queue_create_for_next(NULL); server = grpc_server_create(NULL, NULL); grpc_server_register_completion_queue(server, cq, NULL); GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port( @@ -261,8 +260,7 @@ void test_connect(const char *server_host, const char *client_host, int port, grpc_channel_destroy(client); /* Destroy server. */ - shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), grpc_timeout_seconds_to_deadline(5), diff --git a/test/core/end2end/fixtures/h2_census.c b/test/core/end2end/fixtures/h2_census.c index 35a52fa9a9..1a754835f0 100644 --- a/test/core/end2end/fixtures/h2_census.c +++ b/test/core/end2end/fixtures/h2_census.c @@ -65,10 +65,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } @@ -122,9 +120,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack+census", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack+census", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_compress.c b/test/core/end2end/fixtures/h2_compress.c index e627007151..b73d6d787a 100644 --- a/test/core/end2end/fixtures/h2_compress.c +++ b/test/core/end2end/fixtures/h2_compress.c @@ -69,10 +69,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression( memset(&f, 0, sizeof(f)); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } @@ -122,9 +120,10 @@ void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack_compression", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack_compression", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack_compression, chttp2_init_client_fullstack_compression, chttp2_init_server_fullstack_compression, diff --git a/test/core/end2end/fixtures/h2_fakesec.c b/test/core/end2end/fixtures/h2_fakesec.c index 59ae3f0cb3..5969b110e6 100644 --- a/test/core/end2end/fixtures/h2_fakesec.c +++ b/test/core/end2end/fixtures/h2_fakesec.c @@ -60,10 +60,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_fd.c b/test/core/end2end/fixtures/h2_fd.c index b01b52c996..53888dbc5b 100644 --- a/test/core/end2end/fixtures/h2_fd.c +++ b/test/core/end2end/fixtures/h2_fd.c @@ -70,10 +70,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = fixture_data; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); create_sockets(fixture_data->fd_pair); diff --git a/test/core/end2end/fixtures/h2_full+pipe.c b/test/core/end2end/fixtures/h2_full+pipe.c index 6add99707f..927ca8ae01 100644 --- a/test/core/end2end/fixtures/h2_full+pipe.c +++ b/test/core/end2end/fixtures/h2_full+pipe.c @@ -70,10 +70,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } @@ -105,9 +103,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_full+trace.c b/test/core/end2end/fixtures/h2_full+trace.c index 25a76ca266..bb24f966c1 100644 --- a/test/core/end2end/fixtures/h2_full+trace.c +++ b/test/core/end2end/fixtures/h2_full+trace.c @@ -70,10 +70,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } @@ -105,9 +103,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_full.c b/test/core/end2end/fixtures/h2_full.c index 435d9dfd45..d8d4d95177 100644 --- a/test/core/end2end/fixtures/h2_full.c +++ b/test/core/end2end/fixtures/h2_full.c @@ -64,10 +64,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } @@ -99,9 +97,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_http_proxy.c b/test/core/end2end/fixtures/h2_http_proxy.c index 7f8f55f71f..451c55677f 100644 --- a/test/core/end2end/fixtures/h2_http_proxy.c +++ b/test/core/end2end/fixtures/h2_http_proxy.c @@ -69,10 +69,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( ffd->proxy = grpc_end2end_http_proxy_create(); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } @@ -110,9 +108,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_load_reporting.c b/test/core/end2end/fixtures/h2_load_reporting.c index 5b8721adbd..31f9a46562 100644 --- a/test/core/end2end/fixtures/h2_load_reporting.c +++ b/test/core/end2end/fixtures/h2_load_reporting.c @@ -67,10 +67,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_oauth2.c b/test/core/end2end/fixtures/h2_oauth2.c index 19920473ff..c94f1f6239 100644 --- a/test/core/end2end/fixtures/h2_oauth2.c +++ b/test/core/end2end/fixtures/h2_oauth2.c @@ -113,10 +113,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_proxy.c b/test/core/end2end/fixtures/h2_proxy.c index 55eec11b81..af7d277689 100644 --- a/test/core/end2end/fixtures/h2_proxy.c +++ b/test/core/end2end/fixtures/h2_proxy.c @@ -79,10 +79,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } @@ -116,10 +114,11 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack+proxy", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_REQUEST_PROXYING | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack+proxy", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_REQUEST_PROXYING | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.c index 069b880238..0528b5d308 100644 --- a/test/core/end2end/fixtures/h2_sockpair+trace.c +++ b/test/core/end2end/fixtures/h2_sockpair+trace.c @@ -94,10 +94,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture"); *sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 65536); diff --git a/test/core/end2end/fixtures/h2_sockpair.c b/test/core/end2end/fixtures/h2_sockpair.c index c19d485403..ca16de075b 100644 --- a/test/core/end2end/fixtures/h2_sockpair.c +++ b/test/core/end2end/fixtures/h2_sockpair.c @@ -88,10 +88,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture"); *sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 65536); diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c index 05883b5ef4..79b39aa915 100644 --- a/test/core/end2end/fixtures/h2_sockpair_1byte.c +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.c @@ -88,10 +88,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair( grpc_end2end_test_fixture f; memset(&f, 0, sizeof(f)); f.fixture_data = sfd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); grpc_resource_quota *resource_quota = grpc_resource_quota_create("fixture"); *sfd = grpc_iomgr_create_endpoint_pair("fixture", resource_quota, 1); diff --git a/test/core/end2end/fixtures/h2_ssl.c b/test/core/end2end/fixtures/h2_ssl.c index d704b97e1c..c6a1ca09f8 100644 --- a/test/core/end2end/fixtures/h2_ssl.c +++ b/test/core/end2end/fixtures/h2_ssl.c @@ -64,10 +64,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_ssl_cert.c b/test/core/end2end/fixtures/h2_ssl_cert.c index cf3bc45741..59a728307b 100644 --- a/test/core/end2end/fixtures/h2_ssl_cert.c +++ b/test/core/end2end/fixtures/h2_ssl_cert.c @@ -67,10 +67,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( gpr_join_host_port(&ffd->localaddr, "localhost", port); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } @@ -206,15 +204,17 @@ CLIENT_INIT(BAD_CERT_PAIR) typedef enum { SUCCESS, FAIL } test_result; -#define SSL_TEST(request_type, cert_type, result) \ - { \ - {TEST_NAME(request_type, cert_type, result), \ - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | \ - FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \ - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL, \ - chttp2_create_fixture_secure_fullstack, CLIENT_INIT_NAME(cert_type), \ - SERVER_INIT_NAME(request_type), chttp2_tear_down_secure_fullstack}, \ - result \ +#define SSL_TEST(request_type, cert_type, result) \ + { \ + {TEST_NAME(request_type, cert_type, result), \ + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | \ + FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \ + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL, \ + chttp2_create_fixture_secure_fullstack, \ + CLIENT_INIT_NAME(cert_type), \ + SERVER_INIT_NAME(request_type), \ + chttp2_tear_down_secure_fullstack}, \ + result \ } /* All test configurations */ diff --git a/test/core/end2end/fixtures/h2_ssl_proxy.c b/test/core/end2end/fixtures/h2_ssl_proxy.c index 61bcfebbbe..9a6c9f558f 100644 --- a/test/core/end2end/fixtures/h2_ssl_proxy.c +++ b/test/core/end2end/fixtures/h2_ssl_proxy.c @@ -100,10 +100,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack( ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } diff --git a/test/core/end2end/fixtures/h2_uds.c b/test/core/end2end/fixtures/h2_uds.c index 8f043566b1..89b4b5e64b 100644 --- a/test/core/end2end/fixtures/h2_uds.c +++ b/test/core/end2end/fixtures/h2_uds.c @@ -70,10 +70,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack( unique++); f.fixture_data = ffd; - f.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - f.shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + f.cq = grpc_completion_queue_create_for_next(NULL); + f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); return f; } @@ -104,9 +102,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack_uds", + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/proxy.c b/test/core/end2end/fixtures/proxy.c index 7d306c6032..b8b1e5c6c9 100644 --- a/test/core/end2end/fixtures/proxy.c +++ b/test/core/end2end/fixtures/proxy.c @@ -104,8 +104,7 @@ grpc_end2end_proxy *grpc_end2end_proxy_create(const grpc_end2end_proxy_def *def, gpr_log(GPR_DEBUG, "PROXY ADDR:%s BACKEND:%s", proxy->proxy_port, proxy->server_port); - proxy->cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + proxy->cq = grpc_completion_queue_create_for_next(NULL); proxy->server = def->create_server(proxy->proxy_port, server_args); proxy->client = def->create_client(proxy->server_port, client_args); diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index 88026d9815..afeaf73898 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -314,8 +314,9 @@ static grpc_call_credentials *read_call_creds(input_stream *inp) { cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT; const char *access_token = read_cred_artifact(&ctx, inp, NULL, 0); grpc_call_credentials *out = - access_token == NULL ? NULL : grpc_access_token_credentials_create( - access_token, NULL); + access_token == NULL + ? NULL + : grpc_access_token_credentials_create(access_token, NULL); cred_artifact_ctx_finish(&ctx); return out; } @@ -409,8 +410,9 @@ void my_resolve_address(grpc_exec_ctx *exec_ctx, const char *addr, r->on_done = on_done; r->addrs = addresses; grpc_timer_init( - exec_ctx, &r->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_seconds(1, GPR_TIMESPAN)), + exec_ctx, &r->timer, + gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_seconds(1, GPR_TIMESPAN)), grpc_closure_create(finish_resolve, r, grpc_schedule_on_exec_ctx), gpr_now(GPR_CLOCK_MONOTONIC)); } @@ -471,8 +473,9 @@ static void sched_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure, fc->ep = ep; fc->deadline = deadline; grpc_timer_init( - exec_ctx, &fc->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_millis(1, GPR_TIMESPAN)), + exec_ctx, &fc->timer, + gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_millis(1, GPR_TIMESPAN)), grpc_closure_create(do_connect, fc, grpc_schedule_on_exec_ctx), gpr_now(GPR_CLOCK_MONOTONIC)); } @@ -735,8 +738,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { g_active_call = new_call(NULL, ROOT); g_resource_quota = grpc_resource_quota_create("api_fuzzer"); - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); while (!is_eof(&inp) || g_channel != NULL || g_server != NULL || pending_channel_watches > 0 || pending_pings > 0 || @@ -749,8 +751,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (g_server != NULL) { if (!server_shutdown) { grpc_server_shutdown_and_notify( - g_server, cq, create_validator(assert_success_and_decrement, - &pending_server_shutdowns)); + g_server, cq, + create_validator(assert_success_and_decrement, + &pending_server_shutdowns)); server_shutdown = true; pending_server_shutdowns++; } else if (pending_server_shutdowns == 0) { @@ -855,8 +858,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { case 5: { if (g_server != NULL) { grpc_server_shutdown_and_notify( - g_server, cq, create_validator(assert_success_and_decrement, - &pending_server_shutdowns)); + g_server, cq, + create_validator(assert_success_and_decrement, + &pending_server_shutdowns)); pending_server_shutdowns++; server_shutdown = true; } else { diff --git a/test/core/end2end/fuzzers/client_fuzzer.c b/test/core/end2end/fuzzers/client_fuzzer.c index 46acf7d70a..bc322e45a3 100644 --- a/test/core/end2end/fuzzers/client_fuzzer.c +++ b/test/core/end2end/fuzzers/client_fuzzer.c @@ -65,8 +65,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_mock_endpoint_create(discard_write, resource_quota); grpc_resource_quota_unref_internal(&exec_ctx, resource_quota); - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); grpc_transport *transport = grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 1); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL); diff --git a/test/core/end2end/fuzzers/server_fuzzer.c b/test/core/end2end/fuzzers/server_fuzzer.c index 33c8ed4e72..97b436cdf9 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.c +++ b/test/core/end2end/fuzzers/server_fuzzer.c @@ -67,8 +67,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_slice_from_copied_buffer((const char *)data, size)); grpc_server *server = grpc_server_create(NULL, NULL); - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); grpc_server_register_completion_queue(server, cq, NULL); // TODO(ctiller): add registered methods (one for POST, one for PUT) // void *registered_method = diff --git a/test/core/end2end/goaway_server_test.c b/test/core/end2end/goaway_server_test.c index 92ea7a72ef..c394a032c0 100644 --- a/test/core/end2end/goaway_server_test.c +++ b/test/core/end2end/goaway_server_test.c @@ -121,8 +121,7 @@ int main(int argc, char **argv) { grpc_metadata_array_init(&request_metadata2); grpc_call_details_init(&request_details2); - cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cq = grpc_completion_queue_create_for_next(NULL); cqv = cq_verifier_create(cq); /* reserve two ports */ diff --git a/test/core/end2end/invalid_call_argument_test.c b/test/core/end2end/invalid_call_argument_test.c index 7aa8d98933..6890cfd0a8 100644 --- a/test/core/end2end/invalid_call_argument_test.c +++ b/test/core/end2end/invalid_call_argument_test.c @@ -73,8 +73,7 @@ static void prepare_test(int is_client) { grpc_metadata_array_init(&g_state.initial_metadata_recv); grpc_metadata_array_init(&g_state.trailing_metadata_recv); g_state.deadline = grpc_timeout_seconds_to_deadline(2); - g_state.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + g_state.cq = grpc_completion_queue_create_for_next(NULL); g_state.cqv = cq_verifier_create(g_state.cq); g_state.details = grpc_empty_slice(); memset(g_state.ops, 0, sizeof(g_state.ops)); @@ -133,8 +132,7 @@ static void cleanup_test() { grpc_metadata_array_destroy(&g_state.trailing_metadata_recv); if (!g_state.is_client) { - shutdown_cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); grpc_call_destroy(g_state.server_call); grpc_server_shutdown_and_notify(g_state.server, shutdown_cq, tag(1000)); GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000), diff --git a/test/core/end2end/multiple_server_queues_test.c b/test/core/end2end/multiple_server_queues_test.c index 7da5ee55ae..4696ecd813 100644 --- a/test/core/end2end/multiple_server_queues_test.c +++ b/test/core/end2end/multiple_server_queues_test.c @@ -38,14 +38,26 @@ int main(int argc, char **argv) { grpc_completion_queue *cq1; grpc_completion_queue *cq2; grpc_completion_queue *cq3; + grpc_completion_queue_attributes attr; + grpc_server *server; grpc_test_init(argc, argv); grpc_init(); - cq1 = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); - cq2 = grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_NON_LISTENING, NULL); - cq3 = grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_NON_POLLING, NULL); + + attr.version = 1; + attr.cq_completion_type = GRPC_CQ_NEXT; + attr.cq_polling_type = GRPC_CQ_DEFAULT_POLLING; + cq1 = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&attr), &attr, NULL); + + attr.cq_polling_type = GRPC_CQ_NON_LISTENING; + cq2 = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&attr), &attr, NULL); + + attr.cq_polling_type = GRPC_CQ_NON_POLLING; + cq3 = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&attr), &attr, NULL); server = grpc_server_create(NULL, NULL); grpc_server_register_completion_queue(server, cq1, NULL); diff --git a/test/core/end2end/no_server_test.c b/test/core/end2end/no_server_test.c index fd8a2f8a39..dd18b0c692 100644 --- a/test/core/end2end/no_server_test.c +++ b/test/core/end2end/no_server_test.c @@ -59,8 +59,7 @@ int main(int argc, char **argv) { grpc_metadata_array_init(&trailing_metadata_recv); - cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cq = grpc_completion_queue_create_for_next(NULL); cqv = cq_verifier_create(cq); /* create a call, channel to a non existant server */ diff --git a/test/core/fling/client.c b/test/core/fling/client.c index a9f6a3d516..ecb73cfbdb 100644 --- a/test/core/fling/client.c +++ b/test/core/fling/client.c @@ -208,8 +208,7 @@ int main(int argc, char **argv) { } channel = grpc_insecure_channel_create(target, NULL, NULL); - cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cq = grpc_completion_queue_create_for_next(NULL); the_buffer = grpc_raw_byte_buffer_create(&slice, (size_t)payload_size); histogram = gpr_histogram_create(0.01, 60e9); diff --git a/test/core/fling/server.c b/test/core/fling/server.c index 4a47fe4cf5..ebcb8f05f0 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -215,8 +215,7 @@ int main(int argc, char **argv) { } gpr_log(GPR_INFO, "creating server on: %s", addr); - cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cq = grpc_completion_queue_create_for_next(NULL); if (secure) { grpc_ssl_pem_key_cert_pair pem_key_cert_pair = {test_server1_key, test_server1_cert}; @@ -245,8 +244,7 @@ int main(int argc, char **argv) { if (got_sigint && !shutdown_started) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK, - GRPC_CQ_NON_POLLING, NULL); + shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); GPR_ASSERT( @@ -259,8 +257,9 @@ int main(int argc, char **argv) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); s = ev.tag; switch (ev.type) { diff --git a/test/core/handshake/client_ssl.c b/test/core/handshake/client_ssl.c index 5ebbc42609..16a1f47e8e 100644 --- a/test/core/handshake/client_ssl.c +++ b/test/core/handshake/client_ssl.c @@ -289,8 +289,7 @@ static bool client_ssl_test(char *server_alpn_preferred) { // completed and we know that the client's ALPN list satisfied the server. int retries = 10; grpc_connectivity_state state = GRPC_CHANNEL_IDLE; - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); while (state != GRPC_CHANNEL_READY && retries-- > 0) { grpc_channel_watch_connectivity_state( diff --git a/test/core/handshake/server_ssl.c b/test/core/handshake/server_ssl.c index 6ac22eaae5..2f93277417 100644 --- a/test/core/handshake/server_ssl.c +++ b/test/core/handshake/server_ssl.c @@ -104,8 +104,7 @@ static void server_thread(void *arg) { GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds)); free(addr); - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); grpc_server_register_completion_queue(server, cq, NULL); grpc_server_start(server); diff --git a/test/core/memory_usage/client.c b/test/core/memory_usage/client.c index 582ede48a8..4fb99217b6 100644 --- a/test/core/memory_usage/client.c +++ b/test/core/memory_usage/client.c @@ -223,8 +223,7 @@ int main(int argc, char **argv) { calls[k].details = grpc_empty_slice(); } - cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cq = grpc_completion_queue_create_for_next(NULL); struct grpc_memory_counters client_channel_start = grpc_memory_counters_snapshot(); @@ -262,8 +261,9 @@ int main(int argc, char **argv) { do { event = grpc_completion_queue_next( - cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(10000, GPR_TIMESPAN)), + cq, + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(10000, GPR_TIMESPAN)), NULL); } while (event.type != GRPC_QUEUE_TIMEOUT); diff --git a/test/core/memory_usage/server.c b/test/core/memory_usage/server.c index 437b5473df..94d90a58a6 100644 --- a/test/core/memory_usage/server.c +++ b/test/core/memory_usage/server.c @@ -189,8 +189,7 @@ int main(int argc, char **argv) { } gpr_log(GPR_INFO, "creating server on: %s", addr); - cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cq = grpc_completion_queue_create_for_next(NULL); struct grpc_memory_counters before_server_create = grpc_memory_counters_snapshot(); @@ -233,8 +232,7 @@ int main(int argc, char **argv) { if (got_sigint && !shutdown_started) { gpr_log(GPR_INFO, "Shutting down due to SIGINT"); - shutdown_cq = grpc_completion_queue_create(GRPC_CQ_PLUCK, - GRPC_CQ_NON_POLLING, NULL); + shutdown_cq = grpc_completion_queue_create_for_pluck(NULL); grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000)); GPR_ASSERT( grpc_completion_queue_pluck(shutdown_cq, tag(1000), @@ -245,8 +243,9 @@ int main(int argc, char **argv) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); fling_call *s = ev.tag; switch (ev.type) { diff --git a/test/core/surface/alarm_test.c b/test/core/surface/alarm_test.c index 2c555db5dd..6ea3444fe2 100644 --- a/test/core/surface/alarm_test.c +++ b/test/core/surface/alarm_test.c @@ -58,8 +58,7 @@ static void test_alarm(void) { grpc_completion_queue *cc; LOG_TEST("test_alarm"); - cc = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cc = grpc_completion_queue_create_for_next(NULL); { /* regular expiry */ grpc_event ev; diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index c90e72cde6..4489057b2f 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -78,12 +78,15 @@ static void test_no_op(void) { grpc_cq_completion_type completion_types[] = {GRPC_CQ_NEXT, GRPC_CQ_PLUCK}; grpc_cq_polling_type polling_types[] = { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; + grpc_completion_queue_attributes attr; LOG_TEST("test_no_op"); for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) { for (size_t j = 0; j < GPR_ARRAY_SIZE(polling_types); j++) { + attr.cq_completion_type = completion_types[i]; + attr.cq_polling_type = polling_types[j]; shutdown_and_destroy(grpc_completion_queue_create( - completion_types[i], polling_types[j], NULL)); + grpc_completion_queue_factory_lookup(&attr), &attr, NULL)); } } } @@ -93,13 +96,16 @@ static void test_pollset_conversion(void) { grpc_cq_polling_type polling_types[] = {GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING}; grpc_completion_queue *cq; + grpc_completion_queue_attributes attr; LOG_TEST("test_pollset_conversion"); for (size_t i = 0; i < GPR_ARRAY_SIZE(completion_types); i++) { for (size_t j = 0; j < GPR_ARRAY_SIZE(polling_types); j++) { - cq = grpc_completion_queue_create(completion_types[i], polling_types[j], - NULL); + attr.cq_completion_type = completion_types[i]; + attr.cq_polling_type = polling_types[j]; + cq = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&attr), &attr, NULL); GPR_ASSERT(grpc_cq_from_pollset(grpc_cq_pollset(cq)) == cq); shutdown_and_destroy(cq); } @@ -110,12 +116,17 @@ static void test_wait_empty(void) { grpc_cq_polling_type polling_types[] = { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue *cc; + grpc_completion_queue_attributes attr; grpc_event event; LOG_TEST("test_wait_empty"); + attr.cq_completion_type = GRPC_CQ_NEXT; + for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - cc = grpc_completion_queue_create(GRPC_CQ_NEXT, polling_types[i], NULL); + attr.cq_polling_type = polling_types[i]; + cc = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&attr), &attr, NULL); event = grpc_completion_queue_next(cc, gpr_now(GPR_CLOCK_REALTIME), NULL); GPR_ASSERT(event.type == GRPC_QUEUE_TIMEOUT); shutdown_and_destroy(cc); @@ -131,16 +142,20 @@ static void test_cq_end_op(void) { grpc_cq_completion completion; grpc_cq_polling_type polling_types[] = { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; - + grpc_completion_queue_attributes attr; grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx; void *tag = create_test_tag(); LOG_TEST("test_cq_end_op"); + attr.cq_completion_type = GRPC_CQ_NEXT; + for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { exec_ctx = init_exec_ctx; // Reset exec_ctx - cc = grpc_completion_queue_create(GRPC_CQ_NEXT, polling_types[i], NULL); + attr.cq_polling_type = polling_types[i]; + cc = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&attr), &attr, NULL); grpc_cq_begin_op(cc, tag); grpc_cq_end_op(&exec_ctx, cc, tag, GRPC_ERROR_NONE, @@ -160,11 +175,16 @@ static void test_shutdown_then_next_polling(void) { grpc_cq_polling_type polling_types[] = { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue *cc; + grpc_completion_queue_attributes attr; grpc_event event; LOG_TEST("test_shutdown_then_next_polling"); + attr.cq_completion_type = GRPC_CQ_NEXT; + for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - cc = grpc_completion_queue_create(GRPC_CQ_NEXT, polling_types[i], NULL); + attr.cq_polling_type = polling_types[i]; + cc = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&attr), &attr, NULL); grpc_completion_queue_shutdown(cc); event = grpc_completion_queue_next(cc, gpr_inf_past(GPR_CLOCK_REALTIME), NULL); @@ -177,11 +197,16 @@ static void test_shutdown_then_next_with_timeout(void) { grpc_cq_polling_type polling_types[] = { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_completion_queue *cc; + grpc_completion_queue_attributes attr; grpc_event event; LOG_TEST("test_shutdown_then_next_with_timeout"); + attr.cq_completion_type = GRPC_CQ_NEXT; + for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - cc = grpc_completion_queue_create(GRPC_CQ_NEXT, polling_types[i], NULL); + attr.cq_polling_type = polling_types[i]; + cc = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&attr), &attr, NULL); grpc_completion_queue_shutdown(cc); event = grpc_completion_queue_next(cc, gpr_inf_future(GPR_CLOCK_REALTIME), @@ -198,6 +223,7 @@ static void test_pluck(void) { grpc_cq_completion completions[GPR_ARRAY_SIZE(tags)]; grpc_cq_polling_type polling_types[] = { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; + grpc_completion_queue_attributes attr; grpc_exec_ctx init_exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx; unsigned i, j; @@ -211,9 +237,13 @@ static void test_pluck(void) { } } + attr.cq_completion_type = GRPC_CQ_PLUCK; + for (size_t pidx = 0; pidx < GPR_ARRAY_SIZE(polling_types); pidx++) { exec_ctx = init_exec_ctx; // reset exec_ctx - cc = grpc_completion_queue_create(GRPC_CQ_PLUCK, polling_types[pidx], NULL); + attr.cq_polling_type = polling_types[pidx]; + cc = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&attr), &attr, NULL); for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { grpc_cq_begin_op(cc, tags[i]); @@ -249,11 +279,16 @@ static void test_pluck_after_shutdown(void) { GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_POLLING}; grpc_event ev; grpc_completion_queue *cc; + grpc_completion_queue_attributes attr; LOG_TEST("test_pluck_after_shutdown"); + attr.cq_completion_type = GRPC_CQ_PLUCK; + for (size_t i = 0; i < GPR_ARRAY_SIZE(polling_types); i++) { - cc = grpc_completion_queue_create(GRPC_CQ_PLUCK, polling_types[i], NULL); + attr.cq_polling_type = polling_types[i]; + cc = grpc_completion_queue_create( + grpc_completion_queue_factory_lookup(&attr), &attr, NULL); grpc_completion_queue_shutdown(cc); ev = grpc_completion_queue_pluck(cc, NULL, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); diff --git a/test/core/surface/completion_queue_threading_test.c b/test/core/surface/completion_queue_threading_test.c index 6a23aee537..bff69ec74f 100644 --- a/test/core/surface/completion_queue_threading_test.c +++ b/test/core/surface/completion_queue_threading_test.c @@ -101,8 +101,7 @@ static void test_too_many_plucks(void) { LOG_TEST("test_too_many_plucks"); - cc = grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, - NULL); + cc = grpc_completion_queue_create_for_pluck(NULL); gpr_thd_options_set_joinable(&thread_options); for (i = 0; i < GPR_ARRAY_SIZE(tags); i++) { @@ -228,8 +227,7 @@ static void test_threading(size_t producers, size_t consumers) { gpr_malloc((producers + consumers) * sizeof(test_thread_options)); gpr_event phase1 = GPR_EVENT_INIT; gpr_event phase2 = GPR_EVENT_INIT; - grpc_completion_queue *cc = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cc = grpc_completion_queue_create_for_next(NULL); size_t i; size_t total_consumed = 0; static int optid = 101; diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c index 69f00f4d48..f9197fb8fc 100644 --- a/test/core/surface/concurrent_connectivity_test.c +++ b/test/core/surface/concurrent_connectivity_test.c @@ -66,8 +66,7 @@ static int detag(void *p) { return (int)(uintptr_t)p; } void create_loop_destroy(void *addr) { for (int i = 0; i < NUM_OUTER_LOOPS; ++i) { - grpc_completion_queue *cq = grpc_completion_queue_create( - GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); grpc_channel *chan = grpc_insecure_channel_create((char *)addr, NULL, NULL); for (int j = 0; j < NUM_INNER_LOOPS; ++j) { @@ -196,8 +195,7 @@ int main(int argc, char **argv) { gpr_asprintf(&args.addr, "localhost:%d", port); args.server = grpc_server_create(NULL, NULL); grpc_server_add_insecure_http2_port(args.server, args.addr); - args.cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + args.cq = grpc_completion_queue_create_for_next(NULL); grpc_server_register_completion_queue(args.server, args.cq, NULL); grpc_server_start(args.server); gpr_thd_new(&server, server_thread, &args, &options); diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c index 6531e5eb18..6c14a5dcdf 100644 --- a/test/core/surface/lame_client_test.c +++ b/test/core/surface/lame_client_test.c @@ -108,8 +108,7 @@ int main(int argc, char **argv) { GPR_ASSERT(GRPC_CHANNEL_SHUTDOWN == grpc_channel_check_connectivity_state(chan, 0)); - cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + cq = grpc_completion_queue_create_for_next(NULL); grpc_slice host = grpc_slice_from_static_string("anywhere"); call = grpc_channel_create_call(chan, NULL, GRPC_PROPAGATE_DEFAULTS, cq, diff --git a/test/core/surface/sequential_connectivity_test.c b/test/core/surface/sequential_connectivity_test.c index 1880c0b859..fbecdd7e38 100644 --- a/test/core/surface/sequential_connectivity_test.c +++ b/test/core/surface/sequential_connectivity_test.c @@ -77,7 +77,7 @@ static void run_test(const test_fixture *fixture) { grpc_server *server = grpc_server_create(NULL, NULL); fixture->add_server_port(server, addr); grpc_completion_queue *server_cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue_create_for_next(NULL); grpc_server_register_completion_queue(server, server_cq, NULL); grpc_server_start(server); @@ -87,8 +87,7 @@ static void run_test(const test_fixture *fixture) { gpr_thd_options_set_joinable(&thdopt); gpr_thd_new(&server_thread, server_thread_func, &sta, &thdopt); - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); grpc_channel *channels[NUM_CONNECTIONS]; for (size_t i = 0; i < NUM_CONNECTIONS; i++) { channels[i] = fixture->create_channel(addr); diff --git a/test/core/surface/server_chttp2_test.c b/test/core/surface/server_chttp2_test.c index 47e8eeab1e..0d4de0e28b 100644 --- a/test/core/surface/server_chttp2_test.c +++ b/test/core/surface/server_chttp2_test.c @@ -60,8 +60,7 @@ void test_add_same_port_twice() { int port = grpc_pick_unused_port_or_die(); char *addr = NULL; - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_PLUCK, GRPC_CQ_NON_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_pluck(NULL); grpc_server *server = grpc_server_create(&args, NULL); grpc_server_credentials *fake_creds = grpc_fake_transport_security_server_credentials_create(); diff --git a/test/core/surface/server_test.c b/test/core/surface/server_test.c index e488966b93..81a39de216 100644 --- a/test/core/surface/server_test.c +++ b/test/core/surface/server_test.c @@ -70,8 +70,7 @@ void test_register_method_fail(void) { } void test_request_call_on_no_server_cq(void) { - grpc_completion_queue *cc = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cc = grpc_completion_queue_create_for_next(NULL); grpc_server *server = grpc_server_create(NULL, NULL); GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE == grpc_server_request_call(server, NULL, NULL, NULL, cc, cc, NULL)); @@ -92,8 +91,7 @@ void test_bind_server_twice(void) { char *addr; grpc_server *server1 = grpc_server_create(&args, NULL); grpc_server *server2 = grpc_server_create(&args, NULL); - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); int port = grpc_pick_unused_port_or_die(); gpr_asprintf(&addr, "[::]:%d", port); grpc_server_register_completion_queue(server1, cq, NULL); @@ -130,8 +128,7 @@ void test_bind_server_to_addr(const char *host, bool secure) { } else { GPR_ASSERT(grpc_server_add_insecure_http2_port(server, addr)); } - grpc_completion_queue *cq = - grpc_completion_queue_create(GRPC_CQ_NEXT, GRPC_CQ_DEFAULT_POLLING, NULL); + grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL); grpc_server_register_completion_queue(server, cq, NULL); grpc_server_start(server); grpc_server_shutdown_and_notify(server, cq, NULL); -- cgit v1.2.3 From 5bec133ba03f8cdffc7e2ace03a06aa5b48aed5c Mon Sep 17 00:00:00 2001 From: Sree Kuchibhotla Date: Fri, 24 Mar 2017 10:03:22 -0700 Subject: clang format --- include/grpc++/impl/codegen/client_unary_call.h | 2 +- include/grpc++/impl/codegen/completion_queue.h | 5 ++--- include/grpc++/impl/codegen/sync_stream.h | 6 +++--- src/core/lib/surface/completion_queue.c | 10 ++++------ test/core/bad_ssl/server_common.c | 5 ++--- test/core/client_channel/lb_policies_test.c | 6 +++--- test/core/end2end/fixtures/h2_census.c | 7 +++---- test/core/end2end/fixtures/h2_compress.c | 7 +++---- test/core/end2end/fixtures/h2_full+pipe.c | 7 +++---- test/core/end2end/fixtures/h2_full+trace.c | 7 +++---- test/core/end2end/fixtures/h2_full.c | 7 +++---- test/core/end2end/fixtures/h2_http_proxy.c | 7 +++---- test/core/end2end/fixtures/h2_proxy.c | 9 ++++----- test/core/end2end/fixtures/h2_ssl_cert.c | 20 +++++++++----------- test/core/end2end/fixtures/h2_uds.c | 7 +++---- test/core/end2end/fuzzers/api_fuzzer.c | 25 ++++++++++--------------- test/core/fling/server.c | 5 ++--- test/core/memory_usage/client.c | 5 ++--- test/core/memory_usage/server.c | 5 ++--- test/cpp/grpclb/grpclb_test.cc | 5 ++--- 20 files changed, 67 insertions(+), 90 deletions(-) (limited to 'test/core/end2end/fuzzers') diff --git a/include/grpc++/impl/codegen/client_unary_call.h b/include/grpc++/impl/codegen/client_unary_call.h index 6218e3ed1b..a5a4f3d739 100644 --- a/include/grpc++/impl/codegen/client_unary_call.h +++ b/include/grpc++/impl/codegen/client_unary_call.h @@ -52,7 +52,7 @@ template Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, ClientContext* context, const InputMessage& request, OutputMessage* result) { - CompletionQueue cq(true); // Pluckable completion queue + CompletionQueue cq(true); // Pluckable completion queue Call call(channel->CreateCall(method, context, &cq)); CallOpSet, diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h index 0130e9ca0f..025eea3ef5 100644 --- a/include/grpc++/impl/codegen/completion_queue.h +++ b/include/grpc++/impl/codegen/completion_queue.h @@ -147,9 +147,8 @@ class CompletionQueue : private GrpcLibraryCodegen { /// /// \return true if read a regular event, false if the queue is shutting down. bool Next(void** tag, bool* ok) { - return (AsyncNextInternal(tag, ok, - g_core_codegen_interface->gpr_inf_future( - GPR_CLOCK_REALTIME)) != SHUTDOWN); + return (AsyncNextInternal(tag, ok, g_core_codegen_interface->gpr_inf_future( + GPR_CLOCK_REALTIME)) != SHUTDOWN); } /// Request the shutdown of the queue. diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h index 4e12f3261e..1ed290966c 100644 --- a/include/grpc++/impl/codegen/sync_stream.h +++ b/include/grpc++/impl/codegen/sync_stream.h @@ -138,7 +138,7 @@ class ClientReader final : public ClientReaderInterface { ClientReader(ChannelInterface* channel, const RpcMethod& method, ClientContext* context, const W& request) : context_(context), - cq_(true), // Pluckable cq + cq_(true), // Pluckable cq call_(channel->CreateCall(method, context, &cq_)) { CallOpSet @@ -212,7 +212,7 @@ class ClientWriter : public ClientWriterInterface { ClientWriter(ChannelInterface* channel, const RpcMethod& method, ClientContext* context, R* response) : context_(context), - cq_(true), // Pluckable cq + cq_(true), // Pluckable cq call_(channel->CreateCall(method, context, &cq_)) { finish_ops_.RecvMessage(response); finish_ops_.AllowNoMessage(); @@ -297,7 +297,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface { ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method, ClientContext* context) : context_(context), - cq_(true), // Pluckable cq + cq_(true), // Pluckable cq call_(channel->CreateCall(method, context, &cq_)) { CallOpSet ops; ops.SendInitialMetadata(context->send_initial_metadata_, diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c index 1e88e83449..aecc393edf 100644 --- a/src/core/lib/surface/completion_queue.c +++ b/src/core/lib/surface/completion_queue.c @@ -383,9 +383,8 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc, "deadline=gpr_timespec { tv_sec: %" PRId64 ", tv_nsec: %d, clock_type: %d }, " "reserved=%p)", - 5, - (cc, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, - reserved)); + 5, (cc, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, + reserved)); GPR_ASSERT(!reserved); dump_pending_tags(cc); @@ -559,9 +558,8 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, "deadline=gpr_timespec { tv_sec: %" PRId64 ", tv_nsec: %d, clock_type: %d }, " "reserved=%p)", - 6, - (cc, tag, deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, - reserved)); + 6, (cc, tag, deadline.tv_sec, deadline.tv_nsec, + (int)deadline.clock_type, reserved)); } GPR_ASSERT(!reserved); diff --git a/test/core/bad_ssl/server_common.c b/test/core/bad_ssl/server_common.c index 67404711cd..0ec14676c6 100644 --- a/test/core/bad_ssl/server_common.c +++ b/test/core/bad_ssl/server_common.c @@ -95,9 +95,8 @@ void bad_ssl_run(grpc_server *server) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, - gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); switch (ev.type) { case GRPC_OP_COMPLETE: diff --git a/test/core/client_channel/lb_policies_test.c b/test/core/client_channel/lb_policies_test.c index 433f77db82..50ec08b1db 100644 --- a/test/core/client_channel/lb_policies_test.c +++ b/test/core/client_channel/lb_policies_test.c @@ -65,9 +65,9 @@ typedef struct servers_fixture { } servers_fixture; typedef struct request_sequences { - size_t n; /* number of iterations */ - int *connections; /* indexed by the interation number, value is the index of - the server it connected to or -1 if none */ + size_t n; /* number of iterations */ + int *connections; /* indexed by the interation number, value is the index of + the server it connected to or -1 if none */ int *connectivity_states; /* indexed by the interation number, value is the client connectivity state */ } request_sequences; diff --git a/test/core/end2end/fixtures/h2_census.c b/test/core/end2end/fixtures/h2_census.c index 1a754835f0..7fc965a718 100644 --- a/test/core/end2end/fixtures/h2_census.c +++ b/test/core/end2end/fixtures/h2_census.c @@ -120,10 +120,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack+census", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack+census", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_compress.c b/test/core/end2end/fixtures/h2_compress.c index b73d6d787a..8636324ca1 100644 --- a/test/core/end2end/fixtures/h2_compress.c +++ b/test/core/end2end/fixtures/h2_compress.c @@ -120,10 +120,9 @@ void chttp2_tear_down_fullstack_compression(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack_compression", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack_compression", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack_compression, chttp2_init_client_fullstack_compression, chttp2_init_server_fullstack_compression, diff --git a/test/core/end2end/fixtures/h2_full+pipe.c b/test/core/end2end/fixtures/h2_full+pipe.c index 927ca8ae01..bc99d26550 100644 --- a/test/core/end2end/fixtures/h2_full+pipe.c +++ b/test/core/end2end/fixtures/h2_full+pipe.c @@ -103,10 +103,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_full+trace.c b/test/core/end2end/fixtures/h2_full+trace.c index bb24f966c1..f849496d21 100644 --- a/test/core/end2end/fixtures/h2_full+trace.c +++ b/test/core/end2end/fixtures/h2_full+trace.c @@ -103,10 +103,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_full.c b/test/core/end2end/fixtures/h2_full.c index d8d4d95177..92bd28eea7 100644 --- a/test/core/end2end/fixtures/h2_full.c +++ b/test/core/end2end/fixtures/h2_full.c @@ -97,10 +97,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_http_proxy.c b/test/core/end2end/fixtures/h2_http_proxy.c index 451c55677f..ebab96943d 100644 --- a/test/core/end2end/fixtures/h2_http_proxy.c +++ b/test/core/end2end/fixtures/h2_http_proxy.c @@ -108,10 +108,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_proxy.c b/test/core/end2end/fixtures/h2_proxy.c index af7d277689..9078001e3b 100644 --- a/test/core/end2end/fixtures/h2_proxy.c +++ b/test/core/end2end/fixtures/h2_proxy.c @@ -114,11 +114,10 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack+proxy", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_REQUEST_PROXYING | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack+proxy", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_REQUEST_PROXYING | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fixtures/h2_ssl_cert.c b/test/core/end2end/fixtures/h2_ssl_cert.c index 59a728307b..7aa0e16bf6 100644 --- a/test/core/end2end/fixtures/h2_ssl_cert.c +++ b/test/core/end2end/fixtures/h2_ssl_cert.c @@ -204,17 +204,15 @@ CLIENT_INIT(BAD_CERT_PAIR) typedef enum { SUCCESS, FAIL } test_result; -#define SSL_TEST(request_type, cert_type, result) \ - { \ - {TEST_NAME(request_type, cert_type, result), \ - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | \ - FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \ - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL, \ - chttp2_create_fixture_secure_fullstack, \ - CLIENT_INIT_NAME(cert_type), \ - SERVER_INIT_NAME(request_type), \ - chttp2_tear_down_secure_fullstack}, \ - result \ +#define SSL_TEST(request_type, cert_type, result) \ + { \ + {TEST_NAME(request_type, cert_type, result), \ + FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | \ + FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS | \ + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL, \ + chttp2_create_fixture_secure_fullstack, CLIENT_INIT_NAME(cert_type), \ + SERVER_INIT_NAME(request_type), chttp2_tear_down_secure_fullstack}, \ + result \ } /* All test configurations */ diff --git a/test/core/end2end/fixtures/h2_uds.c b/test/core/end2end/fixtures/h2_uds.c index 89b4b5e64b..60c5c497c7 100644 --- a/test/core/end2end/fixtures/h2_uds.c +++ b/test/core/end2end/fixtures/h2_uds.c @@ -102,10 +102,9 @@ void chttp2_tear_down_fullstack(grpc_end2end_test_fixture *f) { /* All test configurations */ static grpc_end2end_test_config configs[] = { - {"chttp2/fullstack_uds", - FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | - FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | - FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, + {"chttp2/fullstack_uds", FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION | + FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL | + FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER, chttp2_create_fixture_fullstack, chttp2_init_client_fullstack, chttp2_init_server_fullstack, chttp2_tear_down_fullstack}, }; diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index c8384346f0..2eff2f103e 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -314,9 +314,8 @@ static grpc_call_credentials *read_call_creds(input_stream *inp) { cred_artifact_ctx ctx = CRED_ARTIFACT_CTX_INIT; const char *access_token = read_cred_artifact(&ctx, inp, NULL, 0); grpc_call_credentials *out = - access_token == NULL - ? NULL - : grpc_access_token_credentials_create(access_token, NULL); + access_token == NULL ? NULL : grpc_access_token_credentials_create( + access_token, NULL); cred_artifact_ctx_finish(&ctx); return out; } @@ -410,9 +409,8 @@ void my_resolve_address(grpc_exec_ctx *exec_ctx, const char *addr, r->on_done = on_done; r->addrs = addresses; grpc_timer_init( - exec_ctx, &r->timer, - gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_seconds(1, GPR_TIMESPAN)), + exec_ctx, &r->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_seconds(1, GPR_TIMESPAN)), grpc_closure_create(finish_resolve, r, grpc_schedule_on_exec_ctx), gpr_now(GPR_CLOCK_MONOTONIC)); } @@ -473,9 +471,8 @@ static void sched_connect(grpc_exec_ctx *exec_ctx, grpc_closure *closure, fc->ep = ep; fc->deadline = deadline; grpc_timer_init( - exec_ctx, &fc->timer, - gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_millis(1, GPR_TIMESPAN)), + exec_ctx, &fc->timer, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_millis(1, GPR_TIMESPAN)), grpc_closure_create(do_connect, fc, grpc_schedule_on_exec_ctx), gpr_now(GPR_CLOCK_MONOTONIC)); } @@ -751,9 +748,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (g_server != NULL) { if (!server_shutdown) { grpc_server_shutdown_and_notify( - g_server, cq, - create_validator(assert_success_and_decrement, - &pending_server_shutdowns)); + g_server, cq, create_validator(assert_success_and_decrement, + &pending_server_shutdowns)); server_shutdown = true; pending_server_shutdowns++; } else if (pending_server_shutdowns == 0) { @@ -858,9 +854,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { case 5: { if (g_server != NULL) { grpc_server_shutdown_and_notify( - g_server, cq, - create_validator(assert_success_and_decrement, - &pending_server_shutdowns)); + g_server, cq, create_validator(assert_success_and_decrement, + &pending_server_shutdowns)); pending_server_shutdowns++; server_shutdown = true; } else { diff --git a/test/core/fling/server.c b/test/core/fling/server.c index ebcb8f05f0..7edff3d132 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -257,9 +257,8 @@ int main(int argc, char **argv) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, - gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); s = ev.tag; switch (ev.type) { diff --git a/test/core/memory_usage/client.c b/test/core/memory_usage/client.c index 4fb99217b6..d0ec060aca 100644 --- a/test/core/memory_usage/client.c +++ b/test/core/memory_usage/client.c @@ -261,9 +261,8 @@ int main(int argc, char **argv) { do { event = grpc_completion_queue_next( - cq, - gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(10000, GPR_TIMESPAN)), + cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(10000, GPR_TIMESPAN)), NULL); } while (event.type != GRPC_QUEUE_TIMEOUT); diff --git a/test/core/memory_usage/server.c b/test/core/memory_usage/server.c index 94d90a58a6..44c5488014 100644 --- a/test/core/memory_usage/server.c +++ b/test/core/memory_usage/server.c @@ -243,9 +243,8 @@ int main(int argc, char **argv) { shutdown_started = 1; } ev = grpc_completion_queue_next( - cq, - gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), - gpr_time_from_micros(1000000, GPR_TIMESPAN)), + cq, gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), + gpr_time_from_micros(1000000, GPR_TIMESPAN)), NULL); fling_call *s = ev.tag; switch (ev.type) { diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index b85ad949a5..e0ae86955e 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -354,9 +354,8 @@ static void start_backend_server(server_fixture *sf) { } GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); const string expected_token = - strlen(sf->lb_token_prefix) == 0 - ? "" - : sf->lb_token_prefix + std::to_string(sf->port); + strlen(sf->lb_token_prefix) == 0 ? "" : sf->lb_token_prefix + + std::to_string(sf->port); GPR_ASSERT(contains_metadata(&request_metadata_recv, "lb-token", expected_token.c_str())); -- cgit v1.2.3 From 0362d6b374e4b10e324e09e750b88d6c6bc834d1 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 13 Apr 2017 07:59:08 -0700 Subject: ubsan fixes --- src/core/ext/census/context.c | 2 +- src/core/ext/census/resource.c | 4 +++- src/core/lib/channel/http_client_filter.c | 6 ++++-- test/core/end2end/fuzzers/api_fuzzer.c | 2 +- test/core/support/spinlock_test.c | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) (limited to 'test/core/end2end/fuzzers') diff --git a/src/core/ext/census/context.c b/src/core/ext/census/context.c index 0dfc4ecbf1..4195cb1c9b 100644 --- a/src/core/ext/census/context.c +++ b/src/core/ext/census/context.c @@ -200,7 +200,7 @@ static bool tag_set_add_tag(struct tag_set *tags, const census_tag *tag, // allocate new memory if needed tags->kvm_size += 2 * CENSUS_MAX_TAG_KV_LEN + TAG_HEADER_SIZE; char *new_kvm = gpr_malloc(tags->kvm_size); - memcpy(new_kvm, tags->kvm, tags->kvm_used); + if (tags->kvm_used > 0) memcpy(new_kvm, tags->kvm, tags->kvm_used); gpr_free(tags->kvm); tags->kvm = new_kvm; } diff --git a/src/core/ext/census/resource.c b/src/core/ext/census/resource.c index ed44f004f9..26ea1a8672 100644 --- a/src/core/ext/census/resource.c +++ b/src/core/ext/census/resource.c @@ -223,7 +223,9 @@ size_t allocate_resource(void) { if (n_resources == n_defined_resources) { size_t new_n_resources = n_resources ? n_resources * 2 : 2; resource **new_resources = gpr_malloc(new_n_resources * sizeof(resource *)); - memcpy(new_resources, resources, n_resources * sizeof(resource *)); + if (n_resources != 0) { + memcpy(new_resources, resources, n_resources * sizeof(resource *)); + } memset(new_resources + n_resources, 0, (new_n_resources - n_resources) * sizeof(resource *)); gpr_free(resources); diff --git a/src/core/lib/channel/http_client_filter.c b/src/core/lib/channel/http_client_filter.c index 4e47c5c658..255f5388aa 100644 --- a/src/core/lib/channel/http_client_filter.c +++ b/src/core/lib/channel/http_client_filter.c @@ -222,8 +222,10 @@ static void continue_send_message(grpc_exec_ctx *exec_ctx, while (grpc_byte_stream_next( exec_ctx, calld->send_op->payload->send_message.send_message, &calld->incoming_slice, ~(size_t)0, &calld->got_slice)) { - memcpy(wrptr, GRPC_SLICE_START_PTR(calld->incoming_slice), - GRPC_SLICE_LENGTH(calld->incoming_slice)); + if (GRPC_SLICE_LENGTH(calld->incoming_slice) > 0) { + memcpy(wrptr, GRPC_SLICE_START_PTR(calld->incoming_slice), + GRPC_SLICE_LENGTH(calld->incoming_slice)); + } wrptr += GRPC_SLICE_LENGTH(calld->incoming_slice); grpc_slice_buffer_add(&calld->slices, calld->incoming_slice); if (calld->send_length == calld->slices.length) { diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index a0acf5bf60..0ec5a23d5d 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -967,7 +967,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { break; } grpc_op *ops = gpr_malloc(sizeof(grpc_op) * num_ops); - memset(ops, 0, sizeof(grpc_op) * num_ops); + if (num_ops > 0) memset(ops, 0, sizeof(grpc_op) * num_ops); bool ok = true; size_t i; grpc_op *op; diff --git a/test/core/support/spinlock_test.c b/test/core/support/spinlock_test.c index c70e76c7ea..96055e9bd7 100644 --- a/test/core/support/spinlock_test.c +++ b/test/core/support/spinlock_test.c @@ -109,7 +109,7 @@ static void test(const char *name, void (*body)(void *m), int timeout_s, start, gpr_time_from_micros((int64_t)timeout_s * 1000000, GPR_TIMESPAN)); fprintf(stderr, "%s:", name); while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0) { - iterations <<= 1; + if (iterations < INT64_MAX / 2) iterations <<= 1; fprintf(stderr, " %ld", (long)iterations); m = test_new(10, iterations, incr_step); test_create_threads(m, body); -- cgit v1.2.3 From c2b1f1672d23d2a374205d77f374b54cee66fe61 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Fri, 31 Mar 2017 09:38:36 -0700 Subject: Change metadata names used by the instrumentation. --- src/core/lib/transport/static_metadata.c | 765 +++++++++++++++-------------- src/core/lib/transport/static_metadata.h | 186 +++---- test/core/end2end/fuzzers/hpack.dictionary | 5 +- tools/codegen/core/gen_static_metadata.py | 343 +++++++------ 4 files changed, 689 insertions(+), 610 deletions(-) (limited to 'test/core/end2end/fuzzers') diff --git a/src/core/lib/transport/static_metadata.c b/src/core/lib/transport/static_metadata.c index c13ba230b3..599d4ad117 100644 --- a/src/core/lib/transport/static_metadata.c +++ b/src/core/lib/transport/static_metadata.c @@ -51,67 +51,69 @@ static uint8_t g_bytes[] = { 115, 103, 114, 112, 99, 45, 112, 97, 121, 108, 111, 97, 100, 45, 98, 105, 110, 103, 114, 112, 99, 45, 101, 110, 99, 111, 100, 105, 110, 103, 103, 114, 112, 99, 45, 97, 99, 99, 101, 112, 116, 45, 101, 110, 99, - 111, 100, 105, 110, 103, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, - 112, 101, 103, 114, 112, 99, 45, 105, 110, 116, 101, 114, 110, 97, 108, - 45, 101, 110, 99, 111, 100, 105, 110, 103, 45, 114, 101, 113, 117, 101, - 115, 116, 117, 115, 101, 114, 45, 97, 103, 101, 110, 116, 104, 111, 115, - 116, 108, 98, 45, 116, 111, 107, 101, 110, 103, 114, 112, 99, 45, 116, - 105, 109, 101, 111, 117, 116, 103, 114, 112, 99, 45, 116, 114, 97, 99, - 105, 110, 103, 45, 98, 105, 110, 103, 114, 112, 99, 45, 115, 116, 97, - 116, 115, 45, 98, 105, 110, 103, 114, 112, 99, 46, 119, 97, 105, 116, - 95, 102, 111, 114, 95, 114, 101, 97, 100, 121, 103, 114, 112, 99, 46, - 116, 105, 109, 101, 111, 117, 116, 103, 114, 112, 99, 46, 109, 97, 120, - 95, 114, 101, 113, 117, 101, 115, 116, 95, 109, 101, 115, 115, 97, 103, - 101, 95, 98, 121, 116, 101, 115, 103, 114, 112, 99, 46, 109, 97, 120, - 95, 114, 101, 115, 112, 111, 110, 115, 101, 95, 109, 101, 115, 115, 97, - 103, 101, 95, 98, 121, 116, 101, 115, 47, 103, 114, 112, 99, 46, 108, - 98, 46, 118, 49, 46, 76, 111, 97, 100, 66, 97, 108, 97, 110, 99, - 101, 114, 47, 66, 97, 108, 97, 110, 99, 101, 76, 111, 97, 100, 48, - 49, 50, 105, 100, 101, 110, 116, 105, 116, 121, 103, 122, 105, 112, 100, - 101, 102, 108, 97, 116, 101, 116, 114, 97, 105, 108, 101, 114, 115, 97, - 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 103, 114, 112, 99, - 80, 79, 83, 84, 50, 48, 48, 52, 48, 52, 104, 116, 116, 112, 104, - 116, 116, 112, 115, 103, 114, 112, 99, 71, 69, 84, 80, 85, 84, 47, - 47, 105, 110, 100, 101, 120, 46, 104, 116, 109, 108, 50, 48, 52, 50, - 48, 54, 51, 48, 52, 52, 48, 48, 53, 48, 48, 97, 99, 99, 101, - 112, 116, 45, 99, 104, 97, 114, 115, 101, 116, 97, 99, 99, 101, 112, - 116, 45, 101, 110, 99, 111, 100, 105, 110, 103, 103, 122, 105, 112, 44, - 32, 100, 101, 102, 108, 97, 116, 101, 97, 99, 99, 101, 112, 116, 45, - 108, 97, 110, 103, 117, 97, 103, 101, 97, 99, 99, 101, 112, 116, 45, - 114, 97, 110, 103, 101, 115, 97, 99, 99, 101, 112, 116, 97, 99, 99, - 101, 115, 115, 45, 99, 111, 110, 116, 114, 111, 108, 45, 97, 108, 108, - 111, 119, 45, 111, 114, 105, 103, 105, 110, 97, 103, 101, 97, 108, 108, - 111, 119, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, - 99, 97, 99, 104, 101, 45, 99, 111, 110, 116, 114, 111, 108, 99, 111, - 110, 116, 101, 110, 116, 45, 100, 105, 115, 112, 111, 115, 105, 116, 105, - 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, 101, 110, 99, 111, 100, - 105, 110, 103, 99, 111, 110, 116, 101, 110, 116, 45, 108, 97, 110, 103, - 117, 97, 103, 101, 99, 111, 110, 116, 101, 110, 116, 45, 108, 101, 110, - 103, 116, 104, 99, 111, 110, 116, 101, 110, 116, 45, 108, 111, 99, 97, - 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, 114, 97, 110, - 103, 101, 99, 111, 111, 107, 105, 101, 100, 97, 116, 101, 101, 116, 97, - 103, 101, 120, 112, 101, 99, 116, 101, 120, 112, 105, 114, 101, 115, 102, - 114, 111, 109, 105, 102, 45, 109, 97, 116, 99, 104, 105, 102, 45, 109, - 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, 105, 102, - 45, 110, 111, 110, 101, 45, 109, 97, 116, 99, 104, 105, 102, 45, 114, - 97, 110, 103, 101, 105, 102, 45, 117, 110, 109, 111, 100, 105, 102, 105, - 101, 100, 45, 115, 105, 110, 99, 101, 108, 97, 115, 116, 45, 109, 111, - 100, 105, 102, 105, 101, 100, 108, 105, 110, 107, 108, 111, 99, 97, 116, - 105, 111, 110, 109, 97, 120, 45, 102, 111, 114, 119, 97, 114, 100, 115, - 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, - 97, 116, 101, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 111, 114, - 105, 122, 97, 116, 105, 111, 110, 114, 97, 110, 103, 101, 114, 101, 102, - 101, 114, 101, 114, 114, 101, 102, 114, 101, 115, 104, 114, 101, 116, 114, - 121, 45, 97, 102, 116, 101, 114, 115, 101, 114, 118, 101, 114, 115, 101, - 116, 45, 99, 111, 111, 107, 105, 101, 115, 116, 114, 105, 99, 116, 45, - 116, 114, 97, 110, 115, 112, 111, 114, 116, 45, 115, 101, 99, 117, 114, - 105, 116, 121, 116, 114, 97, 110, 115, 102, 101, 114, 45, 101, 110, 99, - 111, 100, 105, 110, 103, 118, 97, 114, 121, 118, 105, 97, 119, 119, 119, - 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 105, 100, - 101, 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 105, - 100, 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, 101, 102, - 108, 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, - 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112}; + 111, 100, 105, 110, 103, 103, 114, 112, 99, 45, 115, 101, 114, 118, 101, + 114, 45, 115, 116, 97, 116, 115, 45, 98, 105, 110, 103, 114, 112, 99, + 45, 116, 97, 103, 115, 45, 98, 105, 110, 103, 114, 112, 99, 45, 116, + 114, 97, 99, 101, 45, 98, 105, 110, 99, 111, 110, 116, 101, 110, 116, + 45, 116, 121, 112, 101, 103, 114, 112, 99, 45, 105, 110, 116, 101, 114, + 110, 97, 108, 45, 101, 110, 99, 111, 100, 105, 110, 103, 45, 114, 101, + 113, 117, 101, 115, 116, 117, 115, 101, 114, 45, 97, 103, 101, 110, 116, + 104, 111, 115, 116, 108, 98, 45, 116, 111, 107, 101, 110, 103, 114, 112, + 99, 45, 116, 105, 109, 101, 111, 117, 116, 103, 114, 112, 99, 46, 119, + 97, 105, 116, 95, 102, 111, 114, 95, 114, 101, 97, 100, 121, 103, 114, + 112, 99, 46, 116, 105, 109, 101, 111, 117, 116, 103, 114, 112, 99, 46, + 109, 97, 120, 95, 114, 101, 113, 117, 101, 115, 116, 95, 109, 101, 115, + 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, 103, 114, 112, 99, 46, + 109, 97, 120, 95, 114, 101, 115, 112, 111, 110, 115, 101, 95, 109, 101, + 115, 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, 47, 103, 114, 112, + 99, 46, 108, 98, 46, 118, 49, 46, 76, 111, 97, 100, 66, 97, 108, + 97, 110, 99, 101, 114, 47, 66, 97, 108, 97, 110, 99, 101, 76, 111, + 97, 100, 48, 49, 50, 105, 100, 101, 110, 116, 105, 116, 121, 103, 122, + 105, 112, 100, 101, 102, 108, 97, 116, 101, 116, 114, 97, 105, 108, 101, + 114, 115, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 103, + 114, 112, 99, 80, 79, 83, 84, 50, 48, 48, 52, 48, 52, 104, 116, + 116, 112, 104, 116, 116, 112, 115, 103, 114, 112, 99, 71, 69, 84, 80, + 85, 84, 47, 47, 105, 110, 100, 101, 120, 46, 104, 116, 109, 108, 50, + 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, 48, 53, 48, 48, 97, + 99, 99, 101, 112, 116, 45, 99, 104, 97, 114, 115, 101, 116, 97, 99, + 99, 101, 112, 116, 45, 101, 110, 99, 111, 100, 105, 110, 103, 103, 122, + 105, 112, 44, 32, 100, 101, 102, 108, 97, 116, 101, 97, 99, 99, 101, + 112, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 97, 99, 99, 101, + 112, 116, 45, 114, 97, 110, 103, 101, 115, 97, 99, 99, 101, 112, 116, + 97, 99, 99, 101, 115, 115, 45, 99, 111, 110, 116, 114, 111, 108, 45, + 97, 108, 108, 111, 119, 45, 111, 114, 105, 103, 105, 110, 97, 103, 101, + 97, 108, 108, 111, 119, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, + 105, 111, 110, 99, 97, 99, 104, 101, 45, 99, 111, 110, 116, 114, 111, + 108, 99, 111, 110, 116, 101, 110, 116, 45, 100, 105, 115, 112, 111, 115, + 105, 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, 101, 110, + 99, 111, 100, 105, 110, 103, 99, 111, 110, 116, 101, 110, 116, 45, 108, + 97, 110, 103, 117, 97, 103, 101, 99, 111, 110, 116, 101, 110, 116, 45, + 108, 101, 110, 103, 116, 104, 99, 111, 110, 116, 101, 110, 116, 45, 108, + 111, 99, 97, 116, 105, 111, 110, 99, 111, 110, 116, 101, 110, 116, 45, + 114, 97, 110, 103, 101, 99, 111, 111, 107, 105, 101, 100, 97, 116, 101, + 101, 116, 97, 103, 101, 120, 112, 101, 99, 116, 101, 120, 112, 105, 114, + 101, 115, 102, 114, 111, 109, 105, 102, 45, 109, 97, 116, 99, 104, 105, + 102, 45, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, + 101, 105, 102, 45, 110, 111, 110, 101, 45, 109, 97, 116, 99, 104, 105, + 102, 45, 114, 97, 110, 103, 101, 105, 102, 45, 117, 110, 109, 111, 100, + 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, 108, 97, 115, 116, + 45, 109, 111, 100, 105, 102, 105, 101, 100, 108, 105, 110, 107, 108, 111, + 99, 97, 116, 105, 111, 110, 109, 97, 120, 45, 102, 111, 114, 119, 97, + 114, 100, 115, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 101, 110, + 116, 105, 99, 97, 116, 101, 112, 114, 111, 120, 121, 45, 97, 117, 116, + 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 114, 97, 110, 103, 101, + 114, 101, 102, 101, 114, 101, 114, 114, 101, 102, 114, 101, 115, 104, 114, + 101, 116, 114, 121, 45, 97, 102, 116, 101, 114, 115, 101, 114, 118, 101, + 114, 115, 101, 116, 45, 99, 111, 111, 107, 105, 101, 115, 116, 114, 105, + 99, 116, 45, 116, 114, 97, 110, 115, 112, 111, 114, 116, 45, 115, 101, + 99, 117, 114, 105, 116, 121, 116, 114, 97, 110, 115, 102, 101, 114, 45, + 101, 110, 99, 111, 100, 105, 110, 103, 118, 97, 114, 121, 118, 105, 97, + 119, 119, 119, 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, + 101, 105, 100, 101, 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, + 116, 101, 105, 100, 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, + 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, + 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, + 122, 105, 112}; static void static_ref(void *unused) {} static void static_unref(grpc_exec_ctx *exec_ctx, void *unused) {} @@ -220,6 +222,7 @@ grpc_slice_refcount grpc_static_metadata_refcounts[GRPC_STATIC_MDSTR_COUNT] = { {&grpc_static_metadata_vtable, &static_sub_refcnt}, {&grpc_static_metadata_vtable, &static_sub_refcnt}, {&grpc_static_metadata_vtable, &static_sub_refcnt}, + {&grpc_static_metadata_vtable, &static_sub_refcnt}, }; const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = { @@ -246,177 +249,179 @@ const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = { {.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, {.refcount = &grpc_static_metadata_refcounts[11], - .data.refcounted = {g_bytes + 110, 12}}, + .data.refcounted = {g_bytes + 110, 21}}, {.refcount = &grpc_static_metadata_refcounts[12], - .data.refcounted = {g_bytes + 122, 30}}, + .data.refcounted = {g_bytes + 131, 13}}, {.refcount = &grpc_static_metadata_refcounts[13], - .data.refcounted = {g_bytes + 152, 10}}, + .data.refcounted = {g_bytes + 144, 14}}, {.refcount = &grpc_static_metadata_refcounts[14], - .data.refcounted = {g_bytes + 162, 4}}, + .data.refcounted = {g_bytes + 158, 12}}, {.refcount = &grpc_static_metadata_refcounts[15], - .data.refcounted = {g_bytes + 166, 8}}, + .data.refcounted = {g_bytes + 170, 30}}, {.refcount = &grpc_static_metadata_refcounts[16], - .data.refcounted = {g_bytes + 174, 12}}, + .data.refcounted = {g_bytes + 200, 10}}, {.refcount = &grpc_static_metadata_refcounts[17], - .data.refcounted = {g_bytes + 186, 16}}, + .data.refcounted = {g_bytes + 210, 4}}, {.refcount = &grpc_static_metadata_refcounts[18], - .data.refcounted = {g_bytes + 202, 14}}, + .data.refcounted = {g_bytes + 214, 8}}, {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}, + .data.refcounted = {g_bytes + 222, 12}}, {.refcount = &grpc_static_metadata_refcounts[20], - .data.refcounted = {g_bytes + 216, 19}}, + .data.refcounted = {g_bytes + 234, 0}}, {.refcount = &grpc_static_metadata_refcounts[21], - .data.refcounted = {g_bytes + 235, 12}}, + .data.refcounted = {g_bytes + 234, 19}}, {.refcount = &grpc_static_metadata_refcounts[22], - .data.refcounted = {g_bytes + 247, 30}}, + .data.refcounted = {g_bytes + 253, 12}}, {.refcount = &grpc_static_metadata_refcounts[23], - .data.refcounted = {g_bytes + 277, 31}}, + .data.refcounted = {g_bytes + 265, 30}}, {.refcount = &grpc_static_metadata_refcounts[24], - .data.refcounted = {g_bytes + 308, 36}}, + .data.refcounted = {g_bytes + 295, 31}}, {.refcount = &grpc_static_metadata_refcounts[25], - .data.refcounted = {g_bytes + 344, 1}}, + .data.refcounted = {g_bytes + 326, 36}}, {.refcount = &grpc_static_metadata_refcounts[26], - .data.refcounted = {g_bytes + 345, 1}}, + .data.refcounted = {g_bytes + 362, 1}}, {.refcount = &grpc_static_metadata_refcounts[27], - .data.refcounted = {g_bytes + 346, 1}}, + .data.refcounted = {g_bytes + 363, 1}}, {.refcount = &grpc_static_metadata_refcounts[28], - .data.refcounted = {g_bytes + 347, 8}}, + .data.refcounted = {g_bytes + 364, 1}}, {.refcount = &grpc_static_metadata_refcounts[29], - .data.refcounted = {g_bytes + 355, 4}}, + .data.refcounted = {g_bytes + 365, 8}}, {.refcount = &grpc_static_metadata_refcounts[30], - .data.refcounted = {g_bytes + 359, 7}}, + .data.refcounted = {g_bytes + 373, 4}}, {.refcount = &grpc_static_metadata_refcounts[31], - .data.refcounted = {g_bytes + 366, 8}}, + .data.refcounted = {g_bytes + 377, 7}}, {.refcount = &grpc_static_metadata_refcounts[32], - .data.refcounted = {g_bytes + 374, 16}}, + .data.refcounted = {g_bytes + 384, 8}}, {.refcount = &grpc_static_metadata_refcounts[33], - .data.refcounted = {g_bytes + 390, 4}}, + .data.refcounted = {g_bytes + 392, 16}}, {.refcount = &grpc_static_metadata_refcounts[34], - .data.refcounted = {g_bytes + 394, 3}}, + .data.refcounted = {g_bytes + 408, 4}}, {.refcount = &grpc_static_metadata_refcounts[35], - .data.refcounted = {g_bytes + 397, 3}}, + .data.refcounted = {g_bytes + 412, 3}}, {.refcount = &grpc_static_metadata_refcounts[36], - .data.refcounted = {g_bytes + 400, 4}}, + .data.refcounted = {g_bytes + 415, 3}}, {.refcount = &grpc_static_metadata_refcounts[37], - .data.refcounted = {g_bytes + 404, 5}}, + .data.refcounted = {g_bytes + 418, 4}}, {.refcount = &grpc_static_metadata_refcounts[38], - .data.refcounted = {g_bytes + 409, 4}}, + .data.refcounted = {g_bytes + 422, 5}}, {.refcount = &grpc_static_metadata_refcounts[39], - .data.refcounted = {g_bytes + 413, 3}}, + .data.refcounted = {g_bytes + 427, 4}}, {.refcount = &grpc_static_metadata_refcounts[40], - .data.refcounted = {g_bytes + 416, 3}}, + .data.refcounted = {g_bytes + 431, 3}}, {.refcount = &grpc_static_metadata_refcounts[41], - .data.refcounted = {g_bytes + 419, 1}}, + .data.refcounted = {g_bytes + 434, 3}}, {.refcount = &grpc_static_metadata_refcounts[42], - .data.refcounted = {g_bytes + 420, 11}}, + .data.refcounted = {g_bytes + 437, 1}}, {.refcount = &grpc_static_metadata_refcounts[43], - .data.refcounted = {g_bytes + 431, 3}}, + .data.refcounted = {g_bytes + 438, 11}}, {.refcount = &grpc_static_metadata_refcounts[44], - .data.refcounted = {g_bytes + 434, 3}}, + .data.refcounted = {g_bytes + 449, 3}}, {.refcount = &grpc_static_metadata_refcounts[45], - .data.refcounted = {g_bytes + 437, 3}}, + .data.refcounted = {g_bytes + 452, 3}}, {.refcount = &grpc_static_metadata_refcounts[46], - .data.refcounted = {g_bytes + 440, 3}}, + .data.refcounted = {g_bytes + 455, 3}}, {.refcount = &grpc_static_metadata_refcounts[47], - .data.refcounted = {g_bytes + 443, 3}}, + .data.refcounted = {g_bytes + 458, 3}}, {.refcount = &grpc_static_metadata_refcounts[48], - .data.refcounted = {g_bytes + 446, 14}}, + .data.refcounted = {g_bytes + 461, 3}}, {.refcount = &grpc_static_metadata_refcounts[49], - .data.refcounted = {g_bytes + 460, 15}}, + .data.refcounted = {g_bytes + 464, 14}}, {.refcount = &grpc_static_metadata_refcounts[50], - .data.refcounted = {g_bytes + 475, 13}}, + .data.refcounted = {g_bytes + 478, 15}}, {.refcount = &grpc_static_metadata_refcounts[51], - .data.refcounted = {g_bytes + 488, 15}}, + .data.refcounted = {g_bytes + 493, 13}}, {.refcount = &grpc_static_metadata_refcounts[52], - .data.refcounted = {g_bytes + 503, 13}}, + .data.refcounted = {g_bytes + 506, 15}}, {.refcount = &grpc_static_metadata_refcounts[53], - .data.refcounted = {g_bytes + 516, 6}}, + .data.refcounted = {g_bytes + 521, 13}}, {.refcount = &grpc_static_metadata_refcounts[54], - .data.refcounted = {g_bytes + 522, 27}}, + .data.refcounted = {g_bytes + 534, 6}}, {.refcount = &grpc_static_metadata_refcounts[55], - .data.refcounted = {g_bytes + 549, 3}}, + .data.refcounted = {g_bytes + 540, 27}}, {.refcount = &grpc_static_metadata_refcounts[56], - .data.refcounted = {g_bytes + 552, 5}}, + .data.refcounted = {g_bytes + 567, 3}}, {.refcount = &grpc_static_metadata_refcounts[57], - .data.refcounted = {g_bytes + 557, 13}}, + .data.refcounted = {g_bytes + 570, 5}}, {.refcount = &grpc_static_metadata_refcounts[58], - .data.refcounted = {g_bytes + 570, 13}}, + .data.refcounted = {g_bytes + 575, 13}}, {.refcount = &grpc_static_metadata_refcounts[59], - .data.refcounted = {g_bytes + 583, 19}}, + .data.refcounted = {g_bytes + 588, 13}}, {.refcount = &grpc_static_metadata_refcounts[60], - .data.refcounted = {g_bytes + 602, 16}}, + .data.refcounted = {g_bytes + 601, 19}}, {.refcount = &grpc_static_metadata_refcounts[61], - .data.refcounted = {g_bytes + 618, 16}}, + .data.refcounted = {g_bytes + 620, 16}}, {.refcount = &grpc_static_metadata_refcounts[62], - .data.refcounted = {g_bytes + 634, 14}}, + .data.refcounted = {g_bytes + 636, 16}}, {.refcount = &grpc_static_metadata_refcounts[63], - .data.refcounted = {g_bytes + 648, 16}}, + .data.refcounted = {g_bytes + 652, 14}}, {.refcount = &grpc_static_metadata_refcounts[64], - .data.refcounted = {g_bytes + 664, 13}}, + .data.refcounted = {g_bytes + 666, 16}}, {.refcount = &grpc_static_metadata_refcounts[65], - .data.refcounted = {g_bytes + 677, 6}}, + .data.refcounted = {g_bytes + 682, 13}}, {.refcount = &grpc_static_metadata_refcounts[66], - .data.refcounted = {g_bytes + 683, 4}}, + .data.refcounted = {g_bytes + 695, 6}}, {.refcount = &grpc_static_metadata_refcounts[67], - .data.refcounted = {g_bytes + 687, 4}}, + .data.refcounted = {g_bytes + 701, 4}}, {.refcount = &grpc_static_metadata_refcounts[68], - .data.refcounted = {g_bytes + 691, 6}}, + .data.refcounted = {g_bytes + 705, 4}}, {.refcount = &grpc_static_metadata_refcounts[69], - .data.refcounted = {g_bytes + 697, 7}}, + .data.refcounted = {g_bytes + 709, 6}}, {.refcount = &grpc_static_metadata_refcounts[70], - .data.refcounted = {g_bytes + 704, 4}}, + .data.refcounted = {g_bytes + 715, 7}}, {.refcount = &grpc_static_metadata_refcounts[71], - .data.refcounted = {g_bytes + 708, 8}}, + .data.refcounted = {g_bytes + 722, 4}}, {.refcount = &grpc_static_metadata_refcounts[72], - .data.refcounted = {g_bytes + 716, 17}}, + .data.refcounted = {g_bytes + 726, 8}}, {.refcount = &grpc_static_metadata_refcounts[73], - .data.refcounted = {g_bytes + 733, 13}}, + .data.refcounted = {g_bytes + 734, 17}}, {.refcount = &grpc_static_metadata_refcounts[74], - .data.refcounted = {g_bytes + 746, 8}}, + .data.refcounted = {g_bytes + 751, 13}}, {.refcount = &grpc_static_metadata_refcounts[75], - .data.refcounted = {g_bytes + 754, 19}}, + .data.refcounted = {g_bytes + 764, 8}}, {.refcount = &grpc_static_metadata_refcounts[76], - .data.refcounted = {g_bytes + 773, 13}}, + .data.refcounted = {g_bytes + 772, 19}}, {.refcount = &grpc_static_metadata_refcounts[77], - .data.refcounted = {g_bytes + 786, 4}}, + .data.refcounted = {g_bytes + 791, 13}}, {.refcount = &grpc_static_metadata_refcounts[78], - .data.refcounted = {g_bytes + 790, 8}}, + .data.refcounted = {g_bytes + 804, 4}}, {.refcount = &grpc_static_metadata_refcounts[79], - .data.refcounted = {g_bytes + 798, 12}}, + .data.refcounted = {g_bytes + 808, 8}}, {.refcount = &grpc_static_metadata_refcounts[80], - .data.refcounted = {g_bytes + 810, 18}}, + .data.refcounted = {g_bytes + 816, 12}}, {.refcount = &grpc_static_metadata_refcounts[81], - .data.refcounted = {g_bytes + 828, 19}}, + .data.refcounted = {g_bytes + 828, 18}}, {.refcount = &grpc_static_metadata_refcounts[82], - .data.refcounted = {g_bytes + 847, 5}}, + .data.refcounted = {g_bytes + 846, 19}}, {.refcount = &grpc_static_metadata_refcounts[83], - .data.refcounted = {g_bytes + 852, 7}}, + .data.refcounted = {g_bytes + 865, 5}}, {.refcount = &grpc_static_metadata_refcounts[84], - .data.refcounted = {g_bytes + 859, 7}}, + .data.refcounted = {g_bytes + 870, 7}}, {.refcount = &grpc_static_metadata_refcounts[85], - .data.refcounted = {g_bytes + 866, 11}}, + .data.refcounted = {g_bytes + 877, 7}}, {.refcount = &grpc_static_metadata_refcounts[86], - .data.refcounted = {g_bytes + 877, 6}}, + .data.refcounted = {g_bytes + 884, 11}}, {.refcount = &grpc_static_metadata_refcounts[87], - .data.refcounted = {g_bytes + 883, 10}}, + .data.refcounted = {g_bytes + 895, 6}}, {.refcount = &grpc_static_metadata_refcounts[88], - .data.refcounted = {g_bytes + 893, 25}}, + .data.refcounted = {g_bytes + 901, 10}}, {.refcount = &grpc_static_metadata_refcounts[89], - .data.refcounted = {g_bytes + 918, 17}}, + .data.refcounted = {g_bytes + 911, 25}}, {.refcount = &grpc_static_metadata_refcounts[90], - .data.refcounted = {g_bytes + 935, 4}}, + .data.refcounted = {g_bytes + 936, 17}}, {.refcount = &grpc_static_metadata_refcounts[91], - .data.refcounted = {g_bytes + 939, 3}}, + .data.refcounted = {g_bytes + 953, 4}}, {.refcount = &grpc_static_metadata_refcounts[92], - .data.refcounted = {g_bytes + 942, 16}}, + .data.refcounted = {g_bytes + 957, 3}}, {.refcount = &grpc_static_metadata_refcounts[93], - .data.refcounted = {g_bytes + 958, 16}}, + .data.refcounted = {g_bytes + 960, 16}}, {.refcount = &grpc_static_metadata_refcounts[94], - .data.refcounted = {g_bytes + 974, 13}}, + .data.refcounted = {g_bytes + 976, 16}}, {.refcount = &grpc_static_metadata_refcounts[95], - .data.refcounted = {g_bytes + 987, 12}}, + .data.refcounted = {g_bytes + 992, 13}}, {.refcount = &grpc_static_metadata_refcounts[96], - .data.refcounted = {g_bytes + 999, 21}}, + .data.refcounted = {g_bytes + 1005, 12}}, + {.refcount = &grpc_static_metadata_refcounts[97], + .data.refcounted = {g_bytes + 1017, 21}}, }; uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { @@ -426,16 +431,16 @@ uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8}; static const int8_t elems_r[] = { - 10, 8, -3, 0, 9, 21, -75, 22, 0, 10, -7, 20, 0, 19, 18, 17, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -48, -49, 16, -51, -52, -53, -54, -54, -55, -56, -57, 0, 37, 36, 35, 34, - 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, - 17, 16, 15, 14, 13, 12, 11, 14, 13, 12, 11, 10, 9, 8, 0}; + 10, 8, -3, 0, 9, 21, -76, 22, 0, 10, -7, 0, 0, 0, 14, 0, + 13, 12, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -50, -51, 15, -53, -54, -55, -56, -56, -57, -58, 0, 37, 36, 35, 34, + 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, + 17, 16, 15, 14, 13, 12, 11, 10, 13, 12, 11, 10, 9, 8, 7, 0}; static uint32_t elems_phash(uint32_t i) { - i -= 41; - uint32_t x = i % 95; - uint32_t y = i / 95; + i -= 42; + uint32_t x = i % 96; + uint32_t y = i / 96; uint32_t h = x; if (y < GPR_ARRAY_SIZE(elems_r)) { uint32_t delta = (uint32_t)elems_r[y]; @@ -445,29 +450,29 @@ static uint32_t elems_phash(uint32_t i) { } static const uint16_t elem_keys[] = { - 998, 999, 1000, 237, 238, 239, 240, 241, 136, 137, 41, 42, - 424, 425, 426, 901, 902, 903, 704, 705, 1086, 516, 706, 1280, - 1377, 1474, 4675, 4772, 4803, 4966, 5063, 5160, 5257, 1099, 5354, 5451, - 5548, 5645, 5742, 5839, 5936, 6033, 6130, 6227, 6324, 6421, 6518, 6615, - 6712, 6809, 6906, 7003, 7100, 7197, 7294, 7391, 7488, 7585, 7682, 7779, - 7876, 7973, 8070, 8167, 8264, 1063, 1064, 1065, 1066, 8361, 8458, 8555, - 8652, 8749, 8846, 8943, 310, 0, 0, 0, 0, 0, 0, 0, + 1009, 1010, 1011, 240, 241, 242, 243, 244, 138, 139, 42, 43, + 429, 430, 431, 911, 912, 913, 712, 713, 1392, 522, 714, 1588, + 1686, 1784, 4822, 4920, 4951, 5116, 5214, 5312, 5410, 1405, 5508, 5606, + 5704, 5802, 5900, 5998, 6096, 6194, 6292, 6390, 6488, 6586, 6684, 6782, + 6880, 6978, 7076, 7174, 7272, 7370, 7468, 7566, 7664, 7762, 7860, 7958, + 8056, 8154, 8252, 8350, 8448, 1074, 1075, 1076, 1077, 8546, 8644, 8742, + 8840, 8938, 9036, 9134, 0, 314, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 130, 228, 229, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 132, 231, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static const uint8_t elem_idxs[] = { 73, 76, 74, 19, 20, 21, 22, 23, 15, 16, 17, 18, 11, 12, 13, 3, 4, 5, 0, 1, 41, 6, 2, 69, 48, 55, 24, 25, 26, 27, 28, 29, 30, 7, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 75, 77, 78, 79, 65, 66, 67, 68, 70, 71, - 72, 14, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, - 255, 255, 255, 255, 255, 255, 255, 255, 255, 8, 9, 10}; + 72, 255, 14, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 8, 9, 10}; grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) { if (a == -1 || b == -1) return GRPC_MDNULL; - uint32_t k = (uint32_t)(a * 97 + b); + uint32_t k = (uint32_t)(a * 98 + b); uint32_t h = elems_phash(k); return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k ? GRPC_MAKE_MDELEM(&grpc_static_mdelem_table[elem_idxs[h]], @@ -476,326 +481,326 @@ grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b) { } grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = { - {{.refcount = &grpc_static_metadata_refcounts[7], - .data.refcounted = {g_bytes + 50, 11}}, - {.refcount = &grpc_static_metadata_refcounts[25], - .data.refcounted = {g_bytes + 344, 1}}}, {{.refcount = &grpc_static_metadata_refcounts[7], .data.refcounted = {g_bytes + 50, 11}}, {.refcount = &grpc_static_metadata_refcounts[26], - .data.refcounted = {g_bytes + 345, 1}}}, + .data.refcounted = {g_bytes + 362, 1}}}, {{.refcount = &grpc_static_metadata_refcounts[7], .data.refcounted = {g_bytes + 50, 11}}, {.refcount = &grpc_static_metadata_refcounts[27], - .data.refcounted = {g_bytes + 346, 1}}}, - {{.refcount = &grpc_static_metadata_refcounts[9], - .data.refcounted = {g_bytes + 77, 13}}, + .data.refcounted = {g_bytes + 363, 1}}}, + {{.refcount = &grpc_static_metadata_refcounts[7], + .data.refcounted = {g_bytes + 50, 11}}, {.refcount = &grpc_static_metadata_refcounts[28], - .data.refcounted = {g_bytes + 347, 8}}}, + .data.refcounted = {g_bytes + 364, 1}}}, {{.refcount = &grpc_static_metadata_refcounts[9], .data.refcounted = {g_bytes + 77, 13}}, {.refcount = &grpc_static_metadata_refcounts[29], - .data.refcounted = {g_bytes + 355, 4}}}, + .data.refcounted = {g_bytes + 365, 8}}}, {{.refcount = &grpc_static_metadata_refcounts[9], .data.refcounted = {g_bytes + 77, 13}}, {.refcount = &grpc_static_metadata_refcounts[30], - .data.refcounted = {g_bytes + 359, 7}}}, + .data.refcounted = {g_bytes + 373, 4}}}, + {{.refcount = &grpc_static_metadata_refcounts[9], + .data.refcounted = {g_bytes + 77, 13}}, + {.refcount = &grpc_static_metadata_refcounts[31], + .data.refcounted = {g_bytes + 377, 7}}}, {{.refcount = &grpc_static_metadata_refcounts[5], .data.refcounted = {g_bytes + 36, 2}}, - {.refcount = &grpc_static_metadata_refcounts[31], - .data.refcounted = {g_bytes + 366, 8}}}, - {{.refcount = &grpc_static_metadata_refcounts[11], - .data.refcounted = {g_bytes + 110, 12}}, {.refcount = &grpc_static_metadata_refcounts[32], - .data.refcounted = {g_bytes + 374, 16}}}, + .data.refcounted = {g_bytes + 384, 8}}}, + {{.refcount = &grpc_static_metadata_refcounts[14], + .data.refcounted = {g_bytes + 158, 12}}, + {.refcount = &grpc_static_metadata_refcounts[33], + .data.refcounted = {g_bytes + 392, 16}}}, {{.refcount = &grpc_static_metadata_refcounts[1], .data.refcounted = {g_bytes + 5, 7}}, - {.refcount = &grpc_static_metadata_refcounts[33], - .data.refcounted = {g_bytes + 390, 4}}}, - {{.refcount = &grpc_static_metadata_refcounts[2], - .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[34], - .data.refcounted = {g_bytes + 394, 3}}}, + .data.refcounted = {g_bytes + 408, 4}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[35], - .data.refcounted = {g_bytes + 397, 3}}}, - {{.refcount = &grpc_static_metadata_refcounts[4], - .data.refcounted = {g_bytes + 29, 7}}, + .data.refcounted = {g_bytes + 412, 3}}}, + {{.refcount = &grpc_static_metadata_refcounts[2], + .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[36], - .data.refcounted = {g_bytes + 400, 4}}}, + .data.refcounted = {g_bytes + 415, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[4], .data.refcounted = {g_bytes + 29, 7}}, {.refcount = &grpc_static_metadata_refcounts[37], - .data.refcounted = {g_bytes + 404, 5}}}, + .data.refcounted = {g_bytes + 418, 4}}}, {{.refcount = &grpc_static_metadata_refcounts[4], .data.refcounted = {g_bytes + 29, 7}}, {.refcount = &grpc_static_metadata_refcounts[38], - .data.refcounted = {g_bytes + 409, 4}}}, + .data.refcounted = {g_bytes + 422, 5}}}, + {{.refcount = &grpc_static_metadata_refcounts[4], + .data.refcounted = {g_bytes + 29, 7}}, + {.refcount = &grpc_static_metadata_refcounts[39], + .data.refcounted = {g_bytes + 427, 4}}}, {{.refcount = &grpc_static_metadata_refcounts[3], .data.refcounted = {g_bytes + 19, 10}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[1], .data.refcounted = {g_bytes + 5, 7}}, - {.refcount = &grpc_static_metadata_refcounts[39], - .data.refcounted = {g_bytes + 413, 3}}}, + {.refcount = &grpc_static_metadata_refcounts[40], + .data.refcounted = {g_bytes + 431, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[1], .data.refcounted = {g_bytes + 5, 7}}, - {.refcount = &grpc_static_metadata_refcounts[40], - .data.refcounted = {g_bytes + 416, 3}}}, - {{.refcount = &grpc_static_metadata_refcounts[0], - .data.refcounted = {g_bytes + 0, 5}}, {.refcount = &grpc_static_metadata_refcounts[41], - .data.refcounted = {g_bytes + 419, 1}}}, + .data.refcounted = {g_bytes + 434, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[0], .data.refcounted = {g_bytes + 0, 5}}, {.refcount = &grpc_static_metadata_refcounts[42], - .data.refcounted = {g_bytes + 420, 11}}}, - {{.refcount = &grpc_static_metadata_refcounts[2], - .data.refcounted = {g_bytes + 12, 7}}, + .data.refcounted = {g_bytes + 437, 1}}}, + {{.refcount = &grpc_static_metadata_refcounts[0], + .data.refcounted = {g_bytes + 0, 5}}, {.refcount = &grpc_static_metadata_refcounts[43], - .data.refcounted = {g_bytes + 431, 3}}}, + .data.refcounted = {g_bytes + 438, 11}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[44], - .data.refcounted = {g_bytes + 434, 3}}}, + .data.refcounted = {g_bytes + 449, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[45], - .data.refcounted = {g_bytes + 437, 3}}}, + .data.refcounted = {g_bytes + 452, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[46], - .data.refcounted = {g_bytes + 440, 3}}}, + .data.refcounted = {g_bytes + 455, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[2], .data.refcounted = {g_bytes + 12, 7}}, {.refcount = &grpc_static_metadata_refcounts[47], - .data.refcounted = {g_bytes + 443, 3}}}, - {{.refcount = &grpc_static_metadata_refcounts[48], - .data.refcounted = {g_bytes + 446, 14}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[49], - .data.refcounted = {g_bytes + 460, 15}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 458, 3}}}, + {{.refcount = &grpc_static_metadata_refcounts[2], + .data.refcounted = {g_bytes + 12, 7}}, + {.refcount = &grpc_static_metadata_refcounts[48], + .data.refcounted = {g_bytes + 461, 3}}}, {{.refcount = &grpc_static_metadata_refcounts[49], - .data.refcounted = {g_bytes + 460, 15}}, - {.refcount = &grpc_static_metadata_refcounts[50], - .data.refcounted = {g_bytes + 475, 13}}}, - {{.refcount = &grpc_static_metadata_refcounts[51], - .data.refcounted = {g_bytes + 488, 15}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 464, 14}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[50], + .data.refcounted = {g_bytes + 478, 15}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[50], + .data.refcounted = {g_bytes + 478, 15}}, + {.refcount = &grpc_static_metadata_refcounts[51], + .data.refcounted = {g_bytes + 493, 13}}}, {{.refcount = &grpc_static_metadata_refcounts[52], - .data.refcounted = {g_bytes + 503, 13}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 506, 15}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[53], - .data.refcounted = {g_bytes + 516, 6}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 521, 13}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[54], - .data.refcounted = {g_bytes + 522, 27}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 534, 6}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[55], - .data.refcounted = {g_bytes + 549, 3}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 540, 27}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[56], - .data.refcounted = {g_bytes + 552, 5}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 567, 3}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[57], - .data.refcounted = {g_bytes + 557, 13}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 570, 5}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[58], - .data.refcounted = {g_bytes + 570, 13}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 575, 13}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[59], - .data.refcounted = {g_bytes + 583, 19}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 588, 13}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[60], - .data.refcounted = {g_bytes + 602, 16}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 601, 19}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[61], - .data.refcounted = {g_bytes + 618, 16}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 620, 16}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[62], - .data.refcounted = {g_bytes + 634, 14}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 636, 16}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[63], - .data.refcounted = {g_bytes + 648, 16}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 652, 14}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[64], - .data.refcounted = {g_bytes + 664, 13}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[11], - .data.refcounted = {g_bytes + 110, 12}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 666, 16}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[65], - .data.refcounted = {g_bytes + 677, 6}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 682, 13}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[14], + .data.refcounted = {g_bytes + 158, 12}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[66], - .data.refcounted = {g_bytes + 683, 4}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 695, 6}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[67], - .data.refcounted = {g_bytes + 687, 4}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 701, 4}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[68], - .data.refcounted = {g_bytes + 691, 6}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 705, 4}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[69], - .data.refcounted = {g_bytes + 697, 7}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 709, 6}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[70], - .data.refcounted = {g_bytes + 704, 4}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[14], - .data.refcounted = {g_bytes + 162, 4}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 715, 7}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[71], - .data.refcounted = {g_bytes + 708, 8}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 722, 4}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[17], + .data.refcounted = {g_bytes + 210, 4}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[72], - .data.refcounted = {g_bytes + 716, 17}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 726, 8}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[73], - .data.refcounted = {g_bytes + 733, 13}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 734, 17}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[74], - .data.refcounted = {g_bytes + 746, 8}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 751, 13}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[75], - .data.refcounted = {g_bytes + 754, 19}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 764, 8}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[76], - .data.refcounted = {g_bytes + 773, 13}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[15], - .data.refcounted = {g_bytes + 166, 8}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 772, 19}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[77], - .data.refcounted = {g_bytes + 786, 4}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 791, 13}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[18], + .data.refcounted = {g_bytes + 214, 8}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[78], - .data.refcounted = {g_bytes + 790, 8}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 804, 4}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[79], - .data.refcounted = {g_bytes + 798, 12}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 808, 8}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[80], - .data.refcounted = {g_bytes + 810, 18}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 816, 12}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[81], - .data.refcounted = {g_bytes + 828, 19}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 828, 18}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[82], - .data.refcounted = {g_bytes + 847, 5}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 846, 19}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[83], - .data.refcounted = {g_bytes + 852, 7}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 865, 5}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[84], - .data.refcounted = {g_bytes + 859, 7}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 870, 7}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[85], - .data.refcounted = {g_bytes + 866, 11}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 877, 7}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[86], - .data.refcounted = {g_bytes + 877, 6}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 884, 11}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[87], - .data.refcounted = {g_bytes + 883, 10}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 895, 6}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[88], - .data.refcounted = {g_bytes + 893, 25}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 901, 10}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[89], - .data.refcounted = {g_bytes + 918, 17}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, - {{.refcount = &grpc_static_metadata_refcounts[13], - .data.refcounted = {g_bytes + 152, 10}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 911, 25}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[90], - .data.refcounted = {g_bytes + 935, 4}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 936, 17}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[16], + .data.refcounted = {g_bytes + 200, 10}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[91], - .data.refcounted = {g_bytes + 939, 3}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 953, 4}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[92], - .data.refcounted = {g_bytes + 942, 16}}, - {.refcount = &grpc_static_metadata_refcounts[19], - .data.refcounted = {g_bytes + 216, 0}}}, + .data.refcounted = {g_bytes + 957, 3}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, + {{.refcount = &grpc_static_metadata_refcounts[93], + .data.refcounted = {g_bytes + 960, 16}}, + {.refcount = &grpc_static_metadata_refcounts[20], + .data.refcounted = {g_bytes + 234, 0}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[28], - .data.refcounted = {g_bytes + 347, 8}}}, - {{.refcount = &grpc_static_metadata_refcounts[10], - .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[30], - .data.refcounted = {g_bytes + 359, 7}}}, + {.refcount = &grpc_static_metadata_refcounts[29], + .data.refcounted = {g_bytes + 365, 8}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[93], - .data.refcounted = {g_bytes + 958, 16}}}, + {.refcount = &grpc_static_metadata_refcounts[31], + .data.refcounted = {g_bytes + 377, 7}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[29], - .data.refcounted = {g_bytes + 355, 4}}}, + {.refcount = &grpc_static_metadata_refcounts[94], + .data.refcounted = {g_bytes + 976, 16}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, - {.refcount = &grpc_static_metadata_refcounts[94], - .data.refcounted = {g_bytes + 974, 13}}}, + {.refcount = &grpc_static_metadata_refcounts[30], + .data.refcounted = {g_bytes + 373, 4}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, {.refcount = &grpc_static_metadata_refcounts[95], - .data.refcounted = {g_bytes + 987, 12}}}, + .data.refcounted = {g_bytes + 992, 13}}}, {{.refcount = &grpc_static_metadata_refcounts[10], .data.refcounted = {g_bytes + 90, 20}}, {.refcount = &grpc_static_metadata_refcounts[96], - .data.refcounted = {g_bytes + 999, 21}}}, + .data.refcounted = {g_bytes + 1005, 12}}}, + {{.refcount = &grpc_static_metadata_refcounts[10], + .data.refcounted = {g_bytes + 90, 20}}, + {.refcount = &grpc_static_metadata_refcounts[97], + .data.refcounted = {g_bytes + 1017, 21}}}, }; const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 73, 74, 75, 76, 77, 78, 79}; diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h index f9600ee2e4..dcbe418edc 100644 --- a/src/core/lib/transport/static_metadata.h +++ b/src/core/lib/transport/static_metadata.h @@ -44,7 +44,7 @@ #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]; /* ":path" */ #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]) /* "grpc-accept-encoding" */ #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" */ -#define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table[11]) +#define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table[14]) /* "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" */ -#define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table[13]) +#define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table[16]) /* "host" */ -#define GRPC_MDSTR_HOST (grpc_static_slice_table[14]) +#define GRPC_MDSTR_HOST (grpc_static_slice_table[17]) /* "lb-token" */ -#define GRPC_MDSTR_LB_TOKEN (grpc_static_slice_table[15]) +#define GRPC_MDSTR_LB_TOKEN (grpc_static_slice_table[18]) /* "grpc-timeout" */ -#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table[16]) -/* "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_GRPC_TIMEOUT (grpc_static_slice_table[19]) /* "" */ -#define GRPC_MDSTR_EMPTY (grpc_static_slice_table[19]) +#define GRPC_MDSTR_EMPTY (grpc_static_slice_table[20]) /* "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" */ -#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" */ #define GRPC_MDSTR_GRPC_DOT_MAX_REQUEST_MESSAGE_BYTES \ - (grpc_static_slice_table[22]) + (grpc_static_slice_table[23]) /* "grpc.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" */ #define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \ - (grpc_static_slice_table[24]) + (grpc_static_slice_table[25]) /* "0" */ -#define GRPC_MDSTR_0 (grpc_static_slice_table[25]) +#define GRPC_MDSTR_0 (grpc_static_slice_table[26]) /* "1" */ -#define GRPC_MDSTR_1 (grpc_static_slice_table[26]) +#define GRPC_MDSTR_1 (grpc_static_slice_table[27]) /* "2" */ -#define GRPC_MDSTR_2 (grpc_static_slice_table[27]) +#define GRPC_MDSTR_2 (grpc_static_slice_table[28]) /* "identity" */ -#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[28]) +#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table[29]) /* "gzip" */ -#define GRPC_MDSTR_GZIP (grpc_static_slice_table[29]) +#define GRPC_MDSTR_GZIP (grpc_static_slice_table[30]) /* "deflate" */ -#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[30]) +#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table[31]) /* "trailers" */ -#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[31]) +#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table[32]) /* "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" */ -#define GRPC_MDSTR_POST (grpc_static_slice_table[33]) +#define GRPC_MDSTR_POST (grpc_static_slice_table[34]) /* "200" */ -#define GRPC_MDSTR_200 (grpc_static_slice_table[34]) +#define GRPC_MDSTR_200 (grpc_static_slice_table[35]) /* "404" */ -#define GRPC_MDSTR_404 (grpc_static_slice_table[35]) +#define GRPC_MDSTR_404 (grpc_static_slice_table[36]) /* "http" */ -#define GRPC_MDSTR_HTTP (grpc_static_slice_table[36]) +#define GRPC_MDSTR_HTTP (grpc_static_slice_table[37]) /* "https" */ -#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[37]) +#define GRPC_MDSTR_HTTPS (grpc_static_slice_table[38]) /* "grpc" */ -#define GRPC_MDSTR_GRPC (grpc_static_slice_table[38]) +#define GRPC_MDSTR_GRPC (grpc_static_slice_table[39]) /* "GET" */ -#define GRPC_MDSTR_GET (grpc_static_slice_table[39]) +#define GRPC_MDSTR_GET (grpc_static_slice_table[40]) /* "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" */ -#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" */ -#define GRPC_MDSTR_204 (grpc_static_slice_table[43]) +#define GRPC_MDSTR_204 (grpc_static_slice_table[44]) /* "206" */ -#define GRPC_MDSTR_206 (grpc_static_slice_table[44]) +#define GRPC_MDSTR_206 (grpc_static_slice_table[45]) /* "304" */ -#define GRPC_MDSTR_304 (grpc_static_slice_table[45]) +#define GRPC_MDSTR_304 (grpc_static_slice_table[46]) /* "400" */ -#define GRPC_MDSTR_400 (grpc_static_slice_table[46]) +#define GRPC_MDSTR_400 (grpc_static_slice_table[47]) /* "500" */ -#define GRPC_MDSTR_500 (grpc_static_slice_table[47]) +#define GRPC_MDSTR_500 (grpc_static_slice_table[48]) /* "accept-charset" */ -#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[48]) +#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table[49]) /* "accept-encoding" */ -#define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table[49]) +#define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table[50]) /* "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" */ -#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[51]) +#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table[52]) /* "accept-ranges" */ -#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[52]) +#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table[53]) /* "accept" */ -#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[53]) +#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table[54]) /* "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" */ -#define GRPC_MDSTR_AGE (grpc_static_slice_table[55]) +#define GRPC_MDSTR_AGE (grpc_static_slice_table[56]) /* "allow" */ -#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[56]) +#define GRPC_MDSTR_ALLOW (grpc_static_slice_table[57]) /* "authorization" */ -#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[57]) +#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table[58]) /* "cache-control" */ -#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[58]) +#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table[59]) /* "content-disposition" */ -#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[59]) +#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table[60]) /* "content-encoding" */ -#define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table[60]) +#define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table[61]) /* "content-language" */ -#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[61]) +#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table[62]) /* "content-length" */ -#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[62]) +#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table[63]) /* "content-location" */ -#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[63]) +#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table[64]) /* "content-range" */ -#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[64]) +#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table[65]) /* "cookie" */ -#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[65]) +#define GRPC_MDSTR_COOKIE (grpc_static_slice_table[66]) /* "date" */ -#define GRPC_MDSTR_DATE (grpc_static_slice_table[66]) +#define GRPC_MDSTR_DATE (grpc_static_slice_table[67]) /* "etag" */ -#define GRPC_MDSTR_ETAG (grpc_static_slice_table[67]) +#define GRPC_MDSTR_ETAG (grpc_static_slice_table[68]) /* "expect" */ -#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[68]) +#define GRPC_MDSTR_EXPECT (grpc_static_slice_table[69]) /* "expires" */ -#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[69]) +#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table[70]) /* "from" */ -#define GRPC_MDSTR_FROM (grpc_static_slice_table[70]) +#define GRPC_MDSTR_FROM (grpc_static_slice_table[71]) /* "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" */ -#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" */ -#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[73]) +#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table[74]) /* "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" */ -#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[75]) +#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table[76]) /* "last-modified" */ -#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[76]) +#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table[77]) /* "link" */ -#define GRPC_MDSTR_LINK (grpc_static_slice_table[77]) +#define GRPC_MDSTR_LINK (grpc_static_slice_table[78]) /* "location" */ -#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[78]) +#define GRPC_MDSTR_LOCATION (grpc_static_slice_table[79]) /* "max-forwards" */ -#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[79]) +#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table[80]) /* "proxy-authenticate" */ -#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[80]) +#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table[81]) /* "proxy-authorization" */ -#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[81]) +#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table[82]) /* "range" */ -#define GRPC_MDSTR_RANGE (grpc_static_slice_table[82]) +#define GRPC_MDSTR_RANGE (grpc_static_slice_table[83]) /* "referer" */ -#define GRPC_MDSTR_REFERER (grpc_static_slice_table[83]) +#define GRPC_MDSTR_REFERER (grpc_static_slice_table[84]) /* "refresh" */ -#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[84]) +#define GRPC_MDSTR_REFRESH (grpc_static_slice_table[85]) /* "retry-after" */ -#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[85]) +#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table[86]) /* "server" */ -#define GRPC_MDSTR_SERVER (grpc_static_slice_table[86]) +#define GRPC_MDSTR_SERVER (grpc_static_slice_table[87]) /* "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" */ -#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[88]) +#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table[89]) /* "transfer-encoding" */ -#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[89]) +#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table[90]) /* "vary" */ -#define GRPC_MDSTR_VARY (grpc_static_slice_table[90]) +#define GRPC_MDSTR_VARY (grpc_static_slice_table[91]) /* "via" */ -#define GRPC_MDSTR_VIA (grpc_static_slice_table[91]) +#define GRPC_MDSTR_VIA (grpc_static_slice_table[92]) /* "www-authenticate" */ -#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[92]) +#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table[93]) /* "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" */ -#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[94]) +#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table[95]) /* "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" */ #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 grpc_slice_refcount @@ -512,6 +514,9 @@ typedef enum { GRPC_BATCH_GRPC_PAYLOAD_BIN, GRPC_BATCH_GRPC_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_GRPC_INTERNAL_ENCODING_REQUEST, GRPC_BATCH_USER_AGENT, @@ -534,6 +539,9 @@ typedef union { struct grpc_linked_mdelem *grpc_payload_bin; struct grpc_linked_mdelem *grpc_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 *grpc_internal_encoding_request; struct grpc_linked_mdelem *user_agent; diff --git a/test/core/end2end/fuzzers/hpack.dictionary b/test/core/end2end/fuzzers/hpack.dictionary index 6b96785419..4282c61214 100644 --- a/test/core/end2end/fuzzers/hpack.dictionary +++ b/test/core/end2end/fuzzers/hpack.dictionary @@ -10,14 +10,15 @@ "\x10grpc-payload-bin" "\x0Dgrpc-encoding" "\x14grpc-accept-encoding" +"\x15grpc-server-stats-bin" +"\x0Dgrpc-tags-bin" +"\x0Egrpc-trace-bin" "\x0Ccontent-type" "\x1Egrpc-internal-encoding-request" "\x0Auser-agent" "\x04host" "\x08lb-token" "\x0Cgrpc-timeout" -"\x10grpc-tracing-bin" -"\x0Egrpc-stats-bin" "\x00" "\x13grpc.wait_for_ready" "\x0Cgrpc.timeout" diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py index 109701f740..ead57b2bf6 100755 --- a/tools/codegen/core/gen_static_metadata.py +++ b/tools/codegen/core/gen_static_metadata.py @@ -56,8 +56,9 @@ CONFIG = [ ':authority', 'grpc-message', 'grpc-status', - 'grpc-tracing-bin', - 'grpc-stats-bin', + 'grpc-server-stats-bin', + 'grpc-tags-bin', + 'grpc-trace-bin', '', # channel arg keys 'grpc.wait_for_ready', @@ -154,6 +155,9 @@ METADATA_BATCH_CALLOUTS = [ 'grpc-payload-bin', 'grpc-encoding', 'grpc-accept-encoding', + 'grpc-server-stats-bin', + 'grpc-tags-bin', + 'grpc-trace-bin', 'content-type', 'grpc-internal-encoding-request', 'user-agent', @@ -167,6 +171,7 @@ COMPRESSION_ALGORITHMS = [ 'gzip', ] + # utility: mangle the name of a config def mangle(elem, name=None): xl = { @@ -177,43 +182,56 @@ def mangle(elem, name=None): ',': 'comma', ' ': '_', } + def m0(x): - if not x: return 'empty' + if not x: + return 'empty' r = '' for c in x: put = xl.get(c, c.lower()) - if not put: continue + if not put: + continue 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: - if not last_is_underscore: r += '_' + if not last_is_underscore: + r += '_' r += put r += '_' else: r += put - if r[-1] == '_': r = r[:-1] + if r[-1] == '_': + r = r[:-1] return r + def n(default, name=name): - if name is None: return 'grpc_%s_' % default - if name == '': return '' + if name is None: + return 'grpc_%s_' % default + if name == '': + return '' return 'grpc_%s_' % name + if isinstance(elem, tuple): return '%s%s_%s' % (n('mdelem'), m0(elem[0]), m0(elem[1])) else: return '%s%s' % (n('mdstr'), m0(elem)) + # utility: generate some hash value for a string def fake_hash(elem): return hashlib.md5(elem).hexdigest()[0:8] + # utility: print a big comment block into a set of files def put_banner(files, banner): for f in files: - print >>f, '/*' + print >> f, '/*' for line in banner: - print >>f, ' * %s' % line - print >>f, ' */' - print >>f + print >> f, ' * %s' % line + print >> f, ' */' + print >> f + # build a list of all the strings we need all_strs = list() @@ -236,7 +254,7 @@ for elem in CONFIG: if elem not in all_strs: all_strs.append(elem) compression_elems = [] -for mask in range(1, 1<>H, '#ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H' -print >>H, '#define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H' -print >>H -print >>H, '#include "src/core/lib/transport/metadata.h"' -print >>H +print >> H, '#ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H' +print >> H, '#define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H' +print >> H +print >> H, '#include "src/core/lib/transport/metadata.h"' +print >> H -print >>C, '#include "src/core/lib/transport/static_metadata.h"' -print >>C -print >>C, '#include "src/core/lib/slice/slice_internal.h"' -print >>C +print >> C, '#include "src/core/lib/transport/static_metadata.h"' +print >> C +print >> C, '#include "src/core/lib/slice/slice_internal.h"' +print >> C str_ofs = 0 id2strofs = {} for i, elem in enumerate(all_strs): id2strofs[i] = str_ofs - str_ofs += len(elem); + str_ofs += len(elem) + + 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 for elem in METADATA_BATCH_CALLOUTS: assert elem in 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, '#define GRPC_STATIC_MDSTR_COUNT %d' % len(all_strs) +print >> H, ('extern const grpc_slice ' + 'grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT];') for i, elem in enumerate(all_strs): - print >>H, '/* "%s" */' % elem - print >>H, '#define %s (grpc_static_slice_table[%d])' % (mangle(elem).upper(), i) -print >>H -print >>C, 'static uint8_t g_bytes[] = {%s};' % (','.join('%d' % ord(c) for c in ''.join(all_strs))) -print >>C -print >>C, 'static void static_ref(void *unused) {}' -print >>C, 'static void static_unref(grpc_exec_ctx *exec_ctx, void *unused) {}' -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 >>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] = {' + print >> H, '/* "%s" */' % elem + print >> H, '#define %s (grpc_static_slice_table[%d])' % ( + mangle(elem).upper(), i) +print >> H +print >> C, 'static uint8_t g_bytes[] = {%s};' % ( + ','.join('%d' % ord(c) for c in ''.join(all_strs))) +print >> C +print >> C, 'static void static_ref(void *unused) {}' +print >> C, 'static void static_unref(grpc_exec_ctx *exec_ctx, void *unused) {}' +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 >> 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): - print >>C, ' {&grpc_static_metadata_vtable, &static_sub_refcnt},' -print >>C, '};' -print >>C -print >>H, '#define GRPC_IS_STATIC_METADATA_STRING(slice) \\' -print >>H, ' ((slice).refcount != NULL && (slice).refcount->vtable == &grpc_static_metadata_vtable)' -print >>H -print >>C, 'const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT] = {' + print >> C, ' {&grpc_static_metadata_vtable, &static_sub_refcnt},' +print >> C, '};' +print >> C +print >> H, '#define GRPC_IS_STATIC_METADATA_STRING(slice) \\' +print >> H, (' ((slice).refcount != NULL && (slice).refcount->vtable == ' + '&grpc_static_metadata_vtable)') +print >> H +print >> C, ('const grpc_slice grpc_static_slice_table[GRPC_STATIC_MDSTR_COUNT]' + ' = {') for i, elem in enumerate(all_strs): - print >>C, slice_def(i) + ',' -print >>C, '};' -print >>C -print >>H, '#define GRPC_STATIC_METADATA_INDEX(static_slice) \\' -print >>H, ' ((int)((static_slice).refcount - grpc_static_metadata_refcounts))' -print >>H - -print >>D, '# hpack fuzzing dictionary' + print >> C, slice_def(i) + ',' +print >> C, '};' +print >> C +print >> H, '#define GRPC_STATIC_METADATA_INDEX(static_slice) \\' +print >> H, (' ((int)((static_slice).refcount - ' + 'grpc_static_metadata_refcounts))') +print >> H + +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])) + 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_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];' -print >>H, 'extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];' + 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_data ' + '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): - 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 -print >>C, 'uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = {' -print >>C, ' %s' % ','.join('%d' % static_userdata.get(elem, 0) for elem in all_elems) -print >>C, '};' -print >>C + 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 +print >> C, ('uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] ' + '= {') +print >> C, ' %s' % ','.join('%d' % static_userdata.get(elem, 0) + for elem in all_elems) +print >> C, '};' +print >> C + def str_idx(s): for i, s2 in enumerate(all_strs): if s == s2: return i + def md_idx(m): for i, m2 in enumerate(all_elems): if m == m2: return i + def offset_trials(mink): yield 0 for i in range(1, 100): for mul in [-1, 1]: yield mul * i + def perfect_hash(keys, name): p = perfection.hash_parameters(keys) + def f(i, p=p): i += p.offset x = i % p.t y = i / p.t return x + p.r[y] + return { - 'PHASHRANGE': p.t - 1 + max(p.r), - 'PHASHNKEYS': len(p.slots), - 'pyfunc': f, - 'code': """ + 'PHASHRANGE': + p.t - 1 + max(p.r), + 'PHASHNKEYS': + len(p.slots), + 'pyfunc': + f, + 'code': + """ static const int8_t %(name)s_r[] = {%(r)s}; static uint32_t %(name)s_phash(uint32_t i) { i %(offset_sign)s= %(offset)d; @@ -430,71 +489,77 @@ static uint32_t %(name)s_phash(uint32_t i) { return h; } """ % { - 'name': name, - 'r': ','.join('%d' % (r if r is not None else 0) for r in p.r), - 't': p.t, - 'offset': abs(p.offset), - 'offset_sign': '+' if p.offset > 0 else '-' + 'name': name, + 'r': ','.join('%d' % (r if r is not None else 0) for r in p.r), + 't': p.t, + 'offset': abs(p.offset), + '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_hash = perfect_hash(elem_keys, "elems") -print >>C, elem_hash['code'] +elem_keys = [ + str_idx(elem[0]) * len(all_strs) + str_idx(elem[1]) for elem in all_elems +] +elem_hash = perfect_hash(elem_keys, 'elems') +print >> C, elem_hash['code'] keys = [0] * int(elem_hash['PHASHRANGE']) idxs = [255] * int(elem_hash['PHASHNKEYS']) for i, k in enumerate(elem_keys): - h = elem_hash['pyfunc'](k) - assert keys[h] == 0 - keys[h] = k - idxs[h] = i -print >>C, 'static const uint16_t elem_keys[] = {%s};' % ','.join('%d' % k for k in keys) -print >>C, 'static const uint8_t elem_idxs[] = {%s};' % ','.join('%d' % i for i in idxs) -print >>C - -print >>H, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b);' -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 >>C, ' uint32_t k = (uint32_t)(a * %d + b);' % len(all_strs) -print >>C, ' uint32_t h = elems_phash(k);' -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 - -print >>C, 'grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {' + h = elem_hash['pyfunc'](k) + assert keys[h] == 0 + keys[h] = k + idxs[h] = i +print >> C, 'static const uint16_t elem_keys[] = {%s};' % ','.join( + '%d' % k for k in keys) +print >> C, 'static const uint8_t elem_idxs[] = {%s};' % ','.join( + '%d' % i for i in idxs) +print >> C + +print >> H, 'grpc_mdelem grpc_static_mdelem_for_static_strings(int a, int b);' +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 >> C, ' uint32_t k = (uint32_t)(a * %d + b);' % len(all_strs) +print >> C, ' uint32_t h = elems_phash(k);' +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 + +print >> C, 'grpc_mdelem_data grpc_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {' for a, b in all_elems: - print >>C, '{%s,%s},' % (slice_def(str_idx(a)), slice_def(str_idx(b))) -print >>C, '};' + print >> C, '{%s,%s},' % (slice_def(str_idx(a)), slice_def(str_idx(b))) +print >> C, '};' -print >>H, 'typedef enum {' +print >> H, 'typedef enum {' for elem in METADATA_BATCH_CALLOUTS: - print >>H, ' %s,' % mangle(elem, 'batch').upper() -print >>H, ' GRPC_BATCH_CALLOUTS_COUNT' -print >>H, '} grpc_metadata_batch_callouts_index;' -print >>H -print >>H, 'typedef union {' -print >>H, ' struct grpc_linked_mdelem *array[GRPC_BATCH_CALLOUTS_COUNT];' -print >>H, ' struct {' + print >> H, ' %s,' % mangle(elem, 'batch').upper() +print >> H, ' GRPC_BATCH_CALLOUTS_COUNT' +print >> H, '} grpc_metadata_batch_callouts_index;' +print >> H +print >> H, 'typedef union {' +print >> H, ' struct grpc_linked_mdelem *array[GRPC_BATCH_CALLOUTS_COUNT];' +print >> H, ' struct {' for elem in METADATA_BATCH_CALLOUTS: - print >>H, ' struct grpc_linked_mdelem *%s;' % mangle(elem, '').lower() -print >>H, ' } named;' -print >>H, '} grpc_metadata_batch_callouts;' -print >>H -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 - -print >>H, 'extern const uint8_t grpc_static_accept_encoding_metadata[%d];' % (1 << len(COMPRESSION_ALGORITHMS)) -print >>C, 'const uint8_t grpc_static_accept_encoding_metadata[%d] = {' % (1 << len(COMPRESSION_ALGORITHMS)) -print >>C, '0,%s' % ','.join('%d' % md_idx(elem) for elem in compression_elems) -print >>C, '};' -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 >>H, '#endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */' + print >> H, ' struct grpc_linked_mdelem *%s;' % mangle(elem, '').lower() +print >> H, ' } named;' +print >> H, '} grpc_metadata_batch_callouts;' +print >> H +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 + +print >> H, 'extern const uint8_t grpc_static_accept_encoding_metadata[%d];' % ( + 1 << len(COMPRESSION_ALGORITHMS)) +print >> C, 'const uint8_t grpc_static_accept_encoding_metadata[%d] = {' % ( + 1 << len(COMPRESSION_ALGORITHMS)) +print >> C, '0,%s' % ','.join('%d' % md_idx(elem) for elem in compression_elems) +print >> C, '};' +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 >> H, '#endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */' H.close() C.close() -- cgit v1.2.3