diff options
Diffstat (limited to 'src/core/ext/filters/client_channel/uri_parser.cc')
-rw-r--r-- | src/core/ext/filters/client_channel/uri_parser.cc | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/core/ext/filters/client_channel/uri_parser.cc b/src/core/ext/filters/client_channel/uri_parser.cc index b76dcbe4e3..3428f4b54c 100644 --- a/src/core/ext/filters/client_channel/uri_parser.cc +++ b/src/core/ext/filters/client_channel/uri_parser.cc @@ -56,8 +56,8 @@ static grpc_uri* bad_uri(const char* uri_text, size_t pos, const char* section, } /** Returns a copy of percent decoded \a src[begin, end) */ -static char* decode_and_copy_component(grpc_exec_ctx* exec_ctx, const char* src, - size_t begin, size_t end) { +static char* decode_and_copy_component(const char* src, size_t begin, + size_t end) { grpc_slice component = (begin == NOT_SET || end == NOT_SET) ? grpc_empty_slice() @@ -65,8 +65,8 @@ static char* decode_and_copy_component(grpc_exec_ctx* exec_ctx, const char* src, grpc_slice decoded_component = grpc_permissive_percent_decode_slice(component); char* out = grpc_dump_slice(decoded_component, GPR_DUMP_ASCII); - grpc_slice_unref_internal(exec_ctx, component); - grpc_slice_unref_internal(exec_ctx, decoded_component); + grpc_slice_unref_internal(component); + grpc_slice_unref_internal(decoded_component); return out; } @@ -184,8 +184,7 @@ static void parse_query_parts(grpc_uri* uri) { } } -grpc_uri* grpc_uri_parse(grpc_exec_ctx* exec_ctx, const char* uri_text, - bool suppress_errors) { +grpc_uri* grpc_uri_parse(const char* uri_text, bool suppress_errors) { grpc_uri* uri; size_t scheme_begin = 0; size_t scheme_end = NOT_SET; @@ -273,16 +272,13 @@ grpc_uri* grpc_uri_parse(grpc_exec_ctx* exec_ctx, const char* uri_text, } uri = (grpc_uri*)gpr_zalloc(sizeof(*uri)); - uri->scheme = - decode_and_copy_component(exec_ctx, uri_text, scheme_begin, scheme_end); - uri->authority = decode_and_copy_component(exec_ctx, uri_text, - authority_begin, authority_end); - uri->path = - decode_and_copy_component(exec_ctx, uri_text, path_begin, path_end); - uri->query = - decode_and_copy_component(exec_ctx, uri_text, query_begin, query_end); - uri->fragment = decode_and_copy_component(exec_ctx, uri_text, fragment_begin, - fragment_end); + uri->scheme = decode_and_copy_component(uri_text, scheme_begin, scheme_end); + uri->authority = + decode_and_copy_component(uri_text, authority_begin, authority_end); + uri->path = decode_and_copy_component(uri_text, path_begin, path_end); + uri->query = decode_and_copy_component(uri_text, query_begin, query_end); + uri->fragment = + decode_and_copy_component(uri_text, fragment_begin, fragment_end); parse_query_parts(uri); return uri; |