/* Destructor for channel data */ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem) { /* grab pointers to our data from the channel element */ channel_data *chand = elem->channel_data; GRPC_AUTH_CONTEXT_UNREF(chand->auth_context, "server_auth_filter"); grpc_server_credentials_unref(chand->creds); }
static void state_unref(server_secure_state *state) { if (gpr_unref(&state->refcount)) { /* ensure all threads have unlocked */ gpr_mu_lock(&state->mu); gpr_mu_unlock(&state->mu); /* clean up */ GRPC_SECURITY_CONNECTOR_UNREF(&state->sc->base, "server"); grpc_server_credentials_unref(state->creds); gpr_free(state); } }
static void tcp_server_shutdown_complete(grpc_exec_ctx *exec_ctx, void *statep, grpc_error *error) { server_secure_state *server_state = statep; /* ensure all threads have unlocked */ gpr_mu_lock(&server_state->mu); grpc_closure *destroy_done = server_state->server_destroy_listener_done; GPR_ASSERT(server_state->is_shutdown); gpr_mu_unlock(&server_state->mu); /* clean up */ grpc_server_security_connector_shutdown(exec_ctx, server_state->sc); /* Flush queued work before a synchronous unref. */ grpc_exec_ctx_flush(exec_ctx); GRPC_SECURITY_CONNECTOR_UNREF(&server_state->sc->base, "server"); grpc_server_credentials_unref(server_state->creds); if (destroy_done != NULL) { destroy_done->cb(exec_ctx, destroy_done->cb_arg, GRPC_ERROR_REF(error)); grpc_exec_ctx_flush(exec_ctx); } gpr_free(server_state); }
void grpc_server_credentials_release(grpc_server_credentials *creds) { GRPC_API_TRACE("grpc_server_credentials_release(creds=%p)", 1, (creds)); grpc_server_credentials_unref(creds); }
static void server_credentials_pointer_arg_destroy(void *p) { grpc_server_credentials_unref(p); }
void grpc_server_credentials_release(grpc_server_credentials *creds) { grpc_server_credentials_unref(creds); }