diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/iomgr/iomgr.c | 1 | ||||
-rw-r--r-- | src/core/surface/channel_create.c | 1 | ||||
-rw-r--r-- | src/core/surface/server.c | 16 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c index c47528aa94..2765706de8 100644 --- a/src/core/iomgr/iomgr.c +++ b/src/core/iomgr/iomgr.c @@ -203,6 +203,7 @@ void grpc_iomgr_closure_init(grpc_iomgr_closure *closure, grpc_iomgr_cb_func cb, void grpc_iomgr_add_delayed_callback(grpc_iomgr_closure *closure, int success) { closure->success = success; + GPR_ASSERT(closure->cb); gpr_mu_lock(&g_mu); closure->next = NULL; if (!g_cbs_tail) { diff --git a/src/core/surface/channel_create.c b/src/core/surface/channel_create.c index 46d1d708dd..a98f550ede 100644 --- a/src/core/surface/channel_create.c +++ b/src/core/surface/channel_create.c @@ -91,6 +91,7 @@ static void connector_connect( c->notify = notify; c->args = channel_args; c->mdctx = metadata_context; + c->transport = transport; grpc_tcp_client_connect(connected, c, pollset_set, addr, addr_len, deadline); } diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 98e0e81eaa..f4d76e882f 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -916,14 +916,6 @@ void grpc_server_setup_transport(grpc_server *s, grpc_transport *transport, server_ref(s); chand->channel = channel; - GRPC_CHANNEL_INTERNAL_REF(channel, "connectivity"); - memset(&op, 0, sizeof(op)); - op.set_accept_stream = accept_stream; - op.set_accept_stream_user_data = chand; - op.on_connectivity_state_change = &chand->channel_connectivity_changed; - op.connectivity_state = &chand->connectivity_state; - grpc_transport_perform_op(transport, &op); - num_registered_methods = 0; for (rm = s->registered_methods; rm; rm = rm->next) { num_registered_methods++; @@ -963,6 +955,14 @@ void grpc_server_setup_transport(grpc_server *s, grpc_transport *transport, gpr_mu_unlock(&s->mu_global); gpr_free(filters); + + GRPC_CHANNEL_INTERNAL_REF(channel, "connectivity"); + memset(&op, 0, sizeof(op)); + op.set_accept_stream = accept_stream; + op.set_accept_stream_user_data = chand; + op.on_connectivity_state_change = &chand->channel_connectivity_changed; + op.connectivity_state = &chand->connectivity_state; + grpc_transport_perform_op(transport, &op); } void grpc_server_shutdown_and_notify(grpc_server *server, |