From 6d1882b4b269dc66ffa96915ad5ab2ca2178dd51 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 3 Dec 2015 13:28:10 -0800 Subject: Make default prefix overridable --- src/core/surface/init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/surface/init.c b/src/core/surface/init.c index 04d68620f1..e0106d8f2b 100644 --- a/src/core/surface/init.c +++ b/src/core/surface/init.c @@ -58,6 +58,10 @@ #include "src/core/transport/chttp2_transport.h" #include "src/core/transport/connectivity_state.h" +#ifndef GRPC_DEFAULT_NAME_PREFIX +#define GRPC_DEFAULT_NAME_PREFIX "dns:///" +#endif + #define MAX_PLUGINS 128 static gpr_once g_basic_init = GPR_ONCE_INIT; @@ -97,7 +101,7 @@ void grpc_init(void) { grpc_lb_policy_registry_init(grpc_pick_first_lb_factory_create()); grpc_register_lb_policy(grpc_pick_first_lb_factory_create()); grpc_register_lb_policy(grpc_round_robin_lb_factory_create()); - grpc_resolver_registry_init("dns:///"); + grpc_resolver_registry_init(GRPC_DEFAULT_NAME_PREFIX); grpc_register_resolver_type(grpc_dns_resolver_factory_create()); grpc_register_resolver_type(grpc_ipv4_resolver_factory_create()); grpc_register_resolver_type(grpc_ipv6_resolver_factory_create()); -- cgit v1.2.3