Merge branch 'client_channel_cleanup' into deadline_filter

pull/7970/head
Mark D. Roth 8 years ago
commit 89119fa9b6
  1. 24
      BUILD
  2. 9
      CMakeLists.txt
  3. 9
      Makefile
  4. 3
      binding.gyp
  5. 22
      build.yaml
  6. 3
      config.m4
  7. 8
      doc/g_stands_for.md
  8. 9
      gRPC-Core.podspec
  9. 1
      grpc.def
  10. 6
      grpc.gemspec
  11. 1
      include/grpc++/create_channel.h
  12. 6
      include/grpc++/impl/codegen/client_context.h
  13. 4
      include/grpc++/impl/codegen/server_context.h
  14. 37
      include/grpc++/impl/codegen/sync_stream.h
  15. 3
      include/grpc/grpc.h
  16. 10
      package.xml
  17. 4
      src/core/ext/client_config/README.md
  18. 508
      src/core/ext/client_config/client_channel.c
  19. 2
      src/core/ext/client_config/lb_policy_factory.h
  20. 4
      src/core/ext/client_config/resolver.c
  21. 12
      src/core/ext/client_config/resolver.h
  22. 2
      src/core/ext/client_config/resolver_factory.h
  23. 21
      src/core/ext/client_config/resolver_result.c
  24. 25
      src/core/ext/client_config/resolver_result.h
  25. 292
      src/core/ext/client_config/subchannel_call_holder.c
  26. 99
      src/core/ext/client_config/subchannel_call_holder.h
  27. 42
      src/core/ext/resolver/dns/native/dns_resolver.c
  28. 18
      src/core/ext/resolver/sockaddr/sockaddr_resolver.c
  29. 5
      src/core/lib/channel/http_client_filter.c
  30. 3
      src/core/lib/iomgr/error.h
  31. 6
      src/core/lib/iomgr/ev_epoll_linux.c
  32. 6
      src/core/lib/security/context/security_context.c
  33. 12
      src/core/lib/security/context/security_context.h
  34. 2
      src/core/lib/surface/version.c
  35. 8
      src/objective-c/RxLibrary/transformations/GRXMappingWriter.m
  36. 3
      src/php/ext/grpc/call.c
  37. 20
      src/php/ext/grpc/call_credentials.c
  38. 37
      src/php/tests/interop/interop_client.php
  39. 65
      src/php/tests/unit_tests/CallCredentials2Test.php
  40. 135
      src/php/tests/unit_tests/CallCredentials3Test.php
  41. 24
      src/php/tests/unit_tests/CallTest.php
  42. 3
      src/python/grpcio/grpc_core_dependencies.py
  43. 3
      src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
  44. 2
      src/ruby/ext/grpc/rb_grpc_imports.generated.c
  45. 3
      src/ruby/ext/grpc/rb_grpc_imports.generated.h
  46. 4
      templates/package.xml.template
  47. 2
      templates/src/core/lib/surface/version.c.template
  48. 12
      test/core/client_config/resolvers/dns_resolver_connectivity_test.c
  49. 2
      test/core/end2end/tests/bad_hostname.c
  50. 2
      test/core/end2end/tests/binary_metadata.c
  51. 2
      test/core/end2end/tests/call_creds.c
  52. 2
      test/core/end2end/tests/cancel_after_accept.c
  53. 2
      test/core/end2end/tests/cancel_after_client_done.c
  54. 2
      test/core/end2end/tests/cancel_after_invoke.c
  55. 2
      test/core/end2end/tests/cancel_before_invoke.c
  56. 2
      test/core/end2end/tests/cancel_in_a_vacuum.c
  57. 2
      test/core/end2end/tests/cancel_with_status.c
  58. 2
      test/core/end2end/tests/compressed_payload.c
  59. 2
      test/core/end2end/tests/default_host.c
  60. 2
      test/core/end2end/tests/disappearing_server.c
  61. 2
      test/core/end2end/tests/empty_batch.c
  62. 2
      test/core/end2end/tests/filter_causes_close.c
  63. 2
      test/core/end2end/tests/graceful_server_shutdown.c
  64. 2
      test/core/end2end/tests/high_initial_seqno.c
  65. 2
      test/core/end2end/tests/idempotent_request.c
  66. 2
      test/core/end2end/tests/invoke_large_request.c
  67. 2
      test/core/end2end/tests/large_metadata.c
  68. 2
      test/core/end2end/tests/max_concurrent_streams.c
  69. 2
      test/core/end2end/tests/max_message_length.c
  70. 2
      test/core/end2end/tests/negative_deadline.c
  71. 2
      test/core/end2end/tests/network_status_change.c
  72. 2
      test/core/end2end/tests/no_op.c
  73. 2
      test/core/end2end/tests/payload.c
  74. 2
      test/core/end2end/tests/ping_pong_streaming.c
  75. 2
      test/core/end2end/tests/registered_call.c
  76. 2
      test/core/end2end/tests/request_with_flags.c
  77. 2
      test/core/end2end/tests/request_with_payload.c
  78. 2
      test/core/end2end/tests/server_finishes_request.c
  79. 2
      test/core/end2end/tests/shutdown_finishes_calls.c
  80. 2
      test/core/end2end/tests/shutdown_finishes_tags.c
  81. 2
      test/core/end2end/tests/simple_delayed_request.c
  82. 2
      test/core/end2end/tests/simple_metadata.c
  83. 2
      test/core/end2end/tests/simple_request.c
  84. 2
      test/core/end2end/tests/streaming_error_response.c
  85. 2
      test/core/end2end/tests/trailing_metadata.c
  86. 2
      third_party/protobuf
  87. 6
      tools/doxygen/Doxyfile.core.internal
  88. 2
      tools/run_tests/sanity/check_submodules.sh
  89. 9
      tools/run_tests/sources_and_headers.json
  90. 9
      vsprojects/vcxproj/grpc/grpc.vcxproj
  91. 14
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  92. 9
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
  93. 14
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters

24
BUILD

@ -289,7 +289,6 @@ cc_library(
"src/core/lib/tsi/transport_security_interface.h",
"src/core/ext/client_config/client_channel.h",
"src/core/ext/client_config/client_channel_factory.h",
"src/core/ext/client_config/client_config.h",
"src/core/ext/client_config/connector.h",
"src/core/ext/client_config/initial_connect_string.h",
"src/core/ext/client_config/lb_policy.h",
@ -299,8 +298,8 @@ cc_library(
"src/core/ext/client_config/resolver.h",
"src/core/ext/client_config/resolver_factory.h",
"src/core/ext/client_config/resolver_registry.h",
"src/core/ext/client_config/resolver_result.h",
"src/core/ext/client_config/subchannel.h",
"src/core/ext/client_config/subchannel_call_holder.h",
"src/core/ext/client_config/subchannel_index.h",
"src/core/ext/client_config/uri_parser.h",
"src/core/ext/lb_policy/grpclb/grpclb.h",
@ -463,7 +462,6 @@ cc_library(
"src/core/ext/client_config/channel_connectivity.c",
"src/core/ext/client_config/client_channel.c",
"src/core/ext/client_config/client_channel_factory.c",
"src/core/ext/client_config/client_config.c",
"src/core/ext/client_config/client_config_plugin.c",
"src/core/ext/client_config/connector.c",
"src/core/ext/client_config/default_initial_connect_string.c",
@ -475,8 +473,8 @@ cc_library(
"src/core/ext/client_config/resolver.c",
"src/core/ext/client_config/resolver_factory.c",
"src/core/ext/client_config/resolver_registry.c",
"src/core/ext/client_config/resolver_result.c",
"src/core/ext/client_config/subchannel.c",
"src/core/ext/client_config/subchannel_call_holder.c",
"src/core/ext/client_config/subchannel_index.c",
"src/core/ext/client_config/uri_parser.c",
"src/core/ext/transport/chttp2/server/insecure/server_chttp2.c",
@ -663,7 +661,6 @@ cc_library(
"src/core/ext/transport/chttp2/alpn/alpn.h",
"src/core/ext/client_config/client_channel.h",
"src/core/ext/client_config/client_channel_factory.h",
"src/core/ext/client_config/client_config.h",
"src/core/ext/client_config/connector.h",
"src/core/ext/client_config/initial_connect_string.h",
"src/core/ext/client_config/lb_policy.h",
@ -673,8 +670,8 @@ cc_library(
"src/core/ext/client_config/resolver.h",
"src/core/ext/client_config/resolver_factory.h",
"src/core/ext/client_config/resolver_registry.h",
"src/core/ext/client_config/resolver_result.h",
"src/core/ext/client_config/subchannel.h",
"src/core/ext/client_config/subchannel_call_holder.h",
"src/core/ext/client_config/subchannel_index.h",
"src/core/ext/client_config/uri_parser.h",
"src/core/lib/security/context/security_context.h",
@ -821,7 +818,6 @@ cc_library(
"src/core/ext/client_config/channel_connectivity.c",
"src/core/ext/client_config/client_channel.c",
"src/core/ext/client_config/client_channel_factory.c",
"src/core/ext/client_config/client_config.c",
"src/core/ext/client_config/client_config_plugin.c",
"src/core/ext/client_config/connector.c",
"src/core/ext/client_config/default_initial_connect_string.c",
@ -833,8 +829,8 @@ cc_library(
"src/core/ext/client_config/resolver.c",
"src/core/ext/client_config/resolver_factory.c",
"src/core/ext/client_config/resolver_registry.c",
"src/core/ext/client_config/resolver_result.c",
"src/core/ext/client_config/subchannel.c",
"src/core/ext/client_config/subchannel_call_holder.c",
"src/core/ext/client_config/subchannel_index.c",
"src/core/ext/client_config/uri_parser.c",
"src/core/lib/http/httpcli_security_connector.c",
@ -1018,7 +1014,6 @@ cc_library(
"src/core/ext/transport/chttp2/alpn/alpn.h",
"src/core/ext/client_config/client_channel.h",
"src/core/ext/client_config/client_channel_factory.h",
"src/core/ext/client_config/client_config.h",
"src/core/ext/client_config/connector.h",
"src/core/ext/client_config/initial_connect_string.h",
"src/core/ext/client_config/lb_policy.h",
@ -1028,8 +1023,8 @@ cc_library(
"src/core/ext/client_config/resolver.h",
"src/core/ext/client_config/resolver_factory.h",
"src/core/ext/client_config/resolver_registry.h",
"src/core/ext/client_config/resolver_result.h",
"src/core/ext/client_config/subchannel.h",
"src/core/ext/client_config/subchannel_call_holder.h",
"src/core/ext/client_config/subchannel_index.h",
"src/core/ext/client_config/uri_parser.h",
"src/core/ext/load_reporting/load_reporting.h",
@ -1167,7 +1162,6 @@ cc_library(
"src/core/ext/client_config/channel_connectivity.c",
"src/core/ext/client_config/client_channel.c",
"src/core/ext/client_config/client_channel_factory.c",
"src/core/ext/client_config/client_config.c",
"src/core/ext/client_config/client_config_plugin.c",
"src/core/ext/client_config/connector.c",
"src/core/ext/client_config/default_initial_connect_string.c",
@ -1179,8 +1173,8 @@ cc_library(
"src/core/ext/client_config/resolver.c",
"src/core/ext/client_config/resolver_factory.c",
"src/core/ext/client_config/resolver_registry.c",
"src/core/ext/client_config/resolver_result.c",
"src/core/ext/client_config/subchannel.c",
"src/core/ext/client_config/subchannel_call_holder.c",
"src/core/ext/client_config/subchannel_index.c",
"src/core/ext/client_config/uri_parser.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
@ -2318,7 +2312,6 @@ objc_library(
"src/core/ext/client_config/channel_connectivity.c",
"src/core/ext/client_config/client_channel.c",
"src/core/ext/client_config/client_channel_factory.c",
"src/core/ext/client_config/client_config.c",
"src/core/ext/client_config/client_config_plugin.c",
"src/core/ext/client_config/connector.c",
"src/core/ext/client_config/default_initial_connect_string.c",
@ -2330,8 +2323,8 @@ objc_library(
"src/core/ext/client_config/resolver.c",
"src/core/ext/client_config/resolver_factory.c",
"src/core/ext/client_config/resolver_registry.c",
"src/core/ext/client_config/resolver_result.c",
"src/core/ext/client_config/subchannel.c",
"src/core/ext/client_config/subchannel_call_holder.c",
"src/core/ext/client_config/subchannel_index.c",
"src/core/ext/client_config/uri_parser.c",
"src/core/ext/transport/chttp2/server/insecure/server_chttp2.c",
@ -2520,7 +2513,6 @@ objc_library(
"src/core/lib/tsi/transport_security_interface.h",
"src/core/ext/client_config/client_channel.h",
"src/core/ext/client_config/client_channel_factory.h",
"src/core/ext/client_config/client_config.h",
"src/core/ext/client_config/connector.h",
"src/core/ext/client_config/initial_connect_string.h",
"src/core/ext/client_config/lb_policy.h",
@ -2530,8 +2522,8 @@ objc_library(
"src/core/ext/client_config/resolver.h",
"src/core/ext/client_config/resolver_factory.h",
"src/core/ext/client_config/resolver_registry.h",
"src/core/ext/client_config/resolver_result.h",
"src/core/ext/client_config/subchannel.h",
"src/core/ext/client_config/subchannel_call_holder.h",
"src/core/ext/client_config/subchannel_index.h",
"src/core/ext/client_config/uri_parser.h",
"src/core/ext/lb_policy/grpclb/grpclb.h",

@ -436,7 +436,6 @@ add_library(grpc
src/core/ext/client_config/channel_connectivity.c
src/core/ext/client_config/client_channel.c
src/core/ext/client_config/client_channel_factory.c
src/core/ext/client_config/client_config.c
src/core/ext/client_config/client_config_plugin.c
src/core/ext/client_config/connector.c
src/core/ext/client_config/default_initial_connect_string.c
@ -448,8 +447,8 @@ add_library(grpc
src/core/ext/client_config/resolver.c
src/core/ext/client_config/resolver_factory.c
src/core/ext/client_config/resolver_registry.c
src/core/ext/client_config/resolver_result.c
src/core/ext/client_config/subchannel.c
src/core/ext/client_config/subchannel_call_holder.c
src/core/ext/client_config/subchannel_index.c
src/core/ext/client_config/uri_parser.c
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c
@ -669,7 +668,6 @@ add_library(grpc_cronet
src/core/ext/client_config/channel_connectivity.c
src/core/ext/client_config/client_channel.c
src/core/ext/client_config/client_channel_factory.c
src/core/ext/client_config/client_config.c
src/core/ext/client_config/client_config_plugin.c
src/core/ext/client_config/connector.c
src/core/ext/client_config/default_initial_connect_string.c
@ -681,8 +679,8 @@ add_library(grpc_cronet
src/core/ext/client_config/resolver.c
src/core/ext/client_config/resolver_factory.c
src/core/ext/client_config/resolver_registry.c
src/core/ext/client_config/resolver_result.c
src/core/ext/client_config/subchannel.c
src/core/ext/client_config/subchannel_call_holder.c
src/core/ext/client_config/subchannel_index.c
src/core/ext/client_config/uri_parser.c
src/core/lib/http/httpcli_security_connector.c
@ -902,7 +900,6 @@ add_library(grpc_unsecure
src/core/ext/client_config/channel_connectivity.c
src/core/ext/client_config/client_channel.c
src/core/ext/client_config/client_channel_factory.c
src/core/ext/client_config/client_config.c
src/core/ext/client_config/client_config_plugin.c
src/core/ext/client_config/connector.c
src/core/ext/client_config/default_initial_connect_string.c
@ -914,8 +911,8 @@ add_library(grpc_unsecure
src/core/ext/client_config/resolver.c
src/core/ext/client_config/resolver_factory.c
src/core/ext/client_config/resolver_registry.c
src/core/ext/client_config/resolver_result.c
src/core/ext/client_config/subchannel.c
src/core/ext/client_config/subchannel_call_holder.c
src/core/ext/client_config/subchannel_index.c
src/core/ext/client_config/uri_parser.c
src/core/ext/resolver/dns/native/dns_resolver.c

@ -2652,7 +2652,6 @@ LIBGRPC_SRC = \
src/core/ext/client_config/channel_connectivity.c \
src/core/ext/client_config/client_channel.c \
src/core/ext/client_config/client_channel_factory.c \
src/core/ext/client_config/client_config.c \
src/core/ext/client_config/client_config_plugin.c \
src/core/ext/client_config/connector.c \
src/core/ext/client_config/default_initial_connect_string.c \
@ -2664,8 +2663,8 @@ LIBGRPC_SRC = \
src/core/ext/client_config/resolver.c \
src/core/ext/client_config/resolver_factory.c \
src/core/ext/client_config/resolver_registry.c \
src/core/ext/client_config/resolver_result.c \
src/core/ext/client_config/subchannel.c \
src/core/ext/client_config/subchannel_call_holder.c \
src/core/ext/client_config/subchannel_index.c \
src/core/ext/client_config/uri_parser.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \
@ -2903,7 +2902,6 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/client_config/channel_connectivity.c \
src/core/ext/client_config/client_channel.c \
src/core/ext/client_config/client_channel_factory.c \
src/core/ext/client_config/client_config.c \
src/core/ext/client_config/client_config_plugin.c \
src/core/ext/client_config/connector.c \
src/core/ext/client_config/default_initial_connect_string.c \
@ -2915,8 +2913,8 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/client_config/resolver.c \
src/core/ext/client_config/resolver_factory.c \
src/core/ext/client_config/resolver_registry.c \
src/core/ext/client_config/resolver_result.c \
src/core/ext/client_config/subchannel.c \
src/core/ext/client_config/subchannel_call_holder.c \
src/core/ext/client_config/subchannel_index.c \
src/core/ext/client_config/uri_parser.c \
src/core/lib/http/httpcli_security_connector.c \
@ -3364,7 +3362,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/client_config/channel_connectivity.c \
src/core/ext/client_config/client_channel.c \
src/core/ext/client_config/client_channel_factory.c \
src/core/ext/client_config/client_config.c \
src/core/ext/client_config/client_config_plugin.c \
src/core/ext/client_config/connector.c \
src/core/ext/client_config/default_initial_connect_string.c \
@ -3376,8 +3373,8 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/client_config/resolver.c \
src/core/ext/client_config/resolver_factory.c \
src/core/ext/client_config/resolver_registry.c \
src/core/ext/client_config/resolver_result.c \
src/core/ext/client_config/subchannel.c \
src/core/ext/client_config/subchannel_call_holder.c \
src/core/ext/client_config/subchannel_index.c \
src/core/ext/client_config/uri_parser.c \
src/core/ext/resolver/dns/native/dns_resolver.c \

@ -708,7 +708,6 @@
'src/core/ext/client_config/channel_connectivity.c',
'src/core/ext/client_config/client_channel.c',
'src/core/ext/client_config/client_channel_factory.c',
'src/core/ext/client_config/client_config.c',
'src/core/ext/client_config/client_config_plugin.c',
'src/core/ext/client_config/connector.c',
'src/core/ext/client_config/default_initial_connect_string.c',
@ -720,8 +719,8 @@
'src/core/ext/client_config/resolver.c',
'src/core/ext/client_config/resolver_factory.c',
'src/core/ext/client_config/resolver_registry.c',
'src/core/ext/client_config/resolver_result.c',
'src/core/ext/client_config/subchannel.c',
'src/core/ext/client_config/subchannel_call_holder.c',
'src/core/ext/client_config/subchannel_index.c',
'src/core/ext/client_config/uri_parser.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',

@ -2,11 +2,17 @@
'#2': It is used among other things to generate all of our project files.
'#3': Please refer to the templates directory for more information.
settings:
'#1': The public version number of the library.
'#2': Master always has a "-dev" suffix
'#3': Use "-preN" suffixes to identify pre-release versions
'#4': Per-language overrides are possible with (eg) ruby_version tag here
'#5': See the expand_version.py for all the quirks here
'#01': The public version number of the library.
'#02': ===
'#03': Please update the 'g_stands_for' field periodically with a new g word
'#04': not listed in doc/g_stands_for.md - and update that document to list the
'#05': new word.
'#06': ===
'#07': Master always has a "-dev" suffix
'#08': Use "-preN" suffixes to identify pre-release versions
'#09': Per-language overrides are possible with (eg) ruby_version tag here
'#10': See the expand_version.py for all the quirks here
g_stands_for: good
version: 1.1.0-dev
filegroups:
- name: census
@ -335,7 +341,6 @@ filegroups:
headers:
- src/core/ext/client_config/client_channel.h
- src/core/ext/client_config/client_channel_factory.h
- src/core/ext/client_config/client_config.h
- src/core/ext/client_config/connector.h
- src/core/ext/client_config/initial_connect_string.h
- src/core/ext/client_config/lb_policy.h
@ -345,15 +350,14 @@ filegroups:
- src/core/ext/client_config/resolver.h
- src/core/ext/client_config/resolver_factory.h
- src/core/ext/client_config/resolver_registry.h
- src/core/ext/client_config/resolver_result.h
- src/core/ext/client_config/subchannel.h
- src/core/ext/client_config/subchannel_call_holder.h
- src/core/ext/client_config/subchannel_index.h
- src/core/ext/client_config/uri_parser.h
src:
- src/core/ext/client_config/channel_connectivity.c
- src/core/ext/client_config/client_channel.c
- src/core/ext/client_config/client_channel_factory.c
- src/core/ext/client_config/client_config.c
- src/core/ext/client_config/client_config_plugin.c
- src/core/ext/client_config/connector.c
- src/core/ext/client_config/default_initial_connect_string.c
@ -365,8 +369,8 @@ filegroups:
- src/core/ext/client_config/resolver.c
- src/core/ext/client_config/resolver_factory.c
- src/core/ext/client_config/resolver_registry.c
- src/core/ext/client_config/resolver_result.c
- src/core/ext/client_config/subchannel.c
- src/core/ext/client_config/subchannel_call_holder.c
- src/core/ext/client_config/subchannel_index.c
- src/core/ext/client_config/uri_parser.c
plugin: grpc_client_config

@ -227,7 +227,6 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/client_config/channel_connectivity.c \
src/core/ext/client_config/client_channel.c \
src/core/ext/client_config/client_channel_factory.c \
src/core/ext/client_config/client_config.c \
src/core/ext/client_config/client_config_plugin.c \
src/core/ext/client_config/connector.c \
src/core/ext/client_config/default_initial_connect_string.c \
@ -239,8 +238,8 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/client_config/resolver.c \
src/core/ext/client_config/resolver_factory.c \
src/core/ext/client_config/resolver_registry.c \
src/core/ext/client_config/resolver_result.c \
src/core/ext/client_config/subchannel.c \
src/core/ext/client_config/subchannel_call_holder.c \
src/core/ext/client_config/subchannel_index.c \
src/core/ext/client_config/uri_parser.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \

@ -0,0 +1,8 @@
Each version of gRPC gets a new description of what the 'g' stands for, since
we've never really been able to figure it out.
Below is a list of already-used definitions (that should not be repeated in the
future), and the corresponding version numbers that used them:
- 1.0 'g' stands for 'gRPC'
- 1.1 'g' stands for 'good'

@ -380,7 +380,6 @@ Pod::Spec.new do |s|
'src/core/lib/tsi/transport_security_interface.h',
'src/core/ext/client_config/client_channel.h',
'src/core/ext/client_config/client_channel_factory.h',
'src/core/ext/client_config/client_config.h',
'src/core/ext/client_config/connector.h',
'src/core/ext/client_config/initial_connect_string.h',
'src/core/ext/client_config/lb_policy.h',
@ -390,8 +389,8 @@ Pod::Spec.new do |s|
'src/core/ext/client_config/resolver.h',
'src/core/ext/client_config/resolver_factory.h',
'src/core/ext/client_config/resolver_registry.h',
'src/core/ext/client_config/resolver_result.h',
'src/core/ext/client_config/subchannel.h',
'src/core/ext/client_config/subchannel_call_holder.h',
'src/core/ext/client_config/subchannel_index.h',
'src/core/ext/client_config/uri_parser.h',
'src/core/ext/lb_policy/grpclb/grpclb.h',
@ -558,7 +557,6 @@ Pod::Spec.new do |s|
'src/core/ext/client_config/channel_connectivity.c',
'src/core/ext/client_config/client_channel.c',
'src/core/ext/client_config/client_channel_factory.c',
'src/core/ext/client_config/client_config.c',
'src/core/ext/client_config/client_config_plugin.c',
'src/core/ext/client_config/connector.c',
'src/core/ext/client_config/default_initial_connect_string.c',
@ -570,8 +568,8 @@ Pod::Spec.new do |s|
'src/core/ext/client_config/resolver.c',
'src/core/ext/client_config/resolver_factory.c',
'src/core/ext/client_config/resolver_registry.c',
'src/core/ext/client_config/resolver_result.c',
'src/core/ext/client_config/subchannel.c',
'src/core/ext/client_config/subchannel_call_holder.c',
'src/core/ext/client_config/subchannel_index.c',
'src/core/ext/client_config/uri_parser.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
@ -743,7 +741,6 @@ Pod::Spec.new do |s|
'src/core/lib/tsi/transport_security_interface.h',
'src/core/ext/client_config/client_channel.h',
'src/core/ext/client_config/client_channel_factory.h',
'src/core/ext/client_config/client_config.h',
'src/core/ext/client_config/connector.h',
'src/core/ext/client_config/initial_connect_string.h',
'src/core/ext/client_config/lb_policy.h',
@ -753,8 +750,8 @@ Pod::Spec.new do |s|
'src/core/ext/client_config/resolver.h',
'src/core/ext/client_config/resolver_factory.h',
'src/core/ext/client_config/resolver_registry.h',
'src/core/ext/client_config/resolver_result.h',
'src/core/ext/client_config/subchannel.h',
'src/core/ext/client_config/subchannel_call_holder.h',
'src/core/ext/client_config/subchannel_index.h',
'src/core/ext/client_config/uri_parser.h',
'src/core/ext/lb_policy/grpclb/grpclb.h',

@ -42,6 +42,7 @@ EXPORTS
grpc_init
grpc_shutdown
grpc_version_string
grpc_g_stands_for
grpc_completion_queue_create
grpc_completion_queue_next
grpc_completion_queue_pluck

@ -299,7 +299,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/tsi/transport_security_interface.h )
s.files += %w( src/core/ext/client_config/client_channel.h )
s.files += %w( src/core/ext/client_config/client_channel_factory.h )
s.files += %w( src/core/ext/client_config/client_config.h )
s.files += %w( src/core/ext/client_config/connector.h )
s.files += %w( src/core/ext/client_config/initial_connect_string.h )
s.files += %w( src/core/ext/client_config/lb_policy.h )
@ -309,8 +308,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/client_config/resolver.h )
s.files += %w( src/core/ext/client_config/resolver_factory.h )
s.files += %w( src/core/ext/client_config/resolver_registry.h )
s.files += %w( src/core/ext/client_config/resolver_result.h )
s.files += %w( src/core/ext/client_config/subchannel.h )
s.files += %w( src/core/ext/client_config/subchannel_call_holder.h )
s.files += %w( src/core/ext/client_config/subchannel_index.h )
s.files += %w( src/core/ext/client_config/uri_parser.h )
s.files += %w( src/core/ext/lb_policy/grpclb/grpclb.h )
@ -477,7 +476,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/client_config/channel_connectivity.c )
s.files += %w( src/core/ext/client_config/client_channel.c )
s.files += %w( src/core/ext/client_config/client_channel_factory.c )
s.files += %w( src/core/ext/client_config/client_config.c )
s.files += %w( src/core/ext/client_config/client_config_plugin.c )
s.files += %w( src/core/ext/client_config/connector.c )
s.files += %w( src/core/ext/client_config/default_initial_connect_string.c )
@ -489,8 +487,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/client_config/resolver.c )
s.files += %w( src/core/ext/client_config/resolver_factory.c )
s.files += %w( src/core/ext/client_config/resolver_registry.c )
s.files += %w( src/core/ext/client_config/resolver_result.c )
s.files += %w( src/core/ext/client_config/subchannel.c )
s.files += %w( src/core/ext/client_config/subchannel_call_holder.c )
s.files += %w( src/core/ext/client_config/subchannel_index.c )
s.files += %w( src/core/ext/client_config/uri_parser.c )
s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.c )

@ -48,7 +48,6 @@ namespace grpc {
/// \param target The URI of the endpoint to connect to.
/// \param creds Credentials to use for the created channel. If it does not hold
/// an object or is invalid, a lame channel is returned.
/// \param args Options for channel creation.
std::shared_ptr<Channel> CreateChannel(
const grpc::string& target,
const std::shared_ptr<ChannelCredentials>& creds);

@ -271,7 +271,7 @@ class ClientContext {
/// Set \a algorithm to be the compression algorithm used for the client call.
///
/// \param algorith The compression algorithm used for the client call.
/// \param algorithm The compression algorithm used for the client call.
void set_compression_algorithm(grpc_compression_algorithm algorithm);
/// Return the peer uri in a string.
@ -307,6 +307,10 @@ class ClientContext {
};
static void SetGlobalCallbacks(GlobalCallbacks* callbacks);
// Should be used for framework-level extensions only.
// Applications never need to call this method.
grpc_call* c_call() { return call_; }
private:
// Disallow copy and assign.
ClientContext(const ClientContext&);

@ -166,6 +166,10 @@ class ServerContext {
async_notify_when_done_tag_ = tag;
}
// Should be used for framework-level extensions only.
// Applications never need to call this method.
grpc_call* c_call() { return call_; }
private:
friend class ::grpc::testing::InteropServerContextInspector;
friend class ::grpc::ServerInterface;

@ -64,6 +64,15 @@ class ClientStreamingInterface {
virtual Status Finish() = 0;
};
/// Common interface for all synchronous server side streaming.
class ServerStreamingInterface {
public:
virtual ~ServerStreamingInterface() {}
/// Blocking send initial metadata to client.
virtual void SendInitialMetadata() = 0;
};
/// An interface that yields a sequence of messages of type \a R.
template <class R>
class ReaderInterface {
@ -336,12 +345,17 @@ class ClientReaderWriter GRPC_FINAL : public ClientReaderWriterInterface<W, R> {
Call call_;
};
/// Server-side interface for streaming reads of message of type \a R.
template <class R>
class ServerReaderInterface : public ServerStreamingInterface,
public ReaderInterface<R> {};
template <class R>
class ServerReader GRPC_FINAL : public ReaderInterface<R> {
class ServerReader GRPC_FINAL : public ServerReaderInterface<R> {
public:
ServerReader(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {}
void SendInitialMetadata() {
void SendInitialMetadata() GRPC_OVERRIDE {
GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
CallOpSet<CallOpSendInitialMetadata> ops;
@ -367,12 +381,17 @@ class ServerReader GRPC_FINAL : public ReaderInterface<R> {
ServerContext* const ctx_;
};
/// Server-side interface for streaming writes of message of type \a W.
template <class W>
class ServerWriter GRPC_FINAL : public WriterInterface<W> {
class ServerWriterInterface : public ServerStreamingInterface,
public WriterInterface<W> {};
template <class W>
class ServerWriter GRPC_FINAL : public ServerWriterInterface<W> {
public:
ServerWriter(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {}
void SendInitialMetadata() {
void SendInitialMetadata() GRPC_OVERRIDE {
GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
CallOpSet<CallOpSendInitialMetadata> ops;
@ -411,12 +430,16 @@ class ServerWriter GRPC_FINAL : public WriterInterface<W> {
/// Server-side interface for bi-directional streaming.
template <class W, class R>
class ServerReaderWriter GRPC_FINAL : public WriterInterface<W>,
public ReaderInterface<R> {
class ServerReaderWriterInterface : public ServerStreamingInterface,
public WriterInterface<W>,
public ReaderInterface<R> {};
template <class W, class R>
class ServerReaderWriter GRPC_FINAL : public ServerReaderWriterInterface<W, R> {
public:
ServerReaderWriter(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {}
void SendInitialMetadata() {
void SendInitialMetadata() GRPC_OVERRIDE {
GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_);
CallOpSet<CallOpSendInitialMetadata> ops;

@ -90,6 +90,9 @@ GRPCAPI void grpc_shutdown(void);
/** Return a string representing the current version of grpc */
GRPCAPI const char *grpc_version_string(void);
/** Return a string specifying what the 'g' in gRPC stands for */
GRPCAPI const char *grpc_g_stands_for(void);
/** Create a completion queue */
GRPCAPI grpc_completion_queue *grpc_completion_queue_create(void *reserved);

@ -22,7 +22,7 @@
</stability>
<license>BSD</license>
<notes>
- TBD
- Reject metadata keys which are not legal #7881
</notes>
<contents>
<dir baseinstalldir="/" name="/">
@ -307,7 +307,6 @@
<file baseinstalldir="/" name="src/core/lib/tsi/transport_security_interface.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/client_channel.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/client_channel_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/client_config.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/connector.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/initial_connect_string.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy.h" role="src" />
@ -317,8 +316,8 @@
<file baseinstalldir="/" name="src/core/ext/client_config/resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver_registry.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver_result.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/subchannel.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/subchannel_call_holder.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/subchannel_index.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/uri_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/grpclb.h" role="src" />
@ -485,7 +484,6 @@
<file baseinstalldir="/" name="src/core/ext/client_config/channel_connectivity.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/client_channel.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/client_channel_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/client_config.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/client_config_plugin.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/connector.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/default_initial_connect_string.c" role="src" />
@ -497,8 +495,8 @@
<file baseinstalldir="/" name="src/core/ext/client_config/resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver_registry.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver_result.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/subchannel.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/subchannel_call_holder.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/subchannel_index.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/uri_parser.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2.c" role="src" />
@ -1183,7 +1181,7 @@ Update to wrap gRPC C Core version 0.10.0
<date>2016-08-22</date>
<license>BSD</license>
<notes>
- TBD
- Reject metadata keys which are not legal #7881
</notes>
</release>
</changelog>

@ -12,7 +12,7 @@ data might include:
- a load balancing policy to decide which server to send a request to
- a set of filters to mutate outgoing requests (say, by adding metadata)
The resolver provides this data as a stream of grpc_client_config objects to
The resolver provides this data as a stream of grpc_resolver_result objects to
the channel. We represent configuration as a stream so that it can be changed
by the resolver during execution, by reacting to external events (such as a
new configuration file being pushed to some store).
@ -22,7 +22,7 @@ Load Balancing
--------------
Load balancing configuration is provided by a grpc_lb_policy object, stored as
part of grpc_client_config.
part of grpc_resolver_result.
The primary job of the load balancing policies is to pick a target server given only the
initial metadata for a request. It does this by providing a grpc_subchannel

@ -33,6 +33,7 @@
#include "src/core/ext/client_config/client_channel.h"
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
@ -41,10 +42,11 @@
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
#include "src/core/ext/client_config/subchannel_call_holder.h"
#include "src/core/ext/client_config/subchannel.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/support/string.h"
#include "src/core/lib/surface/channel.h"
@ -52,30 +54,31 @@
/* Client channel implementation */
typedef grpc_subchannel_call_holder call_data;
/*************************************************************************
* CHANNEL-WIDE FUNCTIONS
*/
typedef struct client_channel_channel_data {
/** resolver for this channel */
grpc_resolver *resolver;
/** have we started resolving this channel */
int started_resolving;
bool started_resolving;
/** mutex protecting client configuration, including all
variables below in this data structure */
gpr_mu mu_config;
/** currently active load balancer - guarded by mu_config */
gpr_mu mu;
/** currently active load balancer - guarded by mu */
grpc_lb_policy *lb_policy;
/** incoming configuration - set by resolver.next
guarded by mu_config */
grpc_client_config *incoming_configuration;
/** incoming resolver result - set by resolver.next(), guarded by mu */
grpc_resolver_result *resolver_result;
/** a list of closures that are all waiting for config to come in */
grpc_closure_list waiting_for_config_closures;
/** resolver callback */
grpc_closure on_config_changed;
grpc_closure on_resolver_result_changed;
/** connectivity state being tracked */
grpc_connectivity_state_tracker state_tracker;
/** when an lb_policy arrives, should we try to exit idle */
int exit_idle_when_lb_policy_arrives;
bool exit_idle_when_lb_policy_arrives;
/** owning stack */
grpc_channel_stack *owning_stack;
/** interested parties (owned) */
@ -83,10 +86,8 @@ typedef struct client_channel_channel_data {
} channel_data;
/** We create one watcher for each new lb_policy that is returned from a
resolver,
to watch for state changes from the lb_policy. When a state change is seen,
we
update the channel, and create a new watcher */
resolver, to watch for state changes from the lb_policy. When a state
change is seen, we update the channel, and create a new watcher. */
typedef struct {
channel_data *chand;
grpc_closure on_changed;
@ -94,22 +95,6 @@ typedef struct {
grpc_lb_policy *lb_policy;
} lb_policy_connectivity_watcher;
typedef struct {
grpc_closure closure;
grpc_call_element *elem;
} waiting_call;
static char *cc_get_peer(grpc_exec_ctx *exec_ctx, grpc_call_element *elem) {
return grpc_subchannel_call_holder_get_peer(exec_ctx, elem->call_data);
}
static void cc_start_transport_stream_op(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_transport_stream_op *op) {
GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
grpc_subchannel_call_holder_perform_op(exec_ctx, elem->call_data, op);
}
static void watch_lb_policy(grpc_exec_ctx *exec_ctx, channel_data *chand,
grpc_lb_policy *lb_policy,
grpc_connectivity_state current_state);
@ -156,9 +141,9 @@ static void on_lb_policy_state_changed(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
lb_policy_connectivity_watcher *w = arg;
gpr_mu_lock(&w->chand->mu_config);
gpr_mu_lock(&w->chand->mu);
on_lb_policy_state_changed_locked(exec_ctx, w, error);
gpr_mu_unlock(&w->chand->mu_config);
gpr_mu_unlock(&w->chand->mu);
GRPC_CHANNEL_STACK_UNREF(exec_ctx, w->chand->owning_stack, "watch_lb_policy");
gpr_free(w);
@ -178,17 +163,17 @@ static void watch_lb_policy(grpc_exec_ctx *exec_ctx, channel_data *chand,
&w->on_changed);
}
static void cc_on_config_changed(grpc_exec_ctx *exec_ctx, void *arg,
static void on_resolver_result_changed(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
channel_data *chand = arg;
grpc_lb_policy *lb_policy = NULL;
grpc_lb_policy *old_lb_policy;
grpc_connectivity_state state = GRPC_CHANNEL_TRANSIENT_FAILURE;
int exit_idle = 0;
bool exit_idle = false;
grpc_error *state_error = GRPC_ERROR_CREATE("No load balancing policy");
if (chand->incoming_configuration != NULL) {
lb_policy = grpc_client_config_get_lb_policy(chand->incoming_configuration);
if (chand->resolver_result != NULL) {
lb_policy = grpc_resolver_result_get_lb_policy(chand->resolver_result);
if (lb_policy != NULL) {
GRPC_LB_POLICY_REF(lb_policy, "channel");
GRPC_LB_POLICY_REF(lb_policy, "config_change");
@ -197,17 +182,17 @@ static void cc_on_config_changed(grpc_exec_ctx *exec_ctx, void *arg,
grpc_lb_policy_check_connectivity(exec_ctx, lb_policy, &state_error);
}
grpc_client_config_unref(exec_ctx, chand->incoming_configuration);
grpc_resolver_result_unref(exec_ctx, chand->resolver_result);
}
chand->incoming_configuration = NULL;
chand->resolver_result = NULL;
if (lb_policy != NULL) {
grpc_pollset_set_add_pollset_set(exec_ctx, lb_policy->interested_parties,
chand->interested_parties);
}
gpr_mu_lock(&chand->mu_config);
gpr_mu_lock(&chand->mu);
old_lb_policy = chand->lb_policy;
chand->lb_policy = lb_policy;
if (lb_policy != NULL) {
@ -222,8 +207,8 @@ static void cc_on_config_changed(grpc_exec_ctx *exec_ctx, void *arg,
}
if (lb_policy != NULL && chand->exit_idle_when_lb_policy_arrives) {
GRPC_LB_POLICY_REF(lb_policy, "exit_idle");
exit_idle = 1;
chand->exit_idle_when_lb_policy_arrives = 0;
exit_idle = true;
chand->exit_idle_when_lb_policy_arrives = false;
}
if (error == GRPC_ERROR_NONE && chand->resolver) {
@ -233,10 +218,9 @@ static void cc_on_config_changed(grpc_exec_ctx *exec_ctx, void *arg,
watch_lb_policy(exec_ctx, chand, lb_policy, state);
}
GRPC_CHANNEL_STACK_REF(chand->owning_stack, "resolver");
grpc_resolver_next(exec_ctx, chand->resolver,
&chand->incoming_configuration,
&chand->on_config_changed);
gpr_mu_unlock(&chand->mu_config);
grpc_resolver_next(exec_ctx, chand->resolver, &chand->resolver_result,
&chand->on_resolver_result_changed);
gpr_mu_unlock(&chand->mu);
} else {
if (chand->resolver != NULL) {
grpc_resolver_shutdown(exec_ctx, chand->resolver);
@ -249,7 +233,7 @@ static void cc_on_config_changed(grpc_exec_ctx *exec_ctx, void *arg,
GRPC_ERROR_CREATE_REFERENCING("Got config after disconnection", refs,
GPR_ARRAY_SIZE(refs)),
"resolver_gone");
gpr_mu_unlock(&chand->mu_config);
gpr_mu_unlock(&chand->mu);
}
if (exit_idle) {
@ -284,7 +268,7 @@ static void cc_start_transport_op(grpc_exec_ctx *exec_ctx,
op->bind_pollset);
}
gpr_mu_lock(&chand->mu_config);
gpr_mu_lock(&chand->mu);
if (op->on_connectivity_state_change != NULL) {
grpc_connectivity_state_notify_on_state_change(
exec_ctx, &chand->state_tracker, op->connectivity_state,
@ -329,7 +313,189 @@ static void cc_start_transport_op(grpc_exec_ctx *exec_ctx,
}
GRPC_ERROR_UNREF(op->disconnect_with_error);
}
gpr_mu_unlock(&chand->mu_config);
gpr_mu_unlock(&chand->mu);
}
/* Constructor for channel_data */
static void cc_init_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem,
grpc_channel_element_args *args) {
channel_data *chand = elem->channel_data;
memset(chand, 0, sizeof(*chand));
GPR_ASSERT(args->is_last);
GPR_ASSERT(elem->filter == &grpc_client_channel_filter);
gpr_mu_init(&chand->mu);
grpc_closure_init(&chand->on_resolver_result_changed,
on_resolver_result_changed, chand);
chand->owning_stack = args->channel_stack;
grpc_connectivity_state_init(&chand->state_tracker, GRPC_CHANNEL_IDLE,
"client_channel");
chand->interested_parties = grpc_pollset_set_create();
}
/* Destructor for channel_data */
static void cc_destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {
channel_data *chand = elem->channel_data;
if (chand->resolver != NULL) {
grpc_resolver_shutdown(exec_ctx, chand->resolver);
GRPC_RESOLVER_UNREF(exec_ctx, chand->resolver, "channel");
}
if (chand->lb_policy != NULL) {
grpc_pollset_set_del_pollset_set(exec_ctx,
chand->lb_policy->interested_parties,
chand->interested_parties);
GRPC_LB_POLICY_UNREF(exec_ctx, chand->lb_policy, "channel");
}
grpc_connectivity_state_destroy(exec_ctx, &chand->state_tracker);
grpc_pollset_set_destroy(chand->interested_parties);
gpr_mu_destroy(&chand->mu);
}
/*************************************************************************
* PER-CALL FUNCTIONS
*/
#define GET_CALL(call_data) \
((grpc_subchannel_call *)(gpr_atm_acq_load(&(call_data)->subchannel_call)))
#define CANCELLED_CALL ((grpc_subchannel_call *)1)
typedef enum {
GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING,
GRPC_SUBCHANNEL_CALL_HOLDER_PICKING_SUBCHANNEL
} subchannel_creation_phase;
/** Call data. Holds a pointer to grpc_subchannel_call and the
associated machinery to create such a pointer.
Handles queueing of stream ops until a call object is ready, waiting
for initial metadata before trying to create a call object,
and handling cancellation gracefully. */
typedef struct client_channel_call_data {
/** either 0 for no call, 1 for cancelled, or a pointer to a
grpc_subchannel_call */
gpr_atm subchannel_call;
gpr_mu mu;
subchannel_creation_phase creation_phase;
grpc_connected_subchannel *connected_subchannel;
grpc_polling_entity *pollent;
grpc_transport_stream_op *waiting_ops;
size_t waiting_ops_count;
size_t waiting_ops_capacity;
grpc_closure next_step;
grpc_call_stack *owning_call;
} call_data;
static void add_waiting_locked(call_data *calld, grpc_transport_stream_op *op) {
GPR_TIMER_BEGIN("add_waiting_locked", 0);
if (calld->waiting_ops_count == calld->waiting_ops_capacity) {
calld->waiting_ops_capacity = GPR_MAX(3, 2 * calld->waiting_ops_capacity);
calld->waiting_ops =
gpr_realloc(calld->waiting_ops,
calld->waiting_ops_capacity * sizeof(*calld->waiting_ops));
}
calld->waiting_ops[calld->waiting_ops_count++] = *op;
GPR_TIMER_END("add_waiting_locked", 0);
}
static void fail_locked(grpc_exec_ctx *exec_ctx, call_data *calld,
grpc_error *error) {
size_t i;
for (i = 0; i < calld->waiting_ops_count; i++) {
grpc_transport_stream_op_finish_with_failure(
exec_ctx, &calld->waiting_ops[i], GRPC_ERROR_REF(error));
}
calld->waiting_ops_count = 0;
GRPC_ERROR_UNREF(error);
}
typedef struct {
grpc_transport_stream_op *ops;
size_t nops;
grpc_subchannel_call *call;
} retry_ops_args;
static void retry_ops(grpc_exec_ctx *exec_ctx, void *args, grpc_error *error) {
retry_ops_args *a = args;
size_t i;
for (i = 0; i < a->nops; i++) {
grpc_subchannel_call_process_op(exec_ctx, a->call, &a->ops[i]);
}
GRPC_SUBCHANNEL_CALL_UNREF(exec_ctx, a->call, "retry_ops");
gpr_free(a->ops);
gpr_free(a);
}
static void retry_waiting_locked(grpc_exec_ctx *exec_ctx, call_data *calld) {
retry_ops_args *a = gpr_malloc(sizeof(*a));
a->ops = calld->waiting_ops;
a->nops = calld->waiting_ops_count;
a->call = GET_CALL(calld);
if (a->call == CANCELLED_CALL) {
gpr_free(a);
fail_locked(exec_ctx, calld, GRPC_ERROR_CANCELLED);
return;
}
calld->waiting_ops = NULL;
calld->waiting_ops_count = 0;
calld->waiting_ops_capacity = 0;
GRPC_SUBCHANNEL_CALL_REF(a->call, "retry_ops");
grpc_exec_ctx_sched(exec_ctx, grpc_closure_create(retry_ops, a),
GRPC_ERROR_NONE, NULL);
}
static void subchannel_ready(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
call_data *calld = arg;
gpr_mu_lock(&calld->mu);
GPR_ASSERT(calld->creation_phase ==
GRPC_SUBCHANNEL_CALL_HOLDER_PICKING_SUBCHANNEL);
calld->creation_phase = GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING;
if (calld->connected_subchannel == NULL) {
gpr_atm_no_barrier_store(&calld->subchannel_call, 1);
fail_locked(exec_ctx, calld, GRPC_ERROR_CREATE_REFERENCING(
"Failed to create subchannel", &error, 1));
} else if (1 == gpr_atm_acq_load(&calld->subchannel_call)) {
/* already cancelled before subchannel became ready */
fail_locked(exec_ctx, calld,
GRPC_ERROR_CREATE_REFERENCING(
"Cancelled before creating subchannel", &error, 1));
} else {
grpc_subchannel_call *subchannel_call = NULL;
grpc_error *new_error = grpc_connected_subchannel_create_call(
exec_ctx, calld->connected_subchannel, calld->pollent,
&subchannel_call);
if (new_error != GRPC_ERROR_NONE) {
new_error = grpc_error_add_child(new_error, error);
subchannel_call = CANCELLED_CALL;
fail_locked(exec_ctx, calld, new_error);
}
gpr_atm_rel_store(&calld->subchannel_call,
(gpr_atm)(uintptr_t)subchannel_call);
retry_waiting_locked(exec_ctx, calld);
}
gpr_mu_unlock(&calld->mu);
GRPC_CALL_STACK_UNREF(exec_ctx, calld->owning_call, "pick_subchannel");
}
static char *cc_get_peer(grpc_exec_ctx *exec_ctx, grpc_call_element *elem) {
call_data *calld = elem->call_data;
grpc_subchannel_call *subchannel_call = GET_CALL(calld);
if (subchannel_call == NULL || subchannel_call == CANCELLED_CALL) {
return NULL;
} else {
return grpc_subchannel_call_get_peer(exec_ctx, subchannel_call);
}
}
typedef struct {
@ -341,7 +507,7 @@ typedef struct {
grpc_closure closure;
} continue_picking_args;
static int cc_pick_subchannel(grpc_exec_ctx *exec_ctx, void *arg,
static bool pick_subchannel(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_metadata_batch *initial_metadata,
uint32_t initial_metadata_flags,
grpc_connected_subchannel **connected_subchannel,
@ -354,7 +520,7 @@ static void continue_picking(grpc_exec_ctx *exec_ctx, void *arg,
/* cancelled, do nothing */
} else if (error != GRPC_ERROR_NONE) {
grpc_exec_ctx_sched(exec_ctx, cpa->on_ready, GRPC_ERROR_REF(error), NULL);
} else if (cc_pick_subchannel(exec_ctx, cpa->elem, cpa->initial_metadata,
} else if (pick_subchannel(exec_ctx, cpa->elem, cpa->initial_metadata,
cpa->initial_metadata_flags,
cpa->connected_subchannel, cpa->on_ready)) {
grpc_exec_ctx_sched(exec_ctx, cpa->on_ready, GRPC_ERROR_NONE, NULL);
@ -362,14 +528,13 @@ static void continue_picking(grpc_exec_ctx *exec_ctx, void *arg,
gpr_free(cpa);
}
static int cc_pick_subchannel(grpc_exec_ctx *exec_ctx, void *elemp,
static bool pick_subchannel(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_metadata_batch *initial_metadata,
uint32_t initial_metadata_flags,
grpc_connected_subchannel **connected_subchannel,
grpc_closure *on_ready) {
GPR_TIMER_BEGIN("cc_pick_subchannel", 0);
GPR_TIMER_BEGIN("pick_subchannel", 0);
grpc_call_element *elem = elemp;
channel_data *chand = elem->channel_data;
call_data *calld = elem->call_data;
continue_picking_args *cpa;
@ -377,7 +542,7 @@ static int cc_pick_subchannel(grpc_exec_ctx *exec_ctx, void *elemp,
GPR_ASSERT(connected_subchannel);
gpr_mu_lock(&chand->mu_config);
gpr_mu_lock(&chand->mu);
if (initial_metadata == NULL) {
if (chand->lb_policy != NULL) {
grpc_lb_policy_cancel_pick(exec_ctx, chand->lb_policy,
@ -392,28 +557,27 @@ static int cc_pick_subchannel(grpc_exec_ctx *exec_ctx, void *elemp,
GRPC_ERROR_CREATE("Pick cancelled"), NULL);
}
}
gpr_mu_unlock(&chand->mu_config);
GPR_TIMER_END("cc_pick_subchannel", 0);
return 1;
gpr_mu_unlock(&chand->mu);
GPR_TIMER_END("pick_subchannel", 0);
return true;
}
if (chand->lb_policy != NULL) {
grpc_lb_policy *lb_policy = chand->lb_policy;
int r;
GRPC_LB_POLICY_REF(lb_policy, "cc_pick_subchannel");
gpr_mu_unlock(&chand->mu_config);
GRPC_LB_POLICY_REF(lb_policy, "pick_subchannel");
gpr_mu_unlock(&chand->mu);
r = grpc_lb_policy_pick(exec_ctx, lb_policy, calld->pollent,
initial_metadata, initial_metadata_flags,
connected_subchannel, on_ready);
GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "cc_pick_subchannel");
GPR_TIMER_END("cc_pick_subchannel", 0);
GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "pick_subchannel");
GPR_TIMER_END("pick_subchannel", 0);
return r;
}
if (chand->resolver != NULL && !chand->started_resolving) {
chand->started_resolving = 1;
chand->started_resolving = true;
GRPC_CHANNEL_STACK_REF(chand->owning_stack, "resolver");
grpc_resolver_next(exec_ctx, chand->resolver,
&chand->incoming_configuration,
&chand->on_config_changed);
grpc_resolver_next(exec_ctx, chand->resolver, &chand->resolver_result,
&chand->on_resolver_result_changed);
}
if (chand->resolver != NULL) {
cpa = gpr_malloc(sizeof(*cpa));
@ -429,69 +593,148 @@ static int cc_pick_subchannel(grpc_exec_ctx *exec_ctx, void *elemp,
grpc_exec_ctx_sched(exec_ctx, on_ready, GRPC_ERROR_CREATE("Disconnected"),
NULL);
}
gpr_mu_unlock(&chand->mu_config);
gpr_mu_unlock(&chand->mu);
GPR_TIMER_END("cc_pick_subchannel", 0);
return 0;
GPR_TIMER_END("pick_subchannel", 0);
return false;
}
// The logic here is fairly complicated, due to (a) the fact that we
// need to handle the case where we receive the send op before the
// initial metadata op, and (b) the need for efficiency, especially in
// the streaming case.
// TODO(ctiller): Explain this more thoroughly.
static void cc_start_transport_stream_op(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_transport_stream_op *op) {
call_data *calld = elem->call_data;
GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
/* try to (atomically) get the call */
grpc_subchannel_call *call = GET_CALL(calld);
GPR_TIMER_BEGIN("cc_start_transport_stream_op", 0);
if (call == CANCELLED_CALL) {
grpc_transport_stream_op_finish_with_failure(exec_ctx, op,
GRPC_ERROR_CANCELLED);
GPR_TIMER_END("cc_start_transport_stream_op", 0);
return;
}
if (call != NULL) {
grpc_subchannel_call_process_op(exec_ctx, call, op);
GPR_TIMER_END("cc_start_transport_stream_op", 0);
return;
}
/* we failed; lock and figure out what to do */
gpr_mu_lock(&calld->mu);
retry:
/* need to recheck that another thread hasn't set the call */
call = GET_CALL(calld);
if (call == CANCELLED_CALL) {
gpr_mu_unlock(&calld->mu);
grpc_transport_stream_op_finish_with_failure(exec_ctx, op,
GRPC_ERROR_CANCELLED);
GPR_TIMER_END("cc_start_transport_stream_op", 0);
return;
}
if (call != NULL) {
gpr_mu_unlock(&calld->mu);
grpc_subchannel_call_process_op(exec_ctx, call, op);
GPR_TIMER_END("cc_start_transport_stream_op", 0);
return;
}
/* if this is a cancellation, then we can raise our cancelled flag */
if (op->cancel_error != GRPC_ERROR_NONE) {
if (!gpr_atm_rel_cas(&calld->subchannel_call, 0,
(gpr_atm)(uintptr_t)CANCELLED_CALL)) {
goto retry;
} else {
switch (calld->creation_phase) {
case GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING:
fail_locked(exec_ctx, calld, GRPC_ERROR_REF(op->cancel_error));
break;
case GRPC_SUBCHANNEL_CALL_HOLDER_PICKING_SUBCHANNEL:
pick_subchannel(exec_ctx, elem, NULL, 0,
&calld->connected_subchannel, NULL);
break;
}
gpr_mu_unlock(&calld->mu);
grpc_transport_stream_op_finish_with_failure(exec_ctx, op,
GRPC_ERROR_CANCELLED);
GPR_TIMER_END("cc_start_transport_stream_op", 0);
return;
}
}
/* if we don't have a subchannel, try to get one */
if (calld->creation_phase == GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING &&
calld->connected_subchannel == NULL &&
op->send_initial_metadata != NULL) {
calld->creation_phase = GRPC_SUBCHANNEL_CALL_HOLDER_PICKING_SUBCHANNEL;
grpc_closure_init(&calld->next_step, subchannel_ready, calld);
GRPC_CALL_STACK_REF(calld->owning_call, "pick_subchannel");
if (pick_subchannel(
exec_ctx, elem, op->send_initial_metadata,
op->send_initial_metadata_flags, &calld->connected_subchannel,
&calld->next_step)) {
calld->creation_phase = GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING;
GRPC_CALL_STACK_UNREF(exec_ctx, calld->owning_call, "pick_subchannel");
}
}
/* if we've got a subchannel, then let's ask it to create a call */
if (calld->creation_phase == GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING &&
calld->connected_subchannel != NULL) {
grpc_subchannel_call *subchannel_call = NULL;
grpc_error *error = grpc_connected_subchannel_create_call(
exec_ctx, calld->connected_subchannel, calld->pollent,
&subchannel_call);
if (error != GRPC_ERROR_NONE) {
subchannel_call = CANCELLED_CALL;
fail_locked(exec_ctx, calld, GRPC_ERROR_REF(error));
grpc_transport_stream_op_finish_with_failure(exec_ctx, op, error);
}
gpr_atm_rel_store(&calld->subchannel_call,
(gpr_atm)(uintptr_t)subchannel_call);
retry_waiting_locked(exec_ctx, calld);
goto retry;
}
/* nothing to be done but wait */
add_waiting_locked(calld, op);
gpr_mu_unlock(&calld->mu);
GPR_TIMER_END("cc_start_transport_stream_op", 0);
}
/* Constructor for call_data */
static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
static grpc_error *cc_init_call_elem(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_call_element_args *args) {
grpc_subchannel_call_holder_init(elem->call_data, cc_pick_subchannel, elem,
args->call_stack);
call_data *calld = elem->call_data;
gpr_atm_rel_store(&calld->subchannel_call, 0);
gpr_mu_init(&calld->mu);
calld->connected_subchannel = NULL;
calld->waiting_ops = NULL;
calld->waiting_ops_count = 0;
calld->waiting_ops_capacity = 0;
calld->creation_phase = GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING;
calld->owning_call = args->call_stack;
calld->pollent = NULL;
return GRPC_ERROR_NONE;
}
/* Destructor for call_data */
static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
static void cc_destroy_call_elem(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
const grpc_call_final_info *final_info,
void *and_free_memory) {
grpc_subchannel_call_holder_destroy(exec_ctx, elem->call_data);
call_data *calld = elem->call_data;
grpc_subchannel_call *call = GET_CALL(calld);
if (call != NULL && call != CANCELLED_CALL) {
GRPC_SUBCHANNEL_CALL_UNREF(exec_ctx, call, "client_channel_destroy_call");
}
GPR_ASSERT(calld->creation_phase == GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING);
gpr_mu_destroy(&calld->mu);
GPR_ASSERT(calld->waiting_ops_count == 0);
gpr_free(calld->waiting_ops);
gpr_free(and_free_memory);
}
/* Constructor for channel_data */
static void init_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem,
grpc_channel_element_args *args) {
channel_data *chand = elem->channel_data;
memset(chand, 0, sizeof(*chand));
GPR_ASSERT(args->is_last);
GPR_ASSERT(elem->filter == &grpc_client_channel_filter);
gpr_mu_init(&chand->mu_config);
grpc_closure_init(&chand->on_config_changed, cc_on_config_changed, chand);
chand->owning_stack = args->channel_stack;
grpc_connectivity_state_init(&chand->state_tracker, GRPC_CHANNEL_IDLE,
"client_channel");
chand->interested_parties = grpc_pollset_set_create();
}
/* Destructor for channel_data */
static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {
channel_data *chand = elem->channel_data;
if (chand->resolver != NULL) {
grpc_resolver_shutdown(exec_ctx, chand->resolver);
GRPC_RESOLVER_UNREF(exec_ctx, chand->resolver, "channel");
}
if (chand->lb_policy != NULL) {
grpc_pollset_set_del_pollset_set(exec_ctx,
chand->lb_policy->interested_parties,
chand->interested_parties);
GRPC_LB_POLICY_UNREF(exec_ctx, chand->lb_policy, "channel");
}
grpc_connectivity_state_destroy(exec_ctx, &chand->state_tracker);
grpc_pollset_set_destroy(chand->interested_parties);
gpr_mu_destroy(&chand->mu_config);
}
static void cc_set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_polling_entity *pollent) {
@ -499,16 +742,20 @@ static void cc_set_pollset_or_pollset_set(grpc_exec_ctx *exec_ctx,
calld->pollent = pollent;
}
/*************************************************************************
* EXPORTED SYMBOLS
*/
const grpc_channel_filter grpc_client_channel_filter = {
cc_start_transport_stream_op,
cc_start_transport_op,
sizeof(call_data),
init_call_elem,
cc_init_call_elem,
cc_set_pollset_or_pollset_set,
destroy_call_elem,
cc_destroy_call_elem,
sizeof(channel_data),
init_channel_elem,
destroy_channel_elem,
cc_init_channel_elem,
cc_destroy_channel_elem,
cc_get_peer,
"client-channel",
};
@ -519,41 +766,40 @@ void grpc_client_channel_set_resolver(grpc_exec_ctx *exec_ctx,
/* post construction initialization: set the transport setup pointer */
grpc_channel_element *elem = grpc_channel_stack_last_element(channel_stack);
channel_data *chand = elem->channel_data;
gpr_mu_lock(&chand->mu_config);
gpr_mu_lock(&chand->mu);
GPR_ASSERT(!chand->resolver);
chand->resolver = resolver;
GRPC_RESOLVER_REF(resolver, "channel");
if (!grpc_closure_list_empty(chand->waiting_for_config_closures) ||
chand->exit_idle_when_lb_policy_arrives) {
chand->started_resolving = 1;
chand->started_resolving = true;
GRPC_CHANNEL_STACK_REF(chand->owning_stack, "resolver");
grpc_resolver_next(exec_ctx, resolver, &chand->incoming_configuration,
&chand->on_config_changed);
grpc_resolver_next(exec_ctx, resolver, &chand->resolver_result,
&chand->on_resolver_result_changed);
}
gpr_mu_unlock(&chand->mu_config);
gpr_mu_unlock(&chand->mu);
}
grpc_connectivity_state grpc_client_channel_check_connectivity_state(
grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, int try_to_connect) {
channel_data *chand = elem->channel_data;
grpc_connectivity_state out;
gpr_mu_lock(&chand->mu_config);
gpr_mu_lock(&chand->mu);
out = grpc_connectivity_state_check(&chand->state_tracker, NULL);
if (out == GRPC_CHANNEL_IDLE && try_to_connect) {
if (chand->lb_policy != NULL) {
grpc_lb_policy_exit_idle(exec_ctx, chand->lb_policy);
} else {
chand->exit_idle_when_lb_policy_arrives = 1;
chand->exit_idle_when_lb_policy_arrives = true;
if (!chand->started_resolving && chand->resolver != NULL) {
GRPC_CHANNEL_STACK_REF(chand->owning_stack, "resolver");
chand->started_resolving = 1;
grpc_resolver_next(exec_ctx, chand->resolver,
&chand->incoming_configuration,
&chand->on_config_changed);
chand->started_resolving = true;
grpc_resolver_next(exec_ctx, chand->resolver, &chand->resolver_result,
&chand->on_resolver_result_changed);
}
}
}
gpr_mu_unlock(&chand->mu_config);
gpr_mu_unlock(&chand->mu);
return out;
}
@ -588,8 +834,8 @@ void grpc_client_channel_watch_connectivity_state(
grpc_closure_init(&w->my_closure, on_external_watch_complete, w);
GRPC_CHANNEL_STACK_REF(w->chand->owning_stack,
"external_connectivity_watcher");
gpr_mu_lock(&chand->mu_config);
gpr_mu_lock(&chand->mu);
grpc_connectivity_state_notify_on_state_change(
exec_ctx, &chand->state_tracker, state, &w->my_closure);
gpr_mu_unlock(&chand->mu_config);
gpr_mu_unlock(&chand->mu);
}

@ -43,8 +43,6 @@
typedef struct grpc_lb_policy_factory grpc_lb_policy_factory;
typedef struct grpc_lb_policy_factory_vtable grpc_lb_policy_factory_vtable;
/** grpc_lb_policy provides grpc_client_config objects to grpc_channel
objects */
struct grpc_lb_policy_factory {
const grpc_lb_policy_factory_vtable *vtable;
};

@ -76,7 +76,7 @@ void grpc_resolver_channel_saw_error(grpc_exec_ctx *exec_ctx,
}
void grpc_resolver_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
grpc_client_config **target_config,
grpc_resolver_result **result,
grpc_closure *on_complete) {
resolver->vtable->next(exec_ctx, resolver, target_config, on_complete);
resolver->vtable->next(exec_ctx, resolver, result, on_complete);
}

@ -34,14 +34,14 @@
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_H
#include "src/core/ext/client_config/client_config.h"
#include "src/core/ext/client_config/resolver_result.h"
#include "src/core/ext/client_config/subchannel.h"
#include "src/core/lib/iomgr/iomgr.h"
typedef struct grpc_resolver grpc_resolver;
typedef struct grpc_resolver_vtable grpc_resolver_vtable;
/** grpc_resolver provides grpc_client_config objects to grpc_channel
/** grpc_resolver provides grpc_resolver_result objects to grpc_channel
objects */
struct grpc_resolver {
const grpc_resolver_vtable *vtable;
@ -53,7 +53,7 @@ struct grpc_resolver_vtable {
void (*shutdown)(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver);
void (*channel_saw_error)(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver);
void (*next)(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
grpc_client_config **target_config, grpc_closure *on_complete);
grpc_resolver_result **result, grpc_closure *on_complete);
};
#ifdef GRPC_RESOLVER_REFCOUNT_DEBUG
@ -82,13 +82,13 @@ void grpc_resolver_channel_saw_error(grpc_exec_ctx *exec_ctx,
grpc_resolver *resolver);
/** Get the next client config. Called by the channel to fetch a new
configuration. Expected to set *target_config with a new configuration,
configuration. Expected to set *result with a new configuration,
and then schedule on_complete for execution.
If resolution is fatally broken, set *target_config to NULL and
If resolution is fatally broken, set *result to NULL and
schedule on_complete. */
void grpc_resolver_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
grpc_client_config **target_config,
grpc_resolver_result **result,
grpc_closure *on_complete);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_H */

@ -41,7 +41,7 @@
typedef struct grpc_resolver_factory grpc_resolver_factory;
typedef struct grpc_resolver_factory_vtable grpc_resolver_factory_vtable;
/** grpc_resolver provides grpc_client_config objects to grpc_channel
/** grpc_resolver provides grpc_resolver_result objects to grpc_channel
objects */
struct grpc_resolver_factory {
const grpc_resolver_factory_vtable *vtable;

@ -31,44 +31,45 @@
*
*/
#include "src/core/ext/client_config/client_config.h"
#include "src/core/ext/client_config/resolver_result.h"
#include <string.h>
#include <grpc/support/alloc.h>
struct grpc_client_config {
struct grpc_resolver_result {
gpr_refcount refs;
grpc_lb_policy *lb_policy;
};
grpc_client_config *grpc_client_config_create() {
grpc_client_config *c = gpr_malloc(sizeof(*c));
grpc_resolver_result *grpc_resolver_result_create() {
grpc_resolver_result *c = gpr_malloc(sizeof(*c));
memset(c, 0, sizeof(*c));
gpr_ref_init(&c->refs, 1);
return c;
}
void grpc_client_config_ref(grpc_client_config *c) { gpr_ref(&c->refs); }
void grpc_resolver_result_ref(grpc_resolver_result *c) { gpr_ref(&c->refs); }
void grpc_client_config_unref(grpc_exec_ctx *exec_ctx, grpc_client_config *c) {
void grpc_resolver_result_unref(grpc_exec_ctx *exec_ctx,
grpc_resolver_result *c) {
if (gpr_unref(&c->refs)) {
if (c->lb_policy != NULL) {
GRPC_LB_POLICY_UNREF(exec_ctx, c->lb_policy, "client_config");
GRPC_LB_POLICY_UNREF(exec_ctx, c->lb_policy, "resolver_result");
}
gpr_free(c);
}
}
void grpc_client_config_set_lb_policy(grpc_client_config *c,
void grpc_resolver_result_set_lb_policy(grpc_resolver_result *c,
grpc_lb_policy *lb_policy) {
GPR_ASSERT(c->lb_policy == NULL);
if (lb_policy) {
GRPC_LB_POLICY_REF(lb_policy, "client_config");
GRPC_LB_POLICY_REF(lb_policy, "resolver_result");
}
c->lb_policy = lb_policy;
}
grpc_lb_policy *grpc_client_config_get_lb_policy(grpc_client_config *c) {
grpc_lb_policy *grpc_resolver_result_get_lb_policy(grpc_resolver_result *c) {
return c->lb_policy;
}

@ -31,23 +31,22 @@
*
*/
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CONFIG_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CONFIG_H
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H
#include "src/core/ext/client_config/lb_policy.h"
/** Total configuration for a client. Provided, and updated, by
grpc_resolver */
typedef struct grpc_client_config grpc_client_config;
/** Results reported from a grpc_resolver. */
typedef struct grpc_resolver_result grpc_resolver_result;
grpc_client_config *grpc_client_config_create();
void grpc_client_config_ref(grpc_client_config *client_config);
void grpc_client_config_unref(grpc_exec_ctx *exec_ctx,
grpc_client_config *client_config);
grpc_resolver_result *grpc_resolver_result_create();
void grpc_resolver_result_ref(grpc_resolver_result *client_config);
void grpc_resolver_result_unref(grpc_exec_ctx *exec_ctx,
grpc_resolver_result *client_config);
void grpc_client_config_set_lb_policy(grpc_client_config *client_config,
void grpc_resolver_result_set_lb_policy(grpc_resolver_result *client_config,
grpc_lb_policy *lb_policy);
grpc_lb_policy *grpc_client_config_get_lb_policy(
grpc_client_config *client_config);
grpc_lb_policy *grpc_resolver_result_get_lb_policy(
grpc_resolver_result *client_config);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CONFIG_H */
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H */

@ -1,292 +0,0 @@
/*
*
* Copyright 2015, 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 "src/core/ext/client_config/subchannel_call_holder.h"
#include <grpc/support/alloc.h>
#include "src/core/lib/profiling/timers.h"
#define GET_CALL(holder) \
((grpc_subchannel_call *)(gpr_atm_acq_load(&(holder)->subchannel_call)))
#define CANCELLED_CALL ((grpc_subchannel_call *)1)
static void subchannel_ready(grpc_exec_ctx *exec_ctx, void *holder,
grpc_error *error);
static void retry_ops(grpc_exec_ctx *exec_ctx, void *retry_ops_args,
grpc_error *error);
static void add_waiting_locked(grpc_subchannel_call_holder *holder,
grpc_transport_stream_op *op);
static void fail_locked(grpc_exec_ctx *exec_ctx,
grpc_subchannel_call_holder *holder, grpc_error *error);
static void retry_waiting_locked(grpc_exec_ctx *exec_ctx,
grpc_subchannel_call_holder *holder);
void grpc_subchannel_call_holder_init(
grpc_subchannel_call_holder *holder,
grpc_subchannel_call_holder_pick_subchannel pick_subchannel,
void *pick_subchannel_arg, grpc_call_stack *owning_call) {
gpr_atm_rel_store(&holder->subchannel_call, 0);
holder->pick_subchannel = pick_subchannel;
holder->pick_subchannel_arg = pick_subchannel_arg;
gpr_mu_init(&holder->mu);
holder->connected_subchannel = NULL;
holder->waiting_ops = NULL;
holder->waiting_ops_count = 0;
holder->waiting_ops_capacity = 0;
holder->creation_phase = GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING;
holder->owning_call = owning_call;
holder->pollent = NULL;
}
void grpc_subchannel_call_holder_destroy(grpc_exec_ctx *exec_ctx,
grpc_subchannel_call_holder *holder) {
grpc_subchannel_call *call = GET_CALL(holder);
if (call != NULL && call != CANCELLED_CALL) {
GRPC_SUBCHANNEL_CALL_UNREF(exec_ctx, call, "holder");
}
GPR_ASSERT(holder->creation_phase ==
GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING);
gpr_mu_destroy(&holder->mu);
GPR_ASSERT(holder->waiting_ops_count == 0);
gpr_free(holder->waiting_ops);
}
// The logic here is fairly complicated, due to (a) the fact that we
// need to handle the case where we receive the send op before the
// initial metadata op, and (b) the need for efficiency, especially in
// the streaming case.
// TODO(ctiller): Explain this more thoroughly.
void grpc_subchannel_call_holder_perform_op(grpc_exec_ctx *exec_ctx,
grpc_subchannel_call_holder *holder,
grpc_transport_stream_op *op) {
/* try to (atomically) get the call */
grpc_subchannel_call *call = GET_CALL(holder);
GPR_TIMER_BEGIN("grpc_subchannel_call_holder_perform_op", 0);
if (call == CANCELLED_CALL) {
grpc_transport_stream_op_finish_with_failure(exec_ctx, op,
GRPC_ERROR_CANCELLED);
GPR_TIMER_END("grpc_subchannel_call_holder_perform_op", 0);
return;
}
if (call != NULL) {
grpc_subchannel_call_process_op(exec_ctx, call, op);
GPR_TIMER_END("grpc_subchannel_call_holder_perform_op", 0);
return;
}
/* we failed; lock and figure out what to do */
gpr_mu_lock(&holder->mu);
retry:
/* need to recheck that another thread hasn't set the call */
call = GET_CALL(holder);
if (call == CANCELLED_CALL) {
gpr_mu_unlock(&holder->mu);
grpc_transport_stream_op_finish_with_failure(exec_ctx, op,
GRPC_ERROR_CANCELLED);
GPR_TIMER_END("grpc_subchannel_call_holder_perform_op", 0);
return;
}
if (call != NULL) {
gpr_mu_unlock(&holder->mu);
grpc_subchannel_call_process_op(exec_ctx, call, op);
GPR_TIMER_END("grpc_subchannel_call_holder_perform_op", 0);
return;
}
/* if this is a cancellation, then we can raise our cancelled flag */
if (op->cancel_error != GRPC_ERROR_NONE) {
if (!gpr_atm_rel_cas(&holder->subchannel_call, 0,
(gpr_atm)(uintptr_t)CANCELLED_CALL)) {
goto retry;
} else {
switch (holder->creation_phase) {
case GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING:
fail_locked(exec_ctx, holder, GRPC_ERROR_REF(op->cancel_error));
break;
case GRPC_SUBCHANNEL_CALL_HOLDER_PICKING_SUBCHANNEL:
holder->pick_subchannel(exec_ctx, holder->pick_subchannel_arg, NULL,
0, &holder->connected_subchannel, NULL);
break;
}
gpr_mu_unlock(&holder->mu);
grpc_transport_stream_op_finish_with_failure(exec_ctx, op,
GRPC_ERROR_CANCELLED);
GPR_TIMER_END("grpc_subchannel_call_holder_perform_op", 0);
return;
}
}
/* if we don't have a subchannel, try to get one */
if (holder->creation_phase == GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING &&
holder->connected_subchannel == NULL &&
op->send_initial_metadata != NULL) {
holder->creation_phase = GRPC_SUBCHANNEL_CALL_HOLDER_PICKING_SUBCHANNEL;
grpc_closure_init(&holder->next_step, subchannel_ready, holder);
GRPC_CALL_STACK_REF(holder->owning_call, "pick_subchannel");
if (holder->pick_subchannel(
exec_ctx, holder->pick_subchannel_arg, op->send_initial_metadata,
op->send_initial_metadata_flags, &holder->connected_subchannel,
&holder->next_step)) {
holder->creation_phase = GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING;
GRPC_CALL_STACK_UNREF(exec_ctx, holder->owning_call, "pick_subchannel");
}
}
/* if we've got a subchannel, then let's ask it to create a call */
if (holder->creation_phase == GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING &&
holder->connected_subchannel != NULL) {
grpc_subchannel_call *subchannel_call = NULL;
grpc_error *error = grpc_connected_subchannel_create_call(
exec_ctx, holder->connected_subchannel, holder->pollent,
&subchannel_call);
if (error != GRPC_ERROR_NONE) {
subchannel_call = CANCELLED_CALL;
fail_locked(exec_ctx, holder, GRPC_ERROR_REF(error));
grpc_transport_stream_op_finish_with_failure(exec_ctx, op, error);
}
gpr_atm_rel_store(&holder->subchannel_call,
(gpr_atm)(uintptr_t)subchannel_call);
retry_waiting_locked(exec_ctx, holder);
goto retry;
}
/* nothing to be done but wait */
add_waiting_locked(holder, op);
gpr_mu_unlock(&holder->mu);
GPR_TIMER_END("grpc_subchannel_call_holder_perform_op", 0);
}
static void subchannel_ready(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
grpc_subchannel_call_holder *holder = arg;
gpr_mu_lock(&holder->mu);
GPR_ASSERT(holder->creation_phase ==
GRPC_SUBCHANNEL_CALL_HOLDER_PICKING_SUBCHANNEL);
holder->creation_phase = GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING;
if (holder->connected_subchannel == NULL) {
gpr_atm_no_barrier_store(&holder->subchannel_call, 1);
fail_locked(exec_ctx, holder,
GRPC_ERROR_CREATE_REFERENCING("Failed to create subchannel",
&error, 1));
} else if (1 == gpr_atm_acq_load(&holder->subchannel_call)) {
/* already cancelled before subchannel became ready */
fail_locked(exec_ctx, holder,
GRPC_ERROR_CREATE_REFERENCING(
"Cancelled before creating subchannel", &error, 1));
} else {
grpc_subchannel_call *subchannel_call = NULL;
grpc_error *new_error = grpc_connected_subchannel_create_call(
exec_ctx, holder->connected_subchannel, holder->pollent,
&subchannel_call);
if (new_error != GRPC_ERROR_NONE) {
new_error = grpc_error_add_child(new_error, error);
subchannel_call = CANCELLED_CALL;
fail_locked(exec_ctx, holder, new_error);
}
gpr_atm_rel_store(&holder->subchannel_call,
(gpr_atm)(uintptr_t)subchannel_call);
retry_waiting_locked(exec_ctx, holder);
}
gpr_mu_unlock(&holder->mu);
GRPC_CALL_STACK_UNREF(exec_ctx, holder->owning_call, "pick_subchannel");
}
typedef struct {
grpc_transport_stream_op *ops;
size_t nops;
grpc_subchannel_call *call;
} retry_ops_args;
static void retry_waiting_locked(grpc_exec_ctx *exec_ctx,
grpc_subchannel_call_holder *holder) {
retry_ops_args *a = gpr_malloc(sizeof(*a));
a->ops = holder->waiting_ops;
a->nops = holder->waiting_ops_count;
a->call = GET_CALL(holder);
if (a->call == CANCELLED_CALL) {
gpr_free(a);
fail_locked(exec_ctx, holder, GRPC_ERROR_CANCELLED);
return;
}
holder->waiting_ops = NULL;
holder->waiting_ops_count = 0;
holder->waiting_ops_capacity = 0;
GRPC_SUBCHANNEL_CALL_REF(a->call, "retry_ops");
grpc_exec_ctx_sched(exec_ctx, grpc_closure_create(retry_ops, a),
GRPC_ERROR_NONE, NULL);
}
static void retry_ops(grpc_exec_ctx *exec_ctx, void *args, grpc_error *error) {
retry_ops_args *a = args;
size_t i;
for (i = 0; i < a->nops; i++) {
grpc_subchannel_call_process_op(exec_ctx, a->call, &a->ops[i]);
}
GRPC_SUBCHANNEL_CALL_UNREF(exec_ctx, a->call, "retry_ops");
gpr_free(a->ops);
gpr_free(a);
}
static void add_waiting_locked(grpc_subchannel_call_holder *holder,
grpc_transport_stream_op *op) {
GPR_TIMER_BEGIN("add_waiting_locked", 0);
if (holder->waiting_ops_count == holder->waiting_ops_capacity) {
holder->waiting_ops_capacity = GPR_MAX(3, 2 * holder->waiting_ops_capacity);
holder->waiting_ops =
gpr_realloc(holder->waiting_ops, holder->waiting_ops_capacity *
sizeof(*holder->waiting_ops));
}
holder->waiting_ops[holder->waiting_ops_count++] = *op;
GPR_TIMER_END("add_waiting_locked", 0);
}
static void fail_locked(grpc_exec_ctx *exec_ctx,
grpc_subchannel_call_holder *holder,
grpc_error *error) {
size_t i;
for (i = 0; i < holder->waiting_ops_count; i++) {
grpc_transport_stream_op_finish_with_failure(
exec_ctx, &holder->waiting_ops[i], GRPC_ERROR_REF(error));
}
holder->waiting_ops_count = 0;
GRPC_ERROR_UNREF(error);
}
char *grpc_subchannel_call_holder_get_peer(
grpc_exec_ctx *exec_ctx, grpc_subchannel_call_holder *holder) {
grpc_subchannel_call *subchannel_call = GET_CALL(holder);
if (subchannel_call == NULL || subchannel_call == CANCELLED_CALL) {
return NULL;
} else {
return grpc_subchannel_call_get_peer(exec_ctx, subchannel_call);
}
}

@ -1,99 +0,0 @@
/*
*
* Copyright 2015, 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.
*
*/
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_CALL_HOLDER_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_CALL_HOLDER_H
#include "src/core/ext/client_config/subchannel.h"
#include "src/core/lib/iomgr/polling_entity.h"
/** Pick a subchannel for grpc_subchannel_call_holder;
Return 1 if subchannel is available immediately (in which case on_ready
should not be called), or 0 otherwise (in which case on_ready should be
called when the subchannel is available) */
typedef int (*grpc_subchannel_call_holder_pick_subchannel)(
grpc_exec_ctx *exec_ctx, void *arg, grpc_metadata_batch *initial_metadata,
uint32_t initial_metadata_flags,
grpc_connected_subchannel **connected_subchannel, grpc_closure *on_ready);
typedef enum {
GRPC_SUBCHANNEL_CALL_HOLDER_NOT_CREATING,
GRPC_SUBCHANNEL_CALL_HOLDER_PICKING_SUBCHANNEL
} grpc_subchannel_call_holder_creation_phase;
/** Wrapper for holding a pointer to grpc_subchannel_call, and the
associated machinery to create such a pointer.
Handles queueing of stream ops until a call object is ready, waiting
for initial metadata before trying to create a call object,
and handling cancellation gracefully.
The channel filter uses this as their call_data. */
typedef struct grpc_subchannel_call_holder {
/** either 0 for no call, 1 for cancelled, or a pointer to a
grpc_subchannel_call */
gpr_atm subchannel_call;
/** Helper function to choose the subchannel on which to create
the call object. Channel filter delegates to the load
balancing policy (once it's ready). */
grpc_subchannel_call_holder_pick_subchannel pick_subchannel;
void *pick_subchannel_arg;
gpr_mu mu;
grpc_subchannel_call_holder_creation_phase creation_phase;
grpc_connected_subchannel *connected_subchannel;
grpc_polling_entity *pollent;
grpc_transport_stream_op *waiting_ops;
size_t waiting_ops_count;
size_t waiting_ops_capacity;
grpc_closure next_step;
grpc_call_stack *owning_call;
} grpc_subchannel_call_holder;
void grpc_subchannel_call_holder_init(
grpc_subchannel_call_holder *holder,
grpc_subchannel_call_holder_pick_subchannel pick_subchannel,
void *pick_subchannel_arg, grpc_call_stack *owning_call);
void grpc_subchannel_call_holder_destroy(grpc_exec_ctx *exec_ctx,
grpc_subchannel_call_holder *holder);
void grpc_subchannel_call_holder_perform_op(grpc_exec_ctx *exec_ctx,
grpc_subchannel_call_holder *holder,
grpc_transport_stream_op *op);
char *grpc_subchannel_call_holder_get_peer(grpc_exec_ctx *exec_ctx,
grpc_subchannel_call_holder *holder);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_CALL_HOLDER_H */

@ -67,16 +67,16 @@ typedef struct {
gpr_mu mu;
/** are we currently resolving? */
int resolving;
/** which version of resolved_config have we published? */
/** which version of the result have we published? */
int published_version;
/** which version of resolved_config is current? */
/** which version of the result is current? */
int resolved_version;
/** pending next completion, or NULL */
grpc_closure *next_completion;
/** target config address for next completion */
grpc_client_config **target_config;
/** current (fully resolved) config */
grpc_client_config *resolved_config;
/** target result address for next completion */
grpc_resolver_result **target_result;
/** current (fully resolved) result */
grpc_resolver_result *resolved_result;
/** retry timer */
bool have_retry_timer;
grpc_timer retry_timer;
@ -97,7 +97,7 @@ static void dns_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
static void dns_shutdown(grpc_exec_ctx *exec_ctx, grpc_resolver *r);
static void dns_channel_saw_error(grpc_exec_ctx *exec_ctx, grpc_resolver *r);
static void dns_next(grpc_exec_ctx *exec_ctx, grpc_resolver *r,
grpc_client_config **target_config,
grpc_resolver_result **target_result,
grpc_closure *on_complete);
static const grpc_resolver_vtable dns_resolver_vtable = {
@ -110,7 +110,7 @@ static void dns_shutdown(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver) {
grpc_timer_cancel(exec_ctx, &r->retry_timer);
}
if (r->next_completion != NULL) {
*r->target_config = NULL;
*r->target_result = NULL;
grpc_exec_ctx_sched(exec_ctx, r->next_completion,
GRPC_ERROR_CREATE("Resolver Shutdown"), NULL);
r->next_completion = NULL;
@ -130,13 +130,13 @@ static void dns_channel_saw_error(grpc_exec_ctx *exec_ctx,
}
static void dns_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
grpc_client_config **target_config,
grpc_resolver_result **target_result,
grpc_closure *on_complete) {
dns_resolver *r = (dns_resolver *)resolver;
gpr_mu_lock(&r->mu);
GPR_ASSERT(!r->next_completion);
r->next_completion = on_complete;
r->target_config = target_config;
r->target_result = target_result;
if (r->resolved_version == 0 && !r->resolving) {
gpr_backoff_reset(&r->backoff_state);
dns_start_resolving_locked(exec_ctx, r);
@ -165,7 +165,7 @@ static void dns_on_retry_timer(grpc_exec_ctx *exec_ctx, void *arg,
static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
dns_resolver *r = arg;
grpc_client_config *config = NULL;
grpc_resolver_result *result = NULL;
grpc_lb_policy *lb_policy;
gpr_mu_lock(&r->mu);
GPR_ASSERT(r->resolving);
@ -173,14 +173,14 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg,
grpc_resolved_addresses *addresses = r->addresses;
if (addresses != NULL) {
grpc_lb_policy_args lb_policy_args;
config = grpc_client_config_create();
result = grpc_resolver_result_create();
memset(&lb_policy_args, 0, sizeof(lb_policy_args));
lb_policy_args.addresses = addresses;
lb_policy_args.client_channel_factory = r->client_channel_factory;
lb_policy =
grpc_lb_policy_create(exec_ctx, r->lb_policy_name, &lb_policy_args);
if (lb_policy != NULL) {
grpc_client_config_set_lb_policy(config, lb_policy);
grpc_resolver_result_set_lb_policy(result, lb_policy);
GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "construction");
}
grpc_resolved_addresses_destroy(addresses);
@ -203,10 +203,10 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg,
grpc_timer_init(exec_ctx, &r->retry_timer, next_try, dns_on_retry_timer, r,
now);
}
if (r->resolved_config) {
grpc_client_config_unref(exec_ctx, r->resolved_config);
if (r->resolved_result) {
grpc_resolver_result_unref(exec_ctx, r->resolved_result);
}
r->resolved_config = config;
r->resolved_result = result;
r->resolved_version++;
dns_maybe_finish_next_locked(exec_ctx, r);
gpr_mu_unlock(&r->mu);
@ -228,9 +228,9 @@ static void dns_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
dns_resolver *r) {
if (r->next_completion != NULL &&
r->resolved_version != r->published_version) {
*r->target_config = r->resolved_config;
if (r->resolved_config) {
grpc_client_config_ref(r->resolved_config);
*r->target_result = r->resolved_result;
if (r->resolved_result) {
grpc_resolver_result_ref(r->resolved_result);
}
grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL);
r->next_completion = NULL;
@ -241,8 +241,8 @@ static void dns_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
static void dns_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) {
dns_resolver *r = (dns_resolver *)gr;
gpr_mu_destroy(&r->mu);
if (r->resolved_config) {
grpc_client_config_unref(exec_ctx, r->resolved_config);
if (r->resolved_result) {
grpc_resolver_result_unref(exec_ctx, r->resolved_result);
}
grpc_client_channel_factory_unref(exec_ctx, r->client_channel_factory);
gpr_free(r->name);

@ -66,8 +66,8 @@ typedef struct {
int published;
/** pending next completion, or NULL */
grpc_closure *next_completion;
/** target config address for next completion */
grpc_client_config **target_config;
/** target result address for next completion */
grpc_resolver_result **target_result;
} sockaddr_resolver;
static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *r);
@ -79,7 +79,7 @@ static void sockaddr_shutdown(grpc_exec_ctx *exec_ctx, grpc_resolver *r);
static void sockaddr_channel_saw_error(grpc_exec_ctx *exec_ctx,
grpc_resolver *r);
static void sockaddr_next(grpc_exec_ctx *exec_ctx, grpc_resolver *r,
grpc_client_config **target_config,
grpc_resolver_result **target_result,
grpc_closure *on_complete);
static const grpc_resolver_vtable sockaddr_resolver_vtable = {
@ -91,7 +91,7 @@ static void sockaddr_shutdown(grpc_exec_ctx *exec_ctx,
sockaddr_resolver *r = (sockaddr_resolver *)resolver;
gpr_mu_lock(&r->mu);
if (r->next_completion != NULL) {
*r->target_config = NULL;
*r->target_result = NULL;
grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL);
r->next_completion = NULL;
}
@ -108,13 +108,13 @@ static void sockaddr_channel_saw_error(grpc_exec_ctx *exec_ctx,
}
static void sockaddr_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
grpc_client_config **target_config,
grpc_resolver_result **target_result,
grpc_closure *on_complete) {
sockaddr_resolver *r = (sockaddr_resolver *)resolver;
gpr_mu_lock(&r->mu);
GPR_ASSERT(!r->next_completion);
r->next_completion = on_complete;
r->target_config = target_config;
r->target_result = target_result;
sockaddr_maybe_finish_next_locked(exec_ctx, r);
gpr_mu_unlock(&r->mu);
}
@ -122,17 +122,17 @@ static void sockaddr_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
sockaddr_resolver *r) {
if (r->next_completion != NULL && !r->published) {
grpc_client_config *cfg = grpc_client_config_create();
grpc_resolver_result *result = grpc_resolver_result_create();
grpc_lb_policy_args lb_policy_args;
memset(&lb_policy_args, 0, sizeof(lb_policy_args));
lb_policy_args.addresses = r->addresses;
lb_policy_args.client_channel_factory = r->client_channel_factory;
grpc_lb_policy *lb_policy =
grpc_lb_policy_create(exec_ctx, r->lb_policy_name, &lb_policy_args);
grpc_client_config_set_lb_policy(cfg, lb_policy);
grpc_resolver_result_set_lb_policy(result, lb_policy);
GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "sockaddr");
r->published = 1;
*r->target_config = cfg;
*r->target_result = result;
grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL);
r->next_completion = NULL;
}

@ -233,8 +233,9 @@ static grpc_mdstr *user_agent_from_args(const grpc_channel_args *args,
}
}
gpr_asprintf(&tmp, "%sgrpc-c/%s (%s; %s)", is_first ? "" : " ",
grpc_version_string(), GPR_PLATFORM_STRING, transport_name);
gpr_asprintf(&tmp, "%sgrpc-c/%s (%s; %s; %s)", is_first ? "" : " ",
grpc_version_string(), GPR_PLATFORM_STRING, transport_name,
grpc_g_stands_for());
is_first = 0;
gpr_strvec_add(&v, tmp);

@ -47,7 +47,8 @@
/// if a grpc_error is passed to a grpc_closure callback function (functions
/// with the signature:
/// void (*f)(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error))
/// then those functions do not automatically own a ref to error
/// then those functions do not own a ref to error (but are free to manually
/// take a reference).
/// if a grpc_error is passed to *ANY OTHER FUNCTION* then that function takes
/// ownership of the error
/// Errors have:

@ -928,7 +928,8 @@ static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
fd->polling_island = NULL;
}
grpc_exec_ctx_sched(exec_ctx, fd->on_done_closure, error, NULL);
grpc_exec_ctx_sched(exec_ctx, fd->on_done_closure, GRPC_ERROR_REF(error),
NULL);
gpr_mu_unlock(&fd->mu);
UNREF_BY(fd, 2, reason); /* Drop the reference */
@ -940,6 +941,7 @@ static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
PI_UNREF(exec_ctx, unref_pi, "fd_orphan");
}
GRPC_LOG_IF_ERROR("fd_orphan", GRPC_ERROR_REF(error));
GRPC_ERROR_UNREF(error);
}
static grpc_error *fd_shutdown_error(bool shutdown) {
@ -1353,8 +1355,10 @@ static void pollset_work_and_unlock(grpc_exec_ctx *exec_ctx,
gpr_mu_unlock(&pollset->mu);
do {
GRPC_SCHEDULING_START_BLOCKING_REGION;
ep_rv = epoll_pwait(epoll_fd, ep_ev, GRPC_EPOLL_MAX_EVENTS, timeout_ms,
sig_mask);
GRPC_SCHEDULING_END_BLOCKING_REGION;
if (ep_rv < 0) {
if (errno != EINTR) {
gpr_asprintf(&err_msg,

@ -99,6 +99,9 @@ void grpc_client_security_context_destroy(void *ctx) {
grpc_client_security_context *c = (grpc_client_security_context *)ctx;
grpc_call_credentials_unref(c->creds);
GRPC_AUTH_CONTEXT_UNREF(c->auth_context, "client_security_context");
if (c->extension.instance != NULL && c->extension.destroy != NULL) {
c->extension.destroy(c->extension.instance);
}
gpr_free(ctx);
}
@ -114,6 +117,9 @@ grpc_server_security_context *grpc_server_security_context_create(void) {
void grpc_server_security_context_destroy(void *ctx) {
grpc_server_security_context *c = (grpc_server_security_context *)ctx;
GRPC_AUTH_CONTEXT_UNREF(c->auth_context, "server_security_context");
if (c->extension.instance != NULL && c->extension.destroy != NULL) {
c->extension.destroy(c->extension.instance);
}
gpr_free(ctx);
}

@ -84,6 +84,16 @@ void grpc_auth_context_unref(grpc_auth_context *policy);
void grpc_auth_property_reset(grpc_auth_property *property);
/* --- grpc_security_context_extension ---
Extension to the security context that may be set in a filter and accessed
later by a higher level method on a grpc_call object. */
typedef struct {
void *instance;
void (*destroy)(void *);
} grpc_security_context_extension;
/* --- grpc_client_security_context ---
Internal client-side security context. */
@ -91,6 +101,7 @@ void grpc_auth_property_reset(grpc_auth_property *property);
typedef struct {
grpc_call_credentials *creds;
grpc_auth_context *auth_context;
grpc_security_context_extension extension;
} grpc_client_security_context;
grpc_client_security_context *grpc_client_security_context_create(void);
@ -102,6 +113,7 @@ void grpc_client_security_context_destroy(void *ctx);
typedef struct {
grpc_auth_context *auth_context;
grpc_security_context_extension extension;
} grpc_server_security_context;
grpc_server_security_context *grpc_server_security_context_create(void);

@ -37,3 +37,5 @@
#include <grpc/grpc.h>
const char *grpc_version_string(void) { return "1.1.0-dev"; }
const char *grpc_g_stands_for(void) { return "good"; }

@ -33,10 +33,6 @@
#import "GRXMappingWriter.h"
static id (^kIdentity)(id value) = ^id(id value) {
return value;
};
@interface GRXForwardingWriter () <GRXWriteable>
@end
@ -51,7 +47,9 @@ static id (^kIdentity)(id value) = ^id(id value) {
// Designated initializer
- (instancetype)initWithWriter:(GRXWriter *)writer map:(id (^)(id value))map {
if ((self = [super initWithWriter:writer])) {
_map = map ?: kIdentity;
_map = map ?: ^id(id value) {
return value;
};
}
return self;
}

@ -164,6 +164,9 @@ bool create_metadata_array(zval *array, grpc_metadata_array *metadata) {
if (key_type1 != HASH_KEY_IS_STRING) {
return false;
}
if (!grpc_header_key_is_legal(key1, strlen(key1))) {
return false;
}
inner_array_hash = Z_ARRVAL_P(inner_array);
PHP_GRPC_HASH_FOREACH_VAL_START(inner_array_hash, value)
if (Z_TYPE_P(value) != IS_STRING) {

@ -192,24 +192,16 @@ void plugin_get_metadata(void *ptr, grpc_auth_metadata_context context,
/* call the user callback function */
zend_call_function(state->fci, state->fci_cache TSRMLS_CC);
if (Z_TYPE_P(retval) != IS_ARRAY) {
zend_throw_exception(spl_ce_InvalidArgumentException,
"plugin callback must return metadata array",
1 TSRMLS_CC);
return;
}
grpc_status_code code = GRPC_STATUS_OK;
grpc_metadata_array metadata;
if (!create_metadata_array(retval, &metadata)) {
zend_throw_exception(spl_ce_InvalidArgumentException,
"invalid metadata", 1 TSRMLS_CC);
if (Z_TYPE_P(retval) != IS_ARRAY) {
code = GRPC_STATUS_INVALID_ARGUMENT;
} else if (!create_metadata_array(retval, &metadata)) {
grpc_metadata_array_destroy(&metadata);
return;
code = GRPC_STATUS_INVALID_ARGUMENT;
}
/* TODO: handle error */
grpc_status_code code = GRPC_STATUS_OK;
/* Pass control back to core */
cb(user_data, metadata.metadata, metadata.count, code, NULL);
}

@ -54,6 +54,15 @@ function hardAssert($value, $error_message)
}
}
function hardAssertIfStatusOk($status)
{
if ($status->code !== Grpc\STATUS_OK) {
echo "Call did not complete successfully. Status object:\n";
var_dump($status);
exit(1);
}
}
/**
* Run the empty_unary test.
*
@ -62,7 +71,7 @@ function hardAssert($value, $error_message)
function emptyUnary($stub)
{
list($result, $status) = $stub->EmptyCall(new grpc\testing\EmptyMessage())->wait();
hardAssert($status->code === Grpc\STATUS_OK, 'Call did not complete successfully');
hardAssertIfStatusOk($status);
hardAssert($result !== null, 'Call completed with a null response');
}
@ -105,7 +114,7 @@ function performLargeUnary($stub, $fillUsername = false, $fillOauthScope = false
}
list($result, $status) = $stub->UnaryCall($request, [], $options)->wait();
hardAssert($status->code === Grpc\STATUS_OK, 'Call did not complete successfully');
hardAssertIfStatusOk($status);
hardAssert($result !== null, 'Call returned a null response');
$payload = $result->getPayload();
hardAssert($payload->getType() === grpc\testing\PayloadType::COMPRESSABLE,
@ -197,7 +206,12 @@ function updateAuthMetadataCallback($context)
$methodName = $context->method_name;
$auth_credentials = ApplicationDefaultCredentials::getCredentials();
return $auth_credentials->updateMetadata($metadata = [], $authUri);
$metadata = [];
$result = $auth_credentials->updateMetadata([], $authUri);
foreach ($result as $key => $value) {
$metadata[strtolower($key)] = $value;
}
return $metadata;
}
/**
@ -242,7 +256,7 @@ function clientStreaming($stub)
$call->write($request);
}
list($result, $status) = $call->wait();
hardAssert($status->code === Grpc\STATUS_OK, 'Call did not complete successfully');
hardAssertIfStatusOk($status);
hardAssert($result->getAggregatedPayloadSize() === 74922,
'aggregated_payload_size was incorrect');
}
@ -275,8 +289,7 @@ function serverStreaming($stub)
'Response '.$i.' had the wrong length');
$i += 1;
}
hardAssert($call->getStatus()->code === Grpc\STATUS_OK,
'Call did not complete successfully');
hardAssertIfStatusOk($call->getStatus());
}
/**
@ -312,8 +325,7 @@ function pingPong($stub)
}
$call->writesDone();
hardAssert($call->read() === null, 'Server returned too many responses');
hardAssert($call->getStatus()->code === Grpc\STATUS_OK,
'Call did not complete successfully');
hardAssertIfStatusOk($call->getStatus());
}
/**
@ -326,8 +338,7 @@ function emptyStream($stub)
$call = $stub->FullDuplexCall();
$call->writesDone();
hardAssert($call->read() === null, 'Server returned too many responses');
hardAssert($call->getStatus()->code === Grpc\STATUS_OK,
'Call did not complete successfully');
hardAssertIfStatusOk($call->getStatus());
}
/**
@ -419,8 +430,7 @@ function customMetadata($stub)
'Incorrect initial metadata value');
list($result, $status) = $call->wait();
hardAssert($status->code === Grpc\STATUS_OK,
'Call did not complete successfully');
hardAssertIfStatusOk($status);
$trailing_metadata = $call->getTrailingMetadata();
hardAssert(array_key_exists($ECHO_TRAILING_KEY, $trailing_metadata),
@ -435,8 +445,7 @@ function customMetadata($stub)
$streaming_call->write($streaming_request);
$streaming_call->writesDone();
hardAssert($streaming_call->getStatus()->code === Grpc\STATUS_OK,
'Call did not complete successfully');
hardAssertIfStatusOk($streaming_call->getStatus());
$streaming_trailing_metadata = $streaming_call->getTrailingMetadata();
hardAssert(array_key_exists($ECHO_TRAILING_KEY,

@ -132,4 +132,69 @@ class CallCredentials2Test extends PHPUnit_Framework_TestCase
unset($call);
unset($server_call);
}
public function invalidKeyCallbackFunc($context)
{
$this->assertTrue(is_string($context->service_url));
$this->assertTrue(is_string($context->method_name));
return ['K1' => ['v1']];
}
public function testCallbackWithInvalidKey()
{
$deadline = Grpc\Timeval::infFuture();
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'/abc/dummy_method',
$deadline,
$this->host_override);
$call_credentials = Grpc\CallCredentials::createFromPlugin(
array($this, 'invalidKeyCallbackFunc'));
$call->setCredentials($call_credentials);
$event = $call->startBatch([
Grpc\OP_SEND_INITIAL_METADATA => [],
Grpc\OP_SEND_CLOSE_FROM_CLIENT => true,
Grpc\OP_RECV_STATUS_ON_CLIENT => true,
]);
$this->assertTrue($event->send_metadata);
$this->assertTrue($event->send_close);
$this->assertTrue($event->status->code == Grpc\STATUS_UNAUTHENTICATED);
}
public function invalidReturnCallbackFunc($context)
{
$this->assertTrue(is_string($context->service_url));
$this->assertTrue(is_string($context->method_name));
return "a string";
}
public function testCallbackWithInvalidReturnValue()
{
$deadline = Grpc\Timeval::infFuture();
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'/abc/dummy_method',
$deadline,
$this->host_override);
$call_credentials = Grpc\CallCredentials::createFromPlugin(
array($this, 'invalidReturnCallbackFunc'));
$call->setCredentials($call_credentials);
$event = $call->startBatch([
Grpc\OP_SEND_INITIAL_METADATA => [],
Grpc\OP_SEND_CLOSE_FROM_CLIENT => true,
Grpc\OP_RECV_STATUS_ON_CLIENT => true,
]);
$this->assertTrue($event->send_metadata);
$this->assertTrue($event->send_close);
$this->assertTrue($event->status->code == Grpc\STATUS_UNAUTHENTICATED);
}
}

@ -1,135 +0,0 @@
<?php
/*
*
* Copyright 2015, 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.
*
*/
class CallCredentials3Test extends PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->credentials = Grpc\ChannelCredentials::createSsl(
file_get_contents(dirname(__FILE__).'/../data/ca.pem'));
$server_credentials = Grpc\ServerCredentials::createSsl(
null,
file_get_contents(dirname(__FILE__).'/../data/server1.key'),
file_get_contents(dirname(__FILE__).'/../data/server1.pem'));
$this->server = new Grpc\Server();
$this->port = $this->server->addSecureHttp2Port('0.0.0.0:0',
$server_credentials);
$this->server->start();
$this->host_override = 'foo.test.google.fr';
$this->channel = new Grpc\Channel(
'localhost:'.$this->port,
[
'grpc.ssl_target_name_override' => $this->host_override,
'grpc.default_authority' => $this->host_override,
'credentials' => $this->credentials,
]
);
}
public function tearDown()
{
unset($this->channel);
unset($this->server);
}
public function callbackFunc($context)
{
$this->assertTrue(is_string($context->service_url));
$this->assertTrue(is_string($context->method_name));
return ['k1' => ['v1'], 'k2' => ['v2']];
}
public function testCreateFromPlugin()
{
$deadline = Grpc\Timeval::infFuture();
$status_text = 'xyz';
$call = new Grpc\Call($this->channel,
'/abc/dummy_method',
$deadline,
$this->host_override);
$call_credentials = Grpc\CallCredentials::createFromPlugin(
[$this, 'callbackFunc']);
$call->setCredentials($call_credentials);
$event = $call->startBatch([
Grpc\OP_SEND_INITIAL_METADATA => [],
Grpc\OP_SEND_CLOSE_FROM_CLIENT => true,
]);
$this->assertTrue($event->send_metadata);
$this->assertTrue($event->send_close);
$event = $this->server->requestCall();
$this->assertTrue(is_array($event->metadata));
$metadata = $event->metadata;
$this->assertTrue(array_key_exists('k1', $metadata));
$this->assertTrue(array_key_exists('k2', $metadata));
$this->assertSame($metadata['k1'], ['v1']);
$this->assertSame($metadata['k2'], ['v2']);
$this->assertSame('/abc/dummy_method', $event->method);
$server_call = $event->call;
$event = $server_call->startBatch([
Grpc\OP_SEND_INITIAL_METADATA => [],
Grpc\OP_SEND_STATUS_FROM_SERVER => [
'metadata' => [],
'code' => Grpc\STATUS_OK,
'details' => $status_text,
],
Grpc\OP_RECV_CLOSE_ON_SERVER => true,
]);
$this->assertTrue($event->send_metadata);
$this->assertTrue($event->send_status);
$this->assertFalse($event->cancelled);
$event = $call->startBatch([
Grpc\OP_RECV_INITIAL_METADATA => true,
Grpc\OP_RECV_STATUS_ON_CLIENT => true,
]);
$this->assertSame([], $event->metadata);
$status = $event->status;
$this->assertSame([], $status->metadata);
$this->assertSame(Grpc\STATUS_OK, $status->code);
$this->assertSame($status_text, $status->details);
unset($call);
unset($server_call);
}
}

@ -113,7 +113,7 @@ class CallTest extends PHPUnit_Framework_TestCase
/**
* @expectedException InvalidArgumentException
*/
public function testInvalidMetadataKey()
public function testInvalidStartBatchKey()
{
$batch = [
'invalid' => ['key1' => 'value1'],
@ -121,6 +121,28 @@ class CallTest extends PHPUnit_Framework_TestCase
$result = $this->call->startBatch($batch);
}
/**
* @expectedException InvalidArgumentException
*/
public function testInvalidMetadataStrKey()
{
$batch = [
Grpc\OP_SEND_INITIAL_METADATA => ['Key' => ['value1', 'value2']],
];
$result = $this->call->startBatch($batch);
}
/**
* @expectedException InvalidArgumentException
*/
public function testInvalidMetadataIntKey()
{
$batch = [
Grpc\OP_SEND_INITIAL_METADATA => [1 => ['value1', 'value2']],
];
$result = $this->call->startBatch($batch);
}
/**
* @expectedException InvalidArgumentException
*/

@ -221,7 +221,6 @@ CORE_SOURCE_FILES = [
'src/core/ext/client_config/channel_connectivity.c',
'src/core/ext/client_config/client_channel.c',
'src/core/ext/client_config/client_channel_factory.c',
'src/core/ext/client_config/client_config.c',
'src/core/ext/client_config/client_config_plugin.c',
'src/core/ext/client_config/connector.c',
'src/core/ext/client_config/default_initial_connect_string.c',
@ -233,8 +232,8 @@ CORE_SOURCE_FILES = [
'src/core/ext/client_config/resolver.c',
'src/core/ext/client_config/resolver_factory.c',
'src/core/ext/client_config/resolver_registry.c',
'src/core/ext/client_config/resolver_result.c',
'src/core/ext/client_config/subchannel.c',
'src/core/ext/client_config/subchannel_call_holder.c',
'src/core/ext/client_config/subchannel_index.c',
'src/core/ext/client_config/uri_parser.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',

@ -114,9 +114,6 @@ class TypeSmokeTest(unittest.TestCase):
lambda ignored_a, ignored_b: None, b'')
del plugin
@unittest.skipIf(
platform.python_implementation() == "PyPy",
'TODO(issue 7672): figure out why this fails on PyPy')
def testCallCredentialsFromPluginUpDown(self):
plugin = cygrpc.CredentialsMetadataPlugin(_metadata_plugin_callback, b'')
call_credentials = cygrpc.call_credentials_metadata_plugin(plugin)

@ -80,6 +80,7 @@ grpc_register_plugin_type grpc_register_plugin_import;
grpc_init_type grpc_init_import;
grpc_shutdown_type grpc_shutdown_import;
grpc_version_string_type grpc_version_string_import;
grpc_g_stands_for_type grpc_g_stands_for_import;
grpc_completion_queue_create_type grpc_completion_queue_create_import;
grpc_completion_queue_next_type grpc_completion_queue_next_import;
grpc_completion_queue_pluck_type grpc_completion_queue_pluck_import;
@ -348,6 +349,7 @@ void grpc_rb_load_imports(HMODULE library) {
grpc_init_import = (grpc_init_type) GetProcAddress(library, "grpc_init");
grpc_shutdown_import = (grpc_shutdown_type) GetProcAddress(library, "grpc_shutdown");
grpc_version_string_import = (grpc_version_string_type) GetProcAddress(library, "grpc_version_string");
grpc_g_stands_for_import = (grpc_g_stands_for_type) GetProcAddress(library, "grpc_g_stands_for");
grpc_completion_queue_create_import = (grpc_completion_queue_create_type) GetProcAddress(library, "grpc_completion_queue_create");
grpc_completion_queue_next_import = (grpc_completion_queue_next_type) GetProcAddress(library, "grpc_completion_queue_next");
grpc_completion_queue_pluck_import = (grpc_completion_queue_pluck_type) GetProcAddress(library, "grpc_completion_queue_pluck");

@ -191,6 +191,9 @@ extern grpc_shutdown_type grpc_shutdown_import;
typedef const char *(*grpc_version_string_type)(void);
extern grpc_version_string_type grpc_version_string_import;
#define grpc_version_string grpc_version_string_import
typedef const char *(*grpc_g_stands_for_type)(void);
extern grpc_g_stands_for_type grpc_g_stands_for_import;
#define grpc_g_stands_for grpc_g_stands_for_import
typedef grpc_completion_queue *(*grpc_completion_queue_create_type)(void *reserved);
extern grpc_completion_queue_create_type grpc_completion_queue_create_import;
#define grpc_completion_queue_create grpc_completion_queue_create_import

@ -24,7 +24,7 @@
</stability>
<license>BSD</license>
<notes>
- TBD
- Reject metadata keys which are not legal #7881
</notes>
<contents>
<dir baseinstalldir="/" name="/">
@ -291,7 +291,7 @@
<date>2016-08-22</date>
<license>BSD</license>
<notes>
- TBD
- Reject metadata keys which are not legal #7881
</notes>
</release>
</changelog>

@ -39,3 +39,5 @@
#include <grpc/grpc.h>
const char *grpc_version_string(void) { return "${settings.core_version}"; }
const char *grpc_g_stands_for(void) { return "${settings.g_stands_for}"; }

@ -127,26 +127,26 @@ int main(int argc, char **argv) {
grpc_resolver *resolver = create_resolver("dns:test");
grpc_client_config *config = (grpc_client_config *)1;
grpc_resolver_result *result = (grpc_resolver_result *)1;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
gpr_event ev1;
gpr_event_init(&ev1);
grpc_resolver_next(&exec_ctx, resolver, &config,
grpc_resolver_next(&exec_ctx, resolver, &result,
grpc_closure_create(on_done, &ev1));
grpc_exec_ctx_flush(&exec_ctx);
GPR_ASSERT(wait_loop(5, &ev1));
GPR_ASSERT(config == NULL);
GPR_ASSERT(result == NULL);
gpr_event ev2;
gpr_event_init(&ev2);
grpc_resolver_next(&exec_ctx, resolver, &config,
grpc_resolver_next(&exec_ctx, resolver, &result,
grpc_closure_create(on_done, &ev2));
grpc_exec_ctx_flush(&exec_ctx);
GPR_ASSERT(wait_loop(30, &ev2));
GPR_ASSERT(config != NULL);
GPR_ASSERT(result != NULL);
grpc_client_config_unref(&exec_ctx, config);
grpc_resolver_result_unref(&exec_ctx, result);
GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test");
grpc_exec_ctx_finish(&exec_ctx);

@ -45,8 +45,6 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -53,8 +53,6 @@ static const char overridden_iam_selector[] = "overridden_selector";
typedef enum { NONE, OVERRIDE, DESTROY } override_mode;
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -44,8 +44,6 @@
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/tests/cancel_test_helpers.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -44,8 +44,6 @@
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/tests/cancel_test_helpers.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -44,8 +44,6 @@
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/tests/cancel_test_helpers.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -44,8 +44,6 @@
#include "test/core/end2end/cq_verifier.h"
#include "test/core/end2end/tests/cancel_test_helpers.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -45,8 +45,6 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -50,8 +50,6 @@
#include "src/core/lib/surface/call_test_only.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -45,8 +45,6 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static gpr_timespec n_seconds_time(int n) {

@ -45,8 +45,6 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -46,8 +46,6 @@
#include "src/core/lib/surface/channel_init.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static bool g_enable_filter = false;
static void *tag(intptr_t t) { return (void *)t; }

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -47,8 +47,6 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -45,8 +45,6 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -45,8 +45,6 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -46,8 +46,6 @@
/* this is a private API but exposed here for testing*/
extern void grpc_network_status_shutdown_all_endpoints();
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -45,8 +45,6 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -44,8 +44,6 @@
#include "src/core/lib/transport/byte_stream.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -45,8 +45,6 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static gpr_timespec n_seconds_time(int n) {

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -45,8 +45,6 @@
#include "src/core/lib/support/string.h"
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -43,8 +43,6 @@
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
enum { TIMEOUT = 200000 };
static void *tag(intptr_t t) { return (void *)t; }
static grpc_end2end_test_fixture begin_test(grpc_end2end_test_config config,

@ -1 +1 @@
Subproject commit e8ae137c96444ea313485ed1118c5e43b2099cf1
Subproject commit bba446bbf2ac7b0b9923d4eb07d5acd0665a8cf0

@ -918,7 +918,6 @@ src/core/lib/tsi/transport_security.h \
src/core/lib/tsi/transport_security_interface.h \
src/core/ext/client_config/client_channel.h \
src/core/ext/client_config/client_channel_factory.h \
src/core/ext/client_config/client_config.h \
src/core/ext/client_config/connector.h \
src/core/ext/client_config/initial_connect_string.h \
src/core/ext/client_config/lb_policy.h \
@ -928,8 +927,8 @@ src/core/ext/client_config/parse_address.h \
src/core/ext/client_config/resolver.h \
src/core/ext/client_config/resolver_factory.h \
src/core/ext/client_config/resolver_registry.h \
src/core/ext/client_config/resolver_result.h \
src/core/ext/client_config/subchannel.h \
src/core/ext/client_config/subchannel_call_holder.h \
src/core/ext/client_config/subchannel_index.h \
src/core/ext/client_config/uri_parser.h \
src/core/ext/lb_policy/grpclb/grpclb.h \
@ -1096,7 +1095,6 @@ src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \
src/core/ext/client_config/channel_connectivity.c \
src/core/ext/client_config/client_channel.c \
src/core/ext/client_config/client_channel_factory.c \
src/core/ext/client_config/client_config.c \
src/core/ext/client_config/client_config_plugin.c \
src/core/ext/client_config/connector.c \
src/core/ext/client_config/default_initial_connect_string.c \
@ -1108,8 +1106,8 @@ src/core/ext/client_config/parse_address.c \
src/core/ext/client_config/resolver.c \
src/core/ext/client_config/resolver_factory.c \
src/core/ext/client_config/resolver_registry.c \
src/core/ext/client_config/resolver_result.c \
src/core/ext/client_config/subchannel.c \
src/core/ext/client_config/subchannel_call_holder.c \
src/core/ext/client_config/subchannel_index.c \
src/core/ext/client_config/uri_parser.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \

@ -45,7 +45,7 @@ cat << EOF | awk '{ print $1 }' | sort > $want_submodules
05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f)
c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0)
f8ac463766281625ad710900479130c7fcb4d63b third_party/nanopb (nanopb-0.3.4-29-gf8ac463)
e8ae137c96444ea313485ed1118c5e43b2099cf1 third_party/protobuf (v3.0.0-beta-4-74-ge8ae137)
bba446bbf2ac7b0b9923d4eb07d5acd0665a8cf0 third_party/protobuf (v3.0.0-beta-4-160-gbba446b)
50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8)
bcad91771b7f0bff28a1cac1981d7ef2b9bcef3c third_party/thrift
EOF

@ -6092,7 +6092,6 @@
"headers": [
"src/core/ext/client_config/client_channel.h",
"src/core/ext/client_config/client_channel_factory.h",
"src/core/ext/client_config/client_config.h",
"src/core/ext/client_config/connector.h",
"src/core/ext/client_config/initial_connect_string.h",
"src/core/ext/client_config/lb_policy.h",
@ -6102,8 +6101,8 @@
"src/core/ext/client_config/resolver.h",
"src/core/ext/client_config/resolver_factory.h",
"src/core/ext/client_config/resolver_registry.h",
"src/core/ext/client_config/resolver_result.h",
"src/core/ext/client_config/subchannel.h",
"src/core/ext/client_config/subchannel_call_holder.h",
"src/core/ext/client_config/subchannel_index.h",
"src/core/ext/client_config/uri_parser.h"
],
@ -6115,8 +6114,6 @@
"src/core/ext/client_config/client_channel.h",
"src/core/ext/client_config/client_channel_factory.c",
"src/core/ext/client_config/client_channel_factory.h",
"src/core/ext/client_config/client_config.c",
"src/core/ext/client_config/client_config.h",
"src/core/ext/client_config/client_config_plugin.c",
"src/core/ext/client_config/connector.c",
"src/core/ext/client_config/connector.h",
@ -6137,10 +6134,10 @@
"src/core/ext/client_config/resolver_factory.h",
"src/core/ext/client_config/resolver_registry.c",
"src/core/ext/client_config/resolver_registry.h",
"src/core/ext/client_config/resolver_result.c",
"src/core/ext/client_config/resolver_result.h",
"src/core/ext/client_config/subchannel.c",
"src/core/ext/client_config/subchannel.h",
"src/core/ext/client_config/subchannel_call_holder.c",
"src/core/ext/client_config/subchannel_call_holder.h",
"src/core/ext/client_config/subchannel_index.c",
"src/core/ext/client_config/subchannel_index.h",
"src/core/ext/client_config/uri_parser.c",

@ -427,7 +427,6 @@
<ClInclude Include="$(SolutionDir)\..\src\core\lib\tsi\transport_security_interface.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\client_channel.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\client_channel_factory.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\client_config.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\connector.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\initial_connect_string.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy.h" />
@ -437,8 +436,8 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_factory.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_registry.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_result.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_call_holder.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_index.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\uri_parser.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\lb_policy\grpclb\grpclb.h" />
@ -753,8 +752,6 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_channel_factory.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_config.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_config_plugin.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\connector.c">
@ -777,9 +774,9 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_registry.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_result.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_call_holder.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_index.c">
</ClCompile>

@ -439,9 +439,6 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_channel_factory.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_config.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_config_plugin.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
@ -475,10 +472,10 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_registry.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_result.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_call_holder.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_index.c">
@ -1052,9 +1049,6 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\client_channel_factory.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\client_config.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\connector.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
@ -1082,10 +1076,10 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_registry.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.h">
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_result.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_call_holder.h">
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_index.h">

@ -393,7 +393,6 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\alpn\alpn.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\client_channel.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\client_channel_factory.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\client_config.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\connector.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\initial_connect_string.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\lb_policy.h" />
@ -403,8 +402,8 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_factory.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_registry.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_result.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_call_holder.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_index.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\uri_parser.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\load_reporting\load_reporting.h" />
@ -669,8 +668,6 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_channel_factory.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_config.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_config_plugin.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\connector.c">
@ -693,9 +690,9 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_registry.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_result.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_call_holder.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_index.c">
</ClCompile>

@ -364,9 +364,6 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_channel_factory.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_config.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\client_config_plugin.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
@ -400,10 +397,10 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_registry.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_result.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_call_holder.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_index.c">
@ -890,9 +887,6 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\client_channel_factory.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\client_config.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\connector.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
@ -920,10 +914,10 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_registry.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.h">
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\resolver_result.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_call_holder.h">
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel.h">
<Filter>src\core\ext\client_config</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\client_config\subchannel_index.h">

Loading…
Cancel
Save