Bool-ify is_client param.

pull/13336/head
Mark D. Roth 7 years ago
parent fbc3f04eab
commit bcfd0f38fc
  1. 4
      src/core/ext/transport/chttp2/client/chttp2_connector.cc
  2. 2
      src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
  3. 4
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  4. 2
      src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
  5. 4
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  6. 2
      src/core/ext/transport/chttp2/transport/chttp2_transport.h
  7. 2
      test/core/bad_client/bad_client.cc
  8. 4
      test/core/end2end/fixtures/h2_sockpair+trace.cc
  9. 4
      test/core/end2end/fixtures/h2_sockpair.cc
  10. 4
      test/core/end2end/fixtures/h2_sockpair_1byte.cc
  11. 2
      test/core/end2end/fuzzers/api_fuzzer.cc
  12. 2
      test/core/end2end/fuzzers/client_fuzzer.cc
  13. 2
      test/core/end2end/fuzzers/server_fuzzer.cc
  14. 6
      test/cpp/microbenchmarks/fullstack_fixtures.h
  15. 6
      test/cpp/performance/writes_per_rpc_test.cc

@ -117,8 +117,8 @@ static void on_handshake_done(grpc_exec_ctx* exec_ctx, void* arg,
} else {
grpc_endpoint_delete_from_pollset_set(exec_ctx, args->endpoint,
c->args.interested_parties);
c->result->transport =
grpc_create_chttp2_transport(exec_ctx, args->args, args->endpoint, 1);
c->result->transport = grpc_create_chttp2_transport(
exec_ctx, args->args, args->endpoint, true);
GPR_ASSERT(c->result->transport);
grpc_chttp2_transport_start_reading(exec_ctx, c->result->transport,
args->read_buffer);

@ -53,7 +53,7 @@ grpc_channel* grpc_insecure_channel_create_from_fd(
&exec_ctx, grpc_fd_create(fd, "client"), args, "fd-client");
grpc_transport* transport =
grpc_create_chttp2_transport(&exec_ctx, final_args, client, 1);
grpc_create_chttp2_transport(&exec_ctx, final_args, client, true);
GPR_ASSERT(transport);
grpc_channel* channel = grpc_channel_create(
&exec_ctx, target, final_args, GRPC_CLIENT_DIRECT_CHANNEL, transport);

@ -88,8 +88,8 @@ static void on_handshake_done(grpc_exec_ctx* exec_ctx, void* arg,
// handshaker may have handed off the connection to some external
// code, so we can just clean up here without creating a transport.
if (args->endpoint != NULL) {
grpc_transport* transport =
grpc_create_chttp2_transport(exec_ctx, args->args, args->endpoint, 0);
grpc_transport* transport = grpc_create_chttp2_transport(
exec_ctx, args->args, args->endpoint, false);
grpc_server_setup_transport(
exec_ctx, connection_state->svr_state->server, transport,
connection_state->accepting_pollset, args->args);

@ -50,7 +50,7 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
const grpc_channel_args* server_args = grpc_server_get_channel_args(server);
grpc_transport* transport = grpc_create_chttp2_transport(
&exec_ctx, server_args, server_endpoint, 0 /* is_client */);
&exec_ctx, server_args, server_endpoint, false /* is_client */);
grpc_pollset** pollsets;
size_t num_pollsets = 0;

@ -3224,10 +3224,10 @@ static const grpc_transport_vtable* get_vtable(void) { return &vtable; }
grpc_transport* grpc_create_chttp2_transport(
grpc_exec_ctx* exec_ctx, const grpc_channel_args* channel_args,
grpc_endpoint* ep, int is_client) {
grpc_endpoint* ep, bool is_client) {
grpc_chttp2_transport* t =
(grpc_chttp2_transport*)gpr_zalloc(sizeof(grpc_chttp2_transport));
init_transport(exec_ctx, t, channel_args, ep, is_client != 0);
init_transport(exec_ctx, t, channel_args, ep, is_client);
return &t->base;
}

@ -37,7 +37,7 @@ extern grpc_tracer_flag grpc_trace_chttp2_refcount;
grpc_transport* grpc_create_chttp2_transport(
grpc_exec_ctx* exec_ctx, const grpc_channel_args* channel_args,
grpc_endpoint* ep, int is_client);
grpc_endpoint* ep, bool is_client);
/// Takes ownership of \a read_buffer, which (if non-NULL) contains
/// leftover bytes previously read from the endpoint (e.g., by handshakers).

@ -115,7 +115,7 @@ void grpc_run_bad_client_test(
GRPC_BAD_CLIENT_REGISTERED_HOST,
GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER, 0);
grpc_server_start(a.server);
transport = grpc_create_chttp2_transport(&exec_ctx, NULL, sfd.server, 0);
transport = grpc_create_chttp2_transport(&exec_ctx, NULL, sfd.server, false);
server_setup_transport(&a, transport);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
grpc_exec_ctx_finish(&exec_ctx);

@ -97,7 +97,7 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f,
cs.client_args = client_args;
cs.f = f;
transport =
grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, true);
client_setup_transport(&exec_ctx, &cs, transport);
GPR_ASSERT(f->client);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
@ -114,7 +114,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f,
grpc_server_register_completion_queue(f->server, f->cq, NULL);
grpc_server_start(f->server);
transport =
grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, false);
server_setup_transport(f, transport);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
grpc_exec_ctx_finish(&exec_ctx);

@ -91,7 +91,7 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f,
cs.client_args = client_args;
cs.f = f;
transport =
grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, true);
client_setup_transport(&exec_ctx, &cs, transport);
GPR_ASSERT(f->client);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
@ -108,7 +108,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f,
grpc_server_register_completion_queue(f->server, f->cq, NULL);
grpc_server_start(f->server);
transport =
grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, false);
server_setup_transport(f, transport);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
grpc_exec_ctx_finish(&exec_ctx);

@ -102,7 +102,7 @@ static void chttp2_init_client_socketpair(grpc_end2end_test_fixture* f,
cs.client_args = client_args;
cs.f = f;
transport =
grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, 1);
grpc_create_chttp2_transport(&exec_ctx, client_args, sfd->client, true);
client_setup_transport(&exec_ctx, &cs, transport);
GPR_ASSERT(f->client);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
@ -119,7 +119,7 @@ static void chttp2_init_server_socketpair(grpc_end2end_test_fixture* f,
grpc_server_register_completion_queue(f->server, f->cq, NULL);
grpc_server_start(f->server);
transport =
grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, 0);
grpc_create_chttp2_transport(&exec_ctx, server_args, sfd->server, false);
server_setup_transport(f, transport);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
grpc_exec_ctx_finish(&exec_ctx);

@ -464,7 +464,7 @@ static void do_connect(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
*fc->ep = client;
grpc_transport* transport =
grpc_create_chttp2_transport(exec_ctx, NULL, server, 0);
grpc_create_chttp2_transport(exec_ctx, NULL, server, false);
grpc_server_setup_transport(exec_ctx, g_server, transport, NULL, NULL);
grpc_chttp2_transport_start_reading(exec_ctx, transport, NULL);

@ -54,7 +54,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
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_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, true);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);
grpc_channel* channel = grpc_channel_create(

@ -61,7 +61,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
// grpc_server_register_method(server, "/reg", NULL, 0);
grpc_server_start(server);
grpc_transport* transport =
grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 0);
grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, false);
grpc_server_setup_transport(&exec_ctx, server, transport, NULL, NULL);
grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL);

@ -174,7 +174,7 @@ class EndpointPairFixture : public BaseFixture {
const grpc_channel_args* server_args =
grpc_server_get_channel_args(server_->c_server());
server_transport_ = grpc_create_chttp2_transport(
&exec_ctx, server_args, endpoints.server, 0 /* is_client */);
&exec_ctx, server_args, endpoints.server, false /* is_client */);
grpc_pollset** pollsets;
size_t num_pollsets = 0;
@ -196,8 +196,8 @@ class EndpointPairFixture : public BaseFixture {
fixture_configuration.ApplyCommonChannelArguments(&args);
grpc_channel_args c_args = args.c_channel_args();
client_transport_ =
grpc_create_chttp2_transport(&exec_ctx, &c_args, endpoints.client, 1);
client_transport_ = grpc_create_chttp2_transport(
&exec_ctx, &c_args, endpoints.client, true);
GPR_ASSERT(client_transport_);
grpc_channel* channel =
grpc_channel_create(&exec_ctx, "target", &c_args,

@ -89,7 +89,7 @@ class EndpointPairFixture {
const grpc_channel_args* server_args =
grpc_server_get_channel_args(server_->c_server());
grpc_transport* transport = grpc_create_chttp2_transport(
&exec_ctx, server_args, endpoints.server, 0 /* is_client */);
&exec_ctx, server_args, endpoints.server, false /* is_client */);
grpc_pollset** pollsets;
size_t num_pollsets = 0;
@ -111,8 +111,8 @@ class EndpointPairFixture {
ApplyCommonChannelArguments(&args);
grpc_channel_args c_args = args.c_channel_args();
grpc_transport* transport =
grpc_create_chttp2_transport(&exec_ctx, &c_args, endpoints.client, 1);
grpc_transport* transport = grpc_create_chttp2_transport(
&exec_ctx, &c_args, endpoints.client, true);
GPR_ASSERT(transport);
grpc_channel* channel = grpc_channel_create(
&exec_ctx, "target", &c_args, GRPC_CLIENT_DIRECT_CHANNEL, transport);

Loading…
Cancel
Save