Better documentation of the method_name field.

Also passing empty string as opposed to NULL when the method name is not
found. This is much less error-prone.
pull/4154/head
Julien Boeuf 9 years ago
parent caf9935e45
commit eb029c93fb
  1. 3
      include/grpc/grpc_security.h
  2. 1
      src/core/security/client_auth_filter.c

@ -247,7 +247,8 @@ typedef struct {
const char *service_url;
/* The method name of the RPC being called (not fully qualified).
Can be NULL if no method name was found. */
The fully qualified method name can be built from the service_url:
full_qualified_method_name = ctx->service_url + '/' + ctx->method_name. */
const char *method_name;
/* The auth_context of the channel which gives the server's identity. */

@ -146,6 +146,7 @@ void build_auth_metadata_context(grpc_security_connector *sc,
*last_slash = '\0';
method_name = gpr_strdup(last_slash + 1);
}
if (method_name == NULL) method_name = gpr_strdup("");
gpr_asprintf(&service_url, "%s://%s%s",
sc->url_scheme == NULL ? "" : sc->url_scheme,
grpc_mdstr_as_c_string(calld->host), service);

Loading…
Cancel
Save