From 4dbd18aec54f2818187f51d6ffef59ad72aef9a9 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 29 May 2018 10:45:04 -0700 Subject: Make mobile log per-host and rename as context --- include/grpc/impl/codegen/grpc_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/grpc/impl/codegen/grpc_types.h') diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index 022be5fec4..9329c61bf2 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -332,7 +332,7 @@ typedef struct { #define GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE "grpc.per_rpc_retry_buffer_size" /** Channel arg that carries the bridged objective c object for custom metrics * logging filter. */ -#define GRPC_ARG_MOBILE_LOG_CONFIG "grpc.mobile_log_config" +#define GRPC_ARG_MOBILE_LOG_CONTEXT "grpc.mobile_log_context" /** If non-zero, client authority filter is disabled for the channel */ #define GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER \ "grpc.disable_client_authority_filter" -- cgit v1.2.3 From 21dbaab4be595bc2f34890e92f3656a61694e522 Mon Sep 17 00:00:00 2001 From: Yash Tibrewal Date: Fri, 8 Jun 2018 18:51:27 -0700 Subject: Add channel arg to enable/disable http proxy --- include/grpc/impl/codegen/grpc_types.h | 2 ++ src/core/ext/filters/client_channel/http_proxy.cc | 13 +++++++++++++ 2 files changed, 15 insertions(+) (limited to 'include/grpc/impl/codegen/grpc_types.h') diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index 9329c61bf2..a5961857c1 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -336,6 +336,8 @@ typedef struct { /** If non-zero, client authority filter is disabled for the channel */ #define GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER \ "grpc.disable_client_authority_filter" +/** If set to zero, disables use of http proxies. Enabled by default. */ +#define GRPC_ARG_ENABLE_HTTP_PROXY "grpc.enable_http_proxy" /** \} */ /** Result of a grpc call. If the caller satisfies the prerequisites of a diff --git a/src/core/ext/filters/client_channel/http_proxy.cc b/src/core/ext/filters/client_channel/http_proxy.cc index 29a6c0e367..9baccd8628 100644 --- a/src/core/ext/filters/client_channel/http_proxy.cc +++ b/src/core/ext/filters/client_channel/http_proxy.cc @@ -83,11 +83,24 @@ done: return proxy_name; } +/** + * Checks the value of GRPC_ARG_ENABLE_HTTP_PROXY to determine if http_proxy + * should be used. + */ +bool http_proxy_enabled(const grpc_channel_args* args) { + const grpc_arg* arg = + grpc_channel_args_find(args, GRPC_ARG_ENABLE_HTTP_PROXY); + return grpc_channel_arg_get_bool(arg, true); +} + static bool proxy_mapper_map_name(grpc_proxy_mapper* mapper, const char* server_uri, const grpc_channel_args* args, char** name_to_resolve, grpc_channel_args** new_args) { + if (!http_proxy_enabled(args)) { + return false; + } char* user_cred = nullptr; *name_to_resolve = get_http_proxy_server(&user_cred); if (*name_to_resolve == nullptr) return false; -- cgit v1.2.3