From f3756c1e0d09a90173851a8e8ab4f6342ae8de45 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 1 Jul 2015 17:21:01 -0700 Subject: Introduce multiple clocks to GPR --- src/core/transport/chttp2/parsing.c | 2 +- src/core/transport/chttp2/stream_encoder.c | 2 +- src/core/transport/metadata.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/transport') diff --git a/src/core/transport/chttp2/parsing.c b/src/core/transport/chttp2/parsing.c index 4664a0895c..a11b7e6d36 100644 --- a/src/core/transport/chttp2/parsing.c +++ b/src/core/transport/chttp2/parsing.c @@ -599,7 +599,7 @@ static void on_header(void *tp, grpc_mdelem *md) { } grpc_chttp2_incoming_metadata_buffer_set_deadline( &stream_parsing->incoming_metadata, - gpr_time_add(gpr_now(), *cached_timeout)); + gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), *cached_timeout)); grpc_mdelem_unref(md); } else { grpc_chttp2_incoming_metadata_buffer_add(&stream_parsing->incoming_metadata, diff --git a/src/core/transport/chttp2/stream_encoder.c b/src/core/transport/chttp2/stream_encoder.c index cf78ac50cc..db642961ec 100644 --- a/src/core/transport/chttp2/stream_encoder.c +++ b/src/core/transport/chttp2/stream_encoder.c @@ -437,7 +437,7 @@ static void deadline_enc(grpc_chttp2_hpack_compressor *c, gpr_timespec deadline, framer_state *st) { char timeout_str[GRPC_CHTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE]; grpc_mdelem *mdelem; - grpc_chttp2_encode_timeout(gpr_time_sub(deadline, gpr_now()), timeout_str); + grpc_chttp2_encode_timeout(gpr_time_sub(deadline, gpr_now(GPR_CLOCK_REALTIME)), timeout_str); mdelem = grpc_mdelem_from_metadata_strings( c->mdctx, grpc_mdstr_ref(c->timeout_key_str), grpc_mdstr_from_string(c->mdctx, timeout_str)); diff --git a/src/core/transport/metadata.c b/src/core/transport/metadata.c index c80d67823f..4d0d83e7b7 100644 --- a/src/core/transport/metadata.c +++ b/src/core/transport/metadata.c @@ -161,7 +161,7 @@ grpc_mdctx *grpc_mdctx_create(void) { /* This seed is used to prevent remote connections from controlling hash table * collisions. It needs to be somewhat unpredictable to a remote connection. */ - return grpc_mdctx_create_with_seed(gpr_now().tv_nsec); + return grpc_mdctx_create_with_seed(gpr_now(GPR_CLOCK_REALTIME).tv_nsec); } static void discard_metadata(grpc_mdctx *ctx) { -- cgit v1.2.3