Merge remote-tracking branch 'upstream/master' into revert-10619-revert-9626-lazy-deframe

pull/10626/head
Muxi Yan 8 years ago
commit 3136568e36
  1. 64
      BUILD
  2. 89
      CMakeLists.txt
  3. 133
      Makefile
  4. 11
      binding.gyp
  5. 58
      build.yaml
  6. 2
      build_config.rb
  7. 17
      config.m4
  8. 33
      gRPC-Core.podspec
  9. 21
      grpc.gemspec
  10. 2
      include/grpc++/impl/codegen/client_unary_call.h
  11. 40
      include/grpc++/impl/codegen/completion_queue.h
  12. 6
      include/grpc++/impl/codegen/core_codegen.h
  13. 4
      include/grpc++/impl/codegen/core_codegen_interface.h
  14. 3
      include/grpc++/impl/codegen/server_context.h
  15. 14
      include/grpc++/impl/codegen/sync_stream.h
  16. 22
      include/grpc/grpc.h
  17. 15
      include/grpc/impl/codegen/grpc_types.h
  18. 21
      package.xml
  19. 27
      src/core/ext/filters/client_channel/client_channel.c
  20. 5
      src/core/ext/filters/client_channel/client_channel_plugin.c
  21. 59
      src/core/ext/filters/deadline/deadline_filter.c
  22. 17
      src/core/ext/filters/deadline/deadline_filter.h
  23. 2
      src/core/ext/filters/http/client/http_client_filter.c
  24. 9
      src/core/ext/filters/http/client/http_client_filter.h
  25. 103
      src/core/ext/filters/http/http_filters_plugin.c
  26. 126
      src/core/ext/filters/http/message_compress/message_compress_filter.c
  27. 9
      src/core/ext/filters/http/message_compress/message_compress_filter.h
  28. 2
      src/core/ext/filters/http/server/http_server_filter.c
  29. 6
      src/core/ext/filters/http/server/http_server_filter.h
  30. 10
      src/core/ext/filters/load_reporting/load_reporting.c
  31. 28
      src/core/ext/filters/max_age/max_age_filter.c
  32. 125
      src/core/ext/filters/message_size/message_size_filter.c
  33. 6
      src/core/ext/filters/message_size/message_size_filter.h
  34. 2
      src/core/ext/transport/chttp2/server/chttp2_server.c
  35. 28
      src/core/lib/channel/channel_args.c
  36. 5
      src/core/lib/channel/channel_args.h
  37. 11
      src/core/lib/channel/channel_stack_builder.c
  38. 4
      src/core/lib/channel/channel_stack_builder.h
  39. 1
      src/core/lib/security/credentials/credentials.c
  40. 1
      src/core/lib/security/credentials/ssl/ssl_credentials.c
  41. 21
      src/core/lib/surface/channel_init.c
  42. 18
      src/core/lib/surface/channel_stack_type.c
  43. 2
      src/core/lib/surface/channel_stack_type.h
  44. 48
      src/core/lib/surface/completion_queue.c
  45. 6
      src/core/lib/surface/completion_queue.h
  46. 33
      src/core/lib/surface/completion_queue_factory.c
  47. 50
      src/core/lib/surface/init.c
  48. 9
      src/core/lib/surface/server.c
  49. 2
      src/core/lib/surface/version.c
  50. 8
      src/core/plugin_registry/grpc_cronet_plugin_registry.c
  51. 12
      src/core/plugin_registry/grpc_plugin_registry.c
  52. 12
      src/core/plugin_registry/grpc_unsecure_plugin_registry.c
  53. 9
      src/cpp/common/core_codegen.cc
  54. 21
      src/cpp/server/server_cc.cc
  55. 4
      src/cpp/server/server_context.cc
  56. 10
      src/csharp/Grpc.Core.Tests/Internal/CompletionQueueSafeHandleTest.cs
  57. 4
      src/csharp/Grpc.Core.Tests/PInvokeTest.cs
  58. 2
      src/csharp/Grpc.Core/Internal/AsyncCall.cs
  59. 14
      src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
  60. 2
      src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs
  61. 9
      src/csharp/Grpc.Core/Internal/NativeMethods.cs
  62. 9
      src/csharp/ext/grpc_csharp_ext.c
  63. 18
      src/node/ext/completion_queue_threadpool.cc
  64. 14
      src/node/ext/completion_queue_uv.cc
  65. 4
      src/node/ext/server_generic.cc
  66. 2
      src/objective-c/GRPCClient/private/GRPCCompletionQueue.m
  67. 3
      src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m
  68. 4
      src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
  69. 5
      src/php/ext/grpc/completion_queue.c
  70. 2
      src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi
  71. 3
      src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
  72. 11
      src/python/grpcio/grpc_core_dependencies.py
  73. 4
      src/ruby/ext/grpc/rb_channel.c
  74. 2
      src/ruby/ext/grpc/rb_grpc_imports.generated.h
  75. 56
      src/ruby/ext/grpc/rb_server.c
  76. 12
      test/core/bad_client/bad_client.c
  77. 2
      test/core/bad_ssl/bad_ssl_test.c
  78. 15
      test/core/bad_ssl/server_common.c
  79. 232
      test/core/channel/minimal_stack_is_minimal_test.c
  80. 17
      test/core/client_channel/lb_policies_test.c
  81. 2
      test/core/end2end/bad_server_response_test.c
  82. 2
      test/core/end2end/connection_refused_test.c
  83. 12
      test/core/end2end/dualstack_socket_test.c
  84. 1
      test/core/end2end/end2end_tests.h
  85. 5
      test/core/end2end/fixtures/h2_census.c
  86. 5
      test/core/end2end/fixtures/h2_compress.c
  87. 3
      test/core/end2end/fixtures/h2_fakesec.c
  88. 3
      test/core/end2end/fixtures/h2_fd.c
  89. 5
      test/core/end2end/fixtures/h2_full+pipe.c
  90. 5
      test/core/end2end/fixtures/h2_full+trace.c
  91. 5
      test/core/end2end/fixtures/h2_full.c
  92. 5
      test/core/end2end/fixtures/h2_http_proxy.c
  93. 5
      test/core/end2end/fixtures/h2_load_reporting.c
  94. 3
      test/core/end2end/fixtures/h2_oauth2.c
  95. 5
      test/core/end2end/fixtures/h2_proxy.c
  96. 9
      test/core/end2end/fixtures/h2_sockpair+trace.c
  97. 9
      test/core/end2end/fixtures/h2_sockpair.c
  98. 9
      test/core/end2end/fixtures/h2_sockpair_1byte.c
  99. 3
      test/core/end2end/fixtures/h2_ssl.c
  100. 11
      test/core/end2end/fixtures/h2_ssl_cert.c
  101. Some files were not shown because too many files have changed in this diff Show More

64
BUILD

@ -77,6 +77,8 @@ grpc_cc_library(
"grpc_transport_chttp2_client_secure", "grpc_transport_chttp2_client_secure",
"grpc_transport_chttp2_server_insecure", "grpc_transport_chttp2_server_insecure",
"grpc_transport_chttp2_server_secure", "grpc_transport_chttp2_server_secure",
"grpc_message_size_filter",
"grpc_deadline_filter",
], ],
) )
@ -91,6 +93,7 @@ grpc_cc_library(
"grpc_base", "grpc_base",
"grpc_transport_chttp2_client_secure", "grpc_transport_chttp2_client_secure",
"grpc_transport_cronet_client_secure", "grpc_transport_cronet_client_secure",
"grpc_http_filters",
], ],
) )
@ -115,6 +118,8 @@ grpc_cc_library(
"grpc_resolver_sockaddr", "grpc_resolver_sockaddr",
"grpc_transport_chttp2_client_insecure", "grpc_transport_chttp2_client_insecure",
"grpc_transport_chttp2_server_insecure", "grpc_transport_chttp2_server_insecure",
"grpc_message_size_filter",
"grpc_deadline_filter",
], ],
) )
@ -451,15 +456,10 @@ grpc_cc_library(
"src/core/lib/channel/channel_args.c", "src/core/lib/channel/channel_args.c",
"src/core/lib/channel/channel_stack.c", "src/core/lib/channel/channel_stack.c",
"src/core/lib/channel/channel_stack_builder.c", "src/core/lib/channel/channel_stack_builder.c",
"src/core/lib/channel/compress_filter.c",
"src/core/lib/channel/connected_channel.c", "src/core/lib/channel/connected_channel.c",
"src/core/lib/channel/deadline_filter.c",
"src/core/lib/channel/handshaker.c", "src/core/lib/channel/handshaker.c",
"src/core/lib/channel/handshaker_factory.c", "src/core/lib/channel/handshaker_factory.c",
"src/core/lib/channel/handshaker_registry.c", "src/core/lib/channel/handshaker_registry.c",
"src/core/lib/channel/http_client_filter.c",
"src/core/lib/channel/http_server_filter.c",
"src/core/lib/channel/message_size_filter.c",
"src/core/lib/compression/compression.c", "src/core/lib/compression/compression.c",
"src/core/lib/compression/message_compress.c", "src/core/lib/compression/message_compress.c",
"src/core/lib/debug/trace.c", "src/core/lib/debug/trace.c",
@ -578,16 +578,11 @@ grpc_cc_library(
"src/core/lib/channel/channel_args.h", "src/core/lib/channel/channel_args.h",
"src/core/lib/channel/channel_stack.h", "src/core/lib/channel/channel_stack.h",
"src/core/lib/channel/channel_stack_builder.h", "src/core/lib/channel/channel_stack_builder.h",
"src/core/lib/channel/compress_filter.h",
"src/core/lib/channel/connected_channel.h", "src/core/lib/channel/connected_channel.h",
"src/core/lib/channel/context.h", "src/core/lib/channel/context.h",
"src/core/lib/channel/deadline_filter.h",
"src/core/lib/channel/handshaker.h", "src/core/lib/channel/handshaker.h",
"src/core/lib/channel/handshaker_factory.h", "src/core/lib/channel/handshaker_factory.h",
"src/core/lib/channel/handshaker_registry.h", "src/core/lib/channel/handshaker_registry.h",
"src/core/lib/channel/http_client_filter.h",
"src/core/lib/channel/http_server_filter.h",
"src/core/lib/channel/message_size_filter.h",
"src/core/lib/compression/algorithm_metadata.h", "src/core/lib/compression/algorithm_metadata.h",
"src/core/lib/compression/message_compress.h", "src/core/lib/compression/message_compress.h",
"src/core/lib/debug/trace.h", "src/core/lib/debug/trace.h",
@ -756,6 +751,7 @@ grpc_cc_library(
language = "c", language = "c",
deps = [ deps = [
"grpc_base", "grpc_base",
"grpc_deadline_filter",
], ],
) )
@ -773,6 +769,53 @@ grpc_cc_library(
], ],
) )
grpc_cc_library(
name = "grpc_deadline_filter",
srcs = [
"src/core/ext/filters/deadline/deadline_filter.c",
],
hdrs = [
"src/core/ext/filters/deadline/deadline_filter.h",
],
language = "c",
deps = [
"grpc_base",
],
)
grpc_cc_library(
name = "grpc_message_size_filter",
srcs = [
"src/core/ext/filters/message_size/message_size_filter.c",
],
hdrs = [
"src/core/ext/filters/message_size/message_size_filter.h",
],
language = "c",
deps = [
"grpc_base",
],
)
grpc_cc_library(
name = "grpc_http_filters",
hdrs = [
"src/core/ext/filters/http/message_compress/message_compress_filter.h",
"src/core/ext/filters/http/client/http_client_filter.h",
"src/core/ext/filters/http/server/http_server_filter.h",
],
srcs = [
"src/core/ext/filters/http/message_compress/message_compress_filter.c",
"src/core/ext/filters/http/client/http_client_filter.c",
"src/core/ext/filters/http/server/http_server_filter.c",
"src/core/ext/filters/http/http_filters_plugin.c"
],
language = "c",
deps = [
"grpc_base",
],
)
grpc_cc_library( grpc_cc_library(
name = "grpc_codegen", name = "grpc_codegen",
language = "c", language = "c",
@ -1035,6 +1078,7 @@ grpc_cc_library(
deps = [ deps = [
"grpc_base", "grpc_base",
"grpc_transport_chttp2_alpn", "grpc_transport_chttp2_alpn",
"grpc_http_filters",
], ],
) )

@ -471,6 +471,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c memory_profile_test) add_dependencies(buildtests_c memory_profile_test)
endif() endif()
add_dependencies(buildtests_c message_compress_test) add_dependencies(buildtests_c message_compress_test)
add_dependencies(buildtests_c minimal_stack_is_minimal_test)
add_dependencies(buildtests_c mlog_test) add_dependencies(buildtests_c mlog_test)
add_dependencies(buildtests_c multiple_server_queues_test) add_dependencies(buildtests_c multiple_server_queues_test)
add_dependencies(buildtests_c murmur_hash_test) add_dependencies(buildtests_c murmur_hash_test)
@ -913,15 +914,10 @@ add_library(grpc
src/core/lib/channel/channel_args.c src/core/lib/channel/channel_args.c
src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack.c
src/core/lib/channel/channel_stack_builder.c src/core/lib/channel/channel_stack_builder.c
src/core/lib/channel/compress_filter.c
src/core/lib/channel/connected_channel.c src/core/lib/channel/connected_channel.c
src/core/lib/channel/deadline_filter.c
src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker.c
src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_factory.c
src/core/lib/channel/handshaker_registry.c src/core/lib/channel/handshaker_registry.c
src/core/lib/channel/http_client_filter.c
src/core/lib/channel/http_server_filter.c
src/core/lib/channel/message_size_filter.c
src/core/lib/compression/compression.c src/core/lib/compression/compression.c
src/core/lib/compression/message_compress.c src/core/lib/compression/message_compress.c
src/core/lib/debug/trace.c src/core/lib/debug/trace.c
@ -1058,6 +1054,10 @@ add_library(grpc
src/core/ext/transport/chttp2/transport/varint.c src/core/ext/transport/chttp2/transport/varint.c
src/core/ext/transport/chttp2/transport/writing.c src/core/ext/transport/chttp2/transport/writing.c
src/core/ext/transport/chttp2/alpn/alpn.c src/core/ext/transport/chttp2/alpn/alpn.c
src/core/ext/filters/http/client/http_client_filter.c
src/core/ext/filters/http/http_filters_plugin.c
src/core/ext/filters/http/message_compress/message_compress_filter.c
src/core/ext/filters/http/server/http_server_filter.c
src/core/lib/http/httpcli_security_connector.c src/core/lib/http/httpcli_security_connector.c
src/core/lib/security/context/security_context.c src/core/lib/security/context/security_context.c
src/core/lib/security/credentials/composite/composite_credentials.c src/core/lib/security/credentials/composite/composite_credentials.c
@ -1107,6 +1107,7 @@ add_library(grpc
src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel.c
src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/subchannel_index.c
src/core/ext/filters/client_channel/uri_parser.c src/core/ext/filters/client_channel/uri_parser.c
src/core/ext/filters/deadline/deadline_filter.c
src/core/ext/transport/chttp2/client/chttp2_connector.c src/core/ext/transport/chttp2/client/chttp2_connector.c
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c src/core/ext/transport/chttp2/server/insecure/server_chttp2.c
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c
@ -1143,6 +1144,7 @@ add_library(grpc
src/core/ext/census/trace_context.c src/core/ext/census/trace_context.c
src/core/ext/census/tracing.c src/core/ext/census/tracing.c
src/core/ext/filters/max_age/max_age_filter.c src/core/ext/filters/max_age/max_age_filter.c
src/core/ext/filters/message_size/message_size_filter.c
src/core/plugin_registry/grpc_plugin_registry.c src/core/plugin_registry/grpc_plugin_registry.c
) )
@ -1237,15 +1239,10 @@ add_library(grpc_cronet
src/core/lib/channel/channel_args.c src/core/lib/channel/channel_args.c
src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack.c
src/core/lib/channel/channel_stack_builder.c src/core/lib/channel/channel_stack_builder.c
src/core/lib/channel/compress_filter.c
src/core/lib/channel/connected_channel.c src/core/lib/channel/connected_channel.c
src/core/lib/channel/deadline_filter.c
src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker.c
src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_factory.c
src/core/lib/channel/handshaker_registry.c src/core/lib/channel/handshaker_registry.c
src/core/lib/channel/http_client_filter.c
src/core/lib/channel/http_server_filter.c
src/core/lib/channel/message_size_filter.c
src/core/lib/compression/compression.c src/core/lib/compression/compression.c
src/core/lib/compression/message_compress.c src/core/lib/compression/message_compress.c
src/core/lib/debug/trace.c src/core/lib/debug/trace.c
@ -1385,6 +1382,10 @@ add_library(grpc_cronet
src/core/ext/transport/chttp2/transport/varint.c src/core/ext/transport/chttp2/transport/varint.c
src/core/ext/transport/chttp2/transport/writing.c src/core/ext/transport/chttp2/transport/writing.c
src/core/ext/transport/chttp2/alpn/alpn.c src/core/ext/transport/chttp2/alpn/alpn.c
src/core/ext/filters/http/client/http_client_filter.c
src/core/ext/filters/http/http_filters_plugin.c
src/core/ext/filters/http/message_compress/message_compress_filter.c
src/core/ext/filters/http/server/http_server_filter.c
src/core/ext/filters/client_channel/channel_connectivity.c src/core/ext/filters/client_channel/channel_connectivity.c
src/core/ext/filters/client_channel/client_channel.c src/core/ext/filters/client_channel/client_channel.c
src/core/ext/filters/client_channel/client_channel_factory.c src/core/ext/filters/client_channel/client_channel_factory.c
@ -1405,6 +1406,7 @@ add_library(grpc_cronet
src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel.c
src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/subchannel_index.c
src/core/ext/filters/client_channel/uri_parser.c src/core/ext/filters/client_channel/uri_parser.c
src/core/ext/filters/deadline/deadline_filter.c
src/core/lib/http/httpcli_security_connector.c src/core/lib/http/httpcli_security_connector.c
src/core/lib/security/context/security_context.c src/core/lib/security/context/security_context.c
src/core/lib/security/credentials/composite/composite_credentials.c src/core/lib/security/credentials/composite/composite_credentials.c
@ -1547,15 +1549,10 @@ add_library(grpc_test_util
src/core/lib/channel/channel_args.c src/core/lib/channel/channel_args.c
src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack.c
src/core/lib/channel/channel_stack_builder.c src/core/lib/channel/channel_stack_builder.c
src/core/lib/channel/compress_filter.c
src/core/lib/channel/connected_channel.c src/core/lib/channel/connected_channel.c
src/core/lib/channel/deadline_filter.c
src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker.c
src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_factory.c
src/core/lib/channel/handshaker_registry.c src/core/lib/channel/handshaker_registry.c
src/core/lib/channel/http_client_filter.c
src/core/lib/channel/http_server_filter.c
src/core/lib/channel/message_size_filter.c
src/core/lib/compression/compression.c src/core/lib/compression/compression.c
src/core/lib/compression/message_compress.c src/core/lib/compression/message_compress.c
src/core/lib/debug/trace.c src/core/lib/debug/trace.c
@ -1808,15 +1805,10 @@ add_library(grpc_unsecure
src/core/lib/channel/channel_args.c src/core/lib/channel/channel_args.c
src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack.c
src/core/lib/channel/channel_stack_builder.c src/core/lib/channel/channel_stack_builder.c
src/core/lib/channel/compress_filter.c
src/core/lib/channel/connected_channel.c src/core/lib/channel/connected_channel.c
src/core/lib/channel/deadline_filter.c
src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker.c
src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_factory.c
src/core/lib/channel/handshaker_registry.c src/core/lib/channel/handshaker_registry.c
src/core/lib/channel/http_client_filter.c
src/core/lib/channel/http_server_filter.c
src/core/lib/channel/message_size_filter.c
src/core/lib/compression/compression.c src/core/lib/compression/compression.c
src/core/lib/compression/message_compress.c src/core/lib/compression/message_compress.c
src/core/lib/debug/trace.c src/core/lib/debug/trace.c
@ -1954,6 +1946,10 @@ add_library(grpc_unsecure
src/core/ext/transport/chttp2/transport/varint.c src/core/ext/transport/chttp2/transport/varint.c
src/core/ext/transport/chttp2/transport/writing.c src/core/ext/transport/chttp2/transport/writing.c
src/core/ext/transport/chttp2/alpn/alpn.c src/core/ext/transport/chttp2/alpn/alpn.c
src/core/ext/filters/http/client/http_client_filter.c
src/core/ext/filters/http/http_filters_plugin.c
src/core/ext/filters/http/message_compress/message_compress_filter.c
src/core/ext/filters/http/server/http_server_filter.c
src/core/ext/transport/chttp2/server/chttp2_server.c src/core/ext/transport/chttp2/server/chttp2_server.c
src/core/ext/transport/chttp2/client/insecure/channel_create.c src/core/ext/transport/chttp2/client/insecure/channel_create.c
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c
@ -1978,6 +1974,7 @@ add_library(grpc_unsecure
src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel.c
src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/subchannel_index.c
src/core/ext/filters/client_channel/uri_parser.c src/core/ext/filters/client_channel/uri_parser.c
src/core/ext/filters/deadline/deadline_filter.c
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c
@ -2009,6 +2006,7 @@ add_library(grpc_unsecure
src/core/ext/census/trace_context.c src/core/ext/census/trace_context.c
src/core/ext/census/tracing.c src/core/ext/census/tracing.c
src/core/ext/filters/max_age/max_age_filter.c src/core/ext/filters/max_age/max_age_filter.c
src/core/ext/filters/message_size/message_size_filter.c
src/core/plugin_registry/grpc_unsecure_plugin_registry.c src/core/plugin_registry/grpc_unsecure_plugin_registry.c
) )
@ -2226,15 +2224,10 @@ add_library(grpc++
src/core/lib/channel/channel_args.c src/core/lib/channel/channel_args.c
src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack.c
src/core/lib/channel/channel_stack_builder.c src/core/lib/channel/channel_stack_builder.c
src/core/lib/channel/compress_filter.c
src/core/lib/channel/connected_channel.c src/core/lib/channel/connected_channel.c
src/core/lib/channel/deadline_filter.c
src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker.c
src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_factory.c
src/core/lib/channel/handshaker_registry.c src/core/lib/channel/handshaker_registry.c
src/core/lib/channel/http_client_filter.c
src/core/lib/channel/http_server_filter.c
src/core/lib/channel/message_size_filter.c
src/core/lib/compression/compression.c src/core/lib/compression/compression.c
src/core/lib/compression/message_compress.c src/core/lib/compression/message_compress.c
src/core/lib/debug/trace.c src/core/lib/debug/trace.c
@ -2557,15 +2550,10 @@ add_library(grpc++_cronet
src/core/lib/channel/channel_args.c src/core/lib/channel/channel_args.c
src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack.c
src/core/lib/channel/channel_stack_builder.c src/core/lib/channel/channel_stack_builder.c
src/core/lib/channel/compress_filter.c
src/core/lib/channel/connected_channel.c src/core/lib/channel/connected_channel.c
src/core/lib/channel/deadline_filter.c
src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker.c
src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_factory.c
src/core/lib/channel/handshaker_registry.c src/core/lib/channel/handshaker_registry.c
src/core/lib/channel/http_client_filter.c
src/core/lib/channel/http_server_filter.c
src/core/lib/channel/message_size_filter.c
src/core/lib/compression/compression.c src/core/lib/compression/compression.c
src/core/lib/compression/message_compress.c src/core/lib/compression/message_compress.c
src/core/lib/debug/trace.c src/core/lib/debug/trace.c
@ -2708,6 +2696,10 @@ add_library(grpc++_cronet
src/core/ext/transport/chttp2/transport/varint.c src/core/ext/transport/chttp2/transport/varint.c
src/core/ext/transport/chttp2/transport/writing.c src/core/ext/transport/chttp2/transport/writing.c
src/core/ext/transport/chttp2/alpn/alpn.c src/core/ext/transport/chttp2/alpn/alpn.c
src/core/ext/filters/http/client/http_client_filter.c
src/core/ext/filters/http/http_filters_plugin.c
src/core/ext/filters/http/message_compress/message_compress_filter.c
src/core/ext/filters/http/server/http_server_filter.c
src/core/ext/filters/client_channel/channel_connectivity.c src/core/ext/filters/client_channel/channel_connectivity.c
src/core/ext/filters/client_channel/client_channel.c src/core/ext/filters/client_channel/client_channel.c
src/core/ext/filters/client_channel/client_channel_factory.c src/core/ext/filters/client_channel/client_channel_factory.c
@ -2728,6 +2720,7 @@ add_library(grpc++_cronet
src/core/ext/filters/client_channel/subchannel.c src/core/ext/filters/client_channel/subchannel.c
src/core/ext/filters/client_channel/subchannel_index.c src/core/ext/filters/client_channel/subchannel_index.c
src/core/ext/filters/client_channel/uri_parser.c src/core/ext/filters/client_channel/uri_parser.c
src/core/ext/filters/deadline/deadline_filter.c
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c src/core/ext/transport/chttp2/server/insecure/server_chttp2.c
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c
src/core/ext/transport/chttp2/server/chttp2_server.c src/core/ext/transport/chttp2/server/chttp2_server.c
@ -3323,15 +3316,10 @@ add_library(grpc++_unsecure
src/core/lib/channel/channel_args.c src/core/lib/channel/channel_args.c
src/core/lib/channel/channel_stack.c src/core/lib/channel/channel_stack.c
src/core/lib/channel/channel_stack_builder.c src/core/lib/channel/channel_stack_builder.c
src/core/lib/channel/compress_filter.c
src/core/lib/channel/connected_channel.c src/core/lib/channel/connected_channel.c
src/core/lib/channel/deadline_filter.c
src/core/lib/channel/handshaker.c src/core/lib/channel/handshaker.c
src/core/lib/channel/handshaker_factory.c src/core/lib/channel/handshaker_factory.c
src/core/lib/channel/handshaker_registry.c src/core/lib/channel/handshaker_registry.c
src/core/lib/channel/http_client_filter.c
src/core/lib/channel/http_server_filter.c
src/core/lib/channel/message_size_filter.c
src/core/lib/compression/compression.c src/core/lib/compression/compression.c
src/core/lib/compression/message_compress.c src/core/lib/compression/message_compress.c
src/core/lib/debug/trace.c src/core/lib/debug/trace.c
@ -7458,6 +7446,37 @@ target_link_libraries(message_compress_test
endif (gRPC_BUILD_TESTS) endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS)
add_executable(minimal_stack_is_minimal_test
test/core/channel/minimal_stack_is_minimal_test.c
)
target_include_directories(minimal_stack_is_minimal_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${BENCHMARK_ROOT_DIR}/include
PRIVATE ${ZLIB_ROOT_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CARES_BUILD_INCLUDE_DIR}
PRIVATE ${CARES_INCLUDE_DIR}
PRIVATE ${CARES_PLATFORM_INCLUDE_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
)
target_link_libraries(minimal_stack_is_minimal_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr_test_util
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(mlog_test add_executable(mlog_test
test/core/census/mlog_test.c test/core/census/mlog_test.c
) )

@ -419,7 +419,7 @@ E = @echo
Q = @ Q = @
endif endif
CORE_VERSION = 3.0.0-dev CORE_VERSION = 4.0.0-dev
CPP_VERSION = 1.4.0-dev CPP_VERSION = 1.4.0-dev
CSHARP_VERSION = 1.4.0-dev CSHARP_VERSION = 1.4.0-dev
@ -469,7 +469,7 @@ SHARED_EXT_CORE = dll
SHARED_EXT_CPP = dll SHARED_EXT_CPP = dll
SHARED_EXT_CSHARP = dll SHARED_EXT_CSHARP = dll
SHARED_PREFIX = SHARED_PREFIX =
SHARED_VERSION_CORE = -3 SHARED_VERSION_CORE = -4
SHARED_VERSION_CPP = -1 SHARED_VERSION_CPP = -1
SHARED_VERSION_CSHARP = -1 SHARED_VERSION_CSHARP = -1
else ifeq ($(SYSTEM),Darwin) else ifeq ($(SYSTEM),Darwin)
@ -1050,6 +1050,7 @@ memory_profile_client: $(BINDIR)/$(CONFIG)/memory_profile_client
memory_profile_server: $(BINDIR)/$(CONFIG)/memory_profile_server memory_profile_server: $(BINDIR)/$(CONFIG)/memory_profile_server
memory_profile_test: $(BINDIR)/$(CONFIG)/memory_profile_test memory_profile_test: $(BINDIR)/$(CONFIG)/memory_profile_test
message_compress_test: $(BINDIR)/$(CONFIG)/message_compress_test message_compress_test: $(BINDIR)/$(CONFIG)/message_compress_test
minimal_stack_is_minimal_test: $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test
mlog_test: $(BINDIR)/$(CONFIG)/mlog_test mlog_test: $(BINDIR)/$(CONFIG)/mlog_test
multiple_server_queues_test: $(BINDIR)/$(CONFIG)/multiple_server_queues_test multiple_server_queues_test: $(BINDIR)/$(CONFIG)/multiple_server_queues_test
murmur_hash_test: $(BINDIR)/$(CONFIG)/murmur_hash_test murmur_hash_test: $(BINDIR)/$(CONFIG)/murmur_hash_test
@ -1423,6 +1424,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/memory_profile_server \ $(BINDIR)/$(CONFIG)/memory_profile_server \
$(BINDIR)/$(CONFIG)/memory_profile_test \ $(BINDIR)/$(CONFIG)/memory_profile_test \
$(BINDIR)/$(CONFIG)/message_compress_test \ $(BINDIR)/$(CONFIG)/message_compress_test \
$(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test \
$(BINDIR)/$(CONFIG)/mlog_test \ $(BINDIR)/$(CONFIG)/mlog_test \
$(BINDIR)/$(CONFIG)/multiple_server_queues_test \ $(BINDIR)/$(CONFIG)/multiple_server_queues_test \
$(BINDIR)/$(CONFIG)/murmur_hash_test \ $(BINDIR)/$(CONFIG)/murmur_hash_test \
@ -1877,6 +1879,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/memory_profile_test || ( echo test memory_profile_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/memory_profile_test || ( echo test memory_profile_test failed ; exit 1 )
$(E) "[RUN] Testing message_compress_test" $(E) "[RUN] Testing message_compress_test"
$(Q) $(BINDIR)/$(CONFIG)/message_compress_test || ( echo test message_compress_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/message_compress_test || ( echo test message_compress_test failed ; exit 1 )
$(E) "[RUN] Testing minimal_stack_is_minimal_test"
$(Q) $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test || ( echo test minimal_stack_is_minimal_test failed ; exit 1 )
$(E) "[RUN] Testing multiple_server_queues_test" $(E) "[RUN] Testing multiple_server_queues_test"
$(Q) $(BINDIR)/$(CONFIG)/multiple_server_queues_test || ( echo test multiple_server_queues_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/multiple_server_queues_test || ( echo test multiple_server_queues_test failed ; exit 1 )
$(E) "[RUN] Testing murmur_hash_test" $(E) "[RUN] Testing murmur_hash_test"
@ -2550,7 +2554,7 @@ install-shared_c: shared_c strip-shared_c install-pkg-config_c
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.3 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.4
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -2559,7 +2563,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -2568,7 +2572,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_cronet.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_cronet.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
@ -2577,7 +2581,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so
endif endif
ifneq ($(SYSTEM),MINGW32) ifneq ($(SYSTEM),MINGW32)
@ -2594,7 +2598,7 @@ install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-con
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
@ -2603,7 +2607,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_cronet.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_cronet.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
@ -2612,7 +2616,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_error_details.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_error_details.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
@ -2621,7 +2625,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_reflection.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_reflection.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
@ -2630,7 +2634,7 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_unsecure.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_unsecure.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so
endif endif
ifneq ($(SYSTEM),MINGW32) ifneq ($(SYSTEM),MINGW32)
@ -2647,7 +2651,7 @@ install-shared_csharp: shared_csharp strip-shared_csharp
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so
endif endif
ifneq ($(SYSTEM),MINGW32) ifneq ($(SYSTEM),MINGW32)
@ -2812,8 +2816,8 @@ $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGPR_OB
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.3 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.4 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.4
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -2853,15 +2857,10 @@ LIBGRPC_SRC = \
src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.c \
src/core/lib/channel/compress_filter.c \
src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.c \
src/core/lib/channel/deadline_filter.c \
src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.c \
src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.c \
src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.c \
src/core/lib/channel/http_client_filter.c \
src/core/lib/channel/http_server_filter.c \
src/core/lib/channel/message_size_filter.c \
src/core/lib/compression/compression.c \ src/core/lib/compression/compression.c \
src/core/lib/compression/message_compress.c \ src/core/lib/compression/message_compress.c \
src/core/lib/debug/trace.c \ src/core/lib/debug/trace.c \
@ -2998,6 +2997,10 @@ LIBGRPC_SRC = \
src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/varint.c \
src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/transport/writing.c \
src/core/ext/transport/chttp2/alpn/alpn.c \ src/core/ext/transport/chttp2/alpn/alpn.c \
src/core/ext/filters/http/client/http_client_filter.c \
src/core/ext/filters/http/http_filters_plugin.c \
src/core/ext/filters/http/message_compress/message_compress_filter.c \
src/core/ext/filters/http/server/http_server_filter.c \
src/core/lib/http/httpcli_security_connector.c \ src/core/lib/http/httpcli_security_connector.c \
src/core/lib/security/context/security_context.c \ src/core/lib/security/context/security_context.c \
src/core/lib/security/credentials/composite/composite_credentials.c \ src/core/lib/security/credentials/composite/composite_credentials.c \
@ -3047,6 +3050,7 @@ LIBGRPC_SRC = \
src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/client_channel/uri_parser.c \
src/core/ext/filters/deadline/deadline_filter.c \
src/core/ext/transport/chttp2/client/chttp2_connector.c \ src/core/ext/transport/chttp2/client/chttp2_connector.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \
@ -3083,6 +3087,7 @@ LIBGRPC_SRC = \
src/core/ext/census/trace_context.c \ src/core/ext/census/trace_context.c \
src/core/ext/census/tracing.c \ src/core/ext/census/tracing.c \
src/core/ext/filters/max_age/max_age_filter.c \ src/core/ext/filters/max_age/max_age_filter.c \
src/core/ext/filters/message_size/message_size_filter.c \
src/core/plugin_registry/grpc_plugin_registry.c \ src/core/plugin_registry/grpc_plugin_registry.c \
PUBLIC_HEADERS_C += \ PUBLIC_HEADERS_C += \
@ -3155,8 +3160,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.3 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.4 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -3175,15 +3180,10 @@ LIBGRPC_CRONET_SRC = \
src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.c \
src/core/lib/channel/compress_filter.c \
src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.c \
src/core/lib/channel/deadline_filter.c \
src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.c \
src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.c \
src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.c \
src/core/lib/channel/http_client_filter.c \
src/core/lib/channel/http_server_filter.c \
src/core/lib/channel/message_size_filter.c \
src/core/lib/compression/compression.c \ src/core/lib/compression/compression.c \
src/core/lib/compression/message_compress.c \ src/core/lib/compression/message_compress.c \
src/core/lib/debug/trace.c \ src/core/lib/debug/trace.c \
@ -3323,6 +3323,10 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/varint.c \
src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/transport/writing.c \
src/core/ext/transport/chttp2/alpn/alpn.c \ src/core/ext/transport/chttp2/alpn/alpn.c \
src/core/ext/filters/http/client/http_client_filter.c \
src/core/ext/filters/http/http_filters_plugin.c \
src/core/ext/filters/http/message_compress/message_compress_filter.c \
src/core/ext/filters/http/server/http_server_filter.c \
src/core/ext/filters/client_channel/channel_connectivity.c \ src/core/ext/filters/client_channel/channel_connectivity.c \
src/core/ext/filters/client_channel/client_channel.c \ src/core/ext/filters/client_channel/client_channel.c \
src/core/ext/filters/client_channel/client_channel_factory.c \ src/core/ext/filters/client_channel/client_channel_factory.c \
@ -3343,6 +3347,7 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/client_channel/uri_parser.c \
src/core/ext/filters/deadline/deadline_filter.c \
src/core/lib/http/httpcli_security_connector.c \ src/core/lib/http/httpcli_security_connector.c \
src/core/lib/security/context/security_context.c \ src/core/lib/security/context/security_context.c \
src/core/lib/security/credentials/composite/composite_credentials.c \ src/core/lib/security/credentials/composite/composite_credentials.c \
@ -3445,8 +3450,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(L
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.3 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.4 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -3484,15 +3489,10 @@ LIBGRPC_TEST_UTIL_SRC = \
src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.c \
src/core/lib/channel/compress_filter.c \
src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.c \
src/core/lib/channel/deadline_filter.c \
src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.c \
src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.c \
src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.c \
src/core/lib/channel/http_client_filter.c \
src/core/lib/channel/http_server_filter.c \
src/core/lib/channel/message_size_filter.c \
src/core/lib/compression/compression.c \ src/core/lib/compression/compression.c \
src/core/lib/compression/message_compress.c \ src/core/lib/compression/message_compress.c \
src/core/lib/debug/trace.c \ src/core/lib/debug/trace.c \
@ -3717,15 +3717,10 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.c \
src/core/lib/channel/compress_filter.c \
src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.c \
src/core/lib/channel/deadline_filter.c \
src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.c \
src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.c \
src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.c \
src/core/lib/channel/http_client_filter.c \
src/core/lib/channel/http_server_filter.c \
src/core/lib/channel/message_size_filter.c \
src/core/lib/compression/compression.c \ src/core/lib/compression/compression.c \
src/core/lib/compression/message_compress.c \ src/core/lib/compression/message_compress.c \
src/core/lib/debug/trace.c \ src/core/lib/debug/trace.c \
@ -3863,6 +3858,10 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/varint.c \
src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/transport/writing.c \
src/core/ext/transport/chttp2/alpn/alpn.c \ src/core/ext/transport/chttp2/alpn/alpn.c \
src/core/ext/filters/http/client/http_client_filter.c \
src/core/ext/filters/http/http_filters_plugin.c \
src/core/ext/filters/http/message_compress/message_compress_filter.c \
src/core/ext/filters/http/server/http_server_filter.c \
src/core/ext/transport/chttp2/server/chttp2_server.c \ src/core/ext/transport/chttp2/server/chttp2_server.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c \
@ -3887,6 +3886,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/client_channel/uri_parser.c \
src/core/ext/filters/deadline/deadline_filter.c \
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c \ src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.c \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c \ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c \
@ -3918,6 +3918,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/census/trace_context.c \ src/core/ext/census/trace_context.c \
src/core/ext/census/tracing.c \ src/core/ext/census/tracing.c \
src/core/ext/filters/max_age/max_age_filter.c \ src/core/ext/filters/max_age/max_age_filter.c \
src/core/ext/filters/message_size/message_size_filter.c \
src/core/plugin_registry/grpc_unsecure_plugin_registry.c \ src/core/plugin_registry/grpc_unsecure_plugin_registry.c \
PUBLIC_HEADERS_C += \ PUBLIC_HEADERS_C += \
@ -3978,8 +3979,8 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.3 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.4 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.4
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -4112,15 +4113,10 @@ LIBGRPC++_SRC = \
src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.c \
src/core/lib/channel/compress_filter.c \
src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.c \
src/core/lib/channel/deadline_filter.c \
src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.c \
src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.c \
src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.c \
src/core/lib/channel/http_client_filter.c \
src/core/lib/channel/http_server_filter.c \
src/core/lib/channel/message_size_filter.c \
src/core/lib/compression/compression.c \ src/core/lib/compression/compression.c \
src/core/lib/compression/message_compress.c \ src/core/lib/compression/message_compress.c \
src/core/lib/debug/trace.c \ src/core/lib/debug/trace.c \
@ -4451,15 +4447,10 @@ LIBGRPC++_CRONET_SRC = \
src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.c \
src/core/lib/channel/compress_filter.c \
src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.c \
src/core/lib/channel/deadline_filter.c \
src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.c \
src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.c \
src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.c \
src/core/lib/channel/http_client_filter.c \
src/core/lib/channel/http_server_filter.c \
src/core/lib/channel/message_size_filter.c \
src/core/lib/compression/compression.c \ src/core/lib/compression/compression.c \
src/core/lib/compression/message_compress.c \ src/core/lib/compression/message_compress.c \
src/core/lib/debug/trace.c \ src/core/lib/debug/trace.c \
@ -4602,6 +4593,10 @@ LIBGRPC++_CRONET_SRC = \
src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/varint.c \
src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/transport/writing.c \
src/core/ext/transport/chttp2/alpn/alpn.c \ src/core/ext/transport/chttp2/alpn/alpn.c \
src/core/ext/filters/http/client/http_client_filter.c \
src/core/ext/filters/http/http_filters_plugin.c \
src/core/ext/filters/http/message_compress/message_compress_filter.c \
src/core/ext/filters/http/server/http_server_filter.c \
src/core/ext/filters/client_channel/channel_connectivity.c \ src/core/ext/filters/client_channel/channel_connectivity.c \
src/core/ext/filters/client_channel/client_channel.c \ src/core/ext/filters/client_channel/client_channel.c \
src/core/ext/filters/client_channel/client_channel_factory.c \ src/core/ext/filters/client_channel/client_channel_factory.c \
@ -4622,6 +4617,7 @@ LIBGRPC++_CRONET_SRC = \
src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/client_channel/uri_parser.c \
src/core/ext/filters/deadline/deadline_filter.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \
src/core/ext/transport/chttp2/server/chttp2_server.c \ src/core/ext/transport/chttp2/server/chttp2_server.c \
@ -5214,15 +5210,10 @@ LIBGRPC++_UNSECURE_SRC = \
src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.c \
src/core/lib/channel/compress_filter.c \
src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.c \
src/core/lib/channel/deadline_filter.c \
src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.c \
src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.c \
src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.c \
src/core/lib/channel/http_client_filter.c \
src/core/lib/channel/http_server_filter.c \
src/core/lib/channel/message_size_filter.c \
src/core/lib/compression/compression.c \ src/core/lib/compression/compression.c \
src/core/lib/compression/message_compress.c \ src/core/lib/compression/message_compress.c \
src/core/lib/debug/trace.c \ src/core/lib/debug/trace.c \
@ -11618,6 +11609,38 @@ endif
endif endif
MINIMAL_STACK_IS_MINIMAL_TEST_SRC = \
test/core/channel/minimal_stack_is_minimal_test.c \
MINIMAL_STACK_IS_MINIMAL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MINIMAL_STACK_IS_MINIMAL_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test: $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/minimal_stack_is_minimal_test
endif
$(OBJDIR)/$(CONFIG)/test/core/channel/minimal_stack_is_minimal_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_minimal_stack_is_minimal_test: $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(MINIMAL_STACK_IS_MINIMAL_TEST_OBJS:.o=.dep)
endif
endif
MLOG_TEST_SRC = \ MLOG_TEST_SRC = \
test/core/census/mlog_test.c \ test/core/census/mlog_test.c \

@ -653,15 +653,10 @@
'src/core/lib/channel/channel_args.c', 'src/core/lib/channel/channel_args.c',
'src/core/lib/channel/channel_stack.c', 'src/core/lib/channel/channel_stack.c',
'src/core/lib/channel/channel_stack_builder.c', 'src/core/lib/channel/channel_stack_builder.c',
'src/core/lib/channel/compress_filter.c',
'src/core/lib/channel/connected_channel.c', 'src/core/lib/channel/connected_channel.c',
'src/core/lib/channel/deadline_filter.c',
'src/core/lib/channel/handshaker.c', 'src/core/lib/channel/handshaker.c',
'src/core/lib/channel/handshaker_factory.c', 'src/core/lib/channel/handshaker_factory.c',
'src/core/lib/channel/handshaker_registry.c', 'src/core/lib/channel/handshaker_registry.c',
'src/core/lib/channel/http_client_filter.c',
'src/core/lib/channel/http_server_filter.c',
'src/core/lib/channel/message_size_filter.c',
'src/core/lib/compression/compression.c', 'src/core/lib/compression/compression.c',
'src/core/lib/compression/message_compress.c', 'src/core/lib/compression/message_compress.c',
'src/core/lib/debug/trace.c', 'src/core/lib/debug/trace.c',
@ -798,6 +793,10 @@
'src/core/ext/transport/chttp2/transport/varint.c', 'src/core/ext/transport/chttp2/transport/varint.c',
'src/core/ext/transport/chttp2/transport/writing.c', 'src/core/ext/transport/chttp2/transport/writing.c',
'src/core/ext/transport/chttp2/alpn/alpn.c', 'src/core/ext/transport/chttp2/alpn/alpn.c',
'src/core/ext/filters/http/client/http_client_filter.c',
'src/core/ext/filters/http/http_filters_plugin.c',
'src/core/ext/filters/http/message_compress/message_compress_filter.c',
'src/core/ext/filters/http/server/http_server_filter.c',
'src/core/lib/http/httpcli_security_connector.c', 'src/core/lib/http/httpcli_security_connector.c',
'src/core/lib/security/context/security_context.c', 'src/core/lib/security/context/security_context.c',
'src/core/lib/security/credentials/composite/composite_credentials.c', 'src/core/lib/security/credentials/composite/composite_credentials.c',
@ -847,6 +846,7 @@
'src/core/ext/filters/client_channel/subchannel.c', 'src/core/ext/filters/client_channel/subchannel.c',
'src/core/ext/filters/client_channel/subchannel_index.c', 'src/core/ext/filters/client_channel/subchannel_index.c',
'src/core/ext/filters/client_channel/uri_parser.c', 'src/core/ext/filters/client_channel/uri_parser.c',
'src/core/ext/filters/deadline/deadline_filter.c',
'src/core/ext/transport/chttp2/client/chttp2_connector.c', 'src/core/ext/transport/chttp2/client/chttp2_connector.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c',
@ -883,6 +883,7 @@
'src/core/ext/census/trace_context.c', 'src/core/ext/census/trace_context.c',
'src/core/ext/census/tracing.c', 'src/core/ext/census/tracing.c',
'src/core/ext/filters/max_age/max_age_filter.c', 'src/core/ext/filters/max_age/max_age_filter.c',
'src/core/ext/filters/message_size/message_size_filter.c',
'src/core/plugin_registry/grpc_plugin_registry.c', 'src/core/plugin_registry/grpc_plugin_registry.c',
], ],
"conditions": [ "conditions": [

@ -12,7 +12,7 @@ settings:
'#08': Use "-preN" suffixes to identify pre-release versions '#08': Use "-preN" suffixes to identify pre-release versions
'#09': Per-language overrides are possible with (eg) ruby_version tag here '#09': Per-language overrides are possible with (eg) ruby_version tag here
'#10': See the expand_version.py for all the quirks here '#10': See the expand_version.py for all the quirks here
core_version: 3.0.0-dev core_version: 4.0.0-dev
g_stands_for: gentle g_stands_for: gentle
version: 1.4.0-dev version: 1.4.0-dev
filegroups: filegroups:
@ -176,16 +176,11 @@ filegroups:
- src/core/lib/channel/channel_args.h - src/core/lib/channel/channel_args.h
- src/core/lib/channel/channel_stack.h - src/core/lib/channel/channel_stack.h
- src/core/lib/channel/channel_stack_builder.h - src/core/lib/channel/channel_stack_builder.h
- src/core/lib/channel/compress_filter.h
- src/core/lib/channel/connected_channel.h - src/core/lib/channel/connected_channel.h
- src/core/lib/channel/context.h - src/core/lib/channel/context.h
- src/core/lib/channel/deadline_filter.h
- src/core/lib/channel/handshaker.h - src/core/lib/channel/handshaker.h
- src/core/lib/channel/handshaker_factory.h - src/core/lib/channel/handshaker_factory.h
- src/core/lib/channel/handshaker_registry.h - src/core/lib/channel/handshaker_registry.h
- src/core/lib/channel/http_client_filter.h
- src/core/lib/channel/http_server_filter.h
- src/core/lib/channel/message_size_filter.h
- src/core/lib/compression/algorithm_metadata.h - src/core/lib/compression/algorithm_metadata.h
- src/core/lib/compression/message_compress.h - src/core/lib/compression/message_compress.h
- src/core/lib/debug/trace.h - src/core/lib/debug/trace.h
@ -288,15 +283,10 @@ filegroups:
- src/core/lib/channel/channel_args.c - src/core/lib/channel/channel_args.c
- src/core/lib/channel/channel_stack.c - src/core/lib/channel/channel_stack.c
- src/core/lib/channel/channel_stack_builder.c - src/core/lib/channel/channel_stack_builder.c
- src/core/lib/channel/compress_filter.c
- src/core/lib/channel/connected_channel.c - src/core/lib/channel/connected_channel.c
- src/core/lib/channel/deadline_filter.c
- src/core/lib/channel/handshaker.c - src/core/lib/channel/handshaker.c
- src/core/lib/channel/handshaker_factory.c - src/core/lib/channel/handshaker_factory.c
- src/core/lib/channel/handshaker_registry.c - src/core/lib/channel/handshaker_registry.c
- src/core/lib/channel/http_client_filter.c
- src/core/lib/channel/http_server_filter.c
- src/core/lib/channel/message_size_filter.c
- src/core/lib/compression/compression.c - src/core/lib/compression/compression.c
- src/core/lib/compression/message_compress.c - src/core/lib/compression/message_compress.c
- src/core/lib/debug/trace.c - src/core/lib/debug/trace.c
@ -458,6 +448,7 @@ filegroups:
plugin: grpc_client_channel plugin: grpc_client_channel
uses: uses:
- grpc_base - grpc_base
- grpc_deadline_filter
- name: grpc_codegen - name: grpc_codegen
public_headers: public_headers:
- include/grpc/impl/codegen/byte_buffer_reader.h - include/grpc/impl/codegen/byte_buffer_reader.h
@ -470,6 +461,27 @@ filegroups:
- include/grpc/impl/codegen/status.h - include/grpc/impl/codegen/status.h
uses: uses:
- gpr_codegen - gpr_codegen
- name: grpc_deadline_filter
headers:
- src/core/ext/filters/deadline/deadline_filter.h
src:
- src/core/ext/filters/deadline/deadline_filter.c
plugin: grpc_deadline_filter
uses:
- grpc_base
- name: grpc_http_filters
headers:
- src/core/ext/filters/http/client/http_client_filter.h
- src/core/ext/filters/http/message_compress/message_compress_filter.h
- src/core/ext/filters/http/server/http_server_filter.h
src:
- src/core/ext/filters/http/client/http_client_filter.c
- src/core/ext/filters/http/http_filters_plugin.c
- src/core/ext/filters/http/message_compress/message_compress_filter.c
- src/core/ext/filters/http/server/http_server_filter.c
plugin: grpc_http_filters
uses:
- grpc_base
- name: grpc_lb_policy_grpclb - name: grpc_lb_policy_grpclb
headers: headers:
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h - src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
@ -535,6 +547,14 @@ filegroups:
plugin: grpc_max_age_filter plugin: grpc_max_age_filter
uses: uses:
- grpc_base - grpc_base
- name: grpc_message_size_filter
headers:
- src/core/ext/filters/message_size/message_size_filter.h
src:
- src/core/ext/filters/message_size/message_size_filter.c
plugin: grpc_message_size_filter
uses:
- grpc_base
- name: grpc_resolver_dns_ares - name: grpc_resolver_dns_ares
headers: headers:
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h - src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
@ -698,6 +718,7 @@ filegroups:
uses: uses:
- grpc_base - grpc_base
- grpc_transport_chttp2_alpn - grpc_transport_chttp2_alpn
- grpc_http_filters
- name: grpc_transport_chttp2_alpn - name: grpc_transport_chttp2_alpn
headers: headers:
- src/core/ext/transport/chttp2/alpn/alpn.h - src/core/ext/transport/chttp2/alpn/alpn.h
@ -771,6 +792,7 @@ filegroups:
filegroups: filegroups:
- grpc_base - grpc_base
- grpc_transport_chttp2 - grpc_transport_chttp2
- grpc_http_filters
- name: nanopb - name: nanopb
headers: headers:
- third_party/nanopb/pb.h - third_party/nanopb/pb.h
@ -1001,6 +1023,8 @@ libs:
- grpc_secure - grpc_secure
- census - census
- grpc_max_age_filter - grpc_max_age_filter
- grpc_message_size_filter
- grpc_deadline_filter
generate_plugin_registry: true generate_plugin_registry: true
secure: true secure: true
vs_packages: vs_packages:
@ -1098,6 +1122,8 @@ libs:
- grpc_lb_policy_round_robin - grpc_lb_policy_round_robin
- census - census
- grpc_max_age_filter - grpc_max_age_filter
- grpc_message_size_filter
- grpc_deadline_filter
generate_plugin_registry: true generate_plugin_registry: true
secure: false secure: false
vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}' vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}'
@ -2520,6 +2546,16 @@ targets:
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: minimal_stack_is_minimal_test
build: test
language: c
src:
- test/core/channel/minimal_stack_is_minimal_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: mlog_test - name: mlog_test
flaky: true flaky: true
build: test build: test

@ -28,5 +28,5 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
module GrpcBuildConfig module GrpcBuildConfig
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-3.dll' CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-4.dll'
end end

@ -86,15 +86,10 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.c \
src/core/lib/channel/channel_stack_builder.c \ src/core/lib/channel/channel_stack_builder.c \
src/core/lib/channel/compress_filter.c \
src/core/lib/channel/connected_channel.c \ src/core/lib/channel/connected_channel.c \
src/core/lib/channel/deadline_filter.c \
src/core/lib/channel/handshaker.c \ src/core/lib/channel/handshaker.c \
src/core/lib/channel/handshaker_factory.c \ src/core/lib/channel/handshaker_factory.c \
src/core/lib/channel/handshaker_registry.c \ src/core/lib/channel/handshaker_registry.c \
src/core/lib/channel/http_client_filter.c \
src/core/lib/channel/http_server_filter.c \
src/core/lib/channel/message_size_filter.c \
src/core/lib/compression/compression.c \ src/core/lib/compression/compression.c \
src/core/lib/compression/message_compress.c \ src/core/lib/compression/message_compress.c \
src/core/lib/debug/trace.c \ src/core/lib/debug/trace.c \
@ -231,6 +226,10 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/varint.c \
src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/transport/writing.c \
src/core/ext/transport/chttp2/alpn/alpn.c \ src/core/ext/transport/chttp2/alpn/alpn.c \
src/core/ext/filters/http/client/http_client_filter.c \
src/core/ext/filters/http/http_filters_plugin.c \
src/core/ext/filters/http/message_compress/message_compress_filter.c \
src/core/ext/filters/http/server/http_server_filter.c \
src/core/lib/http/httpcli_security_connector.c \ src/core/lib/http/httpcli_security_connector.c \
src/core/lib/security/context/security_context.c \ src/core/lib/security/context/security_context.c \
src/core/lib/security/credentials/composite/composite_credentials.c \ src/core/lib/security/credentials/composite/composite_credentials.c \
@ -280,6 +279,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/filters/client_channel/subchannel.c \ src/core/ext/filters/client_channel/subchannel.c \
src/core/ext/filters/client_channel/subchannel_index.c \ src/core/ext/filters/client_channel/subchannel_index.c \
src/core/ext/filters/client_channel/uri_parser.c \ src/core/ext/filters/client_channel/uri_parser.c \
src/core/ext/filters/deadline/deadline_filter.c \
src/core/ext/transport/chttp2/client/chttp2_connector.c \ src/core/ext/transport/chttp2/client/chttp2_connector.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \
@ -316,6 +316,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/census/trace_context.c \ src/core/ext/census/trace_context.c \
src/core/ext/census/tracing.c \ src/core/ext/census/tracing.c \
src/core/ext/filters/max_age/max_age_filter.c \ src/core/ext/filters/max_age/max_age_filter.c \
src/core/ext/filters/message_size/message_size_filter.c \
src/core/plugin_registry/grpc_plugin_registry.c \ src/core/plugin_registry/grpc_plugin_registry.c \
src/boringssl/err_data.c \ src/boringssl/err_data.c \
third_party/boringssl/crypto/aes/aes.c \ third_party/boringssl/crypto/aes/aes.c \
@ -639,8 +640,14 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/c_ares) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/c_ares)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/native) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/dns/native)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/sockaddr) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/client_channel/resolver/sockaddr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/deadline)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/client)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/message_compress)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/http/server)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/load_reporting) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/load_reporting)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/max_age) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/max_age)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/filters/message_size)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/alpn) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/alpn)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/insecure) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/insecure)

@ -258,16 +258,11 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_args.h', 'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h', 'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h', 'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/compress_filter.h',
'src/core/lib/channel/connected_channel.h', 'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h', 'src/core/lib/channel/context.h',
'src/core/lib/channel/deadline_filter.h',
'src/core/lib/channel/handshaker.h', 'src/core/lib/channel/handshaker.h',
'src/core/lib/channel/handshaker_factory.h', 'src/core/lib/channel/handshaker_factory.h',
'src/core/lib/channel/handshaker_registry.h', 'src/core/lib/channel/handshaker_registry.h',
'src/core/lib/channel/http_client_filter.h',
'src/core/lib/channel/http_server_filter.h',
'src/core/lib/channel/message_size_filter.h',
'src/core/lib/compression/algorithm_metadata.h', 'src/core/lib/compression/algorithm_metadata.h',
'src/core/lib/compression/message_compress.h', 'src/core/lib/compression/message_compress.h',
'src/core/lib/debug/trace.h', 'src/core/lib/debug/trace.h',
@ -386,6 +381,9 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/stream_map.h', 'src/core/ext/transport/chttp2/transport/stream_map.h',
'src/core/ext/transport/chttp2/transport/varint.h', 'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/ext/transport/chttp2/alpn/alpn.h', 'src/core/ext/transport/chttp2/alpn/alpn.h',
'src/core/ext/filters/http/client/http_client_filter.h',
'src/core/ext/filters/http/message_compress/message_compress_filter.h',
'src/core/ext/filters/http/server/http_server_filter.h',
'src/core/lib/security/context/security_context.h', 'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/composite/composite_credentials.h', 'src/core/lib/security/credentials/composite/composite_credentials.h',
'src/core/lib/security/credentials/credentials.h', 'src/core/lib/security/credentials/credentials.h',
@ -429,6 +427,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/subchannel.h', 'src/core/ext/filters/client_channel/subchannel.h',
'src/core/ext/filters/client_channel/subchannel_index.h', 'src/core/ext/filters/client_channel/subchannel_index.h',
'src/core/ext/filters/client_channel/uri_parser.h', 'src/core/ext/filters/client_channel/uri_parser.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h',
@ -459,19 +458,15 @@ Pod::Spec.new do |s|
'src/core/ext/census/trace_string.h', 'src/core/ext/census/trace_string.h',
'src/core/ext/census/tracing.h', 'src/core/ext/census/tracing.h',
'src/core/ext/filters/max_age/max_age_filter.h', 'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.h',
'src/core/lib/surface/init.c', 'src/core/lib/surface/init.c',
'src/core/lib/channel/channel_args.c', 'src/core/lib/channel/channel_args.c',
'src/core/lib/channel/channel_stack.c', 'src/core/lib/channel/channel_stack.c',
'src/core/lib/channel/channel_stack_builder.c', 'src/core/lib/channel/channel_stack_builder.c',
'src/core/lib/channel/compress_filter.c',
'src/core/lib/channel/connected_channel.c', 'src/core/lib/channel/connected_channel.c',
'src/core/lib/channel/deadline_filter.c',
'src/core/lib/channel/handshaker.c', 'src/core/lib/channel/handshaker.c',
'src/core/lib/channel/handshaker_factory.c', 'src/core/lib/channel/handshaker_factory.c',
'src/core/lib/channel/handshaker_registry.c', 'src/core/lib/channel/handshaker_registry.c',
'src/core/lib/channel/http_client_filter.c',
'src/core/lib/channel/http_server_filter.c',
'src/core/lib/channel/message_size_filter.c',
'src/core/lib/compression/compression.c', 'src/core/lib/compression/compression.c',
'src/core/lib/compression/message_compress.c', 'src/core/lib/compression/message_compress.c',
'src/core/lib/debug/trace.c', 'src/core/lib/debug/trace.c',
@ -608,6 +603,10 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/varint.c', 'src/core/ext/transport/chttp2/transport/varint.c',
'src/core/ext/transport/chttp2/transport/writing.c', 'src/core/ext/transport/chttp2/transport/writing.c',
'src/core/ext/transport/chttp2/alpn/alpn.c', 'src/core/ext/transport/chttp2/alpn/alpn.c',
'src/core/ext/filters/http/client/http_client_filter.c',
'src/core/ext/filters/http/http_filters_plugin.c',
'src/core/ext/filters/http/message_compress/message_compress_filter.c',
'src/core/ext/filters/http/server/http_server_filter.c',
'src/core/lib/http/httpcli_security_connector.c', 'src/core/lib/http/httpcli_security_connector.c',
'src/core/lib/security/context/security_context.c', 'src/core/lib/security/context/security_context.c',
'src/core/lib/security/credentials/composite/composite_credentials.c', 'src/core/lib/security/credentials/composite/composite_credentials.c',
@ -657,6 +656,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/subchannel.c', 'src/core/ext/filters/client_channel/subchannel.c',
'src/core/ext/filters/client_channel/subchannel_index.c', 'src/core/ext/filters/client_channel/subchannel_index.c',
'src/core/ext/filters/client_channel/uri_parser.c', 'src/core/ext/filters/client_channel/uri_parser.c',
'src/core/ext/filters/deadline/deadline_filter.c',
'src/core/ext/transport/chttp2/client/chttp2_connector.c', 'src/core/ext/transport/chttp2/client/chttp2_connector.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c',
@ -693,6 +693,7 @@ Pod::Spec.new do |s|
'src/core/ext/census/trace_context.c', 'src/core/ext/census/trace_context.c',
'src/core/ext/census/tracing.c', 'src/core/ext/census/tracing.c',
'src/core/ext/filters/max_age/max_age_filter.c', 'src/core/ext/filters/max_age/max_age_filter.c',
'src/core/ext/filters/message_size/message_size_filter.c',
'src/core/plugin_registry/grpc_plugin_registry.c' 'src/core/plugin_registry/grpc_plugin_registry.c'
ss.private_header_files = 'src/core/lib/profiling/timers.h', ss.private_header_files = 'src/core/lib/profiling/timers.h',
@ -712,16 +713,11 @@ Pod::Spec.new do |s|
'src/core/lib/channel/channel_args.h', 'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h', 'src/core/lib/channel/channel_stack.h',
'src/core/lib/channel/channel_stack_builder.h', 'src/core/lib/channel/channel_stack_builder.h',
'src/core/lib/channel/compress_filter.h',
'src/core/lib/channel/connected_channel.h', 'src/core/lib/channel/connected_channel.h',
'src/core/lib/channel/context.h', 'src/core/lib/channel/context.h',
'src/core/lib/channel/deadline_filter.h',
'src/core/lib/channel/handshaker.h', 'src/core/lib/channel/handshaker.h',
'src/core/lib/channel/handshaker_factory.h', 'src/core/lib/channel/handshaker_factory.h',
'src/core/lib/channel/handshaker_registry.h', 'src/core/lib/channel/handshaker_registry.h',
'src/core/lib/channel/http_client_filter.h',
'src/core/lib/channel/http_server_filter.h',
'src/core/lib/channel/message_size_filter.h',
'src/core/lib/compression/algorithm_metadata.h', 'src/core/lib/compression/algorithm_metadata.h',
'src/core/lib/compression/message_compress.h', 'src/core/lib/compression/message_compress.h',
'src/core/lib/debug/trace.h', 'src/core/lib/debug/trace.h',
@ -840,6 +836,9 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/stream_map.h', 'src/core/ext/transport/chttp2/transport/stream_map.h',
'src/core/ext/transport/chttp2/transport/varint.h', 'src/core/ext/transport/chttp2/transport/varint.h',
'src/core/ext/transport/chttp2/alpn/alpn.h', 'src/core/ext/transport/chttp2/alpn/alpn.h',
'src/core/ext/filters/http/client/http_client_filter.h',
'src/core/ext/filters/http/message_compress/message_compress_filter.h',
'src/core/ext/filters/http/server/http_server_filter.h',
'src/core/lib/security/context/security_context.h', 'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/composite/composite_credentials.h', 'src/core/lib/security/credentials/composite/composite_credentials.h',
'src/core/lib/security/credentials/credentials.h', 'src/core/lib/security/credentials/credentials.h',
@ -883,6 +882,7 @@ Pod::Spec.new do |s|
'src/core/ext/filters/client_channel/subchannel.h', 'src/core/ext/filters/client_channel/subchannel.h',
'src/core/ext/filters/client_channel/subchannel_index.h', 'src/core/ext/filters/client_channel/subchannel_index.h',
'src/core/ext/filters/client_channel/uri_parser.h', 'src/core/ext/filters/client_channel/uri_parser.h',
'src/core/ext/filters/deadline/deadline_filter.h',
'src/core/ext/transport/chttp2/client/chttp2_connector.h', 'src/core/ext/transport/chttp2/client/chttp2_connector.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h',
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h', 'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h',
@ -912,7 +912,8 @@ Pod::Spec.new do |s|
'src/core/ext/census/trace_status.h', 'src/core/ext/census/trace_status.h',
'src/core/ext/census/trace_string.h', 'src/core/ext/census/trace_string.h',
'src/core/ext/census/tracing.h', 'src/core/ext/census/tracing.h',
'src/core/ext/filters/max_age/max_age_filter.h' 'src/core/ext/filters/max_age/max_age_filter.h',
'src/core/ext/filters/message_size/message_size_filter.h'
end end
s.subspec 'Cronet-Interface' do |ss| s.subspec 'Cronet-Interface' do |ss|

@ -174,16 +174,11 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/channel/channel_args.h ) s.files += %w( src/core/lib/channel/channel_args.h )
s.files += %w( src/core/lib/channel/channel_stack.h ) s.files += %w( src/core/lib/channel/channel_stack.h )
s.files += %w( src/core/lib/channel/channel_stack_builder.h ) s.files += %w( src/core/lib/channel/channel_stack_builder.h )
s.files += %w( src/core/lib/channel/compress_filter.h )
s.files += %w( src/core/lib/channel/connected_channel.h ) s.files += %w( src/core/lib/channel/connected_channel.h )
s.files += %w( src/core/lib/channel/context.h ) s.files += %w( src/core/lib/channel/context.h )
s.files += %w( src/core/lib/channel/deadline_filter.h )
s.files += %w( src/core/lib/channel/handshaker.h ) s.files += %w( src/core/lib/channel/handshaker.h )
s.files += %w( src/core/lib/channel/handshaker_factory.h ) s.files += %w( src/core/lib/channel/handshaker_factory.h )
s.files += %w( src/core/lib/channel/handshaker_registry.h ) s.files += %w( src/core/lib/channel/handshaker_registry.h )
s.files += %w( src/core/lib/channel/http_client_filter.h )
s.files += %w( src/core/lib/channel/http_server_filter.h )
s.files += %w( src/core/lib/channel/message_size_filter.h )
s.files += %w( src/core/lib/compression/algorithm_metadata.h ) s.files += %w( src/core/lib/compression/algorithm_metadata.h )
s.files += %w( src/core/lib/compression/message_compress.h ) s.files += %w( src/core/lib/compression/message_compress.h )
s.files += %w( src/core/lib/debug/trace.h ) s.files += %w( src/core/lib/debug/trace.h )
@ -302,6 +297,9 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/stream_map.h ) s.files += %w( src/core/ext/transport/chttp2/transport/stream_map.h )
s.files += %w( src/core/ext/transport/chttp2/transport/varint.h ) s.files += %w( src/core/ext/transport/chttp2/transport/varint.h )
s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.h ) s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.h )
s.files += %w( src/core/ext/filters/http/client/http_client_filter.h )
s.files += %w( src/core/ext/filters/http/message_compress/message_compress_filter.h )
s.files += %w( src/core/ext/filters/http/server/http_server_filter.h )
s.files += %w( src/core/lib/security/context/security_context.h ) s.files += %w( src/core/lib/security/context/security_context.h )
s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.h ) s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.h )
s.files += %w( src/core/lib/security/credentials/credentials.h ) s.files += %w( src/core/lib/security/credentials/credentials.h )
@ -345,6 +343,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/subchannel.h ) s.files += %w( src/core/ext/filters/client_channel/subchannel.h )
s.files += %w( src/core/ext/filters/client_channel/subchannel_index.h ) s.files += %w( src/core/ext/filters/client_channel/subchannel_index.h )
s.files += %w( src/core/ext/filters/client_channel/uri_parser.h ) s.files += %w( src/core/ext/filters/client_channel/uri_parser.h )
s.files += %w( src/core/ext/filters/deadline/deadline_filter.h )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h ) s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h )
s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h ) s.files += %w( src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h )
@ -375,19 +374,15 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/census/trace_string.h ) s.files += %w( src/core/ext/census/trace_string.h )
s.files += %w( src/core/ext/census/tracing.h ) s.files += %w( src/core/ext/census/tracing.h )
s.files += %w( src/core/ext/filters/max_age/max_age_filter.h ) s.files += %w( src/core/ext/filters/max_age/max_age_filter.h )
s.files += %w( src/core/ext/filters/message_size/message_size_filter.h )
s.files += %w( src/core/lib/surface/init.c ) s.files += %w( src/core/lib/surface/init.c )
s.files += %w( src/core/lib/channel/channel_args.c ) s.files += %w( src/core/lib/channel/channel_args.c )
s.files += %w( src/core/lib/channel/channel_stack.c ) s.files += %w( src/core/lib/channel/channel_stack.c )
s.files += %w( src/core/lib/channel/channel_stack_builder.c ) s.files += %w( src/core/lib/channel/channel_stack_builder.c )
s.files += %w( src/core/lib/channel/compress_filter.c )
s.files += %w( src/core/lib/channel/connected_channel.c ) s.files += %w( src/core/lib/channel/connected_channel.c )
s.files += %w( src/core/lib/channel/deadline_filter.c )
s.files += %w( src/core/lib/channel/handshaker.c ) s.files += %w( src/core/lib/channel/handshaker.c )
s.files += %w( src/core/lib/channel/handshaker_factory.c ) s.files += %w( src/core/lib/channel/handshaker_factory.c )
s.files += %w( src/core/lib/channel/handshaker_registry.c ) s.files += %w( src/core/lib/channel/handshaker_registry.c )
s.files += %w( src/core/lib/channel/http_client_filter.c )
s.files += %w( src/core/lib/channel/http_server_filter.c )
s.files += %w( src/core/lib/channel/message_size_filter.c )
s.files += %w( src/core/lib/compression/compression.c ) s.files += %w( src/core/lib/compression/compression.c )
s.files += %w( src/core/lib/compression/message_compress.c ) s.files += %w( src/core/lib/compression/message_compress.c )
s.files += %w( src/core/lib/debug/trace.c ) s.files += %w( src/core/lib/debug/trace.c )
@ -524,6 +519,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/varint.c ) s.files += %w( src/core/ext/transport/chttp2/transport/varint.c )
s.files += %w( src/core/ext/transport/chttp2/transport/writing.c ) s.files += %w( src/core/ext/transport/chttp2/transport/writing.c )
s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.c ) s.files += %w( src/core/ext/transport/chttp2/alpn/alpn.c )
s.files += %w( src/core/ext/filters/http/client/http_client_filter.c )
s.files += %w( src/core/ext/filters/http/http_filters_plugin.c )
s.files += %w( src/core/ext/filters/http/message_compress/message_compress_filter.c )
s.files += %w( src/core/ext/filters/http/server/http_server_filter.c )
s.files += %w( src/core/lib/http/httpcli_security_connector.c ) s.files += %w( src/core/lib/http/httpcli_security_connector.c )
s.files += %w( src/core/lib/security/context/security_context.c ) s.files += %w( src/core/lib/security/context/security_context.c )
s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.c ) s.files += %w( src/core/lib/security/credentials/composite/composite_credentials.c )
@ -573,6 +572,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/filters/client_channel/subchannel.c ) s.files += %w( src/core/ext/filters/client_channel/subchannel.c )
s.files += %w( src/core/ext/filters/client_channel/subchannel_index.c ) s.files += %w( src/core/ext/filters/client_channel/subchannel_index.c )
s.files += %w( src/core/ext/filters/client_channel/uri_parser.c ) s.files += %w( src/core/ext/filters/client_channel/uri_parser.c )
s.files += %w( src/core/ext/filters/deadline/deadline_filter.c )
s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.c ) s.files += %w( src/core/ext/transport/chttp2/client/chttp2_connector.c )
s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.c ) s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.c )
s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c ) s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c )
@ -609,6 +609,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/census/trace_context.c ) s.files += %w( src/core/ext/census/trace_context.c )
s.files += %w( src/core/ext/census/tracing.c ) s.files += %w( src/core/ext/census/tracing.c )
s.files += %w( src/core/ext/filters/max_age/max_age_filter.c ) s.files += %w( src/core/ext/filters/max_age/max_age_filter.c )
s.files += %w( src/core/ext/filters/message_size/message_size_filter.c )
s.files += %w( src/core/plugin_registry/grpc_plugin_registry.c ) s.files += %w( src/core/plugin_registry/grpc_plugin_registry.c )
s.files += %w( third_party/boringssl/crypto/aes/internal.h ) s.files += %w( third_party/boringssl/crypto/aes/internal.h )
s.files += %w( third_party/boringssl/crypto/asn1/asn1_locl.h ) s.files += %w( third_party/boringssl/crypto/asn1/asn1_locl.h )

@ -52,7 +52,7 @@ template <class InputMessage, class OutputMessage>
Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context, const InputMessage& request, ClientContext* context, const InputMessage& request,
OutputMessage* result) { OutputMessage* result) {
CompletionQueue cq; CompletionQueue cq(true); // Pluckable completion queue
Call call(channel->CreateCall(method, context, &cq)); Call call(channel->CreateCall(method, context, &cq));
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>, CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,

@ -102,10 +102,7 @@ class CompletionQueue : private GrpcLibraryCodegen {
public: public:
/// Default constructor. Implicitly creates a \a grpc_completion_queue /// Default constructor. Implicitly creates a \a grpc_completion_queue
/// instance. /// instance.
CompletionQueue() { CompletionQueue() : CompletionQueue(false) {}
cq_ = g_core_codegen_interface->grpc_completion_queue_create(nullptr);
InitialAvalanching(); // reserve this for the future shutdown
}
/// Wrap \a take, taking ownership of the instance. /// Wrap \a take, taking ownership of the instance.
/// ///
@ -218,6 +215,18 @@ class CompletionQueue : private GrpcLibraryCodegen {
const InputMessage& request, const InputMessage& request,
OutputMessage* result); OutputMessage* result);
/// Private constructor of CompletionQueue only visible to friend classes
CompletionQueue(bool is_pluck) {
if (is_pluck) {
cq_ = g_core_codegen_interface->grpc_completion_queue_create_for_pluck(
nullptr);
} else {
cq_ = g_core_codegen_interface->grpc_completion_queue_create_for_next(
nullptr);
}
InitialAvalanching(); // reserve this for the future shutdown
}
NextStatus AsyncNextInternal(void** tag, bool* ok, gpr_timespec deadline); NextStatus AsyncNextInternal(void** tag, bool* ok, gpr_timespec deadline);
/// Wraps \a grpc_completion_queue_pluck. /// Wraps \a grpc_completion_queue_pluck.
@ -237,6 +246,12 @@ class CompletionQueue : private GrpcLibraryCodegen {
/// Performs a single polling pluck on \a tag. /// Performs a single polling pluck on \a tag.
/// \warning Must not be mixed with calls to \a Next. /// \warning Must not be mixed with calls to \a Next.
///
/// TODO: sreek - This calls tag->FinalizeResult() even if the cq_ is already
/// shutdown. This is most likely a bug and if it is a bug, then change this
/// implementation to simple call the other TryPluck function with a zero
/// timeout. i.e:
/// TryPluck(tag, gpr_time_0(GPR_CLOCK_REALTIME))
void TryPluck(CompletionQueueTag* tag) { void TryPluck(CompletionQueueTag* tag) {
auto deadline = g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME); auto deadline = g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME);
auto ev = g_core_codegen_interface->grpc_completion_queue_pluck( auto ev = g_core_codegen_interface->grpc_completion_queue_pluck(
@ -248,6 +263,23 @@ class CompletionQueue : private GrpcLibraryCodegen {
GPR_CODEGEN_ASSERT(!tag->FinalizeResult(&ignored, &ok)); GPR_CODEGEN_ASSERT(!tag->FinalizeResult(&ignored, &ok));
} }
/// Performs a single polling pluck on \a tag. Calls tag->FinalizeResult if
/// the pluck() was successful and returned the tag.
///
/// This exects tag->FinalizeResult (if called) to return 'false' i.e expects
/// that the tag is internal not something that is returned to the user.
void TryPluck(CompletionQueueTag* tag, gpr_timespec deadline) {
auto ev = g_core_codegen_interface->grpc_completion_queue_pluck(
cq_, tag, deadline, nullptr);
if (ev.type == GRPC_QUEUE_TIMEOUT || ev.type == GRPC_QUEUE_SHUTDOWN) {
return;
}
bool ok = ev.success != 0;
void* ignored = tag;
GPR_CODEGEN_ASSERT(!tag->FinalizeResult(&ignored, &ok));
}
grpc_completion_queue* cq_; // owned grpc_completion_queue* cq_; // owned
gpr_atm avalanches_in_flight_; gpr_atm avalanches_in_flight_;

@ -38,6 +38,7 @@
#include <grpc++/impl/codegen/core_codegen_interface.h> #include <grpc++/impl/codegen/core_codegen_interface.h>
#include <grpc/byte_buffer.h> #include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h> #include <grpc/impl/codegen/grpc_types.h>
namespace grpc { namespace grpc {
@ -45,7 +46,10 @@ namespace grpc {
/// Implementation of the core codegen interface. /// Implementation of the core codegen interface.
class CoreCodegen : public CoreCodegenInterface { class CoreCodegen : public CoreCodegenInterface {
private: private:
grpc_completion_queue* grpc_completion_queue_create(void* reserved) override; grpc_completion_queue* grpc_completion_queue_create_for_next(
void* reserved) override;
grpc_completion_queue* grpc_completion_queue_create_for_pluck(
void* reserved) override;
void grpc_completion_queue_destroy(grpc_completion_queue* cq) override; void grpc_completion_queue_destroy(grpc_completion_queue* cq) override;
grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, void* tag, grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, void* tag,
gpr_timespec deadline, gpr_timespec deadline,

@ -59,7 +59,9 @@ class CoreCodegenInterface {
virtual void assert_fail(const char* failed_assertion, const char* file, virtual void assert_fail(const char* failed_assertion, const char* file,
int line) = 0; int line) = 0;
virtual grpc_completion_queue* grpc_completion_queue_create( virtual grpc_completion_queue* grpc_completion_queue_create_for_next(
void* reserved) = 0;
virtual grpc_completion_queue* grpc_completion_queue_create_for_pluck(
void* reserved) = 0; void* reserved) = 0;
virtual void grpc_completion_queue_destroy(grpc_completion_queue* cq) = 0; virtual void grpc_completion_queue_destroy(grpc_completion_queue* cq) = 0;
virtual grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq, virtual grpc_event grpc_completion_queue_pluck(grpc_completion_queue* cq,

@ -40,6 +40,7 @@
#include <grpc/impl/codegen/compression_types.h> #include <grpc/impl/codegen/compression_types.h>
#include <grpc++/impl/codegen/completion_queue_tag.h>
#include <grpc++/impl/codegen/config.h> #include <grpc++/impl/codegen/config.h>
#include <grpc++/impl/codegen/create_auth_context.h> #include <grpc++/impl/codegen/create_auth_context.h>
#include <grpc++/impl/codegen/metadata_map.h> #include <grpc++/impl/codegen/metadata_map.h>
@ -211,6 +212,8 @@ class ServerContext {
class CompletionOp; class CompletionOp;
void BeginCompletionOp(Call* call); void BeginCompletionOp(Call* call);
// Return the tag queued by BeginCompletionOp()
CompletionQueueTag* GetCompletionOpTag();
ServerContext(gpr_timespec deadline, grpc_metadata_array* arr); ServerContext(gpr_timespec deadline, grpc_metadata_array* arr);

@ -155,7 +155,9 @@ class ClientReader final : public ClientReaderInterface<R> {
template <class W> template <class W>
ClientReader(ChannelInterface* channel, const RpcMethod& method, ClientReader(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context, const W& request) ClientContext* context, const W& request)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) { : context_(context),
cq_(true), // Pluckable cq
call_(channel->CreateCall(method, context, &cq_)) {
CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose> CallOpClientSendClose>
ops; ops;
@ -227,7 +229,9 @@ class ClientWriter : public ClientWriterInterface<W> {
template <class R> template <class R>
ClientWriter(ChannelInterface* channel, const RpcMethod& method, ClientWriter(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context, R* response) ClientContext* context, R* response)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) { : context_(context),
cq_(true), // Pluckable cq
call_(channel->CreateCall(method, context, &cq_)) {
finish_ops_.RecvMessage(response); finish_ops_.RecvMessage(response);
finish_ops_.AllowNoMessage(); finish_ops_.AllowNoMessage();
@ -325,7 +329,9 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> {
/// Blocking create a stream. /// Blocking create a stream.
ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method, ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method,
ClientContext* context) ClientContext* context)
: context_(context), call_(channel->CreateCall(method, context, &cq_)) { : context_(context),
cq_(true), // Pluckable cq
call_(channel->CreateCall(method, context, &cq_)) {
if (!context_->initial_metadata_corked_) { if (!context_->initial_metadata_corked_) {
CallOpSet<CallOpSendInitialMetadata> ops; CallOpSet<CallOpSendInitialMetadata> ops;
ops.SendInitialMetadata(context->send_initial_metadata_, ops.SendInitialMetadata(context->send_initial_metadata_,
@ -562,7 +568,7 @@ class ServerReaderWriterBody final {
Call* const call_; Call* const call_;
ServerContext* const ctx_; ServerContext* const ctx_;
}; };
} } // namespace internal
// class to represent the user API for a bidirectional streaming call // class to represent the user API for a bidirectional streaming call
template <class W, class R> template <class W, class R>

@ -95,10 +95,10 @@ GRPCAPI const char *grpc_g_stands_for(void);
/** Specifies the type of APIs to use to pop events from the completion queue */ /** Specifies the type of APIs to use to pop events from the completion queue */
typedef enum { typedef enum {
/* Events are popped out by calling grpc_completion_queue_next() API ONLY */ /** Events are popped out by calling grpc_completion_queue_next() API ONLY */
GRPC_CQ_NEXT = 1, GRPC_CQ_NEXT = 1,
/* Events are popped out by calling grpc_completion_queue_pluck() API ONLY */ /** Events are popped out by calling grpc_completion_queue_pluck() API ONLY*/
GRPC_CQ_PLUCK GRPC_CQ_PLUCK
} grpc_cq_completion_type; } grpc_cq_completion_type;
@ -116,15 +116,15 @@ typedef enum {
restriction on the type of file descriptors the pollset may contain */ restriction on the type of file descriptors the pollset may contain */
GRPC_CQ_DEFAULT_POLLING, GRPC_CQ_DEFAULT_POLLING,
/* Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will /** Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will
not contain any 'listening file descriptors' (i.e file descriptors used to not contain any 'listening file descriptors' (i.e file descriptors used to
listen to incoming channels) */ listen to incoming channels) */
GRPC_CQ_NON_LISTENING, GRPC_CQ_NON_LISTENING,
/* The completion queue will not have an associated pollset. Note that /** The completion queue will not have an associated pollset. Note that
grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still be grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still
called to pop events from the completion queue; it is not required to call be called to pop events from the completion queue; it is not required to
them actively to make I/O progress */ call them actively to make I/O progress */
GRPC_CQ_NON_POLLING GRPC_CQ_NON_POLLING
} grpc_cq_polling_type; } grpc_cq_polling_type;
@ -159,7 +159,9 @@ GRPCAPI grpc_completion_queue *grpc_completion_queue_create_for_pluck(
void *reserved); void *reserved);
/** Create a completion queue */ /** Create a completion queue */
GRPCAPI grpc_completion_queue *grpc_completion_queue_create(void *reserved); GRPCAPI grpc_completion_queue *grpc_completion_queue_create(
const grpc_completion_queue_factory *factory,
const grpc_completion_queue_attributes *attributes, void *reserved);
/** Blocks until an event is available, the completion queue is being shut down, /** Blocks until an event is available, the completion queue is being shut down,
or deadline is reached. or deadline is reached.

@ -175,6 +175,12 @@ typedef struct {
/** Grace period after the chennel reaches its max age. Int valued, /** Grace period after the chennel reaches its max age. Int valued,
milliseconds. INT_MAX means unlimited. */ milliseconds. INT_MAX means unlimited. */
#define GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS "grpc.max_connection_age_grace_ms" #define GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS "grpc.max_connection_age_grace_ms"
/** Enable/disable support for per-message compression. Defaults to 1, unless
GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0. */
#define GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION "grpc.per_message_compression"
/** Enable/disable support for deadline checking. Defaults to 1, unless
GRPC_ARG_MINIMAL_STACK is enabled, in which case it defaults to 0 */
#define GRPC_ARG_ENABLE_DEADLINE_CHECKS "grpc.enable_deadline_checking"
/** Initial sequence number for http2 transports. Int valued. */ /** Initial sequence number for http2 transports. Int valued. */
#define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \ #define GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER \
"grpc.http2.initial_sequence_number" "grpc.http2.initial_sequence_number"
@ -199,6 +205,8 @@ typedef struct {
/** Minimum time (in milliseconds) between successive ping frames being sent */ /** Minimum time (in milliseconds) between successive ping frames being sent */
#define GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS \ #define GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS \
"grpc.http2.min_time_between_pings_ms" "grpc.http2.min_time_between_pings_ms"
/* Channel arg to override the http2 :scheme header */
#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
/** How many pings can we send before needing to send a data frame or header /** How many pings can we send before needing to send a data frame or header
frame? frame?
(0 indicates that an infinite number of pings can be sent without sending (0 indicates that an infinite number of pings can be sent without sending
@ -393,8 +401,11 @@ typedef enum grpc_completion_type {
typedef struct grpc_event { typedef struct grpc_event {
/** The type of the completion. */ /** The type of the completion. */
grpc_completion_type type; grpc_completion_type type;
/** non-zero if the operation was successful, 0 upon failure. /** If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates
Only GRPC_OP_COMPLETE can succeed or fail. */ whether the operation was successful or not; 0 in case of failure and
non-zero in case of success.
If grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this
field is guaranteed to be 0 */
int success; int success;
/** The tag passed to grpc_call_start_batch etc to start this operation. /** The tag passed to grpc_call_start_batch etc to start this operation.
Only GRPC_OP_COMPLETE has a tag. */ Only GRPC_OP_COMPLETE has a tag. */

@ -183,16 +183,11 @@
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_args.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_stack.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/compress_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/connected_channel.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/connected_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/context.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/context.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/deadline_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_factory.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_registry.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker_registry.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/http_client_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/http_server_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/message_size_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/algorithm_metadata.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/compression/algorithm_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/message_compress.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/compression/message_compress.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/trace.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/debug/trace.h" role="src" />
@ -311,6 +306,9 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/stream_map.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/stream_map.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/varint.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/varint.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client/http_client_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/message_compress/message_compress_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/server/http_server_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/context/security_context.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/context/security_context.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/composite/composite_credentials.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/credentials/composite/composite_credentials.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/credentials.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/credentials/credentials.h" role="src" />
@ -354,6 +352,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_index.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_index.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/uri_parser.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/uri_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h" role="src" />
@ -384,19 +383,15 @@
<file baseinstalldir="/" name="src/core/ext/census/trace_string.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/trace_string.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/tracing.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/tracing.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/init.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/surface/init.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_args.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_stack.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_stack_builder.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/compress_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/connected_channel.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/connected_channel.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/deadline_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_factory.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/handshaker_registry.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/handshaker_registry.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/http_client_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/http_server_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/message_size_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/compression.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/compression/compression.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/compression/message_compress.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/compression/message_compress.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/debug/trace.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/debug/trace.c" role="src" />
@ -533,6 +528,10 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/varint.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/varint.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/writing.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/writing.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/alpn/alpn.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/client/http_client_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/http_filters_plugin.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/message_compress/message_compress_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/http/server/http_server_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/http/httpcli_security_connector.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/http/httpcli_security_connector.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/context/security_context.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/context/security_context.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/composite/composite_credentials.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/credentials/composite/composite_credentials.c" role="src" />
@ -582,6 +581,7 @@
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_index.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/subchannel_index.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/client_channel/uri_parser.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/client_channel/uri_parser.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/deadline/deadline_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/chttp2_connector.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c" role="src" />
@ -618,6 +618,7 @@
<file baseinstalldir="/" name="src/core/ext/census/trace_context.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/trace_context.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/tracing.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/tracing.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/filters/max_age/max_age_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/filters/message_size/message_size_filter.c" role="src" />
<file baseinstalldir="/" name="src/core/plugin_registry/grpc_plugin_registry.c" role="src" /> <file baseinstalldir="/" name="src/core/plugin_registry/grpc_plugin_registry.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl/crypto/aes/internal.h" role="src" /> <file baseinstalldir="/" name="third_party/boringssl/crypto/aes/internal.h" role="src" />
<file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/asn1_locl.h" role="src" /> <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/asn1_locl.h" role="src" />

@ -49,9 +49,9 @@
#include "src/core/ext/filters/client_channel/resolver_registry.h" #include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/filters/client_channel/retry_throttle.h" #include "src/core/ext/filters/client_channel/retry_throttle.h"
#include "src/core/ext/filters/client_channel/subchannel.h" #include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/ext/filters/deadline/deadline_filter.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/deadline_filter.h"
#include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/combiner.h"
#include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/iomgr/polling_entity.h"
@ -183,6 +183,8 @@ typedef struct client_channel_channel_data {
grpc_resolver *resolver; grpc_resolver *resolver;
/** have we started resolving this channel */ /** have we started resolving this channel */
bool started_resolving; bool started_resolving;
/** is deadline checking enabled? */
bool deadline_checking_enabled;
/** client channel factory */ /** client channel factory */
grpc_client_channel_factory *client_channel_factory; grpc_client_channel_factory *client_channel_factory;
@ -676,6 +678,8 @@ static grpc_error *cc_init_channel_elem(grpc_exec_ctx *exec_ctx,
if (chand->resolver == NULL) { if (chand->resolver == NULL) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("resolver creation failed"); return GRPC_ERROR_CREATE_FROM_STATIC_STRING("resolver creation failed");
} }
chand->deadline_checking_enabled =
grpc_deadline_checking_enabled(args->channel_args);
return GRPC_ERROR_NONE; return GRPC_ERROR_NONE;
} }
@ -864,12 +868,14 @@ static void apply_final_configuration_locked(grpc_exec_ctx *exec_ctx,
/* apply service-config level configuration to the call (now that we're /* apply service-config level configuration to the call (now that we're
* certain it exists) */ * certain it exists) */
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data;
gpr_timespec per_method_deadline; gpr_timespec per_method_deadline;
if (set_call_method_params_from_service_config_locked(exec_ctx, elem, if (set_call_method_params_from_service_config_locked(exec_ctx, elem,
&per_method_deadline)) { &per_method_deadline)) {
// If the deadline from the service config is shorter than the one // If the deadline from the service config is shorter than the one
// from the client API, reset the deadline timer. // from the client API, reset the deadline timer.
if (gpr_time_cmp(per_method_deadline, calld->deadline) < 0) { if (chand->deadline_checking_enabled &&
gpr_time_cmp(per_method_deadline, calld->deadline) < 0) {
calld->deadline = per_method_deadline; calld->deadline = per_method_deadline;
grpc_deadline_state_reset(exec_ctx, elem, calld->deadline); grpc_deadline_state_reset(exec_ctx, elem, calld->deadline);
} }
@ -1227,8 +1233,10 @@ static void cc_start_transport_stream_op_batch(
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data; channel_data *chand = elem->channel_data;
GRPC_CALL_LOG_OP(GPR_INFO, elem, op); GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem, if (chand->deadline_checking_enabled) {
op); grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem,
op);
}
/* try to (atomically) get the call */ /* try to (atomically) get the call */
grpc_subchannel_call *call = GET_CALL(calld); grpc_subchannel_call *call = GET_CALL(calld);
GPR_TIMER_BEGIN("cc_start_transport_stream_op_batch", 0); GPR_TIMER_BEGIN("cc_start_transport_stream_op_batch", 0);
@ -1262,14 +1270,16 @@ static grpc_error *cc_init_call_elem(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem, grpc_call_element *elem,
const grpc_call_element_args *args) { const grpc_call_element_args *args) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data;
// Initialize data members. // Initialize data members.
grpc_deadline_state_init(exec_ctx, elem, args->call_stack);
calld->path = grpc_slice_ref_internal(args->path); calld->path = grpc_slice_ref_internal(args->path);
calld->call_start_time = args->start_time; calld->call_start_time = args->start_time;
calld->deadline = gpr_convert_clock_type(args->deadline, GPR_CLOCK_MONOTONIC); calld->deadline = gpr_convert_clock_type(args->deadline, GPR_CLOCK_MONOTONIC);
calld->owning_call = args->call_stack; calld->owning_call = args->call_stack;
calld->arena = args->arena; calld->arena = args->arena;
grpc_deadline_state_start(exec_ctx, elem, calld->deadline); if (chand->deadline_checking_enabled) {
grpc_deadline_state_init(exec_ctx, elem, args->call_stack, calld->deadline);
}
return GRPC_ERROR_NONE; return GRPC_ERROR_NONE;
} }
@ -1279,7 +1289,10 @@ static void cc_destroy_call_elem(grpc_exec_ctx *exec_ctx,
const grpc_call_final_info *final_info, const grpc_call_final_info *final_info,
grpc_closure *then_schedule_closure) { grpc_closure *then_schedule_closure) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
grpc_deadline_state_destroy(exec_ctx, elem); channel_data *chand = elem->channel_data;
if (chand->deadline_checking_enabled) {
grpc_deadline_state_destroy(exec_ctx, elem);
}
grpc_slice_unref_internal(exec_ctx, calld->path); grpc_slice_unref_internal(exec_ctx, calld->path);
if (calld->method_params != NULL) { if (calld->method_params != NULL) {
method_parameters_unref(calld->method_params); method_parameters_unref(calld->method_params);

@ -91,8 +91,9 @@ void grpc_client_channel_init(void) {
grpc_subchannel_index_init(); grpc_subchannel_index_init();
grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MIN, grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MIN,
set_default_host_if_unset, NULL); set_default_host_if_unset, NULL);
grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MAX, append_filter, grpc_channel_init_register_stage(
(void *)&grpc_client_channel_filter); GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, append_filter,
(void *)&grpc_client_channel_filter);
grpc_http_connect_register_handshaker_factory(); grpc_http_connect_register_handshaker_factory();
} }

@ -29,7 +29,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
#include "src/core/lib/channel/deadline_filter.h" #include "src/core/ext/filters/deadline/deadline_filter.h"
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
@ -39,9 +39,11 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/channel_init.h"
// //
// grpc_deadline_state // grpc_deadline_state
@ -141,18 +143,6 @@ static void inject_on_complete_cb(grpc_deadline_state* deadline_state,
op->on_complete = &deadline_state->on_complete; op->on_complete = &deadline_state->on_complete;
} }
void grpc_deadline_state_init(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
grpc_call_stack* call_stack) {
grpc_deadline_state* deadline_state = elem->call_data;
deadline_state->call_stack = call_stack;
}
void grpc_deadline_state_destroy(grpc_exec_ctx* exec_ctx,
grpc_call_element* elem) {
grpc_deadline_state* deadline_state = elem->call_data;
cancel_timer_if_needed(exec_ctx, deadline_state);
}
// Callback and associated state for starting the timer after call stack // Callback and associated state for starting the timer after call stack
// initialization has been completed. // initialization has been completed.
struct start_timer_after_init_state { struct start_timer_after_init_state {
@ -167,8 +157,11 @@ static void start_timer_after_init(grpc_exec_ctx* exec_ctx, void* arg,
gpr_free(state); gpr_free(state);
} }
void grpc_deadline_state_start(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, void grpc_deadline_state_init(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
gpr_timespec deadline) { grpc_call_stack* call_stack,
gpr_timespec deadline) {
grpc_deadline_state* deadline_state = elem->call_data;
deadline_state->call_stack = call_stack;
// Deadline will always be infinite on servers, so the timer will only be // Deadline will always be infinite on servers, so the timer will only be
// set on clients with a finite deadline. // set on clients with a finite deadline.
deadline = gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC); deadline = gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC);
@ -189,6 +182,12 @@ void grpc_deadline_state_start(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
} }
} }
void grpc_deadline_state_destroy(grpc_exec_ctx* exec_ctx,
grpc_call_element* elem) {
grpc_deadline_state* deadline_state = elem->call_data;
cancel_timer_if_needed(exec_ctx, deadline_state);
}
void grpc_deadline_state_reset(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, void grpc_deadline_state_reset(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
gpr_timespec new_deadline) { gpr_timespec new_deadline) {
grpc_deadline_state* deadline_state = elem->call_data; grpc_deadline_state* deadline_state = elem->call_data;
@ -248,8 +247,7 @@ typedef struct server_call_data {
static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx, static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
grpc_call_element* elem, grpc_call_element* elem,
const grpc_call_element_args* args) { const grpc_call_element_args* args) {
grpc_deadline_state_init(exec_ctx, elem, args->call_stack); grpc_deadline_state_init(exec_ctx, elem, args->call_stack, args->deadline);
grpc_deadline_state_start(exec_ctx, elem, args->deadline);
return GRPC_ERROR_NONE; return GRPC_ERROR_NONE;
} }
@ -346,3 +344,30 @@ const grpc_channel_filter grpc_server_deadline_filter = {
grpc_channel_next_get_info, grpc_channel_next_get_info,
"deadline", "deadline",
}; };
bool grpc_deadline_checking_enabled(const grpc_channel_args* channel_args) {
return grpc_channel_arg_get_bool(
grpc_channel_args_find(channel_args, GRPC_ARG_ENABLE_DEADLINE_CHECKS),
!grpc_channel_args_want_minimal_stack(channel_args));
}
static bool maybe_add_deadline_filter(grpc_exec_ctx* exec_ctx,
grpc_channel_stack_builder* builder,
void* arg) {
return grpc_deadline_checking_enabled(
grpc_channel_stack_builder_get_channel_arguments(builder))
? grpc_channel_stack_builder_prepend_filter(builder, arg, NULL,
NULL)
: true;
}
void grpc_deadline_filter_init(void) {
grpc_channel_init_register_stage(
GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_deadline_filter, (void*)&grpc_client_deadline_filter);
grpc_channel_init_register_stage(
GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_deadline_filter, (void*)&grpc_server_deadline_filter);
}
void grpc_deadline_filter_shutdown(void) {}

@ -29,8 +29,8 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
#ifndef GRPC_CORE_LIB_CHANNEL_DEADLINE_FILTER_H #ifndef GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H
#define GRPC_CORE_LIB_CHANNEL_DEADLINE_FILTER_H #define GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer.h"
@ -64,15 +64,11 @@ typedef struct grpc_deadline_state {
// assumes elem->call_data is zero'd // assumes elem->call_data is zero'd
void grpc_deadline_state_init(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, void grpc_deadline_state_init(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
grpc_call_stack* call_stack); grpc_call_stack* call_stack,
gpr_timespec deadline);
void grpc_deadline_state_destroy(grpc_exec_ctx* exec_ctx, void grpc_deadline_state_destroy(grpc_exec_ctx* exec_ctx,
grpc_call_element* elem); grpc_call_element* elem);
// Starts the timer with the specified deadline.
// Should be called from the filter's init_call_elem() method.
void grpc_deadline_state_start(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
gpr_timespec deadline);
// Cancels the existing timer and starts a new one with new_deadline. // Cancels the existing timer and starts a new one with new_deadline.
// //
// Note: It is generally safe to call this with an earlier deadline // Note: It is generally safe to call this with an earlier deadline
@ -93,10 +89,13 @@ void grpc_deadline_state_client_start_transport_stream_op_batch(
grpc_exec_ctx* exec_ctx, grpc_call_element* elem, grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
grpc_transport_stream_op_batch* op); grpc_transport_stream_op_batch* op);
// Should deadline checking be performed (according to channel args)
bool grpc_deadline_checking_enabled(const grpc_channel_args* args);
// Deadline filters for direct client channels and server channels. // Deadline filters for direct client channels and server channels.
// Note: Deadlines for non-direct client channels are handled by the // Note: Deadlines for non-direct client channels are handled by the
// client_channel filter. // client_channel filter.
extern const grpc_channel_filter grpc_client_deadline_filter; extern const grpc_channel_filter grpc_client_deadline_filter;
extern const grpc_channel_filter grpc_server_deadline_filter; extern const grpc_channel_filter grpc_server_deadline_filter;
#endif /* GRPC_CORE_LIB_CHANNEL_DEADLINE_FILTER_H */ #endif /* GRPC_CORE_EXT_FILTERS_DEADLINE_DEADLINE_FILTER_H */

@ -30,7 +30,7 @@
* *
*/ */
#include "src/core/lib/channel/http_client_filter.h" #include "src/core/ext/filters/http/client/http_client_filter.h"
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>

@ -30,18 +30,15 @@
* *
*/ */
#ifndef GRPC_CORE_LIB_CHANNEL_HTTP_CLIENT_FILTER_H #ifndef GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H
#define GRPC_CORE_LIB_CHANNEL_HTTP_CLIENT_FILTER_H #define GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
/* Processes metadata on the client side for HTTP2 transports */ /* Processes metadata on the client side for HTTP2 transports */
extern const grpc_channel_filter grpc_http_client_filter; extern const grpc_channel_filter grpc_http_client_filter;
/* Channel arg to override the http2 :scheme header */
#define GRPC_ARG_HTTP2_SCHEME "grpc.http2_scheme"
/* Channel arg to determine maximum size of payload eligable for GET request */ /* Channel arg to determine maximum size of payload eligable for GET request */
#define GRPC_ARG_MAX_PAYLOAD_SIZE_FOR_GET "grpc.max_payload_size_for_get" #define GRPC_ARG_MAX_PAYLOAD_SIZE_FOR_GET "grpc.max_payload_size_for_get"
#endif /* GRPC_CORE_LIB_CHANNEL_HTTP_CLIENT_FILTER_H */ #endif /* GRPC_CORE_EXT_FILTERS_HTTP_CLIENT_HTTP_CLIENT_FILTER_H */

@ -0,0 +1,103 @@
/*
*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <string.h>
#include "src/core/ext/filters/http/client/http_client_filter.h"
#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/transport_impl.h"
typedef struct {
const grpc_channel_filter *filter;
const char *control_channel_arg;
} optional_filter;
static optional_filter compress_filter = {
&grpc_message_compress_filter, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION};
static bool is_building_http_like_transport(
grpc_channel_stack_builder *builder) {
grpc_transport *t = grpc_channel_stack_builder_get_transport(builder);
return t != NULL && strstr(t->vtable->name, "http");
}
static bool maybe_add_optional_filter(grpc_exec_ctx *exec_ctx,
grpc_channel_stack_builder *builder,
void *arg) {
if (!is_building_http_like_transport(builder)) return true;
optional_filter *filtarg = arg;
const grpc_channel_args *channel_args =
grpc_channel_stack_builder_get_channel_arguments(builder);
bool enable = grpc_channel_arg_get_bool(
grpc_channel_args_find(channel_args, filtarg->control_channel_arg),
!grpc_channel_args_want_minimal_stack(channel_args));
return enable ? grpc_channel_stack_builder_prepend_filter(
builder, filtarg->filter, NULL, NULL)
: true;
}
static bool maybe_add_required_filter(grpc_exec_ctx *exec_ctx,
grpc_channel_stack_builder *builder,
void *arg) {
return is_building_http_like_transport(builder)
? grpc_channel_stack_builder_prepend_filter(
builder, (const grpc_channel_filter *)arg, NULL, NULL)
: true;
}
void grpc_http_filters_init(void) {
grpc_register_tracer("compression", &grpc_compression_trace);
grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_optional_filter, &compress_filter);
grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_optional_filter, &compress_filter);
grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_optional_filter, &compress_filter);
grpc_channel_init_register_stage(
GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_required_filter, (void *)&grpc_http_client_filter);
grpc_channel_init_register_stage(
GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_required_filter, (void *)&grpc_http_client_filter);
grpc_channel_init_register_stage(
GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_required_filter, (void *)&grpc_http_server_filter);
}
void grpc_http_filters_shutdown(void) {}

@ -39,8 +39,8 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/compress_filter.h"
#include "src/core/lib/compression/algorithm_metadata.h" #include "src/core/lib/compression/algorithm_metadata.h"
#include "src/core/lib/compression/message_compress.h" #include "src/core/lib/compression/message_compress.h"
#include "src/core/lib/profiling/timers.h" #include "src/core/lib/profiling/timers.h"
@ -51,6 +51,12 @@
int grpc_compression_trace = 0; int grpc_compression_trace = 0;
#define INITIAL_METADATA_UNSEEN 0
#define HAS_COMPRESSION_ALGORITHM 2
#define NO_COMPRESSION_ALGORITHM 4
#define CANCELLED_BIT ((gpr_atm)1)
typedef struct call_data { typedef struct call_data {
grpc_slice_buffer slices; /**< Buffers up input slices to be compressed */ grpc_slice_buffer slices; /**< Buffers up input slices to be compressed */
grpc_linked_mdelem compression_algorithm_storage; grpc_linked_mdelem compression_algorithm_storage;
@ -59,8 +65,17 @@ typedef struct call_data {
/** Compression algorithm we'll try to use. It may be given by incoming /** Compression algorithm we'll try to use. It may be given by incoming
* metadata, or by the channel's default compression settings. */ * metadata, or by the channel's default compression settings. */
grpc_compression_algorithm compression_algorithm; grpc_compression_algorithm compression_algorithm;
/** If true, contents of \a compression_algorithm are authoritative */
int has_compression_algorithm; /* Atomic recording the state of initial metadata; allowed values:
INITIAL_METADATA_UNSEEN - initial metadata op not seen
HAS_COMPRESSION_ALGORITHM - initial metadata seen; compression algorithm
set
NO_COMPRESSION_ALGORITHM - initial metadata seen; no compression algorithm
set
pointer - a stalled op containing a send_message that's waiting on initial
metadata
pointer | CANCELLED_BIT - request was cancelled with error pointed to */
gpr_atm send_initial_metadata_state;
grpc_transport_stream_op_batch *send_op; grpc_transport_stream_op_batch *send_op;
uint32_t send_length; uint32_t send_length;
@ -81,14 +96,15 @@ typedef struct channel_data {
uint32_t supported_compression_algorithms; uint32_t supported_compression_algorithms;
} channel_data; } channel_data;
static int skip_compression(grpc_call_element *elem, uint32_t flags) { static bool skip_compression(grpc_call_element *elem, uint32_t flags,
bool has_compression_algorithm) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data; channel_data *channeld = elem->channel_data;
if (flags & (GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_INTERNAL_COMPRESS)) { if (flags & (GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_INTERNAL_COMPRESS)) {
return 1; return 1;
} }
if (calld->has_compression_algorithm) { if (has_compression_algorithm) {
if (calld->compression_algorithm == GRPC_COMPRESS_NONE) { if (calld->compression_algorithm == GRPC_COMPRESS_NONE) {
return 1; return 1;
} }
@ -101,12 +117,14 @@ static int skip_compression(grpc_call_element *elem, uint32_t flags) {
/** Filter initial metadata */ /** Filter initial metadata */
static grpc_error *process_send_initial_metadata( static grpc_error *process_send_initial_metadata(
grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_metadata_batch *initial_metadata) GRPC_MUST_USE_RESULT; grpc_metadata_batch *initial_metadata,
bool *has_compression_algorithm) GRPC_MUST_USE_RESULT;
static grpc_error *process_send_initial_metadata( static grpc_error *process_send_initial_metadata(
grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_metadata_batch *initial_metadata) { grpc_metadata_batch *initial_metadata, bool *has_compression_algorithm) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data; channel_data *channeld = elem->channel_data;
*has_compression_algorithm = false;
/* Parse incoming request for compression. If any, it'll be available /* Parse incoming request for compression. If any, it'll be available
* at calld->compression_algorithm */ * at calld->compression_algorithm */
if (initial_metadata->idx.named.grpc_internal_encoding_request != NULL) { if (initial_metadata->idx.named.grpc_internal_encoding_request != NULL) {
@ -130,7 +148,7 @@ static grpc_error *process_send_initial_metadata(
gpr_free(val); gpr_free(val);
calld->compression_algorithm = GRPC_COMPRESS_NONE; calld->compression_algorithm = GRPC_COMPRESS_NONE;
} }
calld->has_compression_algorithm = 1; *has_compression_algorithm = true;
grpc_metadata_batch_remove( grpc_metadata_batch_remove(
exec_ctx, initial_metadata, exec_ctx, initial_metadata,
@ -140,7 +158,7 @@ static grpc_error *process_send_initial_metadata(
* exceptionally skipping compression, fall back to the channel * exceptionally skipping compression, fall back to the channel
* default */ * default */
calld->compression_algorithm = channeld->default_compression_algorithm; calld->compression_algorithm = channeld->default_compression_algorithm;
calld->has_compression_algorithm = 1; /* GPR_TRUE */ *has_compression_algorithm = true;
} }
grpc_error *error = GRPC_ERROR_NONE; grpc_error *error = GRPC_ERROR_NONE;
@ -260,21 +278,89 @@ static void compress_start_transport_stream_op_batch(
GPR_TIMER_BEGIN("compress_start_transport_stream_op_batch", 0); GPR_TIMER_BEGIN("compress_start_transport_stream_op_batch", 0);
if (op->cancel_stream) {
gpr_atm cur;
GRPC_ERROR_REF(op->payload->cancel_stream.cancel_error);
do {
cur = gpr_atm_acq_load(&calld->send_initial_metadata_state);
} while (!gpr_atm_rel_cas(
&calld->send_initial_metadata_state, cur,
CANCELLED_BIT | (gpr_atm)op->payload->cancel_stream.cancel_error));
switch (cur) {
case HAS_COMPRESSION_ALGORITHM:
case NO_COMPRESSION_ALGORITHM:
case INITIAL_METADATA_UNSEEN:
break;
default:
if ((cur & CANCELLED_BIT) == 0) {
grpc_transport_stream_op_batch_finish_with_failure(
exec_ctx, (grpc_transport_stream_op_batch *)cur,
GRPC_ERROR_REF(op->payload->cancel_stream.cancel_error));
} else {
GRPC_ERROR_UNREF((grpc_error *)(cur & ~CANCELLED_BIT));
}
break;
}
}
if (op->send_initial_metadata) { if (op->send_initial_metadata) {
bool has_compression_algorithm;
grpc_error *error = process_send_initial_metadata( grpc_error *error = process_send_initial_metadata(
exec_ctx, elem, exec_ctx, elem,
op->payload->send_initial_metadata.send_initial_metadata); op->payload->send_initial_metadata.send_initial_metadata,
&has_compression_algorithm);
if (error != GRPC_ERROR_NONE) { if (error != GRPC_ERROR_NONE) {
grpc_transport_stream_op_batch_finish_with_failure(exec_ctx, op, error); grpc_transport_stream_op_batch_finish_with_failure(exec_ctx, op, error);
return; return;
} }
gpr_atm cur = gpr_atm_acq_load(&calld->send_initial_metadata_state);
GPR_ASSERT(cur != HAS_COMPRESSION_ALGORITHM &&
cur != NO_COMPRESSION_ALGORITHM);
if ((cur & CANCELLED_BIT) == 0) {
gpr_atm_rel_store(&calld->send_initial_metadata_state,
has_compression_algorithm ? HAS_COMPRESSION_ALGORITHM
: NO_COMPRESSION_ALGORITHM);
if (cur != INITIAL_METADATA_UNSEEN) {
grpc_call_next_op(exec_ctx, elem,
(grpc_transport_stream_op_batch *)cur);
}
}
} }
if (op->send_message && if (op->send_message) {
!skip_compression(elem, op->payload->send_message.send_message->flags)) { gpr_atm cur;
calld->send_op = op; retry_send:
calld->send_length = op->payload->send_message.send_message->length; cur = gpr_atm_acq_load(&calld->send_initial_metadata_state);
calld->send_flags = op->payload->send_message.send_message->flags; switch (cur) {
continue_send_message(exec_ctx, elem); case INITIAL_METADATA_UNSEEN:
if (!gpr_atm_rel_cas(&calld->send_initial_metadata_state, cur,
(gpr_atm)op)) {
goto retry_send;
}
break;
case HAS_COMPRESSION_ALGORITHM:
case NO_COMPRESSION_ALGORITHM:
if (!skip_compression(elem,
op->payload->send_message.send_message->flags,
cur == HAS_COMPRESSION_ALGORITHM)) {
calld->send_op = op;
calld->send_length = op->payload->send_message.send_message->length;
calld->send_flags = op->payload->send_message.send_message->flags;
continue_send_message(exec_ctx, elem);
} else {
/* pass control down the stack */
grpc_call_next_op(exec_ctx, elem, op);
}
break;
default:
if (cur & CANCELLED_BIT) {
grpc_transport_stream_op_batch_finish_with_failure(
exec_ctx, op,
GRPC_ERROR_REF((grpc_error *)(cur & ~CANCELLED_BIT)));
} else {
/* >1 send_message concurrently */
GPR_UNREACHABLE_CODE(break);
}
}
} else { } else {
/* pass control down the stack */ /* pass control down the stack */
grpc_call_next_op(exec_ctx, elem, op); grpc_call_next_op(exec_ctx, elem, op);
@ -292,7 +378,6 @@ static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
/* initialize members */ /* initialize members */
grpc_slice_buffer_init(&calld->slices); grpc_slice_buffer_init(&calld->slices);
calld->has_compression_algorithm = 0;
grpc_closure_init(&calld->got_slice, got_slice, elem, grpc_closure_init(&calld->got_slice, got_slice, elem,
grpc_schedule_on_exec_ctx); grpc_schedule_on_exec_ctx);
grpc_closure_init(&calld->send_done, send_done, elem, grpc_closure_init(&calld->send_done, send_done, elem,
@ -308,6 +393,11 @@ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
/* grab pointers to our data from the call element */ /* grab pointers to our data from the call element */
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
grpc_slice_buffer_destroy_internal(exec_ctx, &calld->slices); grpc_slice_buffer_destroy_internal(exec_ctx, &calld->slices);
gpr_atm imstate =
gpr_atm_no_barrier_load(&calld->send_initial_metadata_state);
if (imstate & CANCELLED_BIT) {
GRPC_ERROR_UNREF((grpc_error *)(imstate & ~CANCELLED_BIT));
}
} }
/* Constructor for channel_data */ /* Constructor for channel_data */
@ -348,7 +438,7 @@ static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx,
static void destroy_channel_elem(grpc_exec_ctx *exec_ctx, static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {} grpc_channel_element *elem) {}
const grpc_channel_filter grpc_compress_filter = { const grpc_channel_filter grpc_message_compress_filter = {
compress_start_transport_stream_op_batch, compress_start_transport_stream_op_batch,
grpc_channel_next_op, grpc_channel_next_op,
sizeof(call_data), sizeof(call_data),

@ -31,8 +31,8 @@
* *
*/ */
#ifndef GRPC_CORE_LIB_CHANNEL_COMPRESS_FILTER_H #ifndef GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H
#define GRPC_CORE_LIB_CHANNEL_COMPRESS_FILTER_H #define GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H
#include <grpc/impl/codegen/compression_types.h> #include <grpc/impl/codegen/compression_types.h>
@ -62,6 +62,7 @@ extern int grpc_compression_trace;
* aforementioned 'grpc-encoding' metadata value, data will pass through * aforementioned 'grpc-encoding' metadata value, data will pass through
* uncompressed. */ * uncompressed. */
extern const grpc_channel_filter grpc_compress_filter; extern const grpc_channel_filter grpc_message_compress_filter;
#endif /* GRPC_CORE_LIB_CHANNEL_COMPRESS_FILTER_H */ #endif /* GRPC_CORE_EXT_FILTERS_HTTP_MESSAGE_COMPRESS_MESSAGE_COMPRESS_FILTER_H \
*/

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/lib/channel/http_server_filter.h" #include "src/core/ext/filters/http/server/http_server_filter.h"
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>

@ -31,12 +31,12 @@
* *
*/ */
#ifndef GRPC_CORE_LIB_CHANNEL_HTTP_SERVER_FILTER_H #ifndef GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H
#define GRPC_CORE_LIB_CHANNEL_HTTP_SERVER_FILTER_H #define GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
/* Processes metadata on the client side for HTTP2 transports */ /* Processes metadata on the client side for HTTP2 transports */
extern const grpc_channel_filter grpc_http_server_filter; extern const grpc_channel_filter grpc_http_server_filter;
#endif /* GRPC_CORE_LIB_CHANNEL_HTTP_SERVER_FILTER_H */ #endif /* GRPC_CORE_EXT_FILTERS_HTTP_SERVER_HTTP_SERVER_FILTER_H */

@ -65,14 +65,8 @@ void grpc_call_set_load_reporting_cost_context(
} }
static bool is_load_reporting_enabled(const grpc_channel_args *a) { static bool is_load_reporting_enabled(const grpc_channel_args *a) {
if (a == NULL) return false; return grpc_channel_arg_get_bool(
for (size_t i = 0; i < a->num_args; i++) { grpc_channel_args_find(a, GRPC_ARG_ENABLE_LOAD_REPORTING), false);
if (0 == strcmp(a->args[i].key, GRPC_ARG_ENABLE_LOAD_REPORTING)) {
return a->args[i].type == GRPC_ARG_INTEGER &&
a->args[i].value.integer != 0;
}
}
return false;
} }
static bool maybe_add_load_reporting_filter(grpc_exec_ctx *exec_ctx, static bool maybe_add_load_reporting_filter(grpc_exec_ctx *exec_ctx,

@ -47,6 +47,11 @@
#define DEFAULT_MAX_CONNECTION_IDLE_MS INT_MAX #define DEFAULT_MAX_CONNECTION_IDLE_MS INT_MAX
#define MAX_CONNECTION_AGE_JITTER 0.1 #define MAX_CONNECTION_AGE_JITTER 0.1
#define MAX_CONNECTION_AGE_INTEGER_OPTIONS \
(grpc_integer_options) { DEFAULT_MAX_CONNECTION_AGE_MS, 1, INT_MAX }
#define MAX_CONNECTION_IDLE_INTEGER_OPTIONS \
(grpc_integer_options) { DEFAULT_MAX_CONNECTION_IDLE_MS, 1, INT_MAX }
typedef struct channel_data { typedef struct channel_data {
/* We take a reference to the channel stack for the timer callback */ /* We take a reference to the channel stack for the timer callback */
grpc_channel_stack* channel_stack; grpc_channel_stack* channel_stack;
@ -315,8 +320,7 @@ static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
if (0 == strcmp(args->channel_args->args[i].key, if (0 == strcmp(args->channel_args->args[i].key,
GRPC_ARG_MAX_CONNECTION_AGE_MS)) { GRPC_ARG_MAX_CONNECTION_AGE_MS)) {
const int value = grpc_channel_arg_get_integer( const int value = grpc_channel_arg_get_integer(
&args->channel_args->args[i], &args->channel_args->args[i], MAX_CONNECTION_AGE_INTEGER_OPTIONS);
(grpc_integer_options){DEFAULT_MAX_CONNECTION_AGE_MS, 1, INT_MAX});
chand->max_connection_age = chand->max_connection_age =
value == INT_MAX value == INT_MAX
? gpr_inf_future(GPR_TIMESPAN) ? gpr_inf_future(GPR_TIMESPAN)
@ -334,8 +338,7 @@ static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
} else if (0 == strcmp(args->channel_args->args[i].key, } else if (0 == strcmp(args->channel_args->args[i].key,
GRPC_ARG_MAX_CONNECTION_IDLE_MS)) { GRPC_ARG_MAX_CONNECTION_IDLE_MS)) {
const int value = grpc_channel_arg_get_integer( const int value = grpc_channel_arg_get_integer(
&args->channel_args->args[i], &args->channel_args->args[i], MAX_CONNECTION_IDLE_INTEGER_OPTIONS);
(grpc_integer_options){DEFAULT_MAX_CONNECTION_IDLE_MS, 1, INT_MAX});
chand->max_connection_idle = chand->max_connection_idle =
value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN)
: gpr_time_from_millis(value, GPR_TIMESPAN); : gpr_time_from_millis(value, GPR_TIMESPAN);
@ -412,16 +415,13 @@ static bool maybe_add_max_age_filter(grpc_exec_ctx* exec_ctx,
void* arg) { void* arg) {
const grpc_channel_args* channel_args = const grpc_channel_args* channel_args =
grpc_channel_stack_builder_get_channel_arguments(builder); grpc_channel_stack_builder_get_channel_arguments(builder);
const grpc_arg* a = bool enable =
grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_AGE_MS); grpc_channel_arg_get_integer(
bool enable = false; grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_AGE_MS),
if (a != NULL && a->type == GRPC_ARG_INTEGER && a->value.integer != INT_MAX) { MAX_CONNECTION_AGE_INTEGER_OPTIONS) != INT_MAX &&
enable = true; grpc_channel_arg_get_integer(
} grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_IDLE_MS),
a = grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_IDLE_MS); MAX_CONNECTION_IDLE_INTEGER_OPTIONS) != INT_MAX;
if (a != NULL && a->type == GRPC_ARG_INTEGER && a->value.integer != INT_MAX) {
enable = true;
}
if (enable) { if (enable) {
return grpc_channel_stack_builder_prepend_filter( return grpc_channel_stack_builder_prepend_filter(
builder, &grpc_max_age_filter, NULL, NULL); builder, &grpc_max_age_filter, NULL, NULL);

@ -29,7 +29,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
#include "src/core/lib/channel/message_size_filter.h" #include "src/core/ext/filters/message_size/message_size_filter.h"
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
@ -40,7 +40,9 @@
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/support/string.h" #include "src/core/lib/support/string.h"
#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/service_config.h" #include "src/core/lib/transport/service_config.h"
typedef struct message_size_limits { typedef struct message_size_limits {
@ -89,8 +91,7 @@ static void* message_size_limits_create_from_json(const grpc_json* json) {
} }
typedef struct call_data { typedef struct call_data {
int max_send_size; message_size_limits limits;
int max_recv_size;
// Receive closures are chained: we inject this closure as the // Receive closures are chained: we inject this closure as the
// recv_message_ready up-call on transport_stream_op, and remember to // recv_message_ready up-call on transport_stream_op, and remember to
// call our next_recv_message_ready member after handling it. // call our next_recv_message_ready member after handling it.
@ -102,8 +103,7 @@ typedef struct call_data {
} call_data; } call_data;
typedef struct channel_data { typedef struct channel_data {
int max_send_size; message_size_limits limits;
int max_recv_size;
// Maps path names to message_size_limits structs. // Maps path names to message_size_limits structs.
grpc_slice_hash_table* method_limit_table; grpc_slice_hash_table* method_limit_table;
} channel_data; } channel_data;
@ -114,12 +114,12 @@ static void recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data,
grpc_error* error) { grpc_error* error) {
grpc_call_element* elem = user_data; grpc_call_element* elem = user_data;
call_data* calld = elem->call_data; call_data* calld = elem->call_data;
if (*calld->recv_message != NULL && calld->max_recv_size >= 0 && if (*calld->recv_message != NULL && calld->limits.max_recv_size >= 0 &&
(*calld->recv_message)->length > (size_t)calld->max_recv_size) { (*calld->recv_message)->length > (size_t)calld->limits.max_recv_size) {
char* message_string; char* message_string;
gpr_asprintf(&message_string, gpr_asprintf(&message_string,
"Received message larger than max (%u vs. %d)", "Received message larger than max (%u vs. %d)",
(*calld->recv_message)->length, calld->max_recv_size); (*calld->recv_message)->length, calld->limits.max_recv_size);
grpc_error* new_error = grpc_error_set_int( grpc_error* new_error = grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string), GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED); GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
@ -141,13 +141,13 @@ static void start_transport_stream_op_batch(
grpc_transport_stream_op_batch* op) { grpc_transport_stream_op_batch* op) {
call_data* calld = elem->call_data; call_data* calld = elem->call_data;
// Check max send message size. // Check max send message size.
if (op->send_message && calld->max_send_size >= 0 && if (op->send_message && calld->limits.max_send_size >= 0 &&
op->payload->send_message.send_message->length > op->payload->send_message.send_message->length >
(size_t)calld->max_send_size) { (size_t)calld->limits.max_send_size) {
char* message_string; char* message_string;
gpr_asprintf(&message_string, "Sent message larger than max (%u vs. %d)", gpr_asprintf(&message_string, "Sent message larger than max (%u vs. %d)",
op->payload->send_message.send_message->length, op->payload->send_message.send_message->length,
calld->max_send_size); calld->limits.max_send_size);
grpc_transport_stream_op_batch_finish_with_failure( grpc_transport_stream_op_batch_finish_with_failure(
exec_ctx, op, exec_ctx, op,
grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string), grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string),
@ -180,21 +180,20 @@ static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
// Note: Per-method config is only available on the client, so we // Note: Per-method config is only available on the client, so we
// apply the max request size to the send limit and the max response // apply the max request size to the send limit and the max response
// size to the receive limit. // size to the receive limit.
calld->max_send_size = chand->max_send_size; calld->limits = chand->limits;
calld->max_recv_size = chand->max_recv_size;
if (chand->method_limit_table != NULL) { if (chand->method_limit_table != NULL) {
message_size_limits* limits = grpc_method_config_table_get( message_size_limits* limits = grpc_method_config_table_get(
exec_ctx, chand->method_limit_table, args->path); exec_ctx, chand->method_limit_table, args->path);
if (limits != NULL) { if (limits != NULL) {
if (limits->max_send_size >= 0 && if (limits->max_send_size >= 0 &&
(limits->max_send_size < calld->max_send_size || (limits->max_send_size < calld->limits.max_send_size ||
calld->max_send_size < 0)) { calld->limits.max_send_size < 0)) {
calld->max_send_size = limits->max_send_size; calld->limits.max_send_size = limits->max_send_size;
} }
if (limits->max_recv_size >= 0 && if (limits->max_recv_size >= 0 &&
(limits->max_recv_size < calld->max_recv_size || (limits->max_recv_size < calld->limits.max_recv_size ||
calld->max_recv_size < 0)) { calld->limits.max_recv_size < 0)) {
calld->max_recv_size = limits->max_recv_size; calld->limits.max_recv_size = limits->max_recv_size;
} }
} }
} }
@ -206,30 +205,45 @@ static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
const grpc_call_final_info* final_info, const grpc_call_final_info* final_info,
grpc_closure* ignored) {} grpc_closure* ignored) {}
static int default_size(const grpc_channel_args* args,
int without_minimal_stack) {
if (grpc_channel_args_want_minimal_stack(args)) {
return -1;
}
return without_minimal_stack;
}
message_size_limits get_message_size_limits(
const grpc_channel_args* channel_args) {
message_size_limits lim;
lim.max_send_size =
default_size(channel_args, GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH);
lim.max_recv_size =
default_size(channel_args, GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH);
for (size_t i = 0; i < channel_args->num_args; ++i) {
if (strcmp(channel_args->args[i].key, GRPC_ARG_MAX_SEND_MESSAGE_LENGTH) ==
0) {
const grpc_integer_options options = {lim.max_send_size, -1, INT_MAX};
lim.max_send_size =
grpc_channel_arg_get_integer(&channel_args->args[i], options);
}
if (strcmp(channel_args->args[i].key,
GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH) == 0) {
const grpc_integer_options options = {lim.max_recv_size, -1, INT_MAX};
lim.max_recv_size =
grpc_channel_arg_get_integer(&channel_args->args[i], options);
}
}
return lim;
}
// Constructor for channel_data. // Constructor for channel_data.
static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx, static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
grpc_channel_element* elem, grpc_channel_element* elem,
grpc_channel_element_args* args) { grpc_channel_element_args* args) {
GPR_ASSERT(!args->is_last); GPR_ASSERT(!args->is_last);
channel_data* chand = elem->channel_data; channel_data* chand = elem->channel_data;
chand->max_send_size = GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH; chand->limits = get_message_size_limits(args->channel_args);
chand->max_recv_size = GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH;
for (size_t i = 0; i < args->channel_args->num_args; ++i) {
if (strcmp(args->channel_args->args[i].key,
GRPC_ARG_MAX_SEND_MESSAGE_LENGTH) == 0) {
const grpc_integer_options options = {
GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH, -1, INT_MAX};
chand->max_send_size =
grpc_channel_arg_get_integer(&args->channel_args->args[i], options);
}
if (strcmp(args->channel_args->args[i].key,
GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH) == 0) {
const grpc_integer_options options = {
GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH, -1, INT_MAX};
chand->max_recv_size =
grpc_channel_arg_get_integer(&args->channel_args->args[i], options);
}
}
// Get method config table from channel args. // Get method config table from channel args.
const grpc_arg* channel_arg = const grpc_arg* channel_arg =
grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVICE_CONFIG); grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVICE_CONFIG);
@ -268,3 +282,40 @@ const grpc_channel_filter grpc_message_size_filter = {
grpc_call_next_get_peer, grpc_call_next_get_peer,
grpc_channel_next_get_info, grpc_channel_next_get_info,
"message_size"}; "message_size"};
static bool maybe_add_message_size_filter(grpc_exec_ctx* exec_ctx,
grpc_channel_stack_builder* builder,
void* arg) {
const grpc_channel_args* channel_args =
grpc_channel_stack_builder_get_channel_arguments(builder);
bool enable = false;
message_size_limits lim = get_message_size_limits(channel_args);
if (lim.max_send_size != -1 || lim.max_recv_size != -1) {
enable = true;
}
const grpc_arg* a =
grpc_channel_args_find(channel_args, GRPC_ARG_SERVICE_CONFIG);
if (a != NULL) {
enable = true;
}
if (enable) {
return grpc_channel_stack_builder_prepend_filter(
builder, &grpc_message_size_filter, NULL, NULL);
} else {
return true;
}
}
void grpc_message_size_filter_init(void) {
grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_message_size_filter, NULL);
grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_message_size_filter, NULL);
grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_message_size_filter, NULL);
}
void grpc_message_size_filter_shutdown(void) {}

@ -29,11 +29,11 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
#ifndef GRPC_CORE_LIB_CHANNEL_MESSAGE_SIZE_FILTER_H #ifndef GRPC_CORE_EXT_FILTERS_MESSAGE_SIZE_MESSAGE_SIZE_FILTER_H
#define GRPC_CORE_LIB_CHANNEL_MESSAGE_SIZE_FILTER_H #define GRPC_CORE_EXT_FILTERS_MESSAGE_SIZE_MESSAGE_SIZE_FILTER_H
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
extern const grpc_channel_filter grpc_message_size_filter; extern const grpc_channel_filter grpc_message_size_filter;
#endif /* GRPC_CORE_LIB_CHANNEL_MESSAGE_SIZE_FILTER_H */ #endif /* GRPC_CORE_EXT_FILTERS_MESSAGE_SIZE_MESSAGE_SIZE_FILTER_H */

@ -43,11 +43,11 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/handshaker.h" #include "src/core/lib/channel/handshaker.h"
#include "src/core/lib/channel/handshaker_registry.h" #include "src/core/lib/channel/handshaker_registry.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/tcp_server.h" #include "src/core/lib/iomgr/tcp_server.h"

@ -329,7 +329,9 @@ const grpc_arg *grpc_channel_args_find(const grpc_channel_args *args,
return NULL; return NULL;
} }
int grpc_channel_arg_get_integer(grpc_arg *arg, grpc_integer_options options) { int grpc_channel_arg_get_integer(const grpc_arg *arg,
grpc_integer_options options) {
if (arg == NULL) return options.default_value;
if (arg->type != GRPC_ARG_INTEGER) { if (arg->type != GRPC_ARG_INTEGER) {
gpr_log(GPR_ERROR, "%s ignored: it must be an integer", arg->key); gpr_log(GPR_ERROR, "%s ignored: it must be an integer", arg->key);
return options.default_value; return options.default_value;
@ -347,9 +349,25 @@ int grpc_channel_arg_get_integer(grpc_arg *arg, grpc_integer_options options) {
return arg->value.integer; return arg->value.integer;
} }
bool grpc_channel_arg_get_bool(const grpc_arg *arg, bool default_value) {
if (arg == NULL) return default_value;
if (arg->type != GRPC_ARG_INTEGER) {
gpr_log(GPR_ERROR, "%s ignored: it must be an integer", arg->key);
return default_value;
}
switch (arg->value.integer) {
case 0:
return false;
case 1:
return true;
default:
gpr_log(GPR_ERROR, "%s treated as bool but set to %d (assuming true)",
arg->key, arg->value.integer);
return true;
}
}
bool grpc_channel_args_want_minimal_stack(const grpc_channel_args *args) { bool grpc_channel_args_want_minimal_stack(const grpc_channel_args *args) {
const grpc_arg *arg = grpc_channel_args_find(args, GRPC_ARG_MINIMAL_STACK); return grpc_channel_arg_get_bool(
if (arg == NULL) return false; grpc_channel_args_find(args, GRPC_ARG_MINIMAL_STACK), false);
if (arg->type == GRPC_ARG_INTEGER && arg->value.integer == 0) return false;
return true;
} }

@ -121,6 +121,9 @@ typedef struct grpc_integer_options {
int max_value; int max_value;
} grpc_integer_options; } grpc_integer_options;
/** Returns the value of \a arg, subject to the contraints in \a options. */ /** Returns the value of \a arg, subject to the contraints in \a options. */
int grpc_channel_arg_get_integer(grpc_arg *arg, grpc_integer_options options); int grpc_channel_arg_get_integer(const grpc_arg *arg,
grpc_integer_options options);
bool grpc_channel_arg_get_bool(const grpc_arg *arg, bool default_value);
#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */ #endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */

@ -113,6 +113,17 @@ grpc_channel_stack_builder_create_iterator_at_last(
return create_iterator_at_filter_node(builder, &builder->end); return create_iterator_at_filter_node(builder, &builder->end);
} }
bool grpc_channel_stack_builder_iterator_is_end(
grpc_channel_stack_builder_iterator *iterator) {
return iterator->node == &iterator->builder->end;
}
const char *grpc_channel_stack_builder_iterator_filter_name(
grpc_channel_stack_builder_iterator *iterator) {
if (iterator->node->filter == NULL) return NULL;
return iterator->node->filter->name;
}
bool grpc_channel_stack_builder_move_next( bool grpc_channel_stack_builder_move_next(
grpc_channel_stack_builder_iterator *iterator) { grpc_channel_stack_builder_iterator *iterator) {
if (iterator->node == &iterator->builder->end) return false; if (iterator->node == &iterator->builder->end) return false;

@ -98,6 +98,10 @@ bool grpc_channel_stack_builder_iterator_is_first(
bool grpc_channel_stack_builder_iterator_is_end( bool grpc_channel_stack_builder_iterator_is_end(
grpc_channel_stack_builder_iterator *iterator); grpc_channel_stack_builder_iterator *iterator);
/// What is the name of the filter at this iterator position?
const char *grpc_channel_stack_builder_iterator_filter_name(
grpc_channel_stack_builder_iterator *iterator);
/// Move an iterator to the next item /// Move an iterator to the next item
bool grpc_channel_stack_builder_move_next( bool grpc_channel_stack_builder_move_next(
grpc_channel_stack_builder_iterator *iterator); grpc_channel_stack_builder_iterator *iterator);

@ -37,7 +37,6 @@
#include <string.h> #include <string.h>
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/http_client_filter.h"
#include "src/core/lib/http/httpcli.h" #include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h" #include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/executor.h" #include "src/core/lib/iomgr/executor.h"

@ -36,7 +36,6 @@
#include <string.h> #include <string.h>
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/http_client_filter.h"
#include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/api_trace.h"
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>

@ -104,30 +104,13 @@ void grpc_channel_init_shutdown(void) {
} }
} }
static const char *name_for_type(grpc_channel_stack_type type) {
switch (type) {
case GRPC_CLIENT_CHANNEL:
return "CLIENT_CHANNEL";
case GRPC_CLIENT_SUBCHANNEL:
return "CLIENT_SUBCHANNEL";
case GRPC_SERVER_CHANNEL:
return "SERVER_CHANNEL";
case GRPC_CLIENT_LAME_CHANNEL:
return "CLIENT_LAME_CHANNEL";
case GRPC_CLIENT_DIRECT_CHANNEL:
return "CLIENT_DIRECT_CHANNEL";
case GRPC_NUM_CHANNEL_STACK_TYPES:
break;
}
GPR_UNREACHABLE_CODE(return "UNKNOWN");
}
bool grpc_channel_init_create_stack(grpc_exec_ctx *exec_ctx, bool grpc_channel_init_create_stack(grpc_exec_ctx *exec_ctx,
grpc_channel_stack_builder *builder, grpc_channel_stack_builder *builder,
grpc_channel_stack_type type) { grpc_channel_stack_type type) {
GPR_ASSERT(g_finalized); GPR_ASSERT(g_finalized);
grpc_channel_stack_builder_set_name(builder, name_for_type(type)); grpc_channel_stack_builder_set_name(builder,
grpc_channel_stack_type_string(type));
for (size_t i = 0; i < g_slots[type].num_slots; i++) { for (size_t i = 0; i < g_slots[type].num_slots; i++) {
const stage_slot *slot = &g_slots[type].slots[i]; const stage_slot *slot = &g_slots[type].slots[i];

@ -52,3 +52,21 @@ bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type) {
} }
GPR_UNREACHABLE_CODE(return true;); GPR_UNREACHABLE_CODE(return true;);
} }
const char *grpc_channel_stack_type_string(grpc_channel_stack_type type) {
switch (type) {
case GRPC_CLIENT_CHANNEL:
return "CLIENT_CHANNEL";
case GRPC_CLIENT_SUBCHANNEL:
return "CLIENT_SUBCHANNEL";
case GRPC_SERVER_CHANNEL:
return "SERVER_CHANNEL";
case GRPC_CLIENT_LAME_CHANNEL:
return "CLIENT_LAME_CHANNEL";
case GRPC_CLIENT_DIRECT_CHANNEL:
return "CLIENT_DIRECT_CHANNEL";
case GRPC_NUM_CHANNEL_STACK_TYPES:
break;
}
GPR_UNREACHABLE_CODE(return "UNKNOWN");
}

@ -55,4 +55,6 @@ typedef enum {
bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type); bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type);
const char *grpc_channel_stack_type_string(grpc_channel_stack_type type);
#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H */ #endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_STACK_TYPE_H */

@ -64,6 +64,10 @@ typedef struct {
struct grpc_completion_queue { struct grpc_completion_queue {
/** owned by pollset */ /** owned by pollset */
gpr_mu *mu; gpr_mu *mu;
grpc_cq_completion_type completion_type;
grpc_cq_polling_type polling_type;
/** completed events */ /** completed events */
grpc_cq_completion completed_head; grpc_cq_completion completed_head;
grpc_cq_completion *completed_tail; grpc_cq_completion *completed_tail;
@ -79,6 +83,7 @@ struct grpc_completion_queue {
int shutdown_called; int shutdown_called;
int is_server_cq; int is_server_cq;
/** Can the server cq accept incoming channels */ /** Can the server cq accept incoming channels */
/* TODO: sreek - This will no longer be needed. Use polling_type set */
int is_non_listening_server_cq; int is_non_listening_server_cq;
int num_pluckers; int num_pluckers;
plucker pluckers[GRPC_MAX_COMPLETION_QUEUE_PLUCKERS]; plucker pluckers[GRPC_MAX_COMPLETION_QUEUE_PLUCKERS];
@ -110,13 +115,17 @@ int grpc_cq_event_timeout_trace;
static void on_pollset_shutdown_done(grpc_exec_ctx *exec_ctx, void *cc, static void on_pollset_shutdown_done(grpc_exec_ctx *exec_ctx, void *cc,
grpc_error *error); grpc_error *error);
grpc_completion_queue *grpc_completion_queue_create(void *reserved) { grpc_completion_queue *grpc_completion_queue_create_internal(
grpc_cq_completion_type completion_type,
grpc_cq_polling_type polling_type) {
grpc_completion_queue *cc; grpc_completion_queue *cc;
GPR_ASSERT(!reserved);
GPR_TIMER_BEGIN("grpc_completion_queue_create", 0); GPR_TIMER_BEGIN("grpc_completion_queue_create_internal", 0);
GRPC_API_TRACE("grpc_completion_queue_create(reserved=%p)", 1, (reserved)); GRPC_API_TRACE(
"grpc_completion_queue_create_internal(completion_type=%d, "
"polling_type=%d)",
2, (completion_type, polling_type));
cc = gpr_zalloc(sizeof(grpc_completion_queue) + grpc_pollset_size()); cc = gpr_zalloc(sizeof(grpc_completion_queue) + grpc_pollset_size());
grpc_pollset_init(POLLSET_FROM_CQ(cc), &cc->mu); grpc_pollset_init(POLLSET_FROM_CQ(cc), &cc->mu);
@ -125,6 +134,9 @@ grpc_completion_queue *grpc_completion_queue_create(void *reserved) {
cc->outstanding_tag_capacity = 0; cc->outstanding_tag_capacity = 0;
#endif #endif
cc->completion_type = completion_type;
cc->polling_type = polling_type;
/* Initial ref is dropped by grpc_completion_queue_shutdown */ /* Initial ref is dropped by grpc_completion_queue_shutdown */
gpr_ref_init(&cc->pending_events, 1); gpr_ref_init(&cc->pending_events, 1);
/* One for destroy(), one for pollset_shutdown */ /* One for destroy(), one for pollset_shutdown */
@ -143,11 +155,19 @@ grpc_completion_queue *grpc_completion_queue_create(void *reserved) {
grpc_closure_init(&cc->pollset_shutdown_done, on_pollset_shutdown_done, cc, grpc_closure_init(&cc->pollset_shutdown_done, on_pollset_shutdown_done, cc,
grpc_schedule_on_exec_ctx); grpc_schedule_on_exec_ctx);
GPR_TIMER_END("grpc_completion_queue_create", 0); GPR_TIMER_END("grpc_completion_queue_create_internal", 0);
return cc; return cc;
} }
grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue *cc) {
return cc->completion_type;
}
grpc_cq_polling_type grpc_get_cq_polling_type(grpc_completion_queue *cc) {
return cc->polling_type;
}
#ifdef GRPC_CQ_REF_COUNT_DEBUG #ifdef GRPC_CQ_REF_COUNT_DEBUG
void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason, void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason,
const char *file, int line) { const char *file, int line) {
@ -347,6 +367,13 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc,
grpc_event ret; grpc_event ret;
gpr_timespec now; gpr_timespec now;
if (cc->completion_type != GRPC_CQ_NEXT) {
gpr_log(GPR_ERROR,
"grpc_completion_queue_next() cannot be called on this completion "
"queue since its completion type is not GRPC_CQ_NEXT");
abort();
}
GPR_TIMER_BEGIN("grpc_completion_queue_next", 0); GPR_TIMER_BEGIN("grpc_completion_queue_next", 0);
GRPC_API_TRACE( GRPC_API_TRACE(
@ -516,6 +543,13 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag,
GPR_TIMER_BEGIN("grpc_completion_queue_pluck", 0); GPR_TIMER_BEGIN("grpc_completion_queue_pluck", 0);
if (cc->completion_type != GRPC_CQ_PLUCK) {
gpr_log(GPR_ERROR,
"grpc_completion_queue_pluck() cannot be called on this completion "
"queue since its completion type is not GRPC_CQ_PLUCK");
abort();
}
if (grpc_cq_pluck_trace) { if (grpc_cq_pluck_trace) {
GRPC_API_TRACE( GRPC_API_TRACE(
"grpc_completion_queue_pluck(" "grpc_completion_queue_pluck("
@ -680,10 +714,14 @@ grpc_completion_queue *grpc_cq_from_pollset(grpc_pollset *ps) {
} }
void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc) { void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc) {
/* TODO: sreek - use cc->polling_type field here and add a validation check
(i.e grpc_cq_mark_non_listening_server_cq can only be called on a cc whose
polling_type is set to GRPC_CQ_NON_LISTENING */
cc->is_non_listening_server_cq = 1; cc->is_non_listening_server_cq = 1;
} }
bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc) { bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc) {
/* TODO (sreek) - return (cc->polling_type == GRPC_CQ_NON_LISTENING) */
return (cc->is_non_listening_server_cq == 1); return (cc->is_non_listening_server_cq == 1);
} }

@ -99,4 +99,10 @@ bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc);
void grpc_cq_mark_server_cq(grpc_completion_queue *cc); void grpc_cq_mark_server_cq(grpc_completion_queue *cc);
int grpc_cq_is_server_cq(grpc_completion_queue *cc); int grpc_cq_is_server_cq(grpc_completion_queue *cc);
grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue *cc);
grpc_cq_polling_type grpc_get_cq_polling_type(grpc_completion_queue *cc);
grpc_completion_queue *grpc_completion_queue_create_internal(
grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type);
#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H */ #endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H */

@ -36,12 +36,15 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
/* TODO (sreek) - Currently this does not use the attributes arg. This will be /*
added in a future PR */ * == Default completion queue factory implementation ==
*/
static grpc_completion_queue* default_create( static grpc_completion_queue* default_create(
const grpc_completion_queue_factory* factory, const grpc_completion_queue_factory* factory,
const grpc_completion_queue_attributes* attributes) { const grpc_completion_queue_attributes* attr) {
return grpc_completion_queue_create(NULL); return grpc_completion_queue_create_internal(attr->cq_completion_type,
attr->cq_polling_type);
} }
static grpc_completion_queue_factory_vtable default_vtable = {default_create}; static grpc_completion_queue_factory_vtable default_vtable = {default_create};
@ -49,19 +52,24 @@ static grpc_completion_queue_factory_vtable default_vtable = {default_create};
static const grpc_completion_queue_factory g_default_cq_factory = { static const grpc_completion_queue_factory g_default_cq_factory = {
"Default Factory", NULL, &default_vtable}; "Default Factory", NULL, &default_vtable};
/*
* == Completion queue factory APIs
*/
const grpc_completion_queue_factory* grpc_completion_queue_factory_lookup( const grpc_completion_queue_factory* grpc_completion_queue_factory_lookup(
const grpc_completion_queue_attributes* attributes) { const grpc_completion_queue_attributes* attributes) {
/* As we add more fields to grpc_completion_queue_attributes, we may have to GPR_ASSERT(attributes->version >= 1 &&
change this assert to: attributes->version <= GRPC_CQ_CURRENT_VERSION);
GPR_ASSERT (attributes->version >= 1 &&
attributes->version <= GRPC_CQ_CURRENT_VERSION) */
GPR_ASSERT(attributes->version == 1);
/* The default factory can handle version 1 of the attributes structure. We /* The default factory can handle version 1 of the attributes structure. We
may have to change this as more fields are added to the structure */ may have to change this as more fields are added to the structure */
return &g_default_cq_factory; return &g_default_cq_factory;
} }
/*
* == Completion queue creation APIs ==
*/
grpc_completion_queue* grpc_completion_queue_create_for_next(void* reserved) { grpc_completion_queue* grpc_completion_queue_create_for_next(void* reserved) {
GPR_ASSERT(!reserved); GPR_ASSERT(!reserved);
grpc_completion_queue_attributes attr = {1, GRPC_CQ_NEXT, grpc_completion_queue_attributes attr = {1, GRPC_CQ_NEXT,
@ -75,3 +83,10 @@ grpc_completion_queue* grpc_completion_queue_create_for_pluck(void* reserved) {
GRPC_CQ_DEFAULT_POLLING}; GRPC_CQ_DEFAULT_POLLING};
return g_default_cq_factory.vtable->create(&g_default_cq_factory, &attr); return g_default_cq_factory.vtable->create(&g_default_cq_factory, &attr);
} }
grpc_completion_queue* grpc_completion_queue_create(
const grpc_completion_queue_factory* factory,
const grpc_completion_queue_attributes* attr, void* reserved) {
GPR_ASSERT(!reserved);
return factory->vtable->create(factory, attr);
}

@ -41,13 +41,8 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/compress_filter.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/deadline_filter.h"
#include "src/core/lib/channel/handshaker_registry.h" #include "src/core/lib/channel/handshaker_registry.h"
#include "src/core/lib/channel/http_client_filter.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/channel/message_size_filter.h"
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/http/parser.h" #include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/combiner.h" #include "src/core/lib/iomgr/combiner.h"
@ -95,57 +90,13 @@ static bool prepend_filter(grpc_exec_ctx *exec_ctx,
builder, (const grpc_channel_filter *)arg, NULL, NULL); builder, (const grpc_channel_filter *)arg, NULL, NULL);
} }
static bool maybe_add_http_filter(grpc_exec_ctx *exec_ctx,
grpc_channel_stack_builder *builder,
void *arg) {
grpc_transport *t = grpc_channel_stack_builder_get_transport(builder);
if (t && strstr(t->vtable->name, "http")) {
return grpc_channel_stack_builder_prepend_filter(
builder, (const grpc_channel_filter *)arg, NULL, NULL);
}
return true;
}
static void register_builtin_channel_init() { static void register_builtin_channel_init() {
grpc_channel_init_register_stage(
GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
prepend_filter, (void *)&grpc_client_deadline_filter);
grpc_channel_init_register_stage(
GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, prepend_filter,
(void *)&grpc_server_deadline_filter);
grpc_channel_init_register_stage(
GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
prepend_filter, (void *)&grpc_message_size_filter);
grpc_channel_init_register_stage(
GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
prepend_filter, (void *)&grpc_message_size_filter);
grpc_channel_init_register_stage(
GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, prepend_filter,
(void *)&grpc_message_size_filter);
grpc_channel_init_register_stage(
GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, prepend_filter,
(void *)&grpc_compress_filter);
grpc_channel_init_register_stage(
GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
prepend_filter, (void *)&grpc_compress_filter);
grpc_channel_init_register_stage(
GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, prepend_filter,
(void *)&grpc_compress_filter);
grpc_channel_init_register_stage(
GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_http_filter, (void *)&grpc_http_client_filter);
grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
grpc_add_connected_filter, NULL); grpc_add_connected_filter, NULL);
grpc_channel_init_register_stage(
GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_http_filter, (void *)&grpc_http_client_filter);
grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
grpc_add_connected_filter, NULL); grpc_add_connected_filter, NULL);
grpc_channel_init_register_stage(
GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
maybe_add_http_filter, (void *)&grpc_http_server_filter);
grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL,
GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
grpc_add_connected_filter, NULL); grpc_add_connected_filter, NULL);
@ -189,7 +140,6 @@ void grpc_init(void) {
grpc_register_tracer("channel_stack_builder", grpc_register_tracer("channel_stack_builder",
&grpc_trace_channel_stack_builder); &grpc_trace_channel_stack_builder);
grpc_register_tracer("http1", &grpc_http1_trace); grpc_register_tracer("http1", &grpc_http1_trace);
grpc_register_tracer("compression", &grpc_compression_trace);
grpc_register_tracer("queue_pluck", &grpc_cq_pluck_trace); grpc_register_tracer("queue_pluck", &grpc_cq_pluck_trace);
grpc_register_tracer("combiner", &grpc_combiner_trace); grpc_register_tracer("combiner", &grpc_combiner_trace);
grpc_register_tracer("server_channel", &grpc_server_channel_trace); grpc_register_tracer("server_channel", &grpc_server_channel_trace);

@ -1000,6 +1000,15 @@ void grpc_server_register_completion_queue(grpc_server *server,
GRPC_API_TRACE( GRPC_API_TRACE(
"grpc_server_register_completion_queue(server=%p, cq=%p, reserved=%p)", 3, "grpc_server_register_completion_queue(server=%p, cq=%p, reserved=%p)", 3,
(server, cq, reserved)); (server, cq, reserved));
if (grpc_get_cq_completion_type(cq) != GRPC_CQ_NEXT) {
gpr_log(GPR_INFO,
"Completion queue which is not of type GRPC_CQ_NEXT is being "
"registered as a server-completion-queue");
/* Ideally we should log an error and abort but ruby-wrapped-language API
calls grpc_completion_queue_pluck() on server completion queues */
}
register_completion_queue(server, cq, false, reserved); register_completion_queue(server, cq, false, reserved);
} }

@ -36,6 +36,6 @@
#include <grpc/grpc.h> #include <grpc/grpc.h>
const char *grpc_version_string(void) { return "3.0.0-dev"; } const char *grpc_version_string(void) { return "4.0.0-dev"; }
const char *grpc_g_stands_for(void) { return "gentle"; } const char *grpc_g_stands_for(void) { return "gentle"; }

@ -33,16 +33,24 @@
#include <grpc/grpc.h> #include <grpc/grpc.h>
extern void grpc_http_filters_init(void);
extern void grpc_http_filters_shutdown(void);
extern void grpc_chttp2_plugin_init(void); extern void grpc_chttp2_plugin_init(void);
extern void grpc_chttp2_plugin_shutdown(void); extern void grpc_chttp2_plugin_shutdown(void);
extern void grpc_deadline_filter_init(void);
extern void grpc_deadline_filter_shutdown(void);
extern void grpc_client_channel_init(void); extern void grpc_client_channel_init(void);
extern void grpc_client_channel_shutdown(void); extern void grpc_client_channel_shutdown(void);
extern void grpc_load_reporting_plugin_init(void); extern void grpc_load_reporting_plugin_init(void);
extern void grpc_load_reporting_plugin_shutdown(void); extern void grpc_load_reporting_plugin_shutdown(void);
void grpc_register_built_in_plugins(void) { void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
grpc_http_filters_shutdown);
grpc_register_plugin(grpc_chttp2_plugin_init, grpc_register_plugin(grpc_chttp2_plugin_init,
grpc_chttp2_plugin_shutdown); grpc_chttp2_plugin_shutdown);
grpc_register_plugin(grpc_deadline_filter_init,
grpc_deadline_filter_shutdown);
grpc_register_plugin(grpc_client_channel_init, grpc_register_plugin(grpc_client_channel_init,
grpc_client_channel_shutdown); grpc_client_channel_shutdown);
grpc_register_plugin(grpc_load_reporting_plugin_init, grpc_register_plugin(grpc_load_reporting_plugin_init,

@ -33,8 +33,12 @@
#include <grpc/grpc.h> #include <grpc/grpc.h>
extern void grpc_http_filters_init(void);
extern void grpc_http_filters_shutdown(void);
extern void grpc_chttp2_plugin_init(void); extern void grpc_chttp2_plugin_init(void);
extern void grpc_chttp2_plugin_shutdown(void); extern void grpc_chttp2_plugin_shutdown(void);
extern void grpc_deadline_filter_init(void);
extern void grpc_deadline_filter_shutdown(void);
extern void grpc_client_channel_init(void); extern void grpc_client_channel_init(void);
extern void grpc_client_channel_shutdown(void); extern void grpc_client_channel_shutdown(void);
extern void grpc_lb_policy_grpclb_init(void); extern void grpc_lb_policy_grpclb_init(void);
@ -55,10 +59,16 @@ extern void census_grpc_plugin_init(void);
extern void census_grpc_plugin_shutdown(void); extern void census_grpc_plugin_shutdown(void);
extern void grpc_max_age_filter_init(void); extern void grpc_max_age_filter_init(void);
extern void grpc_max_age_filter_shutdown(void); extern void grpc_max_age_filter_shutdown(void);
extern void grpc_message_size_filter_init(void);
extern void grpc_message_size_filter_shutdown(void);
void grpc_register_built_in_plugins(void) { void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
grpc_http_filters_shutdown);
grpc_register_plugin(grpc_chttp2_plugin_init, grpc_register_plugin(grpc_chttp2_plugin_init,
grpc_chttp2_plugin_shutdown); grpc_chttp2_plugin_shutdown);
grpc_register_plugin(grpc_deadline_filter_init,
grpc_deadline_filter_shutdown);
grpc_register_plugin(grpc_client_channel_init, grpc_register_plugin(grpc_client_channel_init,
grpc_client_channel_shutdown); grpc_client_channel_shutdown);
grpc_register_plugin(grpc_lb_policy_grpclb_init, grpc_register_plugin(grpc_lb_policy_grpclb_init,
@ -79,4 +89,6 @@ void grpc_register_built_in_plugins(void) {
census_grpc_plugin_shutdown); census_grpc_plugin_shutdown);
grpc_register_plugin(grpc_max_age_filter_init, grpc_register_plugin(grpc_max_age_filter_init,
grpc_max_age_filter_shutdown); grpc_max_age_filter_shutdown);
grpc_register_plugin(grpc_message_size_filter_init,
grpc_message_size_filter_shutdown);
} }

@ -33,8 +33,12 @@
#include <grpc/grpc.h> #include <grpc/grpc.h>
extern void grpc_http_filters_init(void);
extern void grpc_http_filters_shutdown(void);
extern void grpc_chttp2_plugin_init(void); extern void grpc_chttp2_plugin_init(void);
extern void grpc_chttp2_plugin_shutdown(void); extern void grpc_chttp2_plugin_shutdown(void);
extern void grpc_deadline_filter_init(void);
extern void grpc_deadline_filter_shutdown(void);
extern void grpc_client_channel_init(void); extern void grpc_client_channel_init(void);
extern void grpc_client_channel_shutdown(void); extern void grpc_client_channel_shutdown(void);
extern void grpc_resolver_dns_ares_init(void); extern void grpc_resolver_dns_ares_init(void);
@ -55,10 +59,16 @@ extern void census_grpc_plugin_init(void);
extern void census_grpc_plugin_shutdown(void); extern void census_grpc_plugin_shutdown(void);
extern void grpc_max_age_filter_init(void); extern void grpc_max_age_filter_init(void);
extern void grpc_max_age_filter_shutdown(void); extern void grpc_max_age_filter_shutdown(void);
extern void grpc_message_size_filter_init(void);
extern void grpc_message_size_filter_shutdown(void);
void grpc_register_built_in_plugins(void) { void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_http_filters_init,
grpc_http_filters_shutdown);
grpc_register_plugin(grpc_chttp2_plugin_init, grpc_register_plugin(grpc_chttp2_plugin_init,
grpc_chttp2_plugin_shutdown); grpc_chttp2_plugin_shutdown);
grpc_register_plugin(grpc_deadline_filter_init,
grpc_deadline_filter_shutdown);
grpc_register_plugin(grpc_client_channel_init, grpc_register_plugin(grpc_client_channel_init,
grpc_client_channel_shutdown); grpc_client_channel_shutdown);
grpc_register_plugin(grpc_resolver_dns_ares_init, grpc_register_plugin(grpc_resolver_dns_ares_init,
@ -79,4 +89,6 @@ void grpc_register_built_in_plugins(void) {
census_grpc_plugin_shutdown); census_grpc_plugin_shutdown);
grpc_register_plugin(grpc_max_age_filter_init, grpc_register_plugin(grpc_max_age_filter_init,
grpc_max_age_filter_shutdown); grpc_max_age_filter_shutdown);
grpc_register_plugin(grpc_message_size_filter_init,
grpc_message_size_filter_shutdown);
} }

@ -54,9 +54,14 @@ struct grpc_byte_buffer;
namespace grpc { namespace grpc {
grpc_completion_queue* CoreCodegen::grpc_completion_queue_create( grpc_completion_queue* CoreCodegen::grpc_completion_queue_create_for_next(
void* reserved) { void* reserved) {
return ::grpc_completion_queue_create(reserved); return ::grpc_completion_queue_create_for_next(reserved);
}
grpc_completion_queue* CoreCodegen::grpc_completion_queue_create_for_pluck(
void* reserved) {
return ::grpc_completion_queue_create_for_pluck(reserved);
} }
void CoreCodegen::grpc_completion_queue_destroy(grpc_completion_queue* cq) { void CoreCodegen::grpc_completion_queue_destroy(grpc_completion_queue* cq) {

@ -124,6 +124,14 @@ class ShutdownTag : public CompletionQueueTag {
bool FinalizeResult(void** tag, bool* status) { return false; } bool FinalizeResult(void** tag, bool* status) { return false; }
}; };
class DummyTag : public CompletionQueueTag {
public:
bool FinalizeResult(void** tag, bool* status) {
*status = true;
return true;
}
};
class Server::SyncRequest final : public CompletionQueueTag { class Server::SyncRequest final : public CompletionQueueTag {
public: public:
SyncRequest(RpcServiceMethod* method, void* tag) SyncRequest(RpcServiceMethod* method, void* tag)
@ -145,7 +153,7 @@ class Server::SyncRequest final : public CompletionQueueTag {
grpc_metadata_array_destroy(&request_metadata_); grpc_metadata_array_destroy(&request_metadata_);
} }
void SetupRequest() { cq_ = grpc_completion_queue_create(nullptr); } void SetupRequest() { cq_ = grpc_completion_queue_create_for_pluck(nullptr); }
void TeardownRequest() { void TeardownRequest() {
grpc_completion_queue_destroy(cq_); grpc_completion_queue_destroy(cq_);
@ -213,10 +221,15 @@ class Server::SyncRequest final : public CompletionQueueTag {
MethodHandler::HandlerParameter(&call_, &ctx_, request_payload_)); MethodHandler::HandlerParameter(&call_, &ctx_, request_payload_));
global_callbacks->PostSynchronousRequest(&ctx_); global_callbacks->PostSynchronousRequest(&ctx_);
request_payload_ = nullptr; request_payload_ = nullptr;
void* ignored_tag;
bool ignored_ok;
cq_.Shutdown(); cq_.Shutdown();
GPR_ASSERT(cq_.Next(&ignored_tag, &ignored_ok) == false);
CompletionQueueTag* op_tag = ctx_.GetCompletionOpTag();
cq_.TryPluck(op_tag, gpr_inf_future(GPR_CLOCK_REALTIME));
/* Ensure the cq_ is shutdown */
DummyTag ignored_tag;
GPR_ASSERT(cq_.Pluck(&ignored_tag) == false);
} }
private: private:

@ -167,6 +167,10 @@ void ServerContext::BeginCompletionOp(Call* call) {
call->PerformOps(completion_op_); call->PerformOps(completion_op_);
} }
CompletionQueueTag* ServerContext::GetCompletionOpTag() {
return static_cast<CompletionQueueTag*>(completion_op_);
}
void ServerContext::AddInitialMetadata(const grpc::string& key, void ServerContext::AddInitialMetadata(const grpc::string& key,
const grpc::string& value) { const grpc::string& value) {
initial_metadata_.insert(std::make_pair(key, value)); initial_metadata_.insert(std::make_pair(key, value));

@ -43,19 +43,19 @@ namespace Grpc.Core.Internal.Tests
public class CompletionQueueSafeHandleTest public class CompletionQueueSafeHandleTest
{ {
[Test] [Test]
public void CreateAndDestroy() public void CreateSyncAndDestroy()
{ {
GrpcEnvironment.AddRef(); GrpcEnvironment.AddRef();
var cq = CompletionQueueSafeHandle.Create(); var cq = CompletionQueueSafeHandle.CreateSync();
cq.Dispose(); cq.Dispose();
GrpcEnvironment.ReleaseAsync().Wait(); GrpcEnvironment.ReleaseAsync().Wait();
} }
[Test] [Test]
public void CreateAndShutdown() public void CreateAsyncAndShutdown()
{ {
GrpcEnvironment.AddRef(); var env = GrpcEnvironment.AddRef();
var cq = CompletionQueueSafeHandle.Create(); var cq = CompletionQueueSafeHandle.CreateAsync(new CompletionRegistry(env));
cq.Shutdown(); cq.Shutdown();
var ev = cq.Next(); var ev = cq.Next();
cq.Dispose(); cq.Dispose();

@ -53,7 +53,7 @@ namespace Grpc.Core.Tests
/// (~1.26us .NET Windows) /// (~1.26us .NET Windows)
/// </summary> /// </summary>
[Test] [Test]
public void CompletionQueueCreateDestroyBenchmark() public void CompletionQueueCreateSyncDestroyBenchmark()
{ {
GrpcEnvironment.AddRef(); // completion queue requires gRPC environment being initialized. GrpcEnvironment.AddRef(); // completion queue requires gRPC environment being initialized.
@ -61,7 +61,7 @@ namespace Grpc.Core.Tests
10, 10, 10, 10,
() => () =>
{ {
CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.Create(); CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.CreateSync();
cq.Dispose(); cq.Dispose();
}); });

@ -87,7 +87,7 @@ namespace Grpc.Core.Internal
var profiler = Profilers.ForCurrentThread(); var profiler = Profilers.ForCurrentThread();
using (profiler.NewScope("AsyncCall.UnaryCall")) using (profiler.NewScope("AsyncCall.UnaryCall"))
using (CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.Create()) using (CompletionQueueSafeHandle cq = CompletionQueueSafeHandle.CreateSync())
{ {
byte[] payload = UnsafeSerialize(msg); byte[] payload = UnsafeSerialize(msg);

@ -51,14 +51,20 @@ namespace Grpc.Core.Internal
{ {
} }
public static CompletionQueueSafeHandle Create() /// <summary>
/// Create a completion queue that can only be used for Pluck operations.
/// </summary>
public static CompletionQueueSafeHandle CreateSync()
{ {
return Native.grpcsharp_completion_queue_create(); return Native.grpcsharp_completion_queue_create_sync();
} }
public static CompletionQueueSafeHandle Create(CompletionRegistry completionRegistry) /// <summary>
/// Create a completion queue that can only be used for Next operations.
/// </summary>
public static CompletionQueueSafeHandle CreateAsync(CompletionRegistry completionRegistry)
{ {
var cq = Native.grpcsharp_completion_queue_create(); var cq = Native.grpcsharp_completion_queue_create_async();
cq.completionRegistry = completionRegistry; cq.completionRegistry = completionRegistry;
return cq; return cq;
} }

@ -197,7 +197,7 @@ namespace Grpc.Core.Internal
for (int i = 0; i < completionQueueCount; i++) for (int i = 0; i < completionQueueCount; i++)
{ {
var completionRegistry = new CompletionRegistry(environment); var completionRegistry = new CompletionRegistry(environment);
list.Add(CompletionQueueSafeHandle.Create(completionRegistry)); list.Add(CompletionQueueSafeHandle.CreateAsync(completionRegistry));
} }
return list.AsReadOnly(); return list.AsReadOnly();
} }

@ -115,7 +115,8 @@ namespace Grpc.Core.Internal
public readonly Delegates.grpcsharp_sizeof_grpc_event_delegate grpcsharp_sizeof_grpc_event; public readonly Delegates.grpcsharp_sizeof_grpc_event_delegate grpcsharp_sizeof_grpc_event;
public readonly Delegates.grpcsharp_completion_queue_create_delegate grpcsharp_completion_queue_create; public readonly Delegates.grpcsharp_completion_queue_create_async_delegate grpcsharp_completion_queue_create_async;
public readonly Delegates.grpcsharp_completion_queue_create_sync_delegate grpcsharp_completion_queue_create_sync;
public readonly Delegates.grpcsharp_completion_queue_shutdown_delegate grpcsharp_completion_queue_shutdown; public readonly Delegates.grpcsharp_completion_queue_shutdown_delegate grpcsharp_completion_queue_shutdown;
public readonly Delegates.grpcsharp_completion_queue_next_delegate grpcsharp_completion_queue_next; public readonly Delegates.grpcsharp_completion_queue_next_delegate grpcsharp_completion_queue_next;
public readonly Delegates.grpcsharp_completion_queue_pluck_delegate grpcsharp_completion_queue_pluck; public readonly Delegates.grpcsharp_completion_queue_pluck_delegate grpcsharp_completion_queue_pluck;
@ -229,7 +230,8 @@ namespace Grpc.Core.Internal
this.grpcsharp_sizeof_grpc_event = GetMethodDelegate<Delegates.grpcsharp_sizeof_grpc_event_delegate>(library); this.grpcsharp_sizeof_grpc_event = GetMethodDelegate<Delegates.grpcsharp_sizeof_grpc_event_delegate>(library);
this.grpcsharp_completion_queue_create = GetMethodDelegate<Delegates.grpcsharp_completion_queue_create_delegate>(library); this.grpcsharp_completion_queue_create_async = GetMethodDelegate<Delegates.grpcsharp_completion_queue_create_async_delegate>(library);
this.grpcsharp_completion_queue_create_sync = GetMethodDelegate<Delegates.grpcsharp_completion_queue_create_sync_delegate>(library);
this.grpcsharp_completion_queue_shutdown = GetMethodDelegate<Delegates.grpcsharp_completion_queue_shutdown_delegate>(library); this.grpcsharp_completion_queue_shutdown = GetMethodDelegate<Delegates.grpcsharp_completion_queue_shutdown_delegate>(library);
this.grpcsharp_completion_queue_next = GetMethodDelegate<Delegates.grpcsharp_completion_queue_next_delegate>(library); this.grpcsharp_completion_queue_next = GetMethodDelegate<Delegates.grpcsharp_completion_queue_next_delegate>(library);
this.grpcsharp_completion_queue_pluck = GetMethodDelegate<Delegates.grpcsharp_completion_queue_pluck_delegate>(library); this.grpcsharp_completion_queue_pluck = GetMethodDelegate<Delegates.grpcsharp_completion_queue_pluck_delegate>(library);
@ -383,7 +385,8 @@ namespace Grpc.Core.Internal
public delegate int grpcsharp_sizeof_grpc_event_delegate(); public delegate int grpcsharp_sizeof_grpc_event_delegate();
public delegate CompletionQueueSafeHandle grpcsharp_completion_queue_create_delegate(); public delegate CompletionQueueSafeHandle grpcsharp_completion_queue_create_async_delegate();
public delegate CompletionQueueSafeHandle grpcsharp_completion_queue_create_sync_delegate();
public delegate void grpcsharp_completion_queue_shutdown_delegate(CompletionQueueSafeHandle cq); public delegate void grpcsharp_completion_queue_shutdown_delegate(CompletionQueueSafeHandle cq);
public delegate CompletionQueueEvent grpcsharp_completion_queue_next_delegate(CompletionQueueSafeHandle cq); public delegate CompletionQueueEvent grpcsharp_completion_queue_next_delegate(CompletionQueueSafeHandle cq);
public delegate CompletionQueueEvent grpcsharp_completion_queue_pluck_delegate(CompletionQueueSafeHandle cq, IntPtr tag); public delegate CompletionQueueEvent grpcsharp_completion_queue_pluck_delegate(CompletionQueueSafeHandle cq, IntPtr tag);

@ -354,8 +354,13 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_shutdown(void) { grpc_shutdown(); }
/* Completion queue */ /* Completion queue */
GPR_EXPORT grpc_completion_queue *GPR_CALLTYPE GPR_EXPORT grpc_completion_queue *GPR_CALLTYPE
grpcsharp_completion_queue_create(void) { grpcsharp_completion_queue_create_async(void) {
return grpc_completion_queue_create(NULL); return grpc_completion_queue_create_for_next(NULL);
}
GPR_EXPORT grpc_completion_queue *GPR_CALLTYPE
grpcsharp_completion_queue_create_sync(void) {
return grpc_completion_queue_create_for_pluck(NULL);
} }
GPR_EXPORT void GPR_CALLTYPE GPR_EXPORT void GPR_CALLTYPE

@ -34,14 +34,14 @@
/* I don't like using #ifndef, but I don't see a better way to do this */ /* I don't like using #ifndef, but I don't see a better way to do this */
#ifndef GRPC_UV #ifndef GRPC_UV
#include <node.h>
#include <nan.h> #include <nan.h>
#include <node.h>
#include "call.h"
#include "completion_queue.h"
#include "grpc/grpc.h" #include "grpc/grpc.h"
#include "grpc/support/log.h" #include "grpc/support/log.h"
#include "grpc/support/time.h" #include "grpc/support/time.h"
#include "completion_queue.h"
#include "call.h"
namespace grpc { namespace grpc {
namespace node { namespace node {
@ -111,8 +111,8 @@ CompletionQueueAsyncWorker::CompletionQueueAsyncWorker()
CompletionQueueAsyncWorker::~CompletionQueueAsyncWorker() {} CompletionQueueAsyncWorker::~CompletionQueueAsyncWorker() {}
void CompletionQueueAsyncWorker::Execute() { void CompletionQueueAsyncWorker::Execute() {
result = result = grpc_completion_queue_next(queue, gpr_inf_future(GPR_CLOCK_REALTIME),
grpc_completion_queue_next(queue, gpr_inf_future(GPR_CLOCK_REALTIME), NULL); NULL);
if (!result.success) { if (!result.success) {
SetErrorMessage("The async function encountered an error"); SetErrorMessage("The async function encountered an error");
} }
@ -141,7 +141,7 @@ void CompletionQueueAsyncWorker::Init(Local<Object> exports) {
Nan::HandleScope scope; Nan::HandleScope scope;
current_threads = 0; current_threads = 0;
waiting_next_calls = 0; waiting_next_calls = 0;
queue = grpc_completion_queue_create(NULL); queue = grpc_completion_queue_create_for_next(NULL);
} }
void CompletionQueueAsyncWorker::HandleOKCallback() { void CompletionQueueAsyncWorker::HandleOKCallback() {
@ -168,9 +168,7 @@ grpc_completion_queue *GetCompletionQueue() {
return CompletionQueueAsyncWorker::GetQueue(); return CompletionQueueAsyncWorker::GetQueue();
} }
void CompletionQueueNext() { void CompletionQueueNext() { CompletionQueueAsyncWorker::Next(); }
CompletionQueueAsyncWorker::Next();
}
void CompletionQueueInit(Local<Object> exports) { void CompletionQueueInit(Local<Object> exports) {
CompletionQueueAsyncWorker::Init(exports); CompletionQueueAsyncWorker::Init(exports);
@ -179,4 +177,4 @@ void CompletionQueueInit(Local<Object> exports) {
} // namespace node } // namespace node
} // namespace grpc } // namespace grpc
#endif /* GRPC_UV */ #endif /* GRPC_UV */

@ -33,10 +33,10 @@
#ifdef GRPC_UV #ifdef GRPC_UV
#include <uv.h> #include <grpc/grpc.h>
#include <node.h> #include <node.h>
#include <uv.h>
#include <v8.h> #include <v8.h>
#include <grpc/grpc.h>
#include "call.h" #include "call.h"
#include "completion_queue.h" #include "completion_queue.h"
@ -57,8 +57,8 @@ void drain_completion_queue(uv_prepare_t *handle) {
grpc_event event; grpc_event event;
(void)handle; (void)handle;
do { do {
event = grpc_completion_queue_next( event = grpc_completion_queue_next(queue, gpr_inf_past(GPR_CLOCK_MONOTONIC),
queue, gpr_inf_past(GPR_CLOCK_MONOTONIC), NULL); NULL);
if (event.type == GRPC_OP_COMPLETE) { if (event.type == GRPC_OP_COMPLETE) {
const char *error_message; const char *error_message;
@ -77,9 +77,7 @@ void drain_completion_queue(uv_prepare_t *handle) {
} while (event.type != GRPC_QUEUE_TIMEOUT); } while (event.type != GRPC_QUEUE_TIMEOUT);
} }
grpc_completion_queue *GetCompletionQueue() { grpc_completion_queue *GetCompletionQueue() { return queue; }
return queue;
}
void CompletionQueueNext() { void CompletionQueueNext() {
if (pending_batches == 0) { if (pending_batches == 0) {
@ -90,7 +88,7 @@ void CompletionQueueNext() {
} }
void CompletionQueueInit(Local<Object> exports) { void CompletionQueueInit(Local<Object> exports) {
queue = grpc_completion_queue_create(NULL); queue = grpc_completion_queue_create_for_next(NULL);
uv_prepare_init(uv_default_loop(), &prepare); uv_prepare_init(uv_default_loop(), &prepare);
pending_batches = 0; pending_batches = 0;
} }

@ -35,8 +35,8 @@
#include "server.h" #include "server.h"
#include <node.h>
#include <nan.h> #include <nan.h>
#include <node.h>
#include "grpc/grpc.h" #include "grpc/grpc.h"
#include "grpc/support/time.h" #include "grpc/support/time.h"
@ -44,7 +44,7 @@ namespace grpc {
namespace node { namespace node {
Server::Server(grpc_server *server) : wrapped_server(server) { Server::Server(grpc_server *server) : wrapped_server(server) {
shutdown_queue = grpc_completion_queue_create(NULL); shutdown_queue = grpc_completion_queue_create_for_pluck(NULL);
grpc_server_register_non_listening_completion_queue(server, shutdown_queue, grpc_server_register_non_listening_completion_queue(server, shutdown_queue,
NULL); NULL);
} }

@ -48,7 +48,7 @@
- (instancetype)init { - (instancetype)init {
if ((self = [super init])) { if ((self = [super init])) {
_unmanagedQueue = grpc_completion_queue_create(NULL); _unmanagedQueue = grpc_completion_queue_create_for_next(NULL);
// This is for the following block to capture the pointer by value (instead // This is for the following block to capture the pointer by value (instead
// of retaining self and doing self->_unmanagedQueue). This is essential // of retaining self and doing self->_unmanagedQueue). This is essential

@ -79,7 +79,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "127.0.0.1", port); gpr_join_host_port(&ffd->localaddr, "127.0.0.1", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -160,7 +160,7 @@ unsigned int parse_h2_length(const char *field) {
int port = grpc_pick_unused_port_or_die(); int port = grpc_pick_unused_port_or_die();
char *addr; char *addr;
gpr_join_host_port(&addr, "127.0.0.1", port); gpr_join_host_port(&addr, "127.0.0.1", port);
grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
stream_engine *cronetEngine = [Cronet getGlobalEngine]; stream_engine *cronetEngine = [Cronet getGlobalEngine];
grpc_channel *client = grpc_channel *client =
grpc_cronet_secure_channel_create(cronetEngine, addr, NULL, NULL); grpc_cronet_secure_channel_create(cronetEngine, addr, NULL, NULL);
@ -295,7 +295,7 @@ unsigned int parse_h2_length(const char *field) {
int port = grpc_pick_unused_port_or_die(); int port = grpc_pick_unused_port_or_die();
char *addr; char *addr;
gpr_join_host_port(&addr, "127.0.0.1", port); gpr_join_host_port(&addr, "127.0.0.1", port);
grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
stream_engine *cronetEngine = [Cronet getGlobalEngine]; stream_engine *cronetEngine = [Cronet getGlobalEngine];
grpc_channel *client = grpc_channel *client =
grpc_cronet_secure_channel_create(cronetEngine, addr, args, NULL); grpc_cronet_secure_channel_create(cronetEngine, addr, args, NULL);

@ -38,13 +38,10 @@
grpc_completion_queue *completion_queue; grpc_completion_queue *completion_queue;
void grpc_php_init_completion_queue(TSRMLS_D) { void grpc_php_init_completion_queue(TSRMLS_D) {
completion_queue = grpc_completion_queue_create(NULL); completion_queue = grpc_completion_queue_create_for_pluck(NULL);
} }
void grpc_php_shutdown_completion_queue(TSRMLS_D) { void grpc_php_shutdown_completion_queue(TSRMLS_D) {
grpc_completion_queue_shutdown(completion_queue); grpc_completion_queue_shutdown(completion_queue);
while (grpc_completion_queue_next(completion_queue,
gpr_inf_future(GPR_CLOCK_REALTIME),
NULL).type != GRPC_QUEUE_SHUTDOWN);
grpc_completion_queue_destroy(completion_queue); grpc_completion_queue_destroy(completion_queue);
} }

@ -40,7 +40,7 @@ cdef class CompletionQueue:
def __cinit__(self): def __cinit__(self):
grpc_init() grpc_init()
with nogil: with nogil:
self.c_completion_queue = grpc_completion_queue_create(NULL) self.c_completion_queue = grpc_completion_queue_create_for_next(NULL)
self.is_shutting_down = False self.is_shutting_down = False
self.is_shutdown = False self.is_shutdown = False

@ -309,7 +309,8 @@ cdef extern from "grpc/grpc.h":
void grpc_init() nogil void grpc_init() nogil
void grpc_shutdown() nogil void grpc_shutdown() nogil
grpc_completion_queue *grpc_completion_queue_create(void *reserved) nogil grpc_completion_queue *grpc_completion_queue_create_for_next(void *reserved) nogil
grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, grpc_event grpc_completion_queue_next(grpc_completion_queue *cq,
gpr_timespec deadline, gpr_timespec deadline,
void *reserved) nogil void *reserved) nogil

@ -80,15 +80,10 @@ CORE_SOURCE_FILES = [
'src/core/lib/channel/channel_args.c', 'src/core/lib/channel/channel_args.c',
'src/core/lib/channel/channel_stack.c', 'src/core/lib/channel/channel_stack.c',
'src/core/lib/channel/channel_stack_builder.c', 'src/core/lib/channel/channel_stack_builder.c',
'src/core/lib/channel/compress_filter.c',
'src/core/lib/channel/connected_channel.c', 'src/core/lib/channel/connected_channel.c',
'src/core/lib/channel/deadline_filter.c',
'src/core/lib/channel/handshaker.c', 'src/core/lib/channel/handshaker.c',
'src/core/lib/channel/handshaker_factory.c', 'src/core/lib/channel/handshaker_factory.c',
'src/core/lib/channel/handshaker_registry.c', 'src/core/lib/channel/handshaker_registry.c',
'src/core/lib/channel/http_client_filter.c',
'src/core/lib/channel/http_server_filter.c',
'src/core/lib/channel/message_size_filter.c',
'src/core/lib/compression/compression.c', 'src/core/lib/compression/compression.c',
'src/core/lib/compression/message_compress.c', 'src/core/lib/compression/message_compress.c',
'src/core/lib/debug/trace.c', 'src/core/lib/debug/trace.c',
@ -225,6 +220,10 @@ CORE_SOURCE_FILES = [
'src/core/ext/transport/chttp2/transport/varint.c', 'src/core/ext/transport/chttp2/transport/varint.c',
'src/core/ext/transport/chttp2/transport/writing.c', 'src/core/ext/transport/chttp2/transport/writing.c',
'src/core/ext/transport/chttp2/alpn/alpn.c', 'src/core/ext/transport/chttp2/alpn/alpn.c',
'src/core/ext/filters/http/client/http_client_filter.c',
'src/core/ext/filters/http/http_filters_plugin.c',
'src/core/ext/filters/http/message_compress/message_compress_filter.c',
'src/core/ext/filters/http/server/http_server_filter.c',
'src/core/lib/http/httpcli_security_connector.c', 'src/core/lib/http/httpcli_security_connector.c',
'src/core/lib/security/context/security_context.c', 'src/core/lib/security/context/security_context.c',
'src/core/lib/security/credentials/composite/composite_credentials.c', 'src/core/lib/security/credentials/composite/composite_credentials.c',
@ -274,6 +273,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/client_channel/subchannel.c', 'src/core/ext/filters/client_channel/subchannel.c',
'src/core/ext/filters/client_channel/subchannel_index.c', 'src/core/ext/filters/client_channel/subchannel_index.c',
'src/core/ext/filters/client_channel/uri_parser.c', 'src/core/ext/filters/client_channel/uri_parser.c',
'src/core/ext/filters/deadline/deadline_filter.c',
'src/core/ext/transport/chttp2/client/chttp2_connector.c', 'src/core/ext/transport/chttp2/client/chttp2_connector.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c',
@ -310,6 +310,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/census/trace_context.c', 'src/core/ext/census/trace_context.c',
'src/core/ext/census/tracing.c', 'src/core/ext/census/tracing.c',
'src/core/ext/filters/max_age/max_age_filter.c', 'src/core/ext/filters/max_age/max_age_filter.c',
'src/core/ext/filters/message_size/message_size_filter.c',
'src/core/plugin_registry/grpc_plugin_registry.c', 'src/core/plugin_registry/grpc_plugin_registry.c',
'src/boringssl/err_data.c', 'src/boringssl/err_data.c',
'third_party/boringssl/crypto/aes/aes.c', 'third_party/boringssl/crypto/aes/aes.c',

@ -351,7 +351,7 @@ static VALUE grpc_rb_channel_create_call(VALUE self, VALUE parent, VALUE mask,
parent_call = grpc_rb_get_wrapped_call(parent); parent_call = grpc_rb_get_wrapped_call(parent);
} }
cq = grpc_completion_queue_create(NULL); cq = grpc_completion_queue_create_for_pluck(NULL);
TypedData_Get_Struct(self, grpc_rb_channel, &grpc_channel_data_type, wrapper); TypedData_Get_Struct(self, grpc_rb_channel, &grpc_channel_data_type, wrapper);
ch = wrapper->wrapped; ch = wrapper->wrapped;
if (ch == NULL) { if (ch == NULL) {
@ -522,7 +522,7 @@ static VALUE run_poll_channels_loop(VALUE arg) {
* TODO(apolcyn) remove this when core handles new RPCs on dead connections. * TODO(apolcyn) remove this when core handles new RPCs on dead connections.
*/ */
static void start_poll_channels_loop() { static void start_poll_channels_loop() {
channel_polling_cq = grpc_completion_queue_create(NULL); channel_polling_cq = grpc_completion_queue_create_for_next(NULL);
gpr_mu_init(&global_connection_polling_mu); gpr_mu_init(&global_connection_polling_mu);
abort_channel_polling = 0; abort_channel_polling = 0;
rb_thread_create(run_poll_channels_loop, NULL); rb_thread_create(run_poll_channels_loop, NULL);

@ -233,7 +233,7 @@ extern grpc_completion_queue_create_for_next_type grpc_completion_queue_create_f
typedef grpc_completion_queue *(*grpc_completion_queue_create_for_pluck_type)(void *reserved); typedef grpc_completion_queue *(*grpc_completion_queue_create_for_pluck_type)(void *reserved);
extern grpc_completion_queue_create_for_pluck_type grpc_completion_queue_create_for_pluck_import; extern grpc_completion_queue_create_for_pluck_type grpc_completion_queue_create_for_pluck_import;
#define grpc_completion_queue_create_for_pluck grpc_completion_queue_create_for_pluck_import #define grpc_completion_queue_create_for_pluck grpc_completion_queue_create_for_pluck_import
typedef grpc_completion_queue *(*grpc_completion_queue_create_type)(void *reserved); typedef grpc_completion_queue *(*grpc_completion_queue_create_type)(const grpc_completion_queue_factory *factory, const grpc_completion_queue_attributes *attributes, void *reserved);
extern grpc_completion_queue_create_type grpc_completion_queue_create_import; extern grpc_completion_queue_create_type grpc_completion_queue_create_import;
#define grpc_completion_queue_create grpc_completion_queue_create_import #define grpc_completion_queue_create grpc_completion_queue_create_import
typedef grpc_event(*grpc_completion_queue_next_type)(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved); typedef grpc_event(*grpc_completion_queue_next_type)(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved);

@ -37,15 +37,15 @@
#include "rb_server.h" #include "rb_server.h"
#include <grpc/grpc.h> #include <grpc/grpc.h>
#include <grpc/support/atm.h>
#include <grpc/grpc_security.h> #include <grpc/grpc_security.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "rb_byte_buffer.h"
#include "rb_call.h" #include "rb_call.h"
#include "rb_channel_args.h" #include "rb_channel_args.h"
#include "rb_completion_queue.h" #include "rb_completion_queue.h"
#include "rb_server_credentials.h"
#include "rb_byte_buffer.h"
#include "rb_grpc.h" #include "rb_grpc.h"
#include "rb_server_credentials.h"
/* grpc_rb_cServer is the ruby class that proxies grpc_server. */ /* grpc_rb_cServer is the ruby class that proxies grpc_server. */
static VALUE grpc_rb_cServer = Qnil; static VALUE grpc_rb_cServer = Qnil;
@ -93,9 +93,8 @@ static void grpc_rb_server_free(void *p) {
}; };
svr = (grpc_rb_server *)p; svr = (grpc_rb_server *)p;
deadline = gpr_time_add( deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_seconds(2, GPR_TIMESPAN));
gpr_time_from_seconds(2, GPR_TIMESPAN));
destroy_server(svr, deadline); destroy_server(svr, deadline);
@ -104,13 +103,15 @@ static void grpc_rb_server_free(void *p) {
static const rb_data_type_t grpc_rb_server_data_type = { static const rb_data_type_t grpc_rb_server_data_type = {
"grpc_server", "grpc_server",
{GRPC_RB_GC_NOT_MARKED, grpc_rb_server_free, GRPC_RB_MEMSIZE_UNAVAILABLE, {GRPC_RB_GC_NOT_MARKED,
grpc_rb_server_free,
GRPC_RB_MEMSIZE_UNAVAILABLE,
{NULL, NULL}}, {NULL, NULL}},
NULL, NULL,
NULL, NULL,
#ifdef RUBY_TYPED_FREE_IMMEDIATELY #ifdef RUBY_TYPED_FREE_IMMEDIATELY
/* It is unsafe to specify RUBY_TYPED_FREE_IMMEDIATELY because the free function would block /* It is unsafe to specify RUBY_TYPED_FREE_IMMEDIATELY because the free
* and we might want to unlock GVL * function would block and we might want to unlock GVL
* TODO(yugui) Unlock GVL? * TODO(yugui) Unlock GVL?
*/ */
0, 0,
@ -131,7 +132,7 @@ static VALUE grpc_rb_server_alloc(VALUE cls) {
Initializes server instances. */ Initializes server instances. */
static VALUE grpc_rb_server_init(VALUE self, VALUE channel_args) { static VALUE grpc_rb_server_init(VALUE self, VALUE channel_args) {
grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_completion_queue *cq = grpc_completion_queue_create_for_pluck(NULL);
grpc_rb_server *wrapper = NULL; grpc_rb_server *wrapper = NULL;
grpc_server *srv = NULL; grpc_server *srv = NULL;
grpc_channel_args args; grpc_channel_args args;
@ -163,7 +164,7 @@ typedef struct request_call_stack {
/* grpc_request_call_stack_init ensures the request_call_stack is properly /* grpc_request_call_stack_init ensures the request_call_stack is properly
* initialized */ * initialized */
static void grpc_request_call_stack_init(request_call_stack* st) { static void grpc_request_call_stack_init(request_call_stack *st) {
MEMZERO(st, request_call_stack, 1); MEMZERO(st, request_call_stack, 1);
grpc_metadata_array_init(&st->md_ary); grpc_metadata_array_init(&st->md_ary);
grpc_call_details_init(&st->details); grpc_call_details_init(&st->details);
@ -171,7 +172,7 @@ static void grpc_request_call_stack_init(request_call_stack* st) {
/* grpc_request_call_stack_cleanup ensures the request_call_stack is properly /* grpc_request_call_stack_cleanup ensures the request_call_stack is properly
* cleaned up */ * cleaned up */
static void grpc_request_call_stack_cleanup(request_call_stack* st) { static void grpc_request_call_stack_cleanup(request_call_stack *st) {
grpc_metadata_array_destroy(&st->md_ary); grpc_metadata_array_destroy(&st->md_ary);
grpc_call_details_destroy(&st->details); grpc_call_details_destroy(&st->details);
} }
@ -187,8 +188,9 @@ static VALUE grpc_rb_server_request_call(VALUE self) {
grpc_call_error err; grpc_call_error err;
request_call_stack st; request_call_stack st;
VALUE result; VALUE result;
void *tag = (void*)&st; void *tag = (void *)&st;
grpc_completion_queue *call_queue = grpc_completion_queue_create(NULL); grpc_completion_queue *call_queue =
grpc_completion_queue_create_for_pluck(NULL);
gpr_timespec deadline; gpr_timespec deadline;
TypedData_Get_Struct(self, grpc_rb_server, &grpc_rb_server_data_type, s); TypedData_Get_Struct(self, grpc_rb_server, &grpc_rb_server_data_type, s);
@ -199,9 +201,8 @@ static VALUE grpc_rb_server_request_call(VALUE self) {
grpc_request_call_stack_init(&st); grpc_request_call_stack_init(&st);
/* call grpc_server_request_call, then wait for it to complete using /* call grpc_server_request_call, then wait for it to complete using
* pluck_event */ * pluck_event */
err = grpc_server_request_call( err = grpc_server_request_call(s->wrapped, &call, &st.details, &st.md_ary,
s->wrapped, &call, &st.details, &st.md_ary, call_queue, s->queue, tag);
call_queue, s->queue, tag);
if (err != GRPC_CALL_OK) { if (err != GRPC_CALL_OK) {
grpc_request_call_stack_cleanup(&st); grpc_request_call_stack_cleanup(&st);
rb_raise(grpc_rb_eCallError, rb_raise(grpc_rb_eCallError,
@ -218,8 +219,6 @@ static VALUE grpc_rb_server_request_call(VALUE self) {
return Qnil; return Qnil;
} }
/* build the NewServerRpc struct result */ /* build the NewServerRpc struct result */
deadline = gpr_convert_clock_type(st.details.deadline, GPR_CLOCK_REALTIME); deadline = gpr_convert_clock_type(st.details.deadline, GPR_CLOCK_REALTIME);
result = rb_struct_new( result = rb_struct_new(
@ -299,8 +298,7 @@ static VALUE grpc_rb_server_add_http2_port(VALUE self, VALUE port,
return Qnil; return Qnil;
} else if (TYPE(rb_creds) == T_SYMBOL) { } else if (TYPE(rb_creds) == T_SYMBOL) {
if (id_insecure_server != SYM2ID(rb_creds)) { if (id_insecure_server != SYM2ID(rb_creds)) {
rb_raise(rb_eTypeError, rb_raise(rb_eTypeError, "bad creds symbol, want :this_port_is_insecure");
"bad creds symbol, want :this_port_is_insecure");
return Qnil; return Qnil;
} }
recvd_port = recvd_port =
@ -312,9 +310,8 @@ static VALUE grpc_rb_server_add_http2_port(VALUE self, VALUE port,
} }
} else { } else {
creds = grpc_rb_get_wrapped_server_credentials(rb_creds); creds = grpc_rb_get_wrapped_server_credentials(rb_creds);
recvd_port = recvd_port = grpc_server_add_secure_http2_port(
grpc_server_add_secure_http2_port(s->wrapped, StringValueCStr(port), s->wrapped, StringValueCStr(port), creds);
creds);
if (recvd_port == 0) { if (recvd_port == 0) {
rb_raise(rb_eRuntimeError, rb_raise(rb_eRuntimeError,
"could not add secure port %s to server, not sure why", "could not add secure port %s to server, not sure why",
@ -333,18 +330,17 @@ void Init_grpc_server() {
/* Provides a ruby constructor and support for dup/clone. */ /* Provides a ruby constructor and support for dup/clone. */
rb_define_method(grpc_rb_cServer, "initialize", grpc_rb_server_init, 1); rb_define_method(grpc_rb_cServer, "initialize", grpc_rb_server_init, 1);
rb_define_method(grpc_rb_cServer, "initialize_copy", rb_define_method(grpc_rb_cServer, "initialize_copy", grpc_rb_cannot_init_copy,
grpc_rb_cannot_init_copy, 1); 1);
/* Add the server methods. */ /* Add the server methods. */
rb_define_method(grpc_rb_cServer, "request_call", rb_define_method(grpc_rb_cServer, "request_call", grpc_rb_server_request_call,
grpc_rb_server_request_call, 0); 0);
rb_define_method(grpc_rb_cServer, "start", grpc_rb_server_start, 0); rb_define_method(grpc_rb_cServer, "start", grpc_rb_server_start, 0);
rb_define_method(grpc_rb_cServer, "destroy", grpc_rb_server_destroy, -1); rb_define_method(grpc_rb_cServer, "destroy", grpc_rb_server_destroy, -1);
rb_define_alias(grpc_rb_cServer, "close", "destroy"); rb_define_alias(grpc_rb_cServer, "close", "destroy");
rb_define_method(grpc_rb_cServer, "add_http2_port", rb_define_method(grpc_rb_cServer, "add_http2_port",
grpc_rb_server_add_http2_port, grpc_rb_server_add_http2_port, 2);
2);
id_at = rb_intern("at"); id_at = rb_intern("at");
id_insecure_server = rb_intern("this_port_is_insecure"); id_insecure_server = rb_intern("this_port_is_insecure");
} }

@ -40,9 +40,9 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/support/murmur_hash.h" #include "src/core/lib/support/murmur_hash.h"
@ -104,6 +104,7 @@ void grpc_run_bad_client_test(
grpc_slice_buffer outgoing; grpc_slice_buffer outgoing;
grpc_closure done_write_closure; grpc_closure done_write_closure;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_completion_queue *shutdown_cq;
hex = gpr_dump(client_payload, client_payload_length, hex = gpr_dump(client_payload, client_payload_length,
GPR_DUMP_HEX | GPR_DUMP_ASCII); GPR_DUMP_HEX | GPR_DUMP_ASCII);
@ -121,7 +122,7 @@ void grpc_run_bad_client_test(
/* Create server, completion events */ /* Create server, completion events */
a.server = grpc_server_create(NULL, NULL); a.server = grpc_server_create(NULL, NULL);
a.cq = grpc_completion_queue_create(NULL); a.cq = grpc_completion_queue_create_for_next(NULL);
gpr_event_init(&a.done_thd); gpr_event_init(&a.done_thd);
gpr_event_init(&a.done_write); gpr_event_init(&a.done_write);
a.validator = server_validator; a.validator = server_validator;
@ -194,10 +195,13 @@ void grpc_run_bad_client_test(
grpc_endpoint_destroy(&exec_ctx, sfd.client); grpc_endpoint_destroy(&exec_ctx, sfd.client);
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);
} }
grpc_server_shutdown_and_notify(a.server, a.cq, NULL);
shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
grpc_server_shutdown_and_notify(a.server, shutdown_cq, NULL);
GPR_ASSERT(grpc_completion_queue_pluck( GPR_ASSERT(grpc_completion_queue_pluck(
a.cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL) shutdown_cq, NULL, grpc_timeout_seconds_to_deadline(1), NULL)
.type == GRPC_OP_COMPLETE); .type == GRPC_OP_COMPLETE);
grpc_completion_queue_destroy(shutdown_cq);
grpc_server_destroy(a.server); grpc_server_destroy(a.server);
grpc_completion_queue_destroy(a.cq); grpc_completion_queue_destroy(a.cq);
grpc_slice_buffer_destroy_internal(&exec_ctx, &outgoing); grpc_slice_buffer_destroy_internal(&exec_ctx, &outgoing);

@ -61,7 +61,7 @@ static void run_test(const char *target, size_t nops) {
grpc_status_code status; grpc_status_code status;
grpc_call_error error; grpc_call_error error;
gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5); gpr_timespec deadline = grpc_timeout_seconds_to_deadline(5);
grpc_completion_queue *cq = grpc_completion_queue_create(NULL); grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
cq_verifier *cqv = cq_verifier_create(cq); cq_verifier *cqv = cq_verifier_create(cq);
grpc_op ops[6]; grpc_op ops[6];

@ -66,7 +66,9 @@ void bad_ssl_run(grpc_server *server) {
grpc_call *s = NULL; grpc_call *s = NULL;
grpc_call_details call_details; grpc_call_details call_details;
grpc_metadata_array request_metadata_recv; grpc_metadata_array request_metadata_recv;
grpc_completion_queue *cq = grpc_completion_queue_create(NULL);
grpc_completion_queue *cq = grpc_completion_queue_create_for_next(NULL);
grpc_completion_queue *shutdown_cq;
grpc_call_details_init(&call_details); grpc_call_details_init(&call_details);
grpc_metadata_array_init(&request_metadata_recv); grpc_metadata_array_init(&request_metadata_recv);
@ -82,10 +84,13 @@ void bad_ssl_run(grpc_server *server) {
while (!shutdown_finished) { while (!shutdown_finished) {
if (got_sigint && !shutdown_started) { if (got_sigint && !shutdown_started) {
gpr_log(GPR_INFO, "Shutting down due to SIGINT"); gpr_log(GPR_INFO, "Shutting down due to SIGINT");
grpc_server_shutdown_and_notify(server, cq, NULL); shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
GPR_ASSERT(grpc_completion_queue_pluck( grpc_server_shutdown_and_notify(server, shutdown_cq, NULL);
cq, NULL, grpc_timeout_seconds_to_deadline(5), NULL) GPR_ASSERT(
.type == GRPC_OP_COMPLETE); grpc_completion_queue_pluck(shutdown_cq, NULL,
grpc_timeout_seconds_to_deadline(5), NULL)
.type == GRPC_OP_COMPLETE);
grpc_completion_queue_destroy(shutdown_cq);
grpc_completion_queue_shutdown(cq); grpc_completion_queue_shutdown(cq);
shutdown_started = 1; shutdown_started = 1;
} }

@ -0,0 +1,232 @@
/*
*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*******************************************************************************
* This test verifies that various stack configurations result in the set of
* filters that we expect.
*
* This is akin to a golden-file test, and suffers the same disadvantages and
* advantages: it reflects that the code as written has not been modified - and
* valid code modifications WILL break this test and it will need updating.
*
* The intent therefore is to allow code reviewers to more easily catch changes
* that perturb the generated list of channel filters in different
* configurations and assess whether such a change is correct and desirable.
*/
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <string.h>
#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/support/string.h"
#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/transport/transport_impl.h"
#include "test/core/util/test_config.h"
// use CHECK_STACK instead
static int check_stack(const char *file, int line, const char *transport_name,
grpc_channel_args *init_args,
grpc_channel_stack_type channel_stack_type, ...);
// arguments: const char *transport_name - the name of the transport type to
// simulate
// grpc_channel_args *init_args - channel args to pass down
// grpc_channel_stack_type channel_stack_type - the archetype of
// channel stack to create
// variadic arguments - the (in-order) expected list of channel
// filters to instantiate, terminated with NULL
#define CHECK_STACK(...) check_stack(__FILE__, __LINE__, __VA_ARGS__)
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_init();
int errors = 0;
// tests with a minimal stack
grpc_arg minimal_stack_arg = {.type = GRPC_ARG_INTEGER,
.key = GRPC_ARG_MINIMAL_STACK,
.value.integer = 1};
grpc_channel_args minimal_stack_args = {.num_args = 1,
.args = &minimal_stack_arg};
errors += CHECK_STACK("unknown", &minimal_stack_args,
GRPC_CLIENT_DIRECT_CHANNEL, "connected", NULL);
errors += CHECK_STACK("unknown", &minimal_stack_args, GRPC_CLIENT_SUBCHANNEL,
"connected", NULL);
errors += CHECK_STACK("unknown", &minimal_stack_args, GRPC_SERVER_CHANNEL,
"server", "connected", NULL);
errors +=
CHECK_STACK("chttp2", &minimal_stack_args, GRPC_CLIENT_DIRECT_CHANNEL,
"http-client", "connected", NULL);
errors += CHECK_STACK("chttp2", &minimal_stack_args, GRPC_CLIENT_SUBCHANNEL,
"http-client", "connected", NULL);
errors += CHECK_STACK("chttp2", &minimal_stack_args, GRPC_SERVER_CHANNEL,
"server", "http-server", "connected", NULL);
errors += CHECK_STACK(NULL, &minimal_stack_args, GRPC_CLIENT_CHANNEL,
"client-channel", NULL);
// tests with a default stack
errors += CHECK_STACK("unknown", NULL, GRPC_CLIENT_DIRECT_CHANNEL,
"message_size", "deadline", "connected", NULL);
errors += CHECK_STACK("unknown", NULL, GRPC_CLIENT_SUBCHANNEL, "message_size",
"connected", NULL);
errors += CHECK_STACK("unknown", NULL, GRPC_SERVER_CHANNEL, "server",
"message_size", "deadline", "connected", NULL);
errors +=
CHECK_STACK("chttp2", NULL, GRPC_CLIENT_DIRECT_CHANNEL, "message_size",
"deadline", "http-client", "compress", "connected", NULL);
errors += CHECK_STACK("chttp2", NULL, GRPC_CLIENT_SUBCHANNEL, "message_size",
"http-client", "compress", "connected", NULL);
errors +=
CHECK_STACK("chttp2", NULL, GRPC_SERVER_CHANNEL, "server", "message_size",
"deadline", "http-server", "compress", "connected", NULL);
errors +=
CHECK_STACK(NULL, NULL, GRPC_CLIENT_CHANNEL, "client-channel", NULL);
GPR_ASSERT(errors == 0);
grpc_shutdown();
return 0;
}
/*******************************************************************************
* End of tests definitions, start of test infrastructure
*/
static int check_stack(const char *file, int line, const char *transport_name,
grpc_channel_args *init_args,
grpc_channel_stack_type channel_stack_type, ...) {
// create dummy channel stack
grpc_channel_stack_builder *builder = grpc_channel_stack_builder_create();
grpc_transport_vtable fake_transport_vtable = {.name = transport_name};
grpc_transport fake_transport = {.vtable = &fake_transport_vtable};
grpc_channel_stack_builder_set_target(builder, "foo.test.google.fr");
grpc_channel_args *channel_args = grpc_channel_args_copy(init_args);
if (transport_name != NULL) {
grpc_channel_stack_builder_set_transport(builder, &fake_transport);
}
{
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_channel_stack_builder_set_channel_arguments(&exec_ctx, builder,
channel_args);
GPR_ASSERT(
grpc_channel_init_create_stack(&exec_ctx, builder, channel_stack_type));
grpc_exec_ctx_finish(&exec_ctx);
}
// build up our expectation list
gpr_strvec v;
gpr_strvec_init(&v);
va_list args;
va_start(args, channel_stack_type);
for (;;) {
char *a = va_arg(args, char *);
if (a == NULL) break;
if (v.count != 0) gpr_strvec_add(&v, gpr_strdup(", "));
gpr_strvec_add(&v, gpr_strdup(a));
}
va_end(args);
char *expect = gpr_strvec_flatten(&v, NULL);
gpr_strvec_destroy(&v);
// build up our "got" list
gpr_strvec_init(&v);
grpc_channel_stack_builder_iterator *it =
grpc_channel_stack_builder_create_iterator_at_first(builder);
while (grpc_channel_stack_builder_move_next(it)) {
const char *name = grpc_channel_stack_builder_iterator_filter_name(it);
if (name == NULL) continue;
if (v.count != 0) gpr_strvec_add(&v, gpr_strdup(", "));
gpr_strvec_add(&v, gpr_strdup(name));
}
char *got = gpr_strvec_flatten(&v, NULL);
gpr_strvec_destroy(&v);
grpc_channel_stack_builder_iterator_destroy(it);
// figure out result, log if there's an error
int result = 0;
if (0 != strcmp(got, expect)) {
gpr_strvec_init(&v);
gpr_strvec_add(&v, gpr_strdup("{"));
for (size_t i = 0; i < channel_args->num_args; i++) {
if (i > 0) gpr_strvec_add(&v, gpr_strdup(", "));
gpr_strvec_add(&v, gpr_strdup(channel_args->args[i].key));
gpr_strvec_add(&v, gpr_strdup("="));
switch (channel_args->args[i].type) {
case GRPC_ARG_INTEGER: {
char *tmp;
gpr_asprintf(&tmp, "%d", channel_args->args[i].value.integer);
gpr_strvec_add(&v, tmp);
break;
}
case GRPC_ARG_STRING:
gpr_strvec_add(&v, gpr_strdup(channel_args->args[i].value.string));
break;
case GRPC_ARG_POINTER: {
char *tmp;
gpr_asprintf(&tmp, "%p", channel_args->args[i].value.pointer.p);
gpr_strvec_add(&v, tmp);
break;
}
}
}
gpr_strvec_add(&v, gpr_strdup("}"));
char *args_str = gpr_strvec_flatten(&v, NULL);
gpr_strvec_destroy(&v);
gpr_log(file, line, GPR_LOG_SEVERITY_ERROR,
"**************************************************");
gpr_log(file, line, GPR_LOG_SEVERITY_ERROR,
"FAILED transport=%s; stack_type=%s; channel_args=%s:",
transport_name, grpc_channel_stack_type_string(channel_stack_type),
args_str);
gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "EXPECTED: %s", expect);
gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "GOT: %s", got);
result = 1;
gpr_free(args_str);
}
gpr_free(got);
gpr_free(expect);
{
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_channel_stack_builder_destroy(&exec_ctx, builder);
grpc_channel_args_destroy(&exec_ctx, channel_args);
grpc_exec_ctx_finish(&exec_ctx);
}
return result;
}

@ -59,6 +59,7 @@ typedef struct servers_fixture {
grpc_server **servers; grpc_server **servers;
grpc_call **server_calls; grpc_call **server_calls;
grpc_completion_queue *cq; grpc_completion_queue *cq;
grpc_completion_queue *shutdown_cq;
char **servers_hostports; char **servers_hostports;
grpc_metadata_array *request_metadata_recv; grpc_metadata_array *request_metadata_recv;
} servers_fixture; } servers_fixture;
@ -146,10 +147,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void kill_server(const servers_fixture *f, size_t i) { static void kill_server(const servers_fixture *f, size_t i) {
gpr_log(GPR_INFO, "KILLING SERVER %" PRIuPTR, i); gpr_log(GPR_INFO, "KILLING SERVER %" PRIuPTR, i);
GPR_ASSERT(f->servers[i] != NULL); GPR_ASSERT(f->servers[i] != NULL);
grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); grpc_server_shutdown_and_notify(f->servers[i], f->shutdown_cq, tag(10000));
GPR_ASSERT( GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(10000),
grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000), NULL) n_millis_time(5000), NULL)
.type == GRPC_OP_COMPLETE); .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->servers[i]); grpc_server_destroy(f->servers[i]);
f->servers[i] = NULL; f->servers[i] = NULL;
} }
@ -196,7 +197,8 @@ static servers_fixture *setup_servers(const char *server_host,
/* Create servers. */ /* Create servers. */
f->servers = gpr_malloc(sizeof(grpc_server *) * num_servers); f->servers = gpr_malloc(sizeof(grpc_server *) * num_servers);
f->servers_hostports = gpr_malloc(sizeof(char *) * num_servers); f->servers_hostports = gpr_malloc(sizeof(char *) * num_servers);
f->cq = grpc_completion_queue_create(NULL); f->cq = grpc_completion_queue_create_for_next(NULL);
f->shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
for (i = 0; i < num_servers; i++) { for (i = 0; i < num_servers; i++) {
grpc_metadata_array_init(&f->request_metadata_recv[i]); grpc_metadata_array_init(&f->request_metadata_recv[i]);
gpr_join_host_port(&f->servers_hostports[i], server_host, gpr_join_host_port(&f->servers_hostports[i], server_host,
@ -212,8 +214,8 @@ static void teardown_servers(servers_fixture *f) {
/* Destroy server. */ /* Destroy server. */
for (i = 0; i < f->num_servers; i++) { for (i = 0; i < f->num_servers; i++) {
if (f->servers[i] == NULL) continue; if (f->servers[i] == NULL) continue;
grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); grpc_server_shutdown_and_notify(f->servers[i], f->shutdown_cq, tag(10000));
GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000), GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(10000),
n_millis_time(5000), NULL) n_millis_time(5000), NULL)
.type == GRPC_OP_COMPLETE); .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->servers[i]); grpc_server_destroy(f->servers[i]);
@ -221,6 +223,7 @@ static void teardown_servers(servers_fixture *f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
gpr_free(f->servers); gpr_free(f->servers);

@ -178,7 +178,7 @@ static void start_rpc(int target_port, grpc_status_code expected_status,
cq_verifier *cqv; cq_verifier *cqv;
grpc_slice details; grpc_slice details;
state.cq = grpc_completion_queue_create(NULL); state.cq = grpc_completion_queue_create_for_next(NULL);
cqv = cq_verifier_create(state.cq); cqv = cq_verifier_create(state.cq);
gpr_join_host_port(&state.target, "127.0.0.1", target_port); gpr_join_host_port(&state.target, "127.0.0.1", target_port);
state.channel = grpc_insecure_channel_create(state.target, NULL, NULL); state.channel = grpc_insecure_channel_create(state.target, NULL, NULL);

@ -68,7 +68,7 @@ static void run_test(bool wait_for_ready, bool use_service_config) {
grpc_metadata_array_init(&trailing_metadata_recv); grpc_metadata_array_init(&trailing_metadata_recv);
cq = grpc_completion_queue_create(NULL); cq = grpc_completion_queue_create_for_next(NULL);
cqv = cq_verifier_create(cq); cqv = cq_verifier_create(cq);
/* if using service config, create channel args */ /* if using service config, create channel args */

@ -76,6 +76,7 @@ void test_connect(const char *server_host, const char *client_host, int port,
grpc_channel *client; grpc_channel *client;
grpc_server *server; grpc_server *server;
grpc_completion_queue *cq; grpc_completion_queue *cq;
grpc_completion_queue *shutdown_cq;
grpc_call *c; grpc_call *c;
grpc_call *s; grpc_call *s;
cq_verifier *cqv; cq_verifier *cqv;
@ -107,7 +108,7 @@ void test_connect(const char *server_host, const char *client_host, int port,
grpc_call_details_init(&call_details); grpc_call_details_init(&call_details);
/* Create server. */ /* Create server. */
cq = grpc_completion_queue_create(NULL); cq = grpc_completion_queue_create_for_next(NULL);
server = grpc_server_create(NULL, NULL); server = grpc_server_create(NULL, NULL);
grpc_server_register_completion_queue(server, cq, NULL); grpc_server_register_completion_queue(server, cq, NULL);
GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port( GPR_ASSERT((got_port = grpc_server_add_insecure_http2_port(
@ -259,11 +260,14 @@ void test_connect(const char *server_host, const char *client_host, int port,
grpc_channel_destroy(client); grpc_channel_destroy(client);
/* Destroy server. */ /* Destroy server. */
grpc_server_shutdown_and_notify(server, cq, tag(1000)); shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
GPR_ASSERT(grpc_completion_queue_pluck( grpc_server_shutdown_and_notify(server, shutdown_cq, tag(1000));
cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) GPR_ASSERT(grpc_completion_queue_pluck(shutdown_cq, tag(1000),
grpc_timeout_seconds_to_deadline(5),
NULL)
.type == GRPC_OP_COMPLETE); .type == GRPC_OP_COMPLETE);
grpc_server_destroy(server); grpc_server_destroy(server);
grpc_completion_queue_destroy(shutdown_cq);
grpc_completion_queue_shutdown(cq); grpc_completion_queue_shutdown(cq);
drain_cq(cq); drain_cq(cq);
grpc_completion_queue_destroy(cq); grpc_completion_queue_destroy(cq);

@ -53,6 +53,7 @@ typedef struct grpc_end2end_test_config grpc_end2end_test_config;
struct grpc_end2end_test_fixture { struct grpc_end2end_test_fixture {
grpc_completion_queue *cq; grpc_completion_queue *cq;
grpc_completion_queue *shutdown_cq;
grpc_server *server; grpc_server *server;
grpc_channel *client; grpc_channel *client;
void *fixture_data; void *fixture_data;

@ -42,10 +42,10 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h" #include "src/core/lib/surface/server.h"
#include "test/core/util/port.h" #include "test/core/util/port.h"
@ -65,7 +65,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -42,10 +42,10 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h" #include "src/core/lib/surface/server.h"
#include "test/core/util/port.h" #include "test/core/util/port.h"
@ -69,7 +69,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack_compression(
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -60,7 +60,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -70,7 +70,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f; grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = fixture_data; f.fixture_data = fixture_data;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
create_sockets(fixture_data->fd_pair); create_sockets(fixture_data->fd_pair);

@ -47,9 +47,9 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/iomgr/wakeup_fd_posix.h" #include "src/core/lib/iomgr/wakeup_fd_posix.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h" #include "src/core/lib/surface/server.h"
@ -70,7 +70,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -47,9 +47,9 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/support/env.h" #include "src/core/lib/support/env.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h" #include "src/core/lib/surface/server.h"
@ -70,7 +70,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -42,9 +42,9 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h" #include "src/core/lib/surface/server.h"
#include "test/core/util/port.h" #include "test/core/util/port.h"
@ -64,7 +64,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -43,9 +43,9 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/support/env.h" #include "src/core/lib/support/env.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h" #include "src/core/lib/surface/server.h"
@ -69,7 +69,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
ffd->proxy = grpc_end2end_http_proxy_create(); ffd->proxy = grpc_end2end_http_proxy_create();
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -42,11 +42,11 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/filters/load_reporting/load_reporting.h" #include "src/core/ext/filters/load_reporting/load_reporting.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h" #include "src/core/lib/surface/server.h"
#include "test/core/util/port.h" #include "test/core/util/port.h"
@ -67,7 +67,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_load_reporting(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -113,7 +113,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -42,9 +42,9 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h" #include "src/core/lib/surface/server.h"
#include "test/core/end2end/fixtures/proxy.h" #include "test/core/end2end/fixtures/proxy.h"
@ -79,7 +79,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_fullstack(
ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args); ffd->proxy = grpc_end2end_proxy_create(&proxy_def, client_args, server_args);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -46,11 +46,11 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/client/http_client_filter.h"
#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/compress_filter.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_client_filter.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/support/env.h" #include "src/core/lib/support/env.h"
@ -94,7 +94,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f; grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = sfd; f.fixture_data = sfd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
*sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL); *sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL);

@ -41,11 +41,11 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/client/http_client_filter.h"
#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/compress_filter.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_client_filter.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
@ -88,7 +88,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f; grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = sfd; f.fixture_data = sfd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
*sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL); *sfd = grpc_iomgr_create_endpoint_pair("fixture", NULL);

@ -41,11 +41,11 @@
#include <grpc/support/thd.h> #include <grpc/support/thd.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/filters/client_channel/client_channel.h" #include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/http/client/http_client_filter.h"
#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/compress_filter.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/http_client_filter.h"
#include "src/core/lib/channel/http_server_filter.h"
#include "src/core/lib/iomgr/endpoint_pair.h" #include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/channel.h"
@ -88,7 +88,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_socketpair(
grpc_end2end_test_fixture f; grpc_end2end_test_fixture f;
memset(&f, 0, sizeof(f)); memset(&f, 0, sizeof(f));
f.fixture_data = sfd; f.fixture_data = sfd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE, grpc_arg a[] = {{.key = GRPC_ARG_TCP_READ_CHUNK_SIZE,
.type = GRPC_ARG_INTEGER, .type = GRPC_ARG_INTEGER,

@ -64,7 +64,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }

@ -67,7 +67,8 @@ static grpc_end2end_test_fixture chttp2_create_fixture_secure_fullstack(
gpr_join_host_port(&ffd->localaddr, "localhost", port); gpr_join_host_port(&ffd->localaddr, "localhost", port);
f.fixture_data = ffd; f.fixture_data = ffd;
f.cq = grpc_completion_queue_create(NULL); f.cq = grpc_completion_queue_create_for_next(NULL);
f.shutdown_cq = grpc_completion_queue_create_for_pluck(NULL);
return f; return f;
} }
@ -289,9 +290,10 @@ static void drain_cq(grpc_completion_queue *cq) {
static void shutdown_server(grpc_end2end_test_fixture *f) { static void shutdown_server(grpc_end2end_test_fixture *f) {
if (!f->server) return; if (!f->server) return;
grpc_server_shutdown_and_notify(f->server, f->cq, tag(1000)); grpc_server_shutdown_and_notify(f->server, f->shutdown_cq, tag(1000));
GPR_ASSERT(grpc_completion_queue_pluck( GPR_ASSERT(grpc_completion_queue_pluck(f->shutdown_cq, tag(1000),
f->cq, tag(1000), grpc_timeout_seconds_to_deadline(5), NULL) grpc_timeout_seconds_to_deadline(5),
NULL)
.type == GRPC_OP_COMPLETE); .type == GRPC_OP_COMPLETE);
grpc_server_destroy(f->server); grpc_server_destroy(f->server);
f->server = NULL; f->server = NULL;
@ -310,6 +312,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_shutdown(f->cq); grpc_completion_queue_shutdown(f->cq);
drain_cq(f->cq); drain_cq(f->cq);
grpc_completion_queue_destroy(f->cq); grpc_completion_queue_destroy(f->cq);
grpc_completion_queue_destroy(f->shutdown_cq);
} }
static void simple_request_body(grpc_end2end_test_fixture f, static void simple_request_body(grpc_end2end_test_fixture f,

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save