Skip to content
Snippets Groups Projects
Commit ed0cbc8b authored by David Klempner's avatar David Klempner
Browse files

Review changes for :scheme conversion to http[s]

1. scheme_from_args should return const char*
2. Rename grpc.scheme arg to grpc.http2_scheme, and define a macro for
it.
parent a1e86935
No related branches found
No related tags found
No related merge requests found
......@@ -131,12 +131,12 @@ static void destroy_call_elem(grpc_call_element *elem) {
ignore_unused(channeld);
}
static char *scheme_from_args(const grpc_channel_args *args) {
static const char *scheme_from_args(const grpc_channel_args *args) {
int i;
if (args != NULL) {
for (i = 0; i < args->num_args; ++i) {
if (args->args[i].type == GRPC_ARG_STRING &&
strcmp(args->args[i].key, "grpc.scheme") == 0) {
strcmp(args->args[i].key, GRPC_ARG_HTTP2_SCHEME) == 0) {
return args->args[i].value.string;
}
}
......
......@@ -39,4 +39,6 @@
/* Processes metadata on the client side for HTTP2 transports */
extern const grpc_channel_filter grpc_http_client_filter;
#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
#endif /* __GRPC_INTERNAL_CHANNEL_HTTP_CLIENT_FILTER_H__ */
......@@ -36,6 +36,7 @@
#include <string.h>
#include "src/core/channel/channel_args.h"
#include "src/core/channel/http_client_filter.h"
#include "src/core/security/credentials.h"
#include "src/core/security/secure_endpoint.h"
#include "src/core/surface/lame_client.h"
......@@ -463,7 +464,7 @@ grpc_channel *grpc_ssl_channel_create(grpc_credentials *ssl_creds,
return grpc_lame_client_channel_create();
}
arg.type = GRPC_ARG_STRING;
arg.key = "grpc.scheme";
arg.key = GRPC_ARG_HTTP2_SCHEME;
arg.value.string = "https";
new_args = grpc_channel_args_copy_and_add(args, &arg);
channel = grpc_secure_channel_create_internal(target, new_args, ctx);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment