From 5548cc9263b6cc110f7502cc6b7b67ccf8e2802d Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 28 Mar 2016 16:37:05 -0700 Subject: small improvements to channel_args docstrings --- src/core/lib/channel/channel_args.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/core/lib') diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h index 67d287ec6b..1ea202c543 100644 --- a/src/core/lib/channel/channel_args.h +++ b/src/core/lib/channel/channel_args.h @@ -37,23 +37,23 @@ #include #include -/* Copy some arguments */ +/** Copy the arguments in \a src into a new instance */ grpc_channel_args *grpc_channel_args_copy(const grpc_channel_args *src); -/* Copy some arguments, stably sorting keys */ -grpc_channel_args *grpc_channel_args_normalize(const grpc_channel_args *a); +/** Copy the arguments in \a src into a new instance, stably sorting keys */ +grpc_channel_args *grpc_channel_args_normalize(const grpc_channel_args *src); -/** Copy some arguments and add the to_add parameter in the end. - If to_add is NULL, it is equivalent to call grpc_channel_args_copy. */ +/** Copy the arguments in \a src and append \a to_add. If \a to_add is NULL, it + * is equivalent to calling \a grpc_channel_args_copy. */ grpc_channel_args *grpc_channel_args_copy_and_add(const grpc_channel_args *src, const grpc_arg *to_add, size_t num_to_add); -/** Copy args from a then args from b into a new channel args */ +/** Concatenate args from \a a and \a b into a new instance */ grpc_channel_args *grpc_channel_args_merge(const grpc_channel_args *a, const grpc_channel_args *b); -/** Destroy arguments created by grpc_channel_args_copy */ +/** Destroy arguments created by \a grpc_channel_args_copy */ void grpc_channel_args_destroy(grpc_channel_args *a); /** Reads census_enabled settings from channel args. Returns 1 if census_enabled -- cgit v1.2.3 From dd2cfc55ab68aee249c3988d5530f0fcc6c6ec58 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 30 Mar 2016 07:56:23 -0700 Subject: Revert "added grpclb support to sockaddr resolver" --- .../client_config/resolvers/sockaddr_resolver.c | 39 +++------------------- 1 file changed, 5 insertions(+), 34 deletions(-) (limited to 'src/core/lib') diff --git a/src/core/lib/client_config/resolvers/sockaddr_resolver.c b/src/core/lib/client_config/resolvers/sockaddr_resolver.c index 5c5133649a..c787bd57d6 100644 --- a/src/core/lib/client_config/resolvers/sockaddr_resolver.c +++ b/src/core/lib/client_config/resolvers/sockaddr_resolver.c @@ -267,46 +267,17 @@ static grpc_resolver *sockaddr_create( r->lb_policy_name = NULL; if (0 != strcmp(args->uri->query, "")) { gpr_slice query_slice; - gpr_slice_buffer query_parts; /* the &-separated elements of the query */ - gpr_slice_buffer query_param_parts; /* the =-separated subelements */ + gpr_slice_buffer query_parts; query_slice = gpr_slice_new(args->uri->query, strlen(args->uri->query), do_nothing); gpr_slice_buffer_init(&query_parts); - gpr_slice_buffer_init(&query_param_parts); - /* the query can contain "lb_policy=" and "lb_enabled=<1|0>" */ - - bool lb_enabled; - gpr_slice_split(query_slice, "&", &query_parts); - for (i = 0; i < query_parts.count; i++) { - gpr_slice_split(query_parts.slices[i], "=", &query_param_parts); - GPR_ASSERT(query_param_parts.count == 2); - if (0 == gpr_slice_str_cmp(query_param_parts.slices[0], "lb_policy")) { - r->lb_policy_name = - gpr_dump_slice(query_param_parts.slices[1], GPR_DUMP_ASCII); - } else if (0 == - gpr_slice_str_cmp(query_param_parts.slices[0], "lb_enabled")) { - if (0 != gpr_slice_str_cmp(query_param_parts.slices[1], "0")) { - /* anything other than 0 is taken to be true */ - lb_enabled = true; - } - } else { - gpr_log(GPR_ERROR, "invalid query element value: '%s'", - query_parts.slices[0]); - } - gpr_slice_buffer_reset_and_unref(&query_param_parts); - } - - if (strcmp("grpclb", r->lb_policy_name) == 0 && !lb_enabled) { - /* we want grpclb but the "resolved" addresses aren't LB enabled. Bail - * out, as this is meant mostly for tests. */ - gpr_log(GPR_ERROR, - "Requested 'grpclb' LB policy but resolved addresses don't " - "support load balancing."); - abort(); + gpr_slice_split(query_slice, "=", &query_parts); + GPR_ASSERT(query_parts.count == 2); + if (0 == gpr_slice_str_cmp(query_parts.slices[0], "lb_policy")) { + r->lb_policy_name = gpr_dump_slice(query_parts.slices[1], GPR_DUMP_ASCII); } gpr_slice_buffer_destroy(&query_parts); - gpr_slice_buffer_destroy(&query_param_parts); gpr_slice_unref(query_slice); } if (r->lb_policy_name == NULL) { -- cgit v1.2.3