diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index d1fb3fc3833..5d2f3ee2f25 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -372,6 +372,7 @@ static void server_delete(grpc_exec_ctx *exec_ctx, grpc_server *server) { for (i = 0; i < server->cq_count; i++) { request_matcher_destroy(&rm->request_matchers[i]); } + gpr_free(rm->request_matchers); gpr_free(rm->method); gpr_free(rm->host); gpr_free(rm); @@ -381,6 +382,7 @@ static void server_delete(grpc_exec_ctx *exec_ctx, grpc_server *server) { request_matcher_destroy(&server->unregistered_request_matchers[i]); } gpr_stack_lockfree_destroy(server->request_freelist); + gpr_free(server->unregistered_request_matchers); gpr_free(server->cqs); gpr_free(server->pollsets); gpr_free(server->shutdown_tags); diff --git a/test/core/bad_client/bad_client.c b/test/core/bad_client/bad_client.c index e5820688ef1..f753b6fd243 100644 --- a/test/core/bad_client/bad_client.c +++ b/test/core/bad_client/bad_client.c @@ -70,7 +70,7 @@ static void done_write(grpc_exec_ctx *exec_ctx, void *arg, bool success) { static void server_setup_transport(void *ts, grpc_transport *transport) { thd_args *a = ts; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_server_setup_transport(&exec_ctx, a->server, transport, + grpc_server_setup_transport(&exec_ctx, a->server, transport, NULL, grpc_server_get_channel_args(a->server)); grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/client_config/set_initial_connect_string_test.c b/test/core/client_config/set_initial_connect_string_test.c index c1b84528663..f21d651d46b 100644 --- a/test/core/client_config/set_initial_connect_string_test.c +++ b/test/core/client_config/set_initial_connect_string_test.c @@ -79,7 +79,7 @@ static void handle_read(grpc_exec_ctx *exec_ctx, void *arg, bool success) { } } -static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp, +static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp,grpc_pollset*accepting_pollset, grpc_tcp_server_acceptor *acceptor) { test_tcp_server *server = arg; grpc_closure_init(&on_read, handle_read, NULL); diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.c index b730df753ca..6b0769b6088 100644 --- a/test/core/end2end/fixtures/h2_sockpair+trace.c +++ b/test/core/end2end/fixtures/h2_sockpair+trace.c @@ -63,7 +63,7 @@ static void server_setup_transport(void *ts, grpc_transport *transport) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_endpoint_pair *sfd = f->fixture_data; grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq)); - grpc_server_setup_transport(&exec_ctx, f->server, transport, + grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL, grpc_server_get_channel_args(f->server)); grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/end2end/fixtures/h2_sockpair.c b/test/core/end2end/fixtures/h2_sockpair.c index 41fcc1d6313..7be88f8a68e 100644 --- a/test/core/end2end/fixtures/h2_sockpair.c +++ b/test/core/end2end/fixtures/h2_sockpair.c @@ -62,7 +62,7 @@ static void server_setup_transport(void *ts, grpc_transport *transport) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_endpoint_pair *sfd = f->fixture_data; grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq)); - grpc_server_setup_transport(&exec_ctx, f->server, transport, + grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL, grpc_server_get_channel_args(f->server)); grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c index 16ffb6ec13f..166654bcbfd 100644 --- a/test/core/end2end/fixtures/h2_sockpair_1byte.c +++ b/test/core/end2end/fixtures/h2_sockpair_1byte.c @@ -62,7 +62,7 @@ static void server_setup_transport(void *ts, grpc_transport *transport) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_endpoint_pair *sfd = f->fixture_data; grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq)); - grpc_server_setup_transport(&exec_ctx, f->server, transport, + grpc_server_setup_transport(&exec_ctx, f->server, transport, NULL, grpc_server_get_channel_args(f->server)); grpc_exec_ctx_finish(&exec_ctx); } diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c index b133a948ee0..a1d9e0d59b0 100644 --- a/test/core/end2end/fuzzers/api_fuzzer.c +++ b/test/core/end2end/fuzzers/api_fuzzer.c @@ -252,7 +252,7 @@ static void do_connect(grpc_exec_ctx *exec_ctx, void *arg, bool success) { grpc_transport *transport = grpc_create_chttp2_transport(exec_ctx, NULL, server, 0); - grpc_server_setup_transport(exec_ctx, g_server, transport, NULL); + grpc_server_setup_transport(exec_ctx, g_server, transport, NULL, NULL); grpc_chttp2_transport_start_reading(exec_ctx, transport, NULL, 0); grpc_exec_ctx_enqueue(exec_ctx, fc->closure, false, NULL); diff --git a/test/core/end2end/fuzzers/server_fuzzer.c b/test/core/end2end/fuzzers/server_fuzzer.c index 40273711ab7..0a7d6d92aac 100644 --- a/test/core/end2end/fuzzers/server_fuzzer.c +++ b/test/core/end2end/fuzzers/server_fuzzer.c @@ -69,7 +69,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { grpc_server_start(server); grpc_transport *transport = grpc_create_chttp2_transport(&exec_ctx, NULL, mock_endpoint, 0); - grpc_server_setup_transport(&exec_ctx, server, transport, NULL); + grpc_server_setup_transport(&exec_ctx, server, transport, NULL, NULL); grpc_chttp2_transport_start_reading(&exec_ctx, transport, NULL, 0); grpc_call *call1 = NULL; diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c index 266d2396afd..365bfbbaa84 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -112,7 +112,7 @@ static void server_weak_ref_set(server_weak_ref *weak_ref, weak_ref->server = server; } -static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp, +static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp, grpc_pollset *pollset, grpc_tcp_server_acceptor *acceptor) { grpc_endpoint_shutdown(exec_ctx, tcp); grpc_endpoint_destroy(exec_ctx, tcp); diff --git a/test/core/surface/completion_queue_test.c b/test/core/surface/completion_queue_test.c index be6115e0128..49a1fc441f0 100644 --- a/test/core/surface/completion_queue_test.c +++ b/test/core/surface/completion_queue_test.c @@ -63,8 +63,8 @@ static void test_no_op(void) { shutdown_and_destroy(grpc_completion_queue_create(NULL)); } -static void test_pollset_conversion() { - grpc_completion_queue *cq = grpc_completion_queue(NULL); +static void test_pollset_conversion(void) { + grpc_completion_queue *cq = grpc_completion_queue_create(NULL); GPR_ASSERT(grpc_cq_from_pollset(grpc_cq_pollset(cq)) == cq); shutdown_and_destroy(cq); } @@ -414,6 +414,7 @@ int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); test_no_op(); + test_pollset_conversion(); test_wait_empty(); test_shutdown_then_next_polling(); test_shutdown_then_next_with_timeout(); diff --git a/test/core/surface/concurrent_connectivity_test.c b/test/core/surface/concurrent_connectivity_test.c index 28ddf58cc84..af23fba8f3b 100644 --- a/test/core/surface/concurrent_connectivity_test.c +++ b/test/core/surface/concurrent_connectivity_test.c @@ -95,7 +95,7 @@ void server_thread(void *vargs) { GPR_ASSERT(detag(ev.tag) == 0xd1e); } -static void on_connect(grpc_exec_ctx *exec_ctx, void *vargs, grpc_endpoint *tcp, +static void on_connect(grpc_exec_ctx *exec_ctx, void *vargs, grpc_endpoint *tcp, grpc_pollset*accepting_pollset, grpc_tcp_server_acceptor *acceptor) { struct server_thread_args *args = (struct server_thread_args *)vargs; (void)acceptor; diff --git a/test/core/surface/server_test.c b/test/core/surface/server_test.c index 3d2e25379a0..1e94c5a41b4 100644 --- a/test/core/surface/server_test.c +++ b/test/core/surface/server_test.c @@ -67,12 +67,14 @@ void test_register_method_fail(void) { void test_request_call_on_no_server_cq(void) { grpc_completion_queue *cc = grpc_completion_queue_create(NULL); + grpc_server *server = grpc_server_create(NULL, NULL); GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE == - grpc_server_request_call(NULL, NULL, NULL, NULL, cc, cc, NULL)); + grpc_server_request_call(server, NULL, NULL, NULL, cc, cc, NULL)); GPR_ASSERT(GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE == - grpc_server_request_registered_call(NULL, NULL, NULL, NULL, NULL, + grpc_server_request_registered_call(server, NULL, NULL, NULL, NULL, NULL, cc, cc, NULL)); grpc_completion_queue_destroy(cc); + grpc_server_destroy(server); } void test_bind_server_twice(void) { diff --git a/test/core/util/reconnect_server.c b/test/core/util/reconnect_server.c index d408374a095..d3d8f5a23b5 100644 --- a/test/core/util/reconnect_server.c +++ b/test/core/util/reconnect_server.c @@ -70,7 +70,7 @@ static void pretty_print_backoffs(reconnect_server *server) { } } -static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp, +static void on_connect(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp, grpc_pollset *accepting_pollset, grpc_tcp_server_acceptor *acceptor) { char *peer; char *last_colon;