sanity fixes

pull/10849/head
Muxi Yan 8 years ago
parent 384d8ffaaa
commit 58a1220a07
  1. 1
      build.yaml
  2. 12
      src/core/ext/filters/workarounds/workaround_cronet_compression_filter.c
  3. 6
      src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
  4. 4
      src/core/ext/filters/workarounds/workaround_utils.c
  5. 3
      tools/run_tests/generated/sources_and_headers.json

@ -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

@ -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) {

@ -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 */

@ -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;

@ -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"

Loading…
Cancel
Save