static void destroy_done(grpc_exec_ctx *exec_ctx, void *statep, bool success) {
  grpc_server_secure_state *state = statep;
  if (state->destroy_callback != NULL) {
    state->destroy_callback->cb(exec_ctx, state->destroy_callback->cb_arg,
                                success);
  }
  grpc_server_security_connector_shutdown(exec_ctx, state->sc);
  state_unref(state);
}
Beispiel #2
0
static void destroy_done(grpc_exec_ctx *exec_ctx, void *statep,
                         grpc_error *error) {
  server_secure_state *state = statep;
  if (state->destroy_callback != NULL) {
    state->destroy_callback->cb(exec_ctx, state->destroy_callback->cb_arg,
                                GRPC_ERROR_REF(error));
  }
  grpc_server_security_connector_shutdown(exec_ctx, state->sc);
  state_unref(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);
}