From d423f3c2fdb9f6ca8ed3cfa16f51a9046ac35e0a Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Thu, 16 Jul 2015 14:16:51 -0700 Subject: Fix authority in uri_parser --- src/core/client_config/uri_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/client_config') diff --git a/src/core/client_config/uri_parser.c b/src/core/client_config/uri_parser.c index 776a255923..615aa4eaf0 100644 --- a/src/core/client_config/uri_parser.c +++ b/src/core/client_config/uri_parser.c @@ -99,7 +99,7 @@ grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors) { if (uri_text[scheme_end + 1] == '/' && uri_text[scheme_end + 2] == '/') { authority_begin = scheme_end + 3; for (i = authority_begin; uri_text[i] != 0; i++) { - if (uri_text[i] == '/') { + if (uri_text[i] == '/' && authority_end == -1) { authority_end = i; } if (uri_text[i] == '?') { -- cgit v1.2.3 From 275a02c317d3c204b216aab5f7c7e74852c6ff60 Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Thu, 16 Jul 2015 15:16:20 -0700 Subject: Small fix --- src/core/client_config/uri_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/client_config') diff --git a/src/core/client_config/uri_parser.c b/src/core/client_config/uri_parser.c index 615aa4eaf0..410a61c8cf 100644 --- a/src/core/client_config/uri_parser.c +++ b/src/core/client_config/uri_parser.c @@ -98,8 +98,8 @@ grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors) { if (uri_text[scheme_end + 1] == '/' && uri_text[scheme_end + 2] == '/') { authority_begin = scheme_end + 3; - for (i = authority_begin; uri_text[i] != 0; i++) { - if (uri_text[i] == '/' && authority_end == -1) { + for (i = authority_begin; uri_text[i] != 0 && authority_end == -1; i++) { + if (uri_text[i] == '/') { authority_end = i; } if (uri_text[i] == '?') { -- cgit v1.2.3 From 65749c1079ef9ce4c58d13a65988548462fac9b0 Mon Sep 17 00:00:00 2001 From: "David G. Quintas" Date: Thu, 16 Jul 2015 18:22:21 -0700 Subject: Docstring for grpc_create_pick_first_lb_policy --- src/core/client_config/lb_policies/pick_first.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/client_config') diff --git a/src/core/client_config/lb_policies/pick_first.h b/src/core/client_config/lb_policies/pick_first.h index 94c2a9f0c7..31394985e5 100644 --- a/src/core/client_config/lb_policies/pick_first.h +++ b/src/core/client_config/lb_policies/pick_first.h @@ -36,6 +36,8 @@ #include "src/core/client_config/lb_policy.h" +/** Returns a load balancing policy instance that picks up the first subchannel + * from \a subchannels to succesfully connect */ grpc_lb_policy *grpc_create_pick_first_lb_policy(grpc_subchannel **subchannels, size_t num_subchannels); -- cgit v1.2.3