aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/security
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2015-08-07 15:44:14 -0700
committerGravatar yang-g <yangg@google.com>2015-08-07 15:44:14 -0700
commit2109217c4a3bf01d08817cab2bf8390b62b878c3 (patch)
tree870cdf440c2c6e3c7ce69bbc3203c658268ecff9 /src/core/security
parentc29812fc2c9285046a886a0c3a29127679c4b02b (diff)
Fix gce detection
Diffstat (limited to 'src/core/security')
-rw-r--r--src/core/security/google_default_credentials.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/security/google_default_credentials.c b/src/core/security/google_default_credentials.c
index f368819597..1701a67d02 100644
--- a/src/core/security/google_default_credentials.c
+++ b/src/core/security/google_default_credentials.c
@@ -84,6 +84,8 @@ static void on_compute_engine_detection_http_response(
gpr_mu_unlock(GRPC_POLLSET_MU(&detector->pollset));
}
+static void destroy_pollset(void *p) { grpc_pollset_destroy(p); }
+
static int is_stack_running_on_compute_engine(void) {
compute_engine_detector detector;
grpc_httpcli_request request;
@@ -114,12 +116,12 @@ static int is_stack_running_on_compute_engine(void) {
while (!detector.is_done) {
grpc_pollset_worker worker;
grpc_pollset_work(&detector.pollset, &worker,
- gpr_inf_future(GPR_CLOCK_REALTIME));
+ gpr_inf_future(GPR_CLOCK_MONOTONIC));
}
gpr_mu_unlock(GRPC_POLLSET_MU(&detector.pollset));
grpc_httpcli_context_destroy(&context);
- grpc_pollset_destroy(&detector.pollset);
+ grpc_pollset_shutdown(&detector.pollset, destroy_pollset, &destroy_pollset);
return detector.success;
}