From 58a1220a073c4304716a634ddef70ac0236e18aa Mon Sep 17 00:00:00 2001 From: Muxi Yan <mxyan@google.com> Date: Fri, 28 Apr 2017 13:38:43 -0700 Subject: [PATCH] sanity fixes --- build.yaml | 1 + .../workaround_cronet_compression_filter.c | 12 +++++++----- .../workaround_cronet_compression_filter.h | 6 +++--- src/core/ext/filters/workarounds/workaround_utils.c | 4 +++- tools/run_tests/generated/sources_and_headers.json | 3 ++- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/build.yaml b/build.yaml index 2677dae0fb..f5bdec6601 100644 --- a/build.yaml +++ b/build.yaml @@ -808,6 +808,7 @@ filegroups: plugin: grpc_workaround_cronet_compression_filter uses: - grpc_base + - grpc_server_backward_compatibility - name: nanopb headers: - third_party/nanopb/pb.h diff --git a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c index 57f0f0ae41..ba4f958e18 100644 --- a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c +++ b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c @@ -112,7 +112,8 @@ static void start_transport_stream_op_batch( } if (op->send_message) { - /* Send message happens after client's user-agent (initial metadata) is received, so workaround_active must be set already */ + /* Send message happens after client's user-agent (initial metadata) is + * received, so workaround_active must be set already */ if (calld->workaround_active) { op->payload->send_message.send_message->flags |= GRPC_WRITE_NO_COMPRESS; } @@ -204,15 +205,16 @@ const grpc_channel_filter grpc_workaround_cronet_compression_filter = { static bool register_workaround_cronet_compression( grpc_exec_ctx* exec_ctx, grpc_channel_stack_builder* builder, void* arg) { - const grpc_channel_args *channel_args = + const grpc_channel_args* channel_args = grpc_channel_stack_builder_get_channel_arguments(builder); - const grpc_arg *a = - grpc_channel_args_find(channel_args, GRPC_ARG_WORKAROUND_CRONET_COMPRESSION); + const grpc_arg* a = grpc_channel_args_find( + channel_args, GRPC_ARG_WORKAROUND_CRONET_COMPRESSION); if (a == NULL) { return true; } if (a->type != GRPC_ARG_INTEGER) { - gpr_log(GPR_ERROR, "%s ignored: it must be an integer", GRPC_ARG_WORKAROUND_CRONET_COMPRESSION); + gpr_log(GPR_ERROR, "%s ignored: it must be an integer", + GRPC_ARG_WORKAROUND_CRONET_COMPRESSION); return true; } if (a->value.integer == 0) { diff --git a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h index 289223477f..def30f2236 100644 --- a/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h +++ b/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h @@ -29,11 +29,11 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -#ifndef GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION -#define GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION +#ifndef GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION_FILTER_H +#define GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION_FILTER_H #include "src/core/lib/channel/channel_stack.h" extern const grpc_channel_filter grpc_workaround_cronet_compression_filter; -#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION */ +#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION_FILTER_H */ diff --git a/src/core/ext/filters/workarounds/workaround_utils.c b/src/core/ext/filters/workarounds/workaround_utils.c index fef81395b0..09d54f8a76 100644 --- a/src/core/ext/filters/workarounds/workaround_utils.c +++ b/src/core/ext/filters/workarounds/workaround_utils.c @@ -41,7 +41,9 @@ static void destroy_user_agent_md(void *user_agent_md) { static user_agent_parser user_agent_parsers[GRPC_MAX_WORKAROUND_ID]; grpc_user_agent_md *grpc_parse_user_agent(grpc_mdelem md) { - grpc_user_agent_md *user_agent_md = (grpc_user_agent_md*)grpc_mdelem_get_user_data(md, destroy_user_agent_md); + grpc_user_agent_md *user_agent_md = + (grpc_user_agent_md *)grpc_mdelem_get_user_data(md, + destroy_user_agent_md); if (NULL != user_agent_md) { return user_agent_md; diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index 25acc88a55..29e142d87c 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -8780,7 +8780,8 @@ { "deps": [ "gpr", - "grpc_base" + "grpc_base", + "grpc_server_backward_compatibility" ], "headers": [ "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h" -- GitLab