Ejemplo n.º 1
0
static void dns_channel_saw_error(grpc_resolver *resolver, struct sockaddr *sa,
                                  int len) {
  dns_resolver *r = (dns_resolver *)resolver;
  gpr_mu_lock(&r->mu);
  if (!r->resolving) {
    dns_start_resolving_locked(r);
  }
  gpr_mu_unlock(&r->mu);
}
Ejemplo n.º 2
0
static void dns_channel_saw_error(grpc_exec_ctx *exec_ctx,
                                  grpc_resolver *resolver) {
    dns_resolver *r = (dns_resolver *)resolver;
    gpr_mu_lock(&r->mu);
    if (!r->resolving) {
        dns_start_resolving_locked(r);
    }
    gpr_mu_unlock(&r->mu);
}
Ejemplo n.º 3
0
static void dns_next(grpc_resolver *resolver,
                     grpc_client_config **target_config,
                     grpc_iomgr_closure *on_complete) {
  dns_resolver *r = (dns_resolver *)resolver;
  gpr_mu_lock(&r->mu);
  GPR_ASSERT(!r->next_completion);
  r->next_completion = on_complete;
  r->target_config = target_config;
  if (r->resolved_version == 0 && !r->resolving) {
    dns_start_resolving_locked(r);
  } else {
    dns_maybe_finish_next_locked(r);
  }
  gpr_mu_unlock(&r->mu);
}
Ejemplo n.º 4
0
static void dns_on_retry_timer(grpc_exec_ctx *exec_ctx, void *arg,
                               bool success) {
    dns_resolver *r = arg;

    gpr_mu_lock(&r->mu);
    r->have_retry_timer = false;
    if (success) {
        if (!r->resolving) {
            dns_start_resolving_locked(r);
        }
    }
    gpr_mu_unlock(&r->mu);

    GRPC_RESOLVER_UNREF(exec_ctx, &r->base, "retry-timer");
}
Ejemplo n.º 5
0
static void dns_on_retry_timer(grpc_exec_ctx *exec_ctx, void *arg,
                               grpc_error *error) {
  dns_resolver *r = arg;

  gpr_mu_lock(&r->mu);
  r->have_retry_timer = false;
  if (error == GRPC_ERROR_NONE) {
    if (!r->resolving) {
      dns_start_resolving_locked(exec_ctx, r);
    }
  }
  gpr_mu_unlock(&r->mu);

  GRPC_RESOLVER_UNREF(exec_ctx, &r->base, "retry-timer");
}
Ejemplo n.º 6
0
static void dns_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
                     grpc_channel_args **target_result,
                     grpc_closure *on_complete) {
  dns_resolver *r = (dns_resolver *)resolver;
  gpr_mu_lock(&r->mu);
  GPR_ASSERT(!r->next_completion);
  r->next_completion = on_complete;
  r->target_result = target_result;
  if (r->resolved_version == 0 && !r->resolving) {
    gpr_backoff_reset(&r->backoff_state);
    dns_start_resolving_locked(exec_ctx, r);
  } else {
    dns_maybe_finish_next_locked(exec_ctx, r);
  }
  gpr_mu_unlock(&r->mu);
}