From 441499ac5e5798447e8fdf7a028f84910e9b8c27 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Tue, 26 Jan 2016 19:16:04 -0800 Subject: Fix the initialization by modifying the grpc_channel_args_is_census_enabled to by default return census_enabled() instead of always disable --- src/core/channel/channel_args.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/core/channel') diff --git a/src/core/channel/channel_args.c b/src/core/channel/channel_args.c index 487db1119a..0427ce0b8d 100644 --- a/src/core/channel/channel_args.c +++ b/src/core/channel/channel_args.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,6 +35,7 @@ #include "src/core/channel/channel_args.h" #include "src/core/support/string.h" +#include #include #include #include @@ -119,10 +120,10 @@ int grpc_channel_args_is_census_enabled(const grpc_channel_args *a) { if (a == NULL) return 0; for (i = 0; i < a->num_args; i++) { if (0 == strcmp(a->args[i].key, GRPC_ARG_ENABLE_CENSUS)) { - return a->args[i].value.integer != 0; + return a->args[i].value.integer != 0 && census_enabled(); } } - return 0; + return census_enabled(); } grpc_compression_algorithm grpc_channel_args_get_compression_algorithm( -- cgit v1.2.3