Merge github.com:grpc/grpc into buffer_pools_for_realsies

reviewable/pr8239/r4
Craig Tiller 8 years ago
commit fe8c5012d3
  1. 296
      BUILD
  2. 120
      CMakeLists.txt
  3. 162
      Makefile
  4. 40
      binding.gyp
  5. 113
      build.yaml
  6. 42
      config.m4
  7. 6
      doc/interop-test-descriptions.md
  8. 7
      examples/node/dynamic_codegen/route_guide/route_guide_client.js
  9. 7
      examples/node/static_codegen/route_guide/route_guide_client.js
  10. 108
      gRPC-Core.podspec
  11. 74
      grpc.gemspec
  12. 74
      package.xml
  13. 0
      src/core/ext/client_channel/README.md
  14. 2
      src/core/ext/client_channel/channel_connectivity.c
  15. 149
      src/core/ext/client_channel/client_channel.c
  16. 10
      src/core/ext/client_channel/client_channel.h
  17. 2
      src/core/ext/client_channel/client_channel_factory.c
  18. 8
      src/core/ext/client_channel/client_channel_factory.h
  19. 12
      src/core/ext/client_channel/client_channel_plugin.c
  20. 2
      src/core/ext/client_channel/connector.c
  21. 6
      src/core/ext/client_channel/connector.h
  22. 0
      src/core/ext/client_channel/default_initial_connect_string.c
  23. 4
      src/core/ext/client_channel/http_connect_handshaker.c
  24. 6
      src/core/ext/client_channel/http_connect_handshaker.h
  25. 2
      src/core/ext/client_channel/initial_connect_string.c
  26. 6
      src/core/ext/client_channel/initial_connect_string.h
  27. 2
      src/core/ext/client_channel/lb_policy.c
  28. 9
      src/core/ext/client_channel/lb_policy.h
  29. 2
      src/core/ext/client_channel/lb_policy_factory.c
  30. 10
      src/core/ext/client_channel/lb_policy_factory.h
  31. 2
      src/core/ext/client_channel/lb_policy_registry.c
  32. 8
      src/core/ext/client_channel/lb_policy_registry.h
  33. 58
      src/core/ext/client_channel/method_config.c
  34. 30
      src/core/ext/client_channel/method_config.h
  35. 2
      src/core/ext/client_channel/parse_address.c
  36. 8
      src/core/ext/client_channel/parse_address.h
  37. 2
      src/core/ext/client_channel/resolver.c
  38. 10
      src/core/ext/client_channel/resolver.h
  39. 2
      src/core/ext/client_channel/resolver_factory.c
  40. 12
      src/core/ext/client_channel/resolver_factory.h
  41. 4
      src/core/ext/client_channel/resolver_registry.c
  42. 8
      src/core/ext/client_channel/resolver_registry.h
  43. 2
      src/core/ext/client_channel/resolver_result.c
  44. 9
      src/core/ext/client_channel/resolver_result.h
  45. 8
      src/core/ext/client_channel/subchannel.c
  46. 8
      src/core/ext/client_channel/subchannel.h
  47. 2
      src/core/ext/client_channel/subchannel_index.c
  48. 10
      src/core/ext/client_channel/subchannel_index.h
  49. 2
      src/core/ext/client_channel/uri_parser.c
  50. 6
      src/core/ext/client_channel/uri_parser.h
  51. 8
      src/core/ext/lb_policy/grpclb/grpclb.c
  52. 2
      src/core/ext/lb_policy/grpclb/grpclb.h
  53. 2
      src/core/ext/lb_policy/grpclb/load_balancer_api.h
  54. 2
      src/core/ext/lb_policy/pick_first/pick_first.c
  55. 2
      src/core/ext/lb_policy/round_robin/round_robin.c
  56. 2
      src/core/ext/load_reporting/load_reporting.h
  57. 2
      src/core/ext/load_reporting/load_reporting_filter.c
  58. 6
      src/core/ext/resolver/dns/native/dns_resolver.c
  59. 5
      src/core/ext/resolver/sockaddr/sockaddr_resolver.c
  60. 6
      src/core/ext/transport/chttp2/client/insecure/channel_create.c
  61. 11
      src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
  62. 7
      src/core/lib/channel/http_server_filter.c
  63. 76
      src/core/lib/channel/message_size_filter.c
  64. 37
      src/core/lib/transport/mdstr_hash_table.c
  65. 9
      src/core/lib/transport/mdstr_hash_table.h
  66. 2
      src/core/lib/transport/static_metadata.c
  67. 8
      src/core/lib/transport/static_metadata.h
  68. 8
      src/core/plugin_registry/grpc_cronet_plugin_registry.c
  69. 8
      src/core/plugin_registry/grpc_plugin_registry.c
  70. 8
      src/core/plugin_registry/grpc_unsecure_plugin_registry.c
  71. 4
      src/csharp/Grpc.Auth/GoogleAuthInterceptors.cs
  72. 1
      src/csharp/Grpc.Core/DefaultCallInvoker.cs
  73. 1
      src/csharp/Grpc.Core/Grpc.Core.csproj
  74. 1
      src/csharp/Grpc.Core/GrpcEnvironment.cs
  75. 15
      src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs
  76. 29
      src/csharp/Grpc.Core/Internal/CompletionRegistry.cs
  77. 2
      src/csharp/Grpc.Core/Internal/InterceptingCallInvoker.cs
  78. 7
      src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs
  79. 41
      src/csharp/Grpc.Core/Internal/NativeMethods.cs
  80. 85
      src/csharp/Grpc.Core/Internal/RequestCallContextSafeHandle.cs
  81. 6
      src/csharp/Grpc.Core/Internal/ServerSafeHandle.cs
  82. 6
      src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs
  83. 70
      src/csharp/Grpc.Core/Metadata.cs
  84. 56
      src/csharp/Grpc.Core/Server.cs
  85. 5
      src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json
  86. 16
      src/csharp/Grpc.IntegrationTesting/InteropClient.cs
  87. 8
      src/csharp/Grpc.IntegrationTesting/InteropClientServerTest.cs
  88. 5
      src/csharp/Grpc.IntegrationTesting/QpsWorker.cs
  89. 37
      src/csharp/Grpc.IntegrationTesting/Test.cs
  90. 105
      src/csharp/Grpc.IntegrationTesting/TestGrpc.cs
  91. 64
      src/csharp/ext/grpc_csharp_ext.c
  92. 8
      src/node/ext/node_grpc.cc
  93. 16
      src/node/interop/interop_client.js
  94. 4
      src/node/test/interop_sanity_test.js
  95. 12
      src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj
  96. 2
      src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme
  97. 18
      src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj
  98. 2
      src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/xcshareddata/xcschemes/SwiftSample.xcscheme
  99. 25
      src/objective-c/examples/SwiftSample/ViewController.swift
  100. 2
      src/objective-c/tests/Info.plist
  101. Some files were not shown because too many files have changed in this diff Show More

296
BUILD

@ -293,23 +293,23 @@ cc_library(
"src/core/lib/tsi/ssl_types.h", "src/core/lib/tsi/ssl_types.h",
"src/core/lib/tsi/transport_security.h", "src/core/lib/tsi/transport_security.h",
"src/core/lib/tsi/transport_security_interface.h", "src/core/lib/tsi/transport_security_interface.h",
"src/core/ext/client_config/client_channel.h", "src/core/ext/client_channel/client_channel.h",
"src/core/ext/client_config/client_channel_factory.h", "src/core/ext/client_channel/client_channel_factory.h",
"src/core/ext/client_config/connector.h", "src/core/ext/client_channel/connector.h",
"src/core/ext/client_config/http_connect_handshaker.h", "src/core/ext/client_channel/http_connect_handshaker.h",
"src/core/ext/client_config/initial_connect_string.h", "src/core/ext/client_channel/initial_connect_string.h",
"src/core/ext/client_config/lb_policy.h", "src/core/ext/client_channel/lb_policy.h",
"src/core/ext/client_config/lb_policy_factory.h", "src/core/ext/client_channel/lb_policy_factory.h",
"src/core/ext/client_config/lb_policy_registry.h", "src/core/ext/client_channel/lb_policy_registry.h",
"src/core/ext/client_config/method_config.h", "src/core/ext/client_channel/method_config.h",
"src/core/ext/client_config/parse_address.h", "src/core/ext/client_channel/parse_address.h",
"src/core/ext/client_config/resolver.h", "src/core/ext/client_channel/resolver.h",
"src/core/ext/client_config/resolver_factory.h", "src/core/ext/client_channel/resolver_factory.h",
"src/core/ext/client_config/resolver_registry.h", "src/core/ext/client_channel/resolver_registry.h",
"src/core/ext/client_config/resolver_result.h", "src/core/ext/client_channel/resolver_result.h",
"src/core/ext/client_config/subchannel.h", "src/core/ext/client_channel/subchannel.h",
"src/core/ext/client_config/subchannel_index.h", "src/core/ext/client_channel/subchannel_index.h",
"src/core/ext/client_config/uri_parser.h", "src/core/ext/client_channel/uri_parser.h",
"src/core/ext/lb_policy/grpclb/grpclb.h", "src/core/ext/lb_policy/grpclb/grpclb.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h", "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h",
@ -473,26 +473,26 @@ cc_library(
"src/core/lib/tsi/ssl_transport_security.c", "src/core/lib/tsi/ssl_transport_security.c",
"src/core/lib/tsi/transport_security.c", "src/core/lib/tsi/transport_security.c",
"src/core/ext/transport/chttp2/client/secure/secure_channel_create.c", "src/core/ext/transport/chttp2/client/secure/secure_channel_create.c",
"src/core/ext/client_config/channel_connectivity.c", "src/core/ext/client_channel/channel_connectivity.c",
"src/core/ext/client_config/client_channel.c", "src/core/ext/client_channel/client_channel.c",
"src/core/ext/client_config/client_channel_factory.c", "src/core/ext/client_channel/client_channel_factory.c",
"src/core/ext/client_config/client_config_plugin.c", "src/core/ext/client_channel/client_channel_plugin.c",
"src/core/ext/client_config/connector.c", "src/core/ext/client_channel/connector.c",
"src/core/ext/client_config/default_initial_connect_string.c", "src/core/ext/client_channel/default_initial_connect_string.c",
"src/core/ext/client_config/http_connect_handshaker.c", "src/core/ext/client_channel/http_connect_handshaker.c",
"src/core/ext/client_config/initial_connect_string.c", "src/core/ext/client_channel/initial_connect_string.c",
"src/core/ext/client_config/lb_policy.c", "src/core/ext/client_channel/lb_policy.c",
"src/core/ext/client_config/lb_policy_factory.c", "src/core/ext/client_channel/lb_policy_factory.c",
"src/core/ext/client_config/lb_policy_registry.c", "src/core/ext/client_channel/lb_policy_registry.c",
"src/core/ext/client_config/method_config.c", "src/core/ext/client_channel/method_config.c",
"src/core/ext/client_config/parse_address.c", "src/core/ext/client_channel/parse_address.c",
"src/core/ext/client_config/resolver.c", "src/core/ext/client_channel/resolver.c",
"src/core/ext/client_config/resolver_factory.c", "src/core/ext/client_channel/resolver_factory.c",
"src/core/ext/client_config/resolver_registry.c", "src/core/ext/client_channel/resolver_registry.c",
"src/core/ext/client_config/resolver_result.c", "src/core/ext/client_channel/resolver_result.c",
"src/core/ext/client_config/subchannel.c", "src/core/ext/client_channel/subchannel.c",
"src/core/ext/client_config/subchannel_index.c", "src/core/ext/client_channel/subchannel_index.c",
"src/core/ext/client_config/uri_parser.c", "src/core/ext/client_channel/uri_parser.c",
"src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c",
"src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c",
@ -678,23 +678,23 @@ cc_library(
"src/core/ext/transport/chttp2/transport/stream_map.h", "src/core/ext/transport/chttp2/transport/stream_map.h",
"src/core/ext/transport/chttp2/transport/varint.h", "src/core/ext/transport/chttp2/transport/varint.h",
"src/core/ext/transport/chttp2/alpn/alpn.h", "src/core/ext/transport/chttp2/alpn/alpn.h",
"src/core/ext/client_config/client_channel.h", "src/core/ext/client_channel/client_channel.h",
"src/core/ext/client_config/client_channel_factory.h", "src/core/ext/client_channel/client_channel_factory.h",
"src/core/ext/client_config/connector.h", "src/core/ext/client_channel/connector.h",
"src/core/ext/client_config/http_connect_handshaker.h", "src/core/ext/client_channel/http_connect_handshaker.h",
"src/core/ext/client_config/initial_connect_string.h", "src/core/ext/client_channel/initial_connect_string.h",
"src/core/ext/client_config/lb_policy.h", "src/core/ext/client_channel/lb_policy.h",
"src/core/ext/client_config/lb_policy_factory.h", "src/core/ext/client_channel/lb_policy_factory.h",
"src/core/ext/client_config/lb_policy_registry.h", "src/core/ext/client_channel/lb_policy_registry.h",
"src/core/ext/client_config/method_config.h", "src/core/ext/client_channel/method_config.h",
"src/core/ext/client_config/parse_address.h", "src/core/ext/client_channel/parse_address.h",
"src/core/ext/client_config/resolver.h", "src/core/ext/client_channel/resolver.h",
"src/core/ext/client_config/resolver_factory.h", "src/core/ext/client_channel/resolver_factory.h",
"src/core/ext/client_config/resolver_registry.h", "src/core/ext/client_channel/resolver_registry.h",
"src/core/ext/client_config/resolver_result.h", "src/core/ext/client_channel/resolver_result.h",
"src/core/ext/client_config/subchannel.h", "src/core/ext/client_channel/subchannel.h",
"src/core/ext/client_config/subchannel_index.h", "src/core/ext/client_channel/subchannel_index.h",
"src/core/ext/client_config/uri_parser.h", "src/core/ext/client_channel/uri_parser.h",
"src/core/lib/security/context/security_context.h", "src/core/lib/security/context/security_context.h",
"src/core/lib/security/credentials/composite/composite_credentials.h", "src/core/lib/security/credentials/composite/composite_credentials.h",
"src/core/lib/security/credentials/credentials.h", "src/core/lib/security/credentials/credentials.h",
@ -840,26 +840,26 @@ cc_library(
"src/core/ext/transport/chttp2/transport/varint.c", "src/core/ext/transport/chttp2/transport/varint.c",
"src/core/ext/transport/chttp2/transport/writing.c", "src/core/ext/transport/chttp2/transport/writing.c",
"src/core/ext/transport/chttp2/alpn/alpn.c", "src/core/ext/transport/chttp2/alpn/alpn.c",
"src/core/ext/client_config/channel_connectivity.c", "src/core/ext/client_channel/channel_connectivity.c",
"src/core/ext/client_config/client_channel.c", "src/core/ext/client_channel/client_channel.c",
"src/core/ext/client_config/client_channel_factory.c", "src/core/ext/client_channel/client_channel_factory.c",
"src/core/ext/client_config/client_config_plugin.c", "src/core/ext/client_channel/client_channel_plugin.c",
"src/core/ext/client_config/connector.c", "src/core/ext/client_channel/connector.c",
"src/core/ext/client_config/default_initial_connect_string.c", "src/core/ext/client_channel/default_initial_connect_string.c",
"src/core/ext/client_config/http_connect_handshaker.c", "src/core/ext/client_channel/http_connect_handshaker.c",
"src/core/ext/client_config/initial_connect_string.c", "src/core/ext/client_channel/initial_connect_string.c",
"src/core/ext/client_config/lb_policy.c", "src/core/ext/client_channel/lb_policy.c",
"src/core/ext/client_config/lb_policy_factory.c", "src/core/ext/client_channel/lb_policy_factory.c",
"src/core/ext/client_config/lb_policy_registry.c", "src/core/ext/client_channel/lb_policy_registry.c",
"src/core/ext/client_config/method_config.c", "src/core/ext/client_channel/method_config.c",
"src/core/ext/client_config/parse_address.c", "src/core/ext/client_channel/parse_address.c",
"src/core/ext/client_config/resolver.c", "src/core/ext/client_channel/resolver.c",
"src/core/ext/client_config/resolver_factory.c", "src/core/ext/client_channel/resolver_factory.c",
"src/core/ext/client_config/resolver_registry.c", "src/core/ext/client_channel/resolver_registry.c",
"src/core/ext/client_config/resolver_result.c", "src/core/ext/client_channel/resolver_result.c",
"src/core/ext/client_config/subchannel.c", "src/core/ext/client_channel/subchannel.c",
"src/core/ext/client_config/subchannel_index.c", "src/core/ext/client_channel/subchannel_index.c",
"src/core/ext/client_config/uri_parser.c", "src/core/ext/client_channel/uri_parser.c",
"src/core/lib/http/httpcli_security_connector.c", "src/core/lib/http/httpcli_security_connector.c",
"src/core/lib/security/context/security_context.c", "src/core/lib/security/context/security_context.c",
"src/core/lib/security/credentials/composite/composite_credentials.c", "src/core/lib/security/credentials/composite/composite_credentials.c",
@ -1040,23 +1040,23 @@ cc_library(
"src/core/ext/transport/chttp2/transport/stream_map.h", "src/core/ext/transport/chttp2/transport/stream_map.h",
"src/core/ext/transport/chttp2/transport/varint.h", "src/core/ext/transport/chttp2/transport/varint.h",
"src/core/ext/transport/chttp2/alpn/alpn.h", "src/core/ext/transport/chttp2/alpn/alpn.h",
"src/core/ext/client_config/client_channel.h", "src/core/ext/client_channel/client_channel.h",
"src/core/ext/client_config/client_channel_factory.h", "src/core/ext/client_channel/client_channel_factory.h",
"src/core/ext/client_config/connector.h", "src/core/ext/client_channel/connector.h",
"src/core/ext/client_config/http_connect_handshaker.h", "src/core/ext/client_channel/http_connect_handshaker.h",
"src/core/ext/client_config/initial_connect_string.h", "src/core/ext/client_channel/initial_connect_string.h",
"src/core/ext/client_config/lb_policy.h", "src/core/ext/client_channel/lb_policy.h",
"src/core/ext/client_config/lb_policy_factory.h", "src/core/ext/client_channel/lb_policy_factory.h",
"src/core/ext/client_config/lb_policy_registry.h", "src/core/ext/client_channel/lb_policy_registry.h",
"src/core/ext/client_config/method_config.h", "src/core/ext/client_channel/method_config.h",
"src/core/ext/client_config/parse_address.h", "src/core/ext/client_channel/parse_address.h",
"src/core/ext/client_config/resolver.h", "src/core/ext/client_channel/resolver.h",
"src/core/ext/client_config/resolver_factory.h", "src/core/ext/client_channel/resolver_factory.h",
"src/core/ext/client_config/resolver_registry.h", "src/core/ext/client_channel/resolver_registry.h",
"src/core/ext/client_config/resolver_result.h", "src/core/ext/client_channel/resolver_result.h",
"src/core/ext/client_config/subchannel.h", "src/core/ext/client_channel/subchannel.h",
"src/core/ext/client_config/subchannel_index.h", "src/core/ext/client_channel/subchannel_index.h",
"src/core/ext/client_config/uri_parser.h", "src/core/ext/client_channel/uri_parser.h",
"src/core/ext/load_reporting/load_reporting.h", "src/core/ext/load_reporting/load_reporting.h",
"src/core/ext/load_reporting/load_reporting_filter.h", "src/core/ext/load_reporting/load_reporting_filter.h",
"src/core/ext/lb_policy/grpclb/grpclb.h", "src/core/ext/lb_policy/grpclb/grpclb.h",
@ -1195,26 +1195,26 @@ cc_library(
"src/core/ext/transport/chttp2/alpn/alpn.c", "src/core/ext/transport/chttp2/alpn/alpn.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c", "src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c",
"src/core/ext/client_config/channel_connectivity.c", "src/core/ext/client_channel/channel_connectivity.c",
"src/core/ext/client_config/client_channel.c", "src/core/ext/client_channel/client_channel.c",
"src/core/ext/client_config/client_channel_factory.c", "src/core/ext/client_channel/client_channel_factory.c",
"src/core/ext/client_config/client_config_plugin.c", "src/core/ext/client_channel/client_channel_plugin.c",
"src/core/ext/client_config/connector.c", "src/core/ext/client_channel/connector.c",
"src/core/ext/client_config/default_initial_connect_string.c", "src/core/ext/client_channel/default_initial_connect_string.c",
"src/core/ext/client_config/http_connect_handshaker.c", "src/core/ext/client_channel/http_connect_handshaker.c",
"src/core/ext/client_config/initial_connect_string.c", "src/core/ext/client_channel/initial_connect_string.c",
"src/core/ext/client_config/lb_policy.c", "src/core/ext/client_channel/lb_policy.c",
"src/core/ext/client_config/lb_policy_factory.c", "src/core/ext/client_channel/lb_policy_factory.c",
"src/core/ext/client_config/lb_policy_registry.c", "src/core/ext/client_channel/lb_policy_registry.c",
"src/core/ext/client_config/method_config.c", "src/core/ext/client_channel/method_config.c",
"src/core/ext/client_config/parse_address.c", "src/core/ext/client_channel/parse_address.c",
"src/core/ext/client_config/resolver.c", "src/core/ext/client_channel/resolver.c",
"src/core/ext/client_config/resolver_factory.c", "src/core/ext/client_channel/resolver_factory.c",
"src/core/ext/client_config/resolver_registry.c", "src/core/ext/client_channel/resolver_registry.c",
"src/core/ext/client_config/resolver_result.c", "src/core/ext/client_channel/resolver_result.c",
"src/core/ext/client_config/subchannel.c", "src/core/ext/client_channel/subchannel.c",
"src/core/ext/client_config/subchannel_index.c", "src/core/ext/client_channel/subchannel_index.c",
"src/core/ext/client_config/uri_parser.c", "src/core/ext/client_channel/uri_parser.c",
"src/core/ext/resolver/dns/native/dns_resolver.c", "src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c", "src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/load_reporting/load_reporting.c", "src/core/ext/load_reporting/load_reporting.c",
@ -1991,26 +1991,26 @@ objc_library(
"src/core/lib/tsi/ssl_transport_security.c", "src/core/lib/tsi/ssl_transport_security.c",
"src/core/lib/tsi/transport_security.c", "src/core/lib/tsi/transport_security.c",
"src/core/ext/transport/chttp2/client/secure/secure_channel_create.c", "src/core/ext/transport/chttp2/client/secure/secure_channel_create.c",
"src/core/ext/client_config/channel_connectivity.c", "src/core/ext/client_channel/channel_connectivity.c",
"src/core/ext/client_config/client_channel.c", "src/core/ext/client_channel/client_channel.c",
"src/core/ext/client_config/client_channel_factory.c", "src/core/ext/client_channel/client_channel_factory.c",
"src/core/ext/client_config/client_config_plugin.c", "src/core/ext/client_channel/client_channel_plugin.c",
"src/core/ext/client_config/connector.c", "src/core/ext/client_channel/connector.c",
"src/core/ext/client_config/default_initial_connect_string.c", "src/core/ext/client_channel/default_initial_connect_string.c",
"src/core/ext/client_config/http_connect_handshaker.c", "src/core/ext/client_channel/http_connect_handshaker.c",
"src/core/ext/client_config/initial_connect_string.c", "src/core/ext/client_channel/initial_connect_string.c",
"src/core/ext/client_config/lb_policy.c", "src/core/ext/client_channel/lb_policy.c",
"src/core/ext/client_config/lb_policy_factory.c", "src/core/ext/client_channel/lb_policy_factory.c",
"src/core/ext/client_config/lb_policy_registry.c", "src/core/ext/client_channel/lb_policy_registry.c",
"src/core/ext/client_config/method_config.c", "src/core/ext/client_channel/method_config.c",
"src/core/ext/client_config/parse_address.c", "src/core/ext/client_channel/parse_address.c",
"src/core/ext/client_config/resolver.c", "src/core/ext/client_channel/resolver.c",
"src/core/ext/client_config/resolver_factory.c", "src/core/ext/client_channel/resolver_factory.c",
"src/core/ext/client_config/resolver_registry.c", "src/core/ext/client_channel/resolver_registry.c",
"src/core/ext/client_config/resolver_result.c", "src/core/ext/client_channel/resolver_result.c",
"src/core/ext/client_config/subchannel.c", "src/core/ext/client_channel/subchannel.c",
"src/core/ext/client_config/subchannel_index.c", "src/core/ext/client_channel/subchannel_index.c",
"src/core/ext/client_config/uri_parser.c", "src/core/ext/client_channel/uri_parser.c",
"src/core/ext/transport/chttp2/server/insecure/server_chttp2.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2.c",
"src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c", "src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c", "src/core/ext/transport/chttp2/client/insecure/channel_create.c",
@ -2198,23 +2198,23 @@ objc_library(
"src/core/lib/tsi/ssl_types.h", "src/core/lib/tsi/ssl_types.h",
"src/core/lib/tsi/transport_security.h", "src/core/lib/tsi/transport_security.h",
"src/core/lib/tsi/transport_security_interface.h", "src/core/lib/tsi/transport_security_interface.h",
"src/core/ext/client_config/client_channel.h", "src/core/ext/client_channel/client_channel.h",
"src/core/ext/client_config/client_channel_factory.h", "src/core/ext/client_channel/client_channel_factory.h",
"src/core/ext/client_config/connector.h", "src/core/ext/client_channel/connector.h",
"src/core/ext/client_config/http_connect_handshaker.h", "src/core/ext/client_channel/http_connect_handshaker.h",
"src/core/ext/client_config/initial_connect_string.h", "src/core/ext/client_channel/initial_connect_string.h",
"src/core/ext/client_config/lb_policy.h", "src/core/ext/client_channel/lb_policy.h",
"src/core/ext/client_config/lb_policy_factory.h", "src/core/ext/client_channel/lb_policy_factory.h",
"src/core/ext/client_config/lb_policy_registry.h", "src/core/ext/client_channel/lb_policy_registry.h",
"src/core/ext/client_config/method_config.h", "src/core/ext/client_channel/method_config.h",
"src/core/ext/client_config/parse_address.h", "src/core/ext/client_channel/parse_address.h",
"src/core/ext/client_config/resolver.h", "src/core/ext/client_channel/resolver.h",
"src/core/ext/client_config/resolver_factory.h", "src/core/ext/client_channel/resolver_factory.h",
"src/core/ext/client_config/resolver_registry.h", "src/core/ext/client_channel/resolver_registry.h",
"src/core/ext/client_config/resolver_result.h", "src/core/ext/client_channel/resolver_result.h",
"src/core/ext/client_config/subchannel.h", "src/core/ext/client_channel/subchannel.h",
"src/core/ext/client_config/subchannel_index.h", "src/core/ext/client_channel/subchannel_index.h",
"src/core/ext/client_config/uri_parser.h", "src/core/ext/client_channel/uri_parser.h",
"src/core/ext/lb_policy/grpclb/grpclb.h", "src/core/ext/lb_policy/grpclb/grpclb.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h", "src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h", "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h",

@ -436,26 +436,26 @@ add_library(grpc
src/core/lib/tsi/ssl_transport_security.c src/core/lib/tsi/ssl_transport_security.c
src/core/lib/tsi/transport_security.c src/core/lib/tsi/transport_security.c
src/core/ext/transport/chttp2/client/secure/secure_channel_create.c src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
src/core/ext/client_config/channel_connectivity.c src/core/ext/client_channel/channel_connectivity.c
src/core/ext/client_config/client_channel.c src/core/ext/client_channel/client_channel.c
src/core/ext/client_config/client_channel_factory.c src/core/ext/client_channel/client_channel_factory.c
src/core/ext/client_config/client_config_plugin.c src/core/ext/client_channel/client_channel_plugin.c
src/core/ext/client_config/connector.c src/core/ext/client_channel/connector.c
src/core/ext/client_config/default_initial_connect_string.c src/core/ext/client_channel/default_initial_connect_string.c
src/core/ext/client_config/http_connect_handshaker.c src/core/ext/client_channel/http_connect_handshaker.c
src/core/ext/client_config/initial_connect_string.c src/core/ext/client_channel/initial_connect_string.c
src/core/ext/client_config/lb_policy.c src/core/ext/client_channel/lb_policy.c
src/core/ext/client_config/lb_policy_factory.c src/core/ext/client_channel/lb_policy_factory.c
src/core/ext/client_config/lb_policy_registry.c src/core/ext/client_channel/lb_policy_registry.c
src/core/ext/client_config/method_config.c src/core/ext/client_channel/method_config.c
src/core/ext/client_config/parse_address.c src/core/ext/client_channel/parse_address.c
src/core/ext/client_config/resolver.c src/core/ext/client_channel/resolver.c
src/core/ext/client_config/resolver_factory.c src/core/ext/client_channel/resolver_factory.c
src/core/ext/client_config/resolver_registry.c src/core/ext/client_channel/resolver_registry.c
src/core/ext/client_config/resolver_result.c src/core/ext/client_channel/resolver_result.c
src/core/ext/client_config/subchannel.c src/core/ext/client_channel/subchannel.c
src/core/ext/client_config/subchannel_index.c src/core/ext/client_channel/subchannel_index.c
src/core/ext/client_config/uri_parser.c src/core/ext/client_channel/uri_parser.c
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c src/core/ext/transport/chttp2/server/insecure/server_chttp2.c
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c
src/core/ext/transport/chttp2/client/insecure/channel_create.c src/core/ext/transport/chttp2/client/insecure/channel_create.c
@ -672,26 +672,26 @@ add_library(grpc_cronet
src/core/ext/transport/chttp2/transport/varint.c src/core/ext/transport/chttp2/transport/varint.c
src/core/ext/transport/chttp2/transport/writing.c src/core/ext/transport/chttp2/transport/writing.c
src/core/ext/transport/chttp2/alpn/alpn.c src/core/ext/transport/chttp2/alpn/alpn.c
src/core/ext/client_config/channel_connectivity.c src/core/ext/client_channel/channel_connectivity.c
src/core/ext/client_config/client_channel.c src/core/ext/client_channel/client_channel.c
src/core/ext/client_config/client_channel_factory.c src/core/ext/client_channel/client_channel_factory.c
src/core/ext/client_config/client_config_plugin.c src/core/ext/client_channel/client_channel_plugin.c
src/core/ext/client_config/connector.c src/core/ext/client_channel/connector.c
src/core/ext/client_config/default_initial_connect_string.c src/core/ext/client_channel/default_initial_connect_string.c
src/core/ext/client_config/http_connect_handshaker.c src/core/ext/client_channel/http_connect_handshaker.c
src/core/ext/client_config/initial_connect_string.c src/core/ext/client_channel/initial_connect_string.c
src/core/ext/client_config/lb_policy.c src/core/ext/client_channel/lb_policy.c
src/core/ext/client_config/lb_policy_factory.c src/core/ext/client_channel/lb_policy_factory.c
src/core/ext/client_config/lb_policy_registry.c src/core/ext/client_channel/lb_policy_registry.c
src/core/ext/client_config/method_config.c src/core/ext/client_channel/method_config.c
src/core/ext/client_config/parse_address.c src/core/ext/client_channel/parse_address.c
src/core/ext/client_config/resolver.c src/core/ext/client_channel/resolver.c
src/core/ext/client_config/resolver_factory.c src/core/ext/client_channel/resolver_factory.c
src/core/ext/client_config/resolver_registry.c src/core/ext/client_channel/resolver_registry.c
src/core/ext/client_config/resolver_result.c src/core/ext/client_channel/resolver_result.c
src/core/ext/client_config/subchannel.c src/core/ext/client_channel/subchannel.c
src/core/ext/client_config/subchannel_index.c src/core/ext/client_channel/subchannel_index.c
src/core/ext/client_config/uri_parser.c src/core/ext/client_channel/uri_parser.c
src/core/lib/http/httpcli_security_connector.c src/core/lib/http/httpcli_security_connector.c
src/core/lib/security/context/security_context.c src/core/lib/security/context/security_context.c
src/core/lib/security/credentials/composite/composite_credentials.c src/core/lib/security/credentials/composite/composite_credentials.c
@ -906,26 +906,26 @@ add_library(grpc_unsecure
src/core/ext/transport/chttp2/alpn/alpn.c src/core/ext/transport/chttp2/alpn/alpn.c
src/core/ext/transport/chttp2/client/insecure/channel_create.c src/core/ext/transport/chttp2/client/insecure/channel_create.c
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c
src/core/ext/client_config/channel_connectivity.c src/core/ext/client_channel/channel_connectivity.c
src/core/ext/client_config/client_channel.c src/core/ext/client_channel/client_channel.c
src/core/ext/client_config/client_channel_factory.c src/core/ext/client_channel/client_channel_factory.c
src/core/ext/client_config/client_config_plugin.c src/core/ext/client_channel/client_channel_plugin.c
src/core/ext/client_config/connector.c src/core/ext/client_channel/connector.c
src/core/ext/client_config/default_initial_connect_string.c src/core/ext/client_channel/default_initial_connect_string.c
src/core/ext/client_config/http_connect_handshaker.c src/core/ext/client_channel/http_connect_handshaker.c
src/core/ext/client_config/initial_connect_string.c src/core/ext/client_channel/initial_connect_string.c
src/core/ext/client_config/lb_policy.c src/core/ext/client_channel/lb_policy.c
src/core/ext/client_config/lb_policy_factory.c src/core/ext/client_channel/lb_policy_factory.c
src/core/ext/client_config/lb_policy_registry.c src/core/ext/client_channel/lb_policy_registry.c
src/core/ext/client_config/method_config.c src/core/ext/client_channel/method_config.c
src/core/ext/client_config/parse_address.c src/core/ext/client_channel/parse_address.c
src/core/ext/client_config/resolver.c src/core/ext/client_channel/resolver.c
src/core/ext/client_config/resolver_factory.c src/core/ext/client_channel/resolver_factory.c
src/core/ext/client_config/resolver_registry.c src/core/ext/client_channel/resolver_registry.c
src/core/ext/client_config/resolver_result.c src/core/ext/client_channel/resolver_result.c
src/core/ext/client_config/subchannel.c src/core/ext/client_channel/subchannel.c
src/core/ext/client_config/subchannel_index.c src/core/ext/client_channel/subchannel_index.c
src/core/ext/client_config/uri_parser.c src/core/ext/client_channel/uri_parser.c
src/core/ext/resolver/dns/native/dns_resolver.c src/core/ext/resolver/dns/native/dns_resolver.c
src/core/ext/resolver/sockaddr/sockaddr_resolver.c src/core/ext/resolver/sockaddr/sockaddr_resolver.c
src/core/ext/load_reporting/load_reporting.c src/core/ext/load_reporting/load_reporting.c

@ -1229,9 +1229,9 @@ pc_cxx: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc
pc_cxx_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc pc_cxx_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc
ifeq ($(EMBED_OPENSSL),true) ifeq ($(EMBED_OPENSSL),true)
privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_reflection_codegen.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_asn1_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x509_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_reflection_codegen.a $(LIBDIR)/$(CONFIG)/libgrpc++_test.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_asn1_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x509_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a
else else
privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_reflection_codegen.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_reflection_codegen.a $(LIBDIR)/$(CONFIG)/libgrpc++_test.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a
endif endif
@ -2697,26 +2697,26 @@ LIBGRPC_SRC = \
src/core/lib/tsi/ssl_transport_security.c \ src/core/lib/tsi/ssl_transport_security.c \
src/core/lib/tsi/transport_security.c \ src/core/lib/tsi/transport_security.c \
src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \ src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \
src/core/ext/client_config/channel_connectivity.c \ src/core/ext/client_channel/channel_connectivity.c \
src/core/ext/client_config/client_channel.c \ src/core/ext/client_channel/client_channel.c \
src/core/ext/client_config/client_channel_factory.c \ src/core/ext/client_channel/client_channel_factory.c \
src/core/ext/client_config/client_config_plugin.c \ src/core/ext/client_channel/client_channel_plugin.c \
src/core/ext/client_config/connector.c \ src/core/ext/client_channel/connector.c \
src/core/ext/client_config/default_initial_connect_string.c \ src/core/ext/client_channel/default_initial_connect_string.c \
src/core/ext/client_config/http_connect_handshaker.c \ src/core/ext/client_channel/http_connect_handshaker.c \
src/core/ext/client_config/initial_connect_string.c \ src/core/ext/client_channel/initial_connect_string.c \
src/core/ext/client_config/lb_policy.c \ src/core/ext/client_channel/lb_policy.c \
src/core/ext/client_config/lb_policy_factory.c \ src/core/ext/client_channel/lb_policy_factory.c \
src/core/ext/client_config/lb_policy_registry.c \ src/core/ext/client_channel/lb_policy_registry.c \
src/core/ext/client_config/method_config.c \ src/core/ext/client_channel/method_config.c \
src/core/ext/client_config/parse_address.c \ src/core/ext/client_channel/parse_address.c \
src/core/ext/client_config/resolver.c \ src/core/ext/client_channel/resolver.c \
src/core/ext/client_config/resolver_factory.c \ src/core/ext/client_channel/resolver_factory.c \
src/core/ext/client_config/resolver_registry.c \ src/core/ext/client_channel/resolver_registry.c \
src/core/ext/client_config/resolver_result.c \ src/core/ext/client_channel/resolver_result.c \
src/core/ext/client_config/subchannel.c \ src/core/ext/client_channel/subchannel.c \
src/core/ext/client_config/subchannel_index.c \ src/core/ext/client_channel/subchannel_index.c \
src/core/ext/client_config/uri_parser.c \ src/core/ext/client_channel/uri_parser.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \
@ -2951,26 +2951,26 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/transport/chttp2/transport/varint.c \ src/core/ext/transport/chttp2/transport/varint.c \
src/core/ext/transport/chttp2/transport/writing.c \ src/core/ext/transport/chttp2/transport/writing.c \
src/core/ext/transport/chttp2/alpn/alpn.c \ src/core/ext/transport/chttp2/alpn/alpn.c \
src/core/ext/client_config/channel_connectivity.c \ src/core/ext/client_channel/channel_connectivity.c \
src/core/ext/client_config/client_channel.c \ src/core/ext/client_channel/client_channel.c \
src/core/ext/client_config/client_channel_factory.c \ src/core/ext/client_channel/client_channel_factory.c \
src/core/ext/client_config/client_config_plugin.c \ src/core/ext/client_channel/client_channel_plugin.c \
src/core/ext/client_config/connector.c \ src/core/ext/client_channel/connector.c \
src/core/ext/client_config/default_initial_connect_string.c \ src/core/ext/client_channel/default_initial_connect_string.c \
src/core/ext/client_config/http_connect_handshaker.c \ src/core/ext/client_channel/http_connect_handshaker.c \
src/core/ext/client_config/initial_connect_string.c \ src/core/ext/client_channel/initial_connect_string.c \
src/core/ext/client_config/lb_policy.c \ src/core/ext/client_channel/lb_policy.c \
src/core/ext/client_config/lb_policy_factory.c \ src/core/ext/client_channel/lb_policy_factory.c \
src/core/ext/client_config/lb_policy_registry.c \ src/core/ext/client_channel/lb_policy_registry.c \
src/core/ext/client_config/method_config.c \ src/core/ext/client_channel/method_config.c \
src/core/ext/client_config/parse_address.c \ src/core/ext/client_channel/parse_address.c \
src/core/ext/client_config/resolver.c \ src/core/ext/client_channel/resolver.c \
src/core/ext/client_config/resolver_factory.c \ src/core/ext/client_channel/resolver_factory.c \
src/core/ext/client_config/resolver_registry.c \ src/core/ext/client_channel/resolver_registry.c \
src/core/ext/client_config/resolver_result.c \ src/core/ext/client_channel/resolver_result.c \
src/core/ext/client_config/subchannel.c \ src/core/ext/client_channel/subchannel.c \
src/core/ext/client_config/subchannel_index.c \ src/core/ext/client_channel/subchannel_index.c \
src/core/ext/client_config/uri_parser.c \ src/core/ext/client_channel/uri_parser.c \
src/core/lib/http/httpcli_security_connector.c \ src/core/lib/http/httpcli_security_connector.c \
src/core/lib/security/context/security_context.c \ src/core/lib/security/context/security_context.c \
src/core/lib/security/credentials/composite/composite_credentials.c \ src/core/lib/security/credentials/composite/composite_credentials.c \
@ -3417,26 +3417,26 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/transport/chttp2/alpn/alpn.c \ src/core/ext/transport/chttp2/alpn/alpn.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c \ src/core/ext/transport/chttp2/client/insecure/channel_create_posix.c \
src/core/ext/client_config/channel_connectivity.c \ src/core/ext/client_channel/channel_connectivity.c \
src/core/ext/client_config/client_channel.c \ src/core/ext/client_channel/client_channel.c \
src/core/ext/client_config/client_channel_factory.c \ src/core/ext/client_channel/client_channel_factory.c \
src/core/ext/client_config/client_config_plugin.c \ src/core/ext/client_channel/client_channel_plugin.c \
src/core/ext/client_config/connector.c \ src/core/ext/client_channel/connector.c \
src/core/ext/client_config/default_initial_connect_string.c \ src/core/ext/client_channel/default_initial_connect_string.c \
src/core/ext/client_config/http_connect_handshaker.c \ src/core/ext/client_channel/http_connect_handshaker.c \
src/core/ext/client_config/initial_connect_string.c \ src/core/ext/client_channel/initial_connect_string.c \
src/core/ext/client_config/lb_policy.c \ src/core/ext/client_channel/lb_policy.c \
src/core/ext/client_config/lb_policy_factory.c \ src/core/ext/client_channel/lb_policy_factory.c \
src/core/ext/client_config/lb_policy_registry.c \ src/core/ext/client_channel/lb_policy_registry.c \
src/core/ext/client_config/method_config.c \ src/core/ext/client_channel/method_config.c \
src/core/ext/client_config/parse_address.c \ src/core/ext/client_channel/parse_address.c \
src/core/ext/client_config/resolver.c \ src/core/ext/client_channel/resolver.c \
src/core/ext/client_config/resolver_factory.c \ src/core/ext/client_channel/resolver_factory.c \
src/core/ext/client_config/resolver_registry.c \ src/core/ext/client_channel/resolver_registry.c \
src/core/ext/client_config/resolver_result.c \ src/core/ext/client_channel/resolver_result.c \
src/core/ext/client_config/subchannel.c \ src/core/ext/client_channel/subchannel.c \
src/core/ext/client_config/subchannel_index.c \ src/core/ext/client_channel/subchannel_index.c \
src/core/ext/client_config/uri_parser.c \ src/core/ext/client_channel/uri_parser.c \
src/core/ext/resolver/dns/native/dns_resolver.c \ src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \ src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/load_reporting/load_reporting.c \ src/core/ext/load_reporting/load_reporting.c \
@ -7481,7 +7481,7 @@ endif
DNS_RESOLVER_CONNECTIVITY_TEST_SRC = \ DNS_RESOLVER_CONNECTIVITY_TEST_SRC = \
test/core/client_config/resolvers/dns_resolver_connectivity_test.c \ test/core/client_channel/resolvers/dns_resolver_connectivity_test.c \
DNS_RESOLVER_CONNECTIVITY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(DNS_RESOLVER_CONNECTIVITY_TEST_SRC)))) DNS_RESOLVER_CONNECTIVITY_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(DNS_RESOLVER_CONNECTIVITY_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
@ -7501,7 +7501,7 @@ $(BINDIR)/$(CONFIG)/dns_resolver_connectivity_test: $(DNS_RESOLVER_CONNECTIVITY_
endif endif
$(OBJDIR)/$(CONFIG)/test/core/client_config/resolvers/dns_resolver_connectivity_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/client_channel/resolvers/dns_resolver_connectivity_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_dns_resolver_connectivity_test: $(DNS_RESOLVER_CONNECTIVITY_TEST_OBJS:.o=.dep) deps_dns_resolver_connectivity_test: $(DNS_RESOLVER_CONNECTIVITY_TEST_OBJS:.o=.dep)
@ -7513,7 +7513,7 @@ endif
DNS_RESOLVER_TEST_SRC = \ DNS_RESOLVER_TEST_SRC = \
test/core/client_config/resolvers/dns_resolver_test.c \ test/core/client_channel/resolvers/dns_resolver_test.c \
DNS_RESOLVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(DNS_RESOLVER_TEST_SRC)))) DNS_RESOLVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(DNS_RESOLVER_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
@ -7533,7 +7533,7 @@ $(BINDIR)/$(CONFIG)/dns_resolver_test: $(DNS_RESOLVER_TEST_OBJS) $(LIBDIR)/$(CON
endif endif
$(OBJDIR)/$(CONFIG)/test/core/client_config/resolvers/dns_resolver_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/client_channel/resolvers/dns_resolver_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_dns_resolver_test: $(DNS_RESOLVER_TEST_OBJS:.o=.dep) deps_dns_resolver_test: $(DNS_RESOLVER_TEST_OBJS:.o=.dep)
@ -9689,7 +9689,7 @@ endif
LB_POLICIES_TEST_SRC = \ LB_POLICIES_TEST_SRC = \
test/core/client_config/lb_policies_test.c \ test/core/client_channel/lb_policies_test.c \
LB_POLICIES_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LB_POLICIES_TEST_SRC)))) LB_POLICIES_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LB_POLICIES_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
@ -9709,7 +9709,7 @@ $(BINDIR)/$(CONFIG)/lb_policies_test: $(LB_POLICIES_TEST_OBJS) $(LIBDIR)/$(CONFI
endif endif
$(OBJDIR)/$(CONFIG)/test/core/client_config/lb_policies_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/client_channel/lb_policies_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_lb_policies_test: $(LB_POLICIES_TEST_OBJS:.o=.dep) deps_lb_policies_test: $(LB_POLICIES_TEST_OBJS:.o=.dep)
@ -10329,7 +10329,7 @@ endif
SET_INITIAL_CONNECT_STRING_TEST_SRC = \ SET_INITIAL_CONNECT_STRING_TEST_SRC = \
test/core/client_config/set_initial_connect_string_test.c \ test/core/client_channel/set_initial_connect_string_test.c \
SET_INITIAL_CONNECT_STRING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SET_INITIAL_CONNECT_STRING_TEST_SRC)))) SET_INITIAL_CONNECT_STRING_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SET_INITIAL_CONNECT_STRING_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
@ -10349,7 +10349,7 @@ $(BINDIR)/$(CONFIG)/set_initial_connect_string_test: $(SET_INITIAL_CONNECT_STRIN
endif endif
$(OBJDIR)/$(CONFIG)/test/core/client_config/set_initial_connect_string_test.o: $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/client_channel/set_initial_connect_string_test.o: $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_set_initial_connect_string_test: $(SET_INITIAL_CONNECT_STRING_TEST_OBJS:.o=.dep) deps_set_initial_connect_string_test: $(SET_INITIAL_CONNECT_STRING_TEST_OBJS:.o=.dep)
@ -10361,7 +10361,7 @@ endif
SOCKADDR_RESOLVER_TEST_SRC = \ SOCKADDR_RESOLVER_TEST_SRC = \
test/core/client_config/resolvers/sockaddr_resolver_test.c \ test/core/client_channel/resolvers/sockaddr_resolver_test.c \
SOCKADDR_RESOLVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SOCKADDR_RESOLVER_TEST_SRC)))) SOCKADDR_RESOLVER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SOCKADDR_RESOLVER_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
@ -10381,7 +10381,7 @@ $(BINDIR)/$(CONFIG)/sockaddr_resolver_test: $(SOCKADDR_RESOLVER_TEST_OBJS) $(LIB
endif endif
$(OBJDIR)/$(CONFIG)/test/core/client_config/resolvers/sockaddr_resolver_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/client_channel/resolvers/sockaddr_resolver_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_sockaddr_resolver_test: $(SOCKADDR_RESOLVER_TEST_OBJS:.o=.dep) deps_sockaddr_resolver_test: $(SOCKADDR_RESOLVER_TEST_OBJS:.o=.dep)
@ -10809,7 +10809,7 @@ endif
URI_FUZZER_TEST_SRC = \ URI_FUZZER_TEST_SRC = \
test/core/client_config/uri_fuzzer_test.c \ test/core/client_channel/uri_fuzzer_test.c \
URI_FUZZER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_FUZZER_TEST_SRC)))) URI_FUZZER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_FUZZER_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
@ -10829,7 +10829,7 @@ $(BINDIR)/$(CONFIG)/uri_fuzzer_test: $(URI_FUZZER_TEST_OBJS) $(LIBDIR)/$(CONFIG)
endif endif
$(OBJDIR)/$(CONFIG)/test/core/client_config/uri_fuzzer_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/client_channel/uri_fuzzer_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_uri_fuzzer_test: $(URI_FUZZER_TEST_OBJS:.o=.dep) deps_uri_fuzzer_test: $(URI_FUZZER_TEST_OBJS:.o=.dep)
@ -10841,7 +10841,7 @@ endif
URI_PARSER_TEST_SRC = \ URI_PARSER_TEST_SRC = \
test/core/client_config/uri_parser_test.c \ test/core/client_channel/uri_parser_test.c \
URI_PARSER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_PARSER_TEST_SRC)))) URI_PARSER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_PARSER_TEST_SRC))))
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
@ -10861,7 +10861,7 @@ $(BINDIR)/$(CONFIG)/uri_parser_test: $(URI_PARSER_TEST_OBJS) $(LIBDIR)/$(CONFIG)
endif endif
$(OBJDIR)/$(CONFIG)/test/core/client_config/uri_parser_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/client_channel/uri_parser_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_uri_parser_test: $(URI_PARSER_TEST_OBJS:.o=.dep) deps_uri_parser_test: $(URI_PARSER_TEST_OBJS:.o=.dep)
@ -12254,16 +12254,16 @@ $(BINDIR)/$(CONFIG)/interop_test: protobuf_dep_error
else else
$(BINDIR)/$(CONFIG)/interop_test: $(PROTOBUF_DEP) $(INTEROP_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(BINDIR)/$(CONFIG)/interop_test: $(PROTOBUF_DEP) $(INTEROP_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(INTEROP_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/interop_test $(Q) $(LDXX) $(LDFLAGS) $(INTEROP_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/interop_test
endif endif
endif endif
$(OBJDIR)/$(CONFIG)/test/cpp/interop/interop_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/interop_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
deps_interop_test: $(INTEROP_TEST_OBJS:.o=.dep) deps_interop_test: $(INTEROP_TEST_OBJS:.o=.dep)
@ -15829,7 +15829,7 @@ endif
URI_FUZZER_TEST_ONE_ENTRY_SRC = \ URI_FUZZER_TEST_ONE_ENTRY_SRC = \
test/core/client_config/uri_fuzzer_test.c \ test/core/client_channel/uri_fuzzer_test.c \
test/core/util/one_corpus_entry_fuzzer.c \ test/core/util/one_corpus_entry_fuzzer.c \
URI_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_FUZZER_TEST_ONE_ENTRY_SRC)))) URI_FUZZER_TEST_ONE_ENTRY_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_FUZZER_TEST_ONE_ENTRY_SRC))))
@ -15850,7 +15850,7 @@ $(BINDIR)/$(CONFIG)/uri_fuzzer_test_one_entry: $(URI_FUZZER_TEST_ONE_ENTRY_OBJS)
endif endif
$(OBJDIR)/$(CONFIG)/test/core/client_config/uri_fuzzer_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/client_channel/uri_fuzzer_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/core/util/one_corpus_entry_fuzzer.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/core/util/one_corpus_entry_fuzzer.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a

@ -711,26 +711,26 @@
'src/core/lib/tsi/ssl_transport_security.c', 'src/core/lib/tsi/ssl_transport_security.c',
'src/core/lib/tsi/transport_security.c', 'src/core/lib/tsi/transport_security.c',
'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c', 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c',
'src/core/ext/client_config/channel_connectivity.c', 'src/core/ext/client_channel/channel_connectivity.c',
'src/core/ext/client_config/client_channel.c', 'src/core/ext/client_channel/client_channel.c',
'src/core/ext/client_config/client_channel_factory.c', 'src/core/ext/client_channel/client_channel_factory.c',
'src/core/ext/client_config/client_config_plugin.c', 'src/core/ext/client_channel/client_channel_plugin.c',
'src/core/ext/client_config/connector.c', 'src/core/ext/client_channel/connector.c',
'src/core/ext/client_config/default_initial_connect_string.c', 'src/core/ext/client_channel/default_initial_connect_string.c',
'src/core/ext/client_config/http_connect_handshaker.c', 'src/core/ext/client_channel/http_connect_handshaker.c',
'src/core/ext/client_config/initial_connect_string.c', 'src/core/ext/client_channel/initial_connect_string.c',
'src/core/ext/client_config/lb_policy.c', 'src/core/ext/client_channel/lb_policy.c',
'src/core/ext/client_config/lb_policy_factory.c', 'src/core/ext/client_channel/lb_policy_factory.c',
'src/core/ext/client_config/lb_policy_registry.c', 'src/core/ext/client_channel/lb_policy_registry.c',
'src/core/ext/client_config/method_config.c', 'src/core/ext/client_channel/method_config.c',
'src/core/ext/client_config/parse_address.c', 'src/core/ext/client_channel/parse_address.c',
'src/core/ext/client_config/resolver.c', 'src/core/ext/client_channel/resolver.c',
'src/core/ext/client_config/resolver_factory.c', 'src/core/ext/client_channel/resolver_factory.c',
'src/core/ext/client_config/resolver_registry.c', 'src/core/ext/client_channel/resolver_registry.c',
'src/core/ext/client_config/resolver_result.c', 'src/core/ext/client_channel/resolver_result.c',
'src/core/ext/client_config/subchannel.c', 'src/core/ext/client_channel/subchannel.c',
'src/core/ext/client_config/subchannel_index.c', 'src/core/ext/client_channel/subchannel_index.c',
'src/core/ext/client_config/uri_parser.c', 'src/core/ext/client_channel/uri_parser.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c',

@ -351,47 +351,47 @@ filegroups:
- gpr - gpr
uses: uses:
- grpc_codegen - grpc_codegen
- name: grpc_client_config - name: grpc_client_channel
headers: headers:
- src/core/ext/client_config/client_channel.h - src/core/ext/client_channel/client_channel.h
- src/core/ext/client_config/client_channel_factory.h - src/core/ext/client_channel/client_channel_factory.h
- src/core/ext/client_config/connector.h - src/core/ext/client_channel/connector.h
- src/core/ext/client_config/http_connect_handshaker.h - src/core/ext/client_channel/http_connect_handshaker.h
- src/core/ext/client_config/initial_connect_string.h - src/core/ext/client_channel/initial_connect_string.h
- src/core/ext/client_config/lb_policy.h - src/core/ext/client_channel/lb_policy.h
- src/core/ext/client_config/lb_policy_factory.h - src/core/ext/client_channel/lb_policy_factory.h
- src/core/ext/client_config/lb_policy_registry.h - src/core/ext/client_channel/lb_policy_registry.h
- src/core/ext/client_config/method_config.h - src/core/ext/client_channel/method_config.h
- src/core/ext/client_config/parse_address.h - src/core/ext/client_channel/parse_address.h
- src/core/ext/client_config/resolver.h - src/core/ext/client_channel/resolver.h
- src/core/ext/client_config/resolver_factory.h - src/core/ext/client_channel/resolver_factory.h
- src/core/ext/client_config/resolver_registry.h - src/core/ext/client_channel/resolver_registry.h
- src/core/ext/client_config/resolver_result.h - src/core/ext/client_channel/resolver_result.h
- src/core/ext/client_config/subchannel.h - src/core/ext/client_channel/subchannel.h
- src/core/ext/client_config/subchannel_index.h - src/core/ext/client_channel/subchannel_index.h
- src/core/ext/client_config/uri_parser.h - src/core/ext/client_channel/uri_parser.h
src: src:
- src/core/ext/client_config/channel_connectivity.c - src/core/ext/client_channel/channel_connectivity.c
- src/core/ext/client_config/client_channel.c - src/core/ext/client_channel/client_channel.c
- src/core/ext/client_config/client_channel_factory.c - src/core/ext/client_channel/client_channel_factory.c
- src/core/ext/client_config/client_config_plugin.c - src/core/ext/client_channel/client_channel_plugin.c
- src/core/ext/client_config/connector.c - src/core/ext/client_channel/connector.c
- src/core/ext/client_config/default_initial_connect_string.c - src/core/ext/client_channel/default_initial_connect_string.c
- src/core/ext/client_config/http_connect_handshaker.c - src/core/ext/client_channel/http_connect_handshaker.c
- src/core/ext/client_config/initial_connect_string.c - src/core/ext/client_channel/initial_connect_string.c
- src/core/ext/client_config/lb_policy.c - src/core/ext/client_channel/lb_policy.c
- src/core/ext/client_config/lb_policy_factory.c - src/core/ext/client_channel/lb_policy_factory.c
- src/core/ext/client_config/lb_policy_registry.c - src/core/ext/client_channel/lb_policy_registry.c
- src/core/ext/client_config/method_config.c - src/core/ext/client_channel/method_config.c
- src/core/ext/client_config/parse_address.c - src/core/ext/client_channel/parse_address.c
- src/core/ext/client_config/resolver.c - src/core/ext/client_channel/resolver.c
- src/core/ext/client_config/resolver_factory.c - src/core/ext/client_channel/resolver_factory.c
- src/core/ext/client_config/resolver_registry.c - src/core/ext/client_channel/resolver_registry.c
- src/core/ext/client_config/resolver_result.c - src/core/ext/client_channel/resolver_result.c
- src/core/ext/client_config/subchannel.c - src/core/ext/client_channel/subchannel.c
- src/core/ext/client_config/subchannel_index.c - src/core/ext/client_channel/subchannel_index.c
- src/core/ext/client_config/uri_parser.c - src/core/ext/client_channel/uri_parser.c
plugin: grpc_client_config plugin: grpc_client_channel
uses: uses:
- grpc_base - grpc_base
- name: grpc_codegen - name: grpc_codegen
@ -416,7 +416,7 @@ filegroups:
plugin: grpc_lb_policy_grpclb plugin: grpc_lb_policy_grpclb
uses: uses:
- grpc_base - grpc_base
- grpc_client_config - grpc_client_channel
- nanopb - nanopb
- name: grpc_lb_policy_pick_first - name: grpc_lb_policy_pick_first
src: src:
@ -424,14 +424,14 @@ filegroups:
plugin: grpc_lb_policy_pick_first plugin: grpc_lb_policy_pick_first
uses: uses:
- grpc_base - grpc_base
- grpc_client_config - grpc_client_channel
- name: grpc_lb_policy_round_robin - name: grpc_lb_policy_round_robin
src: src:
- src/core/ext/lb_policy/round_robin/round_robin.c - src/core/ext/lb_policy/round_robin/round_robin.c
plugin: grpc_lb_policy_round_robin plugin: grpc_lb_policy_round_robin
uses: uses:
- grpc_base - grpc_base
- grpc_client_config - grpc_client_channel
- name: grpc_load_reporting - name: grpc_load_reporting
headers: headers:
- src/core/ext/load_reporting/load_reporting.h - src/core/ext/load_reporting/load_reporting.h
@ -448,14 +448,14 @@ filegroups:
plugin: grpc_resolver_dns_native plugin: grpc_resolver_dns_native
uses: uses:
- grpc_base - grpc_base
- grpc_client_config - grpc_client_channel
- name: grpc_resolver_sockaddr - name: grpc_resolver_sockaddr
src: src:
- src/core/ext/resolver/sockaddr/sockaddr_resolver.c - src/core/ext/resolver/sockaddr/sockaddr_resolver.c
plugin: grpc_resolver_sockaddr plugin: grpc_resolver_sockaddr
uses: uses:
- grpc_base - grpc_base
- grpc_client_config - grpc_client_channel
- name: grpc_secure - name: grpc_secure
public_headers: public_headers:
- include/grpc/grpc_security.h - include/grpc/grpc_security.h
@ -606,14 +606,14 @@ filegroups:
uses: uses:
- grpc_transport_chttp2 - grpc_transport_chttp2
- grpc_base - grpc_base
- grpc_client_config - grpc_client_channel
- name: grpc_transport_chttp2_client_secure - name: grpc_transport_chttp2_client_secure
src: src:
- src/core/ext/transport/chttp2/client/secure/secure_channel_create.c - src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
uses: uses:
- grpc_transport_chttp2 - grpc_transport_chttp2
- grpc_base - grpc_base
- grpc_client_config - grpc_client_channel
- grpc_secure - grpc_secure
- name: grpc_transport_chttp2_server_insecure - name: grpc_transport_chttp2_server_insecure
src: src:
@ -1032,7 +1032,7 @@ libs:
src: src:
- src/proto/grpc/reflection/v1alpha/reflection.proto - src/proto/grpc/reflection/v1alpha/reflection.proto
- name: grpc++_test - name: grpc++_test
build: test build: private
language: c++ language: c++
headers: headers:
- include/grpc++/test/server_context_test_spouse.h - include/grpc++/test/server_context_test_spouse.h
@ -1499,7 +1499,7 @@ targets:
build: test build: test
language: c language: c
src: src:
- test/core/client_config/resolvers/dns_resolver_connectivity_test.c - test/core/client_channel/resolvers/dns_resolver_connectivity_test.c
deps: deps:
- grpc_test_util - grpc_test_util
- grpc - grpc
@ -1509,7 +1509,7 @@ targets:
build: test build: test
language: c language: c
src: src:
- test/core/client_config/resolvers/dns_resolver_test.c - test/core/client_channel/resolvers/dns_resolver_test.c
deps: deps:
- grpc_test_util - grpc_test_util
- grpc - grpc
@ -2203,7 +2203,7 @@ targets:
build: test build: test
language: c language: c
src: src:
- test/core/client_config/lb_policies_test.c - test/core/client_channel/lb_policies_test.c
deps: deps:
- grpc_test_util - grpc_test_util
- grpc - grpc
@ -2425,7 +2425,7 @@ targets:
build: test build: test
language: c language: c
src: src:
- test/core/client_config/set_initial_connect_string_test.c - test/core/client_channel/set_initial_connect_string_test.c
deps: deps:
- test_tcp_server - test_tcp_server
- grpc_test_util - grpc_test_util
@ -2436,7 +2436,7 @@ targets:
build: test build: test
language: c language: c
src: src:
- test/core/client_config/resolvers/sockaddr_resolver_test.c - test/core/client_channel/resolvers/sockaddr_resolver_test.c
deps: deps:
- grpc_test_util - grpc_test_util
- grpc - grpc
@ -2602,20 +2602,20 @@ targets:
build: fuzzer build: fuzzer
language: c language: c
src: src:
- test/core/client_config/uri_fuzzer_test.c - test/core/client_channel/uri_fuzzer_test.c
deps: deps:
- grpc_test_util - grpc_test_util
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
corpus_dirs: corpus_dirs:
- test/core/client_config/uri_corpus - test/core/client_channel/uri_corpus
maxlen: 128 maxlen: 128
- name: uri_parser_test - name: uri_parser_test
build: test build: test
language: c language: c
src: src:
- test/core/client_config/uri_parser_test.c - test/core/client_channel/uri_parser_test.c
deps: deps:
- grpc_test_util - grpc_test_util
- grpc - grpc
@ -3057,6 +3057,7 @@ targets:
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
- grpc++_test_config
platforms: platforms:
- mac - mac
- linux - linux

@ -230,26 +230,26 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/tsi/ssl_transport_security.c \ src/core/lib/tsi/ssl_transport_security.c \
src/core/lib/tsi/transport_security.c \ src/core/lib/tsi/transport_security.c \
src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \ src/core/ext/transport/chttp2/client/secure/secure_channel_create.c \
src/core/ext/client_config/channel_connectivity.c \ src/core/ext/client_channel/channel_connectivity.c \
src/core/ext/client_config/client_channel.c \ src/core/ext/client_channel/client_channel.c \
src/core/ext/client_config/client_channel_factory.c \ src/core/ext/client_channel/client_channel_factory.c \
src/core/ext/client_config/client_config_plugin.c \ src/core/ext/client_channel/client_channel_plugin.c \
src/core/ext/client_config/connector.c \ src/core/ext/client_channel/connector.c \
src/core/ext/client_config/default_initial_connect_string.c \ src/core/ext/client_channel/default_initial_connect_string.c \
src/core/ext/client_config/http_connect_handshaker.c \ src/core/ext/client_channel/http_connect_handshaker.c \
src/core/ext/client_config/initial_connect_string.c \ src/core/ext/client_channel/initial_connect_string.c \
src/core/ext/client_config/lb_policy.c \ src/core/ext/client_channel/lb_policy.c \
src/core/ext/client_config/lb_policy_factory.c \ src/core/ext/client_channel/lb_policy_factory.c \
src/core/ext/client_config/lb_policy_registry.c \ src/core/ext/client_channel/lb_policy_registry.c \
src/core/ext/client_config/method_config.c \ src/core/ext/client_channel/method_config.c \
src/core/ext/client_config/parse_address.c \ src/core/ext/client_channel/parse_address.c \
src/core/ext/client_config/resolver.c \ src/core/ext/client_channel/resolver.c \
src/core/ext/client_config/resolver_factory.c \ src/core/ext/client_channel/resolver_factory.c \
src/core/ext/client_config/resolver_registry.c \ src/core/ext/client_channel/resolver_registry.c \
src/core/ext/client_config/resolver_result.c \ src/core/ext/client_channel/resolver_result.c \
src/core/ext/client_config/subchannel.c \ src/core/ext/client_channel/subchannel.c \
src/core/ext/client_config/subchannel_index.c \ src/core/ext/client_channel/subchannel_index.c \
src/core/ext/client_config/uri_parser.c \ src/core/ext/client_channel/uri_parser.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2.c \
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \ src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \ src/core/ext/transport/chttp2/client/insecure/channel_create.c \
@ -588,7 +588,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl) PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census/gen) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/census/gen)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/client_config) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/client_channel)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/pick_first) PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/pick_first)

@ -779,21 +779,21 @@ Client asserts:
### unimplemented_method ### unimplemented_method
This test verifies that calling an unimplemented RPC method returns the This test verifies that calling an unimplemented RPC method returns the
UNIMPLEMENTED status code. UNIMPLEMENTED status code.
Server features: Server features:
N/A N/A
Procedure: Procedure:
* Client calls `grpc.testing.TestService/UnimplementedMethod` with an empty * Client calls `grpc.testing.TestService/UnimplementedCall` with an empty
request (defined as `grpc.testing.Empty`): request (defined as `grpc.testing.Empty`):
``` ```
{ {
} }
``` ```
Client asserts: Client asserts:
* received status code is 12 (UNIMPLEMENTED) * received status code is 12 (UNIMPLEMENTED)

@ -55,6 +55,7 @@ function runGetFeature(callback) {
function featureCallback(error, feature) { function featureCallback(error, feature) {
if (error) { if (error) {
callback(error); callback(error);
return;
} }
if (feature.name === '') { if (feature.name === '') {
console.log('Found no feature at ' + console.log('Found no feature at ' +
@ -117,13 +118,17 @@ function runRecordRoute(callback) {
string: 'db_path' string: 'db_path'
}); });
fs.readFile(path.resolve(argv.db_path), function(err, data) { fs.readFile(path.resolve(argv.db_path), function(err, data) {
if (err) callback(err); if (err) {
callback(err);
return;
}
var feature_list = JSON.parse(data); var feature_list = JSON.parse(data);
var num_points = 10; var num_points = 10;
var call = client.recordRoute(function(error, stats) { var call = client.recordRoute(function(error, stats) {
if (error) { if (error) {
callback(error); callback(error);
return;
} }
console.log('Finished trip with', stats.point_count, 'points'); console.log('Finished trip with', stats.point_count, 'points');
console.log('Passed', stats.feature_count, 'features'); console.log('Passed', stats.feature_count, 'features');

@ -56,6 +56,7 @@ function runGetFeature(callback) {
function featureCallback(error, feature) { function featureCallback(error, feature) {
if (error) { if (error) {
callback(error); callback(error);
return;
} }
var latitude = feature.getLocation().getLatitude(); var latitude = feature.getLocation().getLatitude();
var longitude = feature.getLocation().getLongitude(); var longitude = feature.getLocation().getLongitude();
@ -115,7 +116,10 @@ function runRecordRoute(callback) {
string: 'db_path' string: 'db_path'
}); });
fs.readFile(path.resolve(argv.db_path), function(err, data) { fs.readFile(path.resolve(argv.db_path), function(err, data) {
if (err) callback(err); if (err) {
callback(err);
return;
}
// Transform the loaded features to Feature objects // Transform the loaded features to Feature objects
var feature_list = _.map(JSON.parse(data), function(value) { var feature_list = _.map(JSON.parse(data), function(value) {
var feature = new messages.Feature(); var feature = new messages.Feature();
@ -131,6 +135,7 @@ function runRecordRoute(callback) {
var call = client.recordRoute(function(error, stats) { var call = client.recordRoute(function(error, stats) {
if (error) { if (error) {
callback(error); callback(error);
return;
} }
console.log('Finished trip with', stats.getPointCount(), 'points'); console.log('Finished trip with', stats.getPointCount(), 'points');
console.log('Passed', stats.getFeatureCount(), 'features'); console.log('Passed', stats.getFeatureCount(), 'features');

@ -380,23 +380,23 @@ Pod::Spec.new do |s|
'src/core/lib/tsi/ssl_types.h', 'src/core/lib/tsi/ssl_types.h',
'src/core/lib/tsi/transport_security.h', 'src/core/lib/tsi/transport_security.h',
'src/core/lib/tsi/transport_security_interface.h', 'src/core/lib/tsi/transport_security_interface.h',
'src/core/ext/client_config/client_channel.h', 'src/core/ext/client_channel/client_channel.h',
'src/core/ext/client_config/client_channel_factory.h', 'src/core/ext/client_channel/client_channel_factory.h',
'src/core/ext/client_config/connector.h', 'src/core/ext/client_channel/connector.h',
'src/core/ext/client_config/http_connect_handshaker.h', 'src/core/ext/client_channel/http_connect_handshaker.h',
'src/core/ext/client_config/initial_connect_string.h', 'src/core/ext/client_channel/initial_connect_string.h',
'src/core/ext/client_config/lb_policy.h', 'src/core/ext/client_channel/lb_policy.h',
'src/core/ext/client_config/lb_policy_factory.h', 'src/core/ext/client_channel/lb_policy_factory.h',
'src/core/ext/client_config/lb_policy_registry.h', 'src/core/ext/client_channel/lb_policy_registry.h',
'src/core/ext/client_config/method_config.h', 'src/core/ext/client_channel/method_config.h',
'src/core/ext/client_config/parse_address.h', 'src/core/ext/client_channel/parse_address.h',
'src/core/ext/client_config/resolver.h', 'src/core/ext/client_channel/resolver.h',
'src/core/ext/client_config/resolver_factory.h', 'src/core/ext/client_channel/resolver_factory.h',
'src/core/ext/client_config/resolver_registry.h', 'src/core/ext/client_channel/resolver_registry.h',
'src/core/ext/client_config/resolver_result.h', 'src/core/ext/client_channel/resolver_result.h',
'src/core/ext/client_config/subchannel.h', 'src/core/ext/client_channel/subchannel.h',
'src/core/ext/client_config/subchannel_index.h', 'src/core/ext/client_channel/subchannel_index.h',
'src/core/ext/client_config/uri_parser.h', 'src/core/ext/client_channel/uri_parser.h',
'src/core/ext/lb_policy/grpclb/grpclb.h', 'src/core/ext/lb_policy/grpclb/grpclb.h',
'src/core/ext/lb_policy/grpclb/load_balancer_api.h', 'src/core/ext/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h',
@ -564,26 +564,26 @@ Pod::Spec.new do |s|
'src/core/lib/tsi/ssl_transport_security.c', 'src/core/lib/tsi/ssl_transport_security.c',
'src/core/lib/tsi/transport_security.c', 'src/core/lib/tsi/transport_security.c',
'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c', 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.c',
'src/core/ext/client_config/channel_connectivity.c', 'src/core/ext/client_channel/channel_connectivity.c',
'src/core/ext/client_config/client_channel.c', 'src/core/ext/client_channel/client_channel.c',
'src/core/ext/client_config/client_channel_factory.c', 'src/core/ext/client_channel/client_channel_factory.c',
'src/core/ext/client_config/client_config_plugin.c', 'src/core/ext/client_channel/client_channel_plugin.c',
'src/core/ext/client_config/connector.c', 'src/core/ext/client_channel/connector.c',
'src/core/ext/client_config/default_initial_connect_string.c', 'src/core/ext/client_channel/default_initial_connect_string.c',
'src/core/ext/client_config/http_connect_handshaker.c', 'src/core/ext/client_channel/http_connect_handshaker.c',
'src/core/ext/client_config/initial_connect_string.c', 'src/core/ext/client_channel/initial_connect_string.c',
'src/core/ext/client_config/lb_policy.c', 'src/core/ext/client_channel/lb_policy.c',
'src/core/ext/client_config/lb_policy_factory.c', 'src/core/ext/client_channel/lb_policy_factory.c',
'src/core/ext/client_config/lb_policy_registry.c', 'src/core/ext/client_channel/lb_policy_registry.c',
'src/core/ext/client_config/method_config.c', 'src/core/ext/client_channel/method_config.c',
'src/core/ext/client_config/parse_address.c', 'src/core/ext/client_channel/parse_address.c',
'src/core/ext/client_config/resolver.c', 'src/core/ext/client_channel/resolver.c',
'src/core/ext/client_config/resolver_factory.c', 'src/core/ext/client_channel/resolver_factory.c',
'src/core/ext/client_config/resolver_registry.c', 'src/core/ext/client_channel/resolver_registry.c',
'src/core/ext/client_config/resolver_result.c', 'src/core/ext/client_channel/resolver_result.c',
'src/core/ext/client_config/subchannel.c', 'src/core/ext/client_channel/subchannel.c',
'src/core/ext/client_config/subchannel_index.c', 'src/core/ext/client_channel/subchannel_index.c',
'src/core/ext/client_config/uri_parser.c', 'src/core/ext/client_channel/uri_parser.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2.c',
'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c', 'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create.c', 'src/core/ext/transport/chttp2/client/insecure/channel_create.c',
@ -760,23 +760,23 @@ Pod::Spec.new do |s|
'src/core/lib/tsi/ssl_types.h', 'src/core/lib/tsi/ssl_types.h',
'src/core/lib/tsi/transport_security.h', 'src/core/lib/tsi/transport_security.h',
'src/core/lib/tsi/transport_security_interface.h', 'src/core/lib/tsi/transport_security_interface.h',
'src/core/ext/client_config/client_channel.h', 'src/core/ext/client_channel/client_channel.h',
'src/core/ext/client_config/client_channel_factory.h', 'src/core/ext/client_channel/client_channel_factory.h',
'src/core/ext/client_config/connector.h', 'src/core/ext/client_channel/connector.h',
'src/core/ext/client_config/http_connect_handshaker.h', 'src/core/ext/client_channel/http_connect_handshaker.h',
'src/core/ext/client_config/initial_connect_string.h', 'src/core/ext/client_channel/initial_connect_string.h',
'src/core/ext/client_config/lb_policy.h', 'src/core/ext/client_channel/lb_policy.h',
'src/core/ext/client_config/lb_policy_factory.h', 'src/core/ext/client_channel/lb_policy_factory.h',
'src/core/ext/client_config/lb_policy_registry.h', 'src/core/ext/client_channel/lb_policy_registry.h',
'src/core/ext/client_config/method_config.h', 'src/core/ext/client_channel/method_config.h',
'src/core/ext/client_config/parse_address.h', 'src/core/ext/client_channel/parse_address.h',
'src/core/ext/client_config/resolver.h', 'src/core/ext/client_channel/resolver.h',
'src/core/ext/client_config/resolver_factory.h', 'src/core/ext/client_channel/resolver_factory.h',
'src/core/ext/client_config/resolver_registry.h', 'src/core/ext/client_channel/resolver_registry.h',
'src/core/ext/client_config/resolver_result.h', 'src/core/ext/client_channel/resolver_result.h',
'src/core/ext/client_config/subchannel.h', 'src/core/ext/client_channel/subchannel.h',
'src/core/ext/client_config/subchannel_index.h', 'src/core/ext/client_channel/subchannel_index.h',
'src/core/ext/client_config/uri_parser.h', 'src/core/ext/client_channel/uri_parser.h',
'src/core/ext/lb_policy/grpclb/grpclb.h', 'src/core/ext/lb_policy/grpclb/grpclb.h',
'src/core/ext/lb_policy/grpclb/load_balancer_api.h', 'src/core/ext/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h', 'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h',

@ -300,23 +300,23 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/tsi/ssl_types.h ) s.files += %w( src/core/lib/tsi/ssl_types.h )
s.files += %w( src/core/lib/tsi/transport_security.h ) s.files += %w( src/core/lib/tsi/transport_security.h )
s.files += %w( src/core/lib/tsi/transport_security_interface.h ) 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_channel/client_channel.h )
s.files += %w( src/core/ext/client_config/client_channel_factory.h ) s.files += %w( src/core/ext/client_channel/client_channel_factory.h )
s.files += %w( src/core/ext/client_config/connector.h ) s.files += %w( src/core/ext/client_channel/connector.h )
s.files += %w( src/core/ext/client_config/http_connect_handshaker.h ) s.files += %w( src/core/ext/client_channel/http_connect_handshaker.h )
s.files += %w( src/core/ext/client_config/initial_connect_string.h ) s.files += %w( src/core/ext/client_channel/initial_connect_string.h )
s.files += %w( src/core/ext/client_config/lb_policy.h ) s.files += %w( src/core/ext/client_channel/lb_policy.h )
s.files += %w( src/core/ext/client_config/lb_policy_factory.h ) s.files += %w( src/core/ext/client_channel/lb_policy_factory.h )
s.files += %w( src/core/ext/client_config/lb_policy_registry.h ) s.files += %w( src/core/ext/client_channel/lb_policy_registry.h )
s.files += %w( src/core/ext/client_config/method_config.h ) s.files += %w( src/core/ext/client_channel/method_config.h )
s.files += %w( src/core/ext/client_config/parse_address.h ) s.files += %w( src/core/ext/client_channel/parse_address.h )
s.files += %w( src/core/ext/client_config/resolver.h ) s.files += %w( src/core/ext/client_channel/resolver.h )
s.files += %w( src/core/ext/client_config/resolver_factory.h ) s.files += %w( src/core/ext/client_channel/resolver_factory.h )
s.files += %w( src/core/ext/client_config/resolver_registry.h ) s.files += %w( src/core/ext/client_channel/resolver_registry.h )
s.files += %w( src/core/ext/client_config/resolver_result.h ) s.files += %w( src/core/ext/client_channel/resolver_result.h )
s.files += %w( src/core/ext/client_config/subchannel.h ) s.files += %w( src/core/ext/client_channel/subchannel.h )
s.files += %w( src/core/ext/client_config/subchannel_index.h ) s.files += %w( src/core/ext/client_channel/subchannel_index.h )
s.files += %w( src/core/ext/client_config/uri_parser.h ) s.files += %w( src/core/ext/client_channel/uri_parser.h )
s.files += %w( src/core/ext/lb_policy/grpclb/grpclb.h ) s.files += %w( src/core/ext/lb_policy/grpclb/grpclb.h )
s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h ) s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h )
s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h ) s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h )
@ -484,26 +484,26 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/tsi/ssl_transport_security.c ) s.files += %w( src/core/lib/tsi/ssl_transport_security.c )
s.files += %w( src/core/lib/tsi/transport_security.c ) s.files += %w( src/core/lib/tsi/transport_security.c )
s.files += %w( src/core/ext/transport/chttp2/client/secure/secure_channel_create.c ) s.files += %w( src/core/ext/transport/chttp2/client/secure/secure_channel_create.c )
s.files += %w( src/core/ext/client_config/channel_connectivity.c ) s.files += %w( src/core/ext/client_channel/channel_connectivity.c )
s.files += %w( src/core/ext/client_config/client_channel.c ) s.files += %w( src/core/ext/client_channel/client_channel.c )
s.files += %w( src/core/ext/client_config/client_channel_factory.c ) s.files += %w( src/core/ext/client_channel/client_channel_factory.c )
s.files += %w( src/core/ext/client_config/client_config_plugin.c ) s.files += %w( src/core/ext/client_channel/client_channel_plugin.c )
s.files += %w( src/core/ext/client_config/connector.c ) s.files += %w( src/core/ext/client_channel/connector.c )
s.files += %w( src/core/ext/client_config/default_initial_connect_string.c ) s.files += %w( src/core/ext/client_channel/default_initial_connect_string.c )
s.files += %w( src/core/ext/client_config/http_connect_handshaker.c ) s.files += %w( src/core/ext/client_channel/http_connect_handshaker.c )
s.files += %w( src/core/ext/client_config/initial_connect_string.c ) s.files += %w( src/core/ext/client_channel/initial_connect_string.c )
s.files += %w( src/core/ext/client_config/lb_policy.c ) s.files += %w( src/core/ext/client_channel/lb_policy.c )
s.files += %w( src/core/ext/client_config/lb_policy_factory.c ) s.files += %w( src/core/ext/client_channel/lb_policy_factory.c )
s.files += %w( src/core/ext/client_config/lb_policy_registry.c ) s.files += %w( src/core/ext/client_channel/lb_policy_registry.c )
s.files += %w( src/core/ext/client_config/method_config.c ) s.files += %w( src/core/ext/client_channel/method_config.c )
s.files += %w( src/core/ext/client_config/parse_address.c ) s.files += %w( src/core/ext/client_channel/parse_address.c )
s.files += %w( src/core/ext/client_config/resolver.c ) s.files += %w( src/core/ext/client_channel/resolver.c )
s.files += %w( src/core/ext/client_config/resolver_factory.c ) s.files += %w( src/core/ext/client_channel/resolver_factory.c )
s.files += %w( src/core/ext/client_config/resolver_registry.c ) s.files += %w( src/core/ext/client_channel/resolver_registry.c )
s.files += %w( src/core/ext/client_config/resolver_result.c ) s.files += %w( src/core/ext/client_channel/resolver_result.c )
s.files += %w( src/core/ext/client_config/subchannel.c ) s.files += %w( src/core/ext/client_channel/subchannel.c )
s.files += %w( src/core/ext/client_config/subchannel_index.c ) s.files += %w( src/core/ext/client_channel/subchannel_index.c )
s.files += %w( src/core/ext/client_config/uri_parser.c ) s.files += %w( src/core/ext/client_channel/uri_parser.c )
s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.c ) s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2.c )
s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c ) s.files += %w( src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c )
s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.c ) s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.c )

@ -307,23 +307,23 @@
<file baseinstalldir="/" name="src/core/lib/tsi/ssl_types.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/tsi/ssl_types.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/tsi/transport_security.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/tsi/transport_security.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/tsi/transport_security_interface.h" role="src" /> <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_channel/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_channel/client_channel_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/connector.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/connector.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/http_connect_handshaker.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/http_connect_handshaker.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/initial_connect_string.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/initial_connect_string.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy_factory.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy_registry.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_registry.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/method_config.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/method_config.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/parse_address.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/parse_address.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver_factory.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/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_channel/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_channel/resolver_result.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/subchannel.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/subchannel.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/subchannel_index.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/subchannel_index.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/uri_parser.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/uri_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/grpclb.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/grpclb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/load_balancer_api.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/load_balancer_api.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h" role="src" />
@ -491,26 +491,26 @@
<file baseinstalldir="/" name="src/core/lib/tsi/ssl_transport_security.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/tsi/ssl_transport_security.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/tsi/transport_security.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/tsi/transport_security.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/secure/secure_channel_create.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/secure/secure_channel_create.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/channel_connectivity.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/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_channel/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_channel/client_channel_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/client_config_plugin.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/client_channel_plugin.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/connector.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/connector.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/default_initial_connect_string.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/default_initial_connect_string.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/http_connect_handshaker.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/http_connect_handshaker.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/initial_connect_string.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/initial_connect_string.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy_factory.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/lb_policy_registry.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_registry.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/method_config.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/method_config.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/parse_address.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/parse_address.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/resolver_factory.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/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_channel/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_channel/resolver_result.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/subchannel.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/subchannel.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/subchannel_index.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/subchannel_index.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_config/uri_parser.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/uri_parser.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/insecure/channel_create.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/client/insecure/channel_create.c" role="src" />

@ -36,7 +36,7 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/ext/client_config/client_channel.h" #include "src/core/ext/client_channel/client_channel.h"
#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/completion_queue.h" #include "src/core/lib/surface/completion_queue.h"

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/client_channel.h" #include "src/core/ext/client_channel/client_channel.h"
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
@ -42,9 +42,9 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/client_config/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/ext/client_config/method_config.h" #include "src/core/ext/client_channel/method_config.h"
#include "src/core/ext/client_config/subchannel.h" #include "src/core/ext/client_channel/subchannel.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/deadline_filter.h" #include "src/core/lib/channel/deadline_filter.h"
@ -60,6 +60,54 @@
/* Client channel implementation */ /* Client channel implementation */
/*************************************************************************
* METHOD-CONFIG TABLE
*/
typedef enum {
WAIT_FOR_READY_UNSET,
WAIT_FOR_READY_FALSE,
WAIT_FOR_READY_TRUE
} wait_for_ready_value;
typedef struct method_parameters {
gpr_timespec timeout;
wait_for_ready_value wait_for_ready;
} method_parameters;
static void *method_parameters_copy(void *value) {
void *new_value = gpr_malloc(sizeof(method_parameters));
memcpy(new_value, value, sizeof(method_parameters));
return new_value;
}
static int method_parameters_cmp(void *value1, void *value2) {
const method_parameters *v1 = value1;
const method_parameters *v2 = value2;
const int retval = gpr_time_cmp(v1->timeout, v2->timeout);
if (retval != 0) return retval;
if (v1->wait_for_ready > v2->wait_for_ready) return 1;
if (v1->wait_for_ready < v2->wait_for_ready) return -1;
return 0;
}
static const grpc_mdstr_hash_table_vtable method_parameters_vtable = {
gpr_free, method_parameters_copy, method_parameters_cmp};
static void *method_config_convert_value(
const grpc_method_config *method_config) {
method_parameters *value = gpr_malloc(sizeof(method_parameters));
const gpr_timespec *timeout = grpc_method_config_get_timeout(method_config);
value->timeout = timeout != NULL ? *timeout : gpr_time_0(GPR_TIMESPAN);
const bool *wait_for_ready =
grpc_method_config_get_wait_for_ready(method_config);
value->wait_for_ready =
wait_for_ready == NULL
? WAIT_FOR_READY_UNSET
: (wait_for_ready ? WAIT_FOR_READY_TRUE : WAIT_FOR_READY_FALSE);
return value;
}
/************************************************************************* /*************************************************************************
* CHANNEL-WIDE FUNCTIONS * CHANNEL-WIDE FUNCTIONS
*/ */
@ -76,8 +124,8 @@ typedef struct client_channel_channel_data {
gpr_mu mu; gpr_mu mu;
/** currently active load balancer */ /** currently active load balancer */
grpc_lb_policy *lb_policy; grpc_lb_policy *lb_policy;
/** method config table */ /** maps method names to method_parameters structs */
grpc_method_config_table *method_config_table; grpc_mdstr_hash_table *method_params_table;
/** incoming resolver result - set by resolver.next() */ /** incoming resolver result - set by resolver.next() */
grpc_resolver_result *resolver_result; grpc_resolver_result *resolver_result;
/** a list of closures that are all waiting for config to come in */ /** a list of closures that are all waiting for config to come in */
@ -177,7 +225,7 @@ static void on_resolver_result_changed(grpc_exec_ctx *exec_ctx, void *arg,
channel_data *chand = arg; channel_data *chand = arg;
grpc_lb_policy *lb_policy = NULL; grpc_lb_policy *lb_policy = NULL;
grpc_lb_policy *old_lb_policy; grpc_lb_policy *old_lb_policy;
grpc_method_config_table *method_config_table = NULL; grpc_mdstr_hash_table *method_params_table = NULL;
grpc_connectivity_state state = GRPC_CHANNEL_TRANSIENT_FAILURE; grpc_connectivity_state state = GRPC_CHANNEL_TRANSIENT_FAILURE;
bool exit_idle = false; bool exit_idle = false;
grpc_error *state_error = GRPC_ERROR_CREATE("No load balancing policy"); grpc_error *state_error = GRPC_ERROR_CREATE("No load balancing policy");
@ -230,8 +278,9 @@ static void on_resolver_result_changed(grpc_exec_ctx *exec_ctx, void *arg,
lb_policy_args.additional_args, GRPC_ARG_SERVICE_CONFIG); lb_policy_args.additional_args, GRPC_ARG_SERVICE_CONFIG);
if (channel_arg != NULL) { if (channel_arg != NULL) {
GPR_ASSERT(channel_arg->type == GRPC_ARG_POINTER); GPR_ASSERT(channel_arg->type == GRPC_ARG_POINTER);
method_config_table = grpc_method_config_table_ref( method_params_table = grpc_method_config_table_convert(
(grpc_method_config_table *)channel_arg->value.pointer.p); (grpc_method_config_table *)channel_arg->value.pointer.p,
method_config_convert_value, &method_parameters_vtable);
} }
grpc_resolver_result_unref(exec_ctx, chand->resolver_result); grpc_resolver_result_unref(exec_ctx, chand->resolver_result);
chand->resolver_result = NULL; chand->resolver_result = NULL;
@ -245,10 +294,10 @@ static void on_resolver_result_changed(grpc_exec_ctx *exec_ctx, void *arg,
gpr_mu_lock(&chand->mu); gpr_mu_lock(&chand->mu);
old_lb_policy = chand->lb_policy; old_lb_policy = chand->lb_policy;
chand->lb_policy = lb_policy; chand->lb_policy = lb_policy;
if (chand->method_config_table != NULL) { if (chand->method_params_table != NULL) {
grpc_method_config_table_unref(chand->method_config_table); grpc_mdstr_hash_table_unref(chand->method_params_table);
} }
chand->method_config_table = method_config_table; chand->method_params_table = method_params_table;
if (lb_policy != NULL) { if (lb_policy != NULL) {
grpc_exec_ctx_enqueue_list(exec_ctx, &chand->waiting_for_config_closures, grpc_exec_ctx_enqueue_list(exec_ctx, &chand->waiting_for_config_closures,
NULL); NULL);
@ -409,8 +458,8 @@ static void cc_destroy_channel_elem(grpc_exec_ctx *exec_ctx,
chand->interested_parties); chand->interested_parties);
GRPC_LB_POLICY_UNREF(exec_ctx, chand->lb_policy, "channel"); GRPC_LB_POLICY_UNREF(exec_ctx, chand->lb_policy, "channel");
} }
if (chand->method_config_table != NULL) { if (chand->method_params_table != NULL) {
grpc_method_config_table_unref(chand->method_config_table); grpc_mdstr_hash_table_unref(chand->method_params_table);
} }
grpc_connectivity_state_destroy(exec_ctx, &chand->state_tracker); grpc_connectivity_state_destroy(exec_ctx, &chand->state_tracker);
grpc_pollset_set_destroy(chand->interested_parties); grpc_pollset_set_destroy(chand->interested_parties);
@ -448,11 +497,7 @@ typedef struct client_channel_call_data {
grpc_mdstr *path; // Request path. grpc_mdstr *path; // Request path.
gpr_timespec call_start_time; gpr_timespec call_start_time;
gpr_timespec deadline; gpr_timespec deadline;
enum { wait_for_ready_value wait_for_ready_from_service_config;
WAIT_FOR_READY_UNSET,
WAIT_FOR_READY_FALSE,
WAIT_FOR_READY_TRUE
} wait_for_ready_from_service_config;
grpc_closure read_service_config; grpc_closure read_service_config;
grpc_error *cancel_error; grpc_error *cancel_error;
@ -846,41 +891,39 @@ static void read_service_config(grpc_exec_ctx *exec_ctx, void *arg,
if (error == GRPC_ERROR_NONE) { if (error == GRPC_ERROR_NONE) {
// Get the method config table from channel data. // Get the method config table from channel data.
gpr_mu_lock(&chand->mu); gpr_mu_lock(&chand->mu);
grpc_method_config_table *method_config_table = NULL; grpc_mdstr_hash_table *method_params_table = NULL;
if (chand->method_config_table != NULL) { if (chand->method_params_table != NULL) {
method_config_table = method_params_table =
grpc_method_config_table_ref(chand->method_config_table); grpc_mdstr_hash_table_ref(chand->method_params_table);
} }
gpr_mu_unlock(&chand->mu); gpr_mu_unlock(&chand->mu);
// If the method config table was present, use it. // If the method config table was present, use it.
if (method_config_table != NULL) { if (method_params_table != NULL) {
const grpc_method_config *method_config = const method_parameters *method_params =
grpc_method_config_table_get_method_config(method_config_table, grpc_method_config_table_get(method_params_table, calld->path);
calld->path); if (method_params != NULL) {
if (method_config != NULL) { const bool have_method_timeout =
const gpr_timespec *per_method_timeout = gpr_time_cmp(method_params->timeout, gpr_time_0(GPR_TIMESPAN)) != 0;
grpc_method_config_get_timeout(method_config); if (have_method_timeout ||
const bool *wait_for_ready = method_params->wait_for_ready != WAIT_FOR_READY_UNSET) {
grpc_method_config_get_wait_for_ready(method_config);
if (per_method_timeout != NULL || wait_for_ready != NULL) {
gpr_mu_lock(&calld->mu); gpr_mu_lock(&calld->mu);
if (per_method_timeout != NULL) { if (have_method_timeout) {
gpr_timespec per_method_deadline = const gpr_timespec per_method_deadline =
gpr_time_add(calld->call_start_time, *per_method_timeout); gpr_time_add(calld->call_start_time, method_params->timeout);
if (gpr_time_cmp(per_method_deadline, calld->deadline) < 0) { if (gpr_time_cmp(per_method_deadline, calld->deadline) < 0) {
calld->deadline = per_method_deadline; calld->deadline = per_method_deadline;
// Reset deadline timer. // Reset deadline timer.
grpc_deadline_state_reset(exec_ctx, elem, calld->deadline); grpc_deadline_state_reset(exec_ctx, elem, calld->deadline);
} }
} }
if (wait_for_ready != NULL) { if (method_params->wait_for_ready != WAIT_FOR_READY_UNSET) {
calld->wait_for_ready_from_service_config = calld->wait_for_ready_from_service_config =
*wait_for_ready ? WAIT_FOR_READY_TRUE : WAIT_FOR_READY_FALSE; method_params->wait_for_ready;
} }
gpr_mu_unlock(&calld->mu); gpr_mu_unlock(&calld->mu);
} }
} }
grpc_method_config_table_unref(method_config_table); grpc_mdstr_hash_table_unref(method_params_table);
} }
} }
GRPC_CALL_STACK_UNREF(exec_ctx, calld->owning_call, "read_service_config"); GRPC_CALL_STACK_UNREF(exec_ctx, calld->owning_call, "read_service_config");
@ -917,29 +960,25 @@ static grpc_error *cc_init_call_elem(grpc_exec_ctx *exec_ctx,
gpr_mu_lock(&chand->mu); gpr_mu_lock(&chand->mu);
if (chand->lb_policy != NULL) { if (chand->lb_policy != NULL) {
// We already have a resolver result, so check for service config. // We already have a resolver result, so check for service config.
if (chand->method_config_table != NULL) { if (chand->method_params_table != NULL) {
grpc_method_config_table *method_config_table = grpc_mdstr_hash_table *method_params_table =
grpc_method_config_table_ref(chand->method_config_table); grpc_mdstr_hash_table_ref(chand->method_params_table);
gpr_mu_unlock(&chand->mu); gpr_mu_unlock(&chand->mu);
grpc_method_config *method_config = method_parameters *method_params =
grpc_method_config_table_get_method_config(method_config_table, grpc_method_config_table_get(method_params_table, args->path);
args->path); if (method_params != NULL) {
if (method_config != NULL) { if (gpr_time_cmp(method_params->timeout,
const gpr_timespec *per_method_timeout = gpr_time_0(GPR_CLOCK_MONOTONIC)) != 0) {
grpc_method_config_get_timeout(method_config);
if (per_method_timeout != NULL) {
gpr_timespec per_method_deadline = gpr_timespec per_method_deadline =
gpr_time_add(calld->call_start_time, *per_method_timeout); gpr_time_add(calld->call_start_time, method_params->timeout);
calld->deadline = gpr_time_min(calld->deadline, per_method_deadline); calld->deadline = gpr_time_min(calld->deadline, per_method_deadline);
} }
const bool *wait_for_ready = if (method_params->wait_for_ready != WAIT_FOR_READY_UNSET) {
grpc_method_config_get_wait_for_ready(method_config);
if (wait_for_ready != NULL) {
calld->wait_for_ready_from_service_config = calld->wait_for_ready_from_service_config =
*wait_for_ready ? WAIT_FOR_READY_TRUE : WAIT_FOR_READY_FALSE; method_params->wait_for_ready;
} }
} }
grpc_method_config_table_unref(method_config_table); grpc_mdstr_hash_table_unref(method_params_table);
} else { } else {
gpr_mu_unlock(&chand->mu); gpr_mu_unlock(&chand->mu);
} }

@ -31,11 +31,11 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_CLIENT_CHANNEL_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_CLIENT_CHANNEL_H
#include "src/core/ext/client_config/client_channel_factory.h" #include "src/core/ext/client_channel/client_channel_factory.h"
#include "src/core/ext/client_config/resolver.h" #include "src/core/ext/client_channel/resolver.h"
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
/* A client channel is a channel that begins disconnected, and can connect /* A client channel is a channel that begins disconnected, and can connect
@ -61,4 +61,4 @@ void grpc_client_channel_watch_connectivity_state(
grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, grpc_pollset *pollset, grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, grpc_pollset *pollset,
grpc_connectivity_state *state, grpc_closure *on_complete); grpc_connectivity_state *state, grpc_closure *on_complete);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_CLIENT_CHANNEL_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/client_channel_factory.h" #include "src/core/ext/client_channel/client_channel_factory.h"
void grpc_client_channel_factory_ref(grpc_client_channel_factory* factory) { void grpc_client_channel_factory_ref(grpc_client_channel_factory* factory) {
factory->vtable->ref(factory); factory->vtable->ref(factory);

@ -31,12 +31,12 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_FACTORY_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_FACTORY_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H
#include <grpc/impl/codegen/grpc_types.h> #include <grpc/impl/codegen/grpc_types.h>
#include "src/core/ext/client_config/subchannel.h" #include "src/core/ext/client_channel/subchannel.h"
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
typedef struct grpc_client_channel_factory grpc_client_channel_factory; typedef struct grpc_client_channel_factory grpc_client_channel_factory;
@ -82,4 +82,4 @@ grpc_channel *grpc_client_channel_factory_create_channel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory, grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory,
const char *target, grpc_client_channel_type type, grpc_channel_args *args); const char *target, grpc_client_channel_type type, grpc_channel_args *args);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_FACTORY_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */

@ -37,10 +37,10 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include "src/core/ext/client_config/client_channel.h" #include "src/core/ext/client_channel/client_channel.h"
#include "src/core/ext/client_config/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/client_channel/resolver_registry.h"
#include "src/core/ext/client_config/subchannel_index.h" #include "src/core/ext/client_channel/subchannel_index.h"
#include "src/core/lib/surface/channel_init.h" #include "src/core/lib/surface/channel_init.h"
static bool append_filter(grpc_channel_stack_builder *builder, void *arg) { static bool append_filter(grpc_channel_stack_builder *builder, void *arg) {
@ -73,7 +73,7 @@ static bool set_default_host_if_unset(grpc_channel_stack_builder *builder,
return true; return true;
} }
void grpc_client_config_init(void) { void grpc_client_channel_init(void) {
grpc_lb_policy_registry_init(); grpc_lb_policy_registry_init();
grpc_resolver_registry_init(); grpc_resolver_registry_init();
grpc_subchannel_index_init(); grpc_subchannel_index_init();
@ -83,7 +83,7 @@ void grpc_client_config_init(void) {
(void *)&grpc_client_channel_filter); (void *)&grpc_client_channel_filter);
} }
void grpc_client_config_shutdown(void) { void grpc_client_channel_shutdown(void) {
grpc_subchannel_index_shutdown(); grpc_subchannel_index_shutdown();
grpc_channel_init_shutdown(); grpc_channel_init_shutdown();
grpc_resolver_registry_shutdown(); grpc_resolver_registry_shutdown();

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/connector.h" #include "src/core/ext/client_channel/connector.h"
grpc_connector* grpc_connector_ref(grpc_connector* connector) { grpc_connector* grpc_connector_ref(grpc_connector* connector) {
connector->vtable->ref(connector); connector->vtable->ref(connector);

@ -31,8 +31,8 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_CONNECTOR_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_CONNECTOR_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_CONNECTOR_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_CONNECTOR_H
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/sockaddr.h"
@ -89,4 +89,4 @@ void grpc_connector_connect(grpc_exec_ctx *exec_ctx, grpc_connector *connector,
void grpc_connector_shutdown(grpc_exec_ctx *exec_ctx, void grpc_connector_shutdown(grpc_exec_ctx *exec_ctx,
grpc_connector *connector); grpc_connector *connector);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_CONNECTOR_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_CONNECTOR_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/http_connect_handshaker.h" #include "src/core/ext/client_channel/http_connect_handshaker.h"
#include <string.h> #include <string.h>
@ -40,7 +40,7 @@
#include <grpc/support/slice_buffer.h> #include <grpc/support/slice_buffer.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/ext/client_config/uri_parser.h" #include "src/core/ext/client_channel/uri_parser.h"
#include "src/core/lib/http/format_request.h" #include "src/core/lib/http/format_request.h"
#include "src/core/lib/http/parser.h" #include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer.h"

@ -31,8 +31,8 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_HTTP_CONNECT_HANDSHAKER_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_HTTP_CONNECT_HANDSHAKER_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H
#include "src/core/lib/channel/handshaker.h" #include "src/core/lib/channel/handshaker.h"
@ -44,4 +44,4 @@ grpc_handshaker* grpc_http_connect_handshaker_create(const char* proxy_server,
/// Caller takes ownership of result. /// Caller takes ownership of result.
char* grpc_get_http_proxy_server(); char* grpc_get_http_proxy_server();
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_HTTP_CONNECT_HANDSHAKER_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/initial_connect_string.h" #include "src/core/ext/client_channel/initial_connect_string.h"
#include <stddef.h> #include <stddef.h>

@ -31,8 +31,8 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_INITIAL_CONNECT_STRING_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_INITIAL_CONNECT_STRING_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_INITIAL_CONNECT_STRING_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_INITIAL_CONNECT_STRING_H
#include <grpc/support/slice.h> #include <grpc/support/slice.h>
#include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/sockaddr.h"
@ -47,4 +47,4 @@ void grpc_test_set_initial_connect_string_function(
void grpc_set_initial_connect_string(struct sockaddr **addr, size_t *addr_len, void grpc_set_initial_connect_string(struct sockaddr **addr, size_t *addr_len,
gpr_slice *connect_string); gpr_slice *connect_string);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_INITIAL_CONNECT_STRING_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_INITIAL_CONNECT_STRING_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/lb_policy.h" #include "src/core/ext/client_channel/lb_policy.h"
#define WEAK_REF_BITS 16 #define WEAK_REF_BITS 16

@ -31,10 +31,11 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_LB_POLICY_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_LB_POLICY_H
#include "src/core/ext/client_config/subchannel.h" #include "src/core/ext/client_channel/subchannel.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/connectivity_state.h"
/** A load balancing policy: specified by a vtable and a struct (which /** A load balancing policy: specified by a vtable and a struct (which
@ -192,4 +193,4 @@ grpc_connectivity_state grpc_lb_policy_check_connectivity(
grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
grpc_error **connectivity_error); grpc_error **connectivity_error);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_LB_POLICY_H */

@ -36,7 +36,7 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/ext/client_config/lb_policy_factory.h" #include "src/core/ext/client_channel/lb_policy_factory.h"
grpc_lb_addresses* grpc_lb_addresses_create(size_t num_addresses) { grpc_lb_addresses* grpc_lb_addresses_create(size_t num_addresses) {
grpc_lb_addresses* addresses = gpr_malloc(sizeof(grpc_lb_addresses)); grpc_lb_addresses* addresses = gpr_malloc(sizeof(grpc_lb_addresses));

@ -31,11 +31,11 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_FACTORY_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_LB_POLICY_FACTORY_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_FACTORY_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_LB_POLICY_FACTORY_H
#include "src/core/ext/client_config/client_channel_factory.h" #include "src/core/ext/client_channel/client_channel_factory.h"
#include "src/core/ext/client_config/lb_policy.h" #include "src/core/ext/client_channel/lb_policy.h"
#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/resolve_address.h"
@ -118,4 +118,4 @@ grpc_lb_policy *grpc_lb_policy_factory_create_lb_policy(
grpc_exec_ctx *exec_ctx, grpc_lb_policy_factory *factory, grpc_exec_ctx *exec_ctx, grpc_lb_policy_factory *factory,
grpc_lb_policy_args *args); grpc_lb_policy_args *args);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_FACTORY_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_LB_POLICY_FACTORY_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include <string.h> #include <string.h>

@ -31,10 +31,10 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_REGISTRY_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_REGISTRY_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H
#include "src/core/ext/client_config/lb_policy_factory.h" #include "src/core/ext/client_channel/lb_policy_factory.h"
#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/exec_ctx.h"
/** Initialize the registry and set \a default_factory as the factory to be /** Initialize the registry and set \a default_factory as the factory to be
@ -52,4 +52,4 @@ void grpc_register_lb_policy(grpc_lb_policy_factory *factory);
grpc_lb_policy *grpc_lb_policy_create(grpc_exec_ctx *exec_ctx, const char *name, grpc_lb_policy *grpc_lb_policy_create(grpc_exec_ctx *exec_ctx, const char *name,
grpc_lb_policy_args *args); grpc_lb_policy_args *args);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_LB_POLICY_REGISTRY_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_LB_POLICY_REGISTRY_H */

@ -29,7 +29,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
#include "src/core/ext/client_config/method_config.h" #include "src/core/ext/client_channel/method_config.h"
#include <string.h> #include <string.h>
@ -254,12 +254,12 @@ int grpc_method_config_table_cmp(const grpc_method_config_table* table1,
return grpc_mdstr_hash_table_cmp(table1, table2); return grpc_mdstr_hash_table_cmp(table1, table2);
} }
grpc_method_config* grpc_method_config_table_get_method_config( void* grpc_method_config_table_get(const grpc_mdstr_hash_table* table,
const grpc_method_config_table* table, const grpc_mdstr* path) { const grpc_mdstr* path) {
grpc_method_config* method_config = grpc_mdstr_hash_table_get(table, path); void* value = grpc_mdstr_hash_table_get(table, path);
// If we didn't find a match for the path, try looking for a wildcard // If we didn't find a match for the path, try looking for a wildcard
// entry (i.e., change "/service/method" to "/service/*"). // entry (i.e., change "/service/method" to "/service/*").
if (method_config == NULL) { if (value == NULL) {
const char* path_str = grpc_mdstr_as_c_string(path); const char* path_str = grpc_mdstr_as_c_string(path);
const char* sep = strrchr(path_str, '/') + 1; const char* sep = strrchr(path_str, '/') + 1;
const size_t len = (size_t)(sep - path_str); const size_t len = (size_t)(sep - path_str);
@ -269,10 +269,10 @@ grpc_method_config* grpc_method_config_table_get_method_config(
buf[len + 1] = '\0'; buf[len + 1] = '\0';
grpc_mdstr* wildcard_path = grpc_mdstr_from_string(buf); grpc_mdstr* wildcard_path = grpc_mdstr_from_string(buf);
gpr_free(buf); gpr_free(buf);
method_config = grpc_mdstr_hash_table_get(table, wildcard_path); value = grpc_mdstr_hash_table_get(table, wildcard_path);
GRPC_MDSTR_UNREF(wildcard_path); GRPC_MDSTR_UNREF(wildcard_path);
} }
return method_config; return value;
} }
static void* copy_arg(void* p) { return grpc_method_config_table_ref(p); } static void* copy_arg(void* p) { return grpc_method_config_table_ref(p); }
@ -294,3 +294,47 @@ grpc_arg grpc_method_config_table_create_channel_arg(
arg.value.pointer.vtable = &arg_vtable; arg.value.pointer.vtable = &arg_vtable;
return arg; return arg;
} }
// State used by convert_entry() below.
typedef struct conversion_state {
void* (*convert_value)(const grpc_method_config* method_config);
const grpc_mdstr_hash_table_vtable* vtable;
size_t num_entries;
grpc_mdstr_hash_table_entry* entries;
} conversion_state;
// A function to be passed to grpc_mdstr_hash_table_iterate() to create
// a copy of the entries.
static void convert_entry(const grpc_mdstr_hash_table_entry* entry,
void* user_data) {
conversion_state* state = user_data;
state->entries[state->num_entries].key = GRPC_MDSTR_REF(entry->key);
state->entries[state->num_entries].value = state->convert_value(entry->value);
state->entries[state->num_entries].vtable = state->vtable;
++state->num_entries;
}
grpc_mdstr_hash_table* grpc_method_config_table_convert(
const grpc_method_config_table* table,
void* (*convert_value)(const grpc_method_config* method_config),
const grpc_mdstr_hash_table_vtable* vtable) {
// Create an array of the entries in the table with converted values.
conversion_state state;
state.convert_value = convert_value;
state.vtable = vtable;
state.num_entries = 0;
state.entries = gpr_malloc(sizeof(grpc_mdstr_hash_table_entry) *
grpc_mdstr_hash_table_num_entries(table));
grpc_mdstr_hash_table_iterate(table, convert_entry, &state);
// Create a new table based on the array we just constructed.
grpc_mdstr_hash_table* new_table =
grpc_mdstr_hash_table_create(state.num_entries, state.entries);
// Clean up the array.
for (size_t i = 0; i < state.num_entries; ++i) {
GRPC_MDSTR_UNREF(state.entries[i].key);
vtable->destroy_value(state.entries[i].value);
}
gpr_free(state.entries);
// Return the new table.
return new_table;
}

@ -29,8 +29,8 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_METHOD_CONFIG_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_METHOD_CONFIG_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_METHOD_CONFIG_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_METHOD_CONFIG_H
#include <stdbool.h> #include <stdbool.h>
@ -106,11 +106,31 @@ int grpc_method_config_table_cmp(const grpc_method_config_table* table1,
/// the form "/service/method". /// the form "/service/method".
/// Returns NULL if the method has no config. /// Returns NULL if the method has no config.
/// Caller does NOT own a reference to the result. /// Caller does NOT own a reference to the result.
grpc_method_config* grpc_method_config_table_get_method_config( ///
const grpc_method_config_table* table, const grpc_mdstr* path); /// Note: This returns a void* instead of a grpc_method_config* so that
/// it can also be used for tables constructed via
/// grpc_method_config_table_convert().
void* grpc_method_config_table_get(const grpc_mdstr_hash_table* table,
const grpc_mdstr* path);
/// Returns a channel arg containing \a table. /// Returns a channel arg containing \a table.
grpc_arg grpc_method_config_table_create_channel_arg( grpc_arg grpc_method_config_table_create_channel_arg(
grpc_method_config_table* table); grpc_method_config_table* table);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_METHOD_CONFIG_H */ /// Generates a new table from \a table whose values are converted to a
/// new form via the \a convert_value function. The new table will use
/// \a vtable for its values.
///
/// This is generally used to convert the table's value type from
/// grpc_method_config to a simple struct containing only the parameters
/// relevant to a particular filter, thus avoiding the need for a hash
/// table lookup on the fast path. In that scenario, \a convert_value
/// will return a new instance of the struct containing the values from
/// the grpc_method_config, and \a vtable provides the methods for
/// operating on the struct type.
grpc_mdstr_hash_table* grpc_method_config_table_convert(
const grpc_method_config_table* table,
void* (*convert_value)(const grpc_method_config* method_config),
const grpc_mdstr_hash_table_vtable* vtable);
#endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_METHOD_CONFIG_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/parse_address.h" #include "src/core/ext/client_channel/parse_address.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

@ -31,12 +31,12 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_PARSE_ADDRESS_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_PARSE_ADDRESS_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_PARSE_ADDRESS_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_PARSE_ADDRESS_H
#include <stddef.h> #include <stddef.h>
#include "src/core/ext/client_config/uri_parser.h" #include "src/core/ext/client_channel/uri_parser.h"
#include "src/core/lib/iomgr/sockaddr.h" #include "src/core/lib/iomgr/sockaddr.h"
#ifdef GPR_HAVE_UNIX_SOCKET #ifdef GPR_HAVE_UNIX_SOCKET
@ -53,4 +53,4 @@ int parse_ipv4(grpc_uri *uri, struct sockaddr_storage *addr, size_t *len);
* host:port pair. Returns true upon success. */ * host:port pair. Returns true upon success. */
int parse_ipv6(grpc_uri *uri, struct sockaddr_storage *addr, size_t *len); int parse_ipv6(grpc_uri *uri, struct sockaddr_storage *addr, size_t *len);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_PARSE_ADDRESS_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_PARSE_ADDRESS_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/resolver.h" #include "src/core/ext/client_channel/resolver.h"
void grpc_resolver_init(grpc_resolver *resolver, void grpc_resolver_init(grpc_resolver *resolver,
const grpc_resolver_vtable *vtable) { const grpc_resolver_vtable *vtable) {

@ -31,11 +31,11 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_H
#include "src/core/ext/client_config/resolver_result.h" #include "src/core/ext/client_channel/resolver_result.h"
#include "src/core/ext/client_config/subchannel.h" #include "src/core/ext/client_channel/subchannel.h"
#include "src/core/lib/iomgr/iomgr.h" #include "src/core/lib/iomgr/iomgr.h"
typedef struct grpc_resolver grpc_resolver; typedef struct grpc_resolver grpc_resolver;
@ -91,4 +91,4 @@ void grpc_resolver_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
grpc_resolver_result **result, grpc_resolver_result **result,
grpc_closure *on_complete); grpc_closure *on_complete);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/resolver_factory.h" #include "src/core/ext/client_channel/resolver_factory.h"
void grpc_resolver_factory_ref(grpc_resolver_factory* factory) { void grpc_resolver_factory_ref(grpc_resolver_factory* factory) {
factory->vtable->ref(factory); factory->vtable->ref(factory);

@ -31,12 +31,12 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_FACTORY_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_FACTORY_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_FACTORY_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_FACTORY_H
#include "src/core/ext/client_config/client_channel_factory.h" #include "src/core/ext/client_channel/client_channel_factory.h"
#include "src/core/ext/client_config/resolver.h" #include "src/core/ext/client_channel/resolver.h"
#include "src/core/ext/client_config/uri_parser.h" #include "src/core/ext/client_channel/uri_parser.h"
typedef struct grpc_resolver_factory grpc_resolver_factory; typedef struct grpc_resolver_factory grpc_resolver_factory;
typedef struct grpc_resolver_factory_vtable grpc_resolver_factory_vtable; typedef struct grpc_resolver_factory_vtable grpc_resolver_factory_vtable;
@ -76,4 +76,4 @@ grpc_resolver *grpc_resolver_factory_create_resolver(
char *grpc_resolver_factory_get_default_authority( char *grpc_resolver_factory_get_default_authority(
grpc_resolver_factory *factory, grpc_uri *uri); grpc_resolver_factory *factory, grpc_uri *uri);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_FACTORY_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_FACTORY_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/client_channel/resolver_registry.h"
#include <string.h> #include <string.h>
@ -55,7 +55,7 @@ void grpc_resolver_registry_shutdown(void) {
grpc_resolver_factory_unref(g_all_of_the_resolvers[i]); grpc_resolver_factory_unref(g_all_of_the_resolvers[i]);
} }
// FIXME(ctiller): this should live in grpc_resolver_registry_init, // FIXME(ctiller): this should live in grpc_resolver_registry_init,
// however that would have the client_config plugin call this AFTER we start // however that would have the client_channel plugin call this AFTER we start
// registering resolvers from third party plugins, and so they'd never show // registering resolvers from third party plugins, and so they'd never show
// up. // up.
// We likely need some kind of dependency system for plugins.... what form // We likely need some kind of dependency system for plugins.... what form

@ -31,10 +31,10 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_REGISTRY_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_REGISTRY_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_REGISTRY_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_REGISTRY_H
#include "src/core/ext/client_config/resolver_factory.h" #include "src/core/ext/client_channel/resolver_factory.h"
void grpc_resolver_registry_init(); void grpc_resolver_registry_init();
void grpc_resolver_registry_shutdown(void); void grpc_resolver_registry_shutdown(void);
@ -68,4 +68,4 @@ grpc_resolver_factory *grpc_resolver_factory_lookup(const char *name);
representing the default authority to pass from a client. */ representing the default authority to pass from a client. */
char *grpc_get_default_authority(const char *target); char *grpc_get_default_authority(const char *target);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_REGISTRY_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */

@ -29,7 +29,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
#include "src/core/ext/client_config/resolver_result.h" #include "src/core/ext/client_channel/resolver_result.h"
#include <string.h> #include <string.h>

@ -29,11 +29,10 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// //
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_RESULT_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_RESULT_H
#include "src/core/ext/client_config/lb_policy_factory.h" #include "src/core/ext/client_channel/lb_policy_factory.h"
#include "src/core/lib/iomgr/resolve_address.h"
// TODO(roth, ctiller): In the long term, we are considering replacing // TODO(roth, ctiller): In the long term, we are considering replacing
// the resolver_result data structure with grpc_channel_args. The idea is // the resolver_result data structure with grpc_channel_args. The idea is
@ -66,4 +65,4 @@ const char* grpc_resolver_result_get_lb_policy_name(
grpc_channel_args* grpc_resolver_result_get_lb_policy_args( grpc_channel_args* grpc_resolver_result_get_lb_policy_args(
grpc_resolver_result* result); grpc_resolver_result* result);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_RESULT_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/subchannel.h" #include "src/core/ext/client_channel/subchannel.h"
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
@ -39,9 +39,9 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/avl.h> #include <grpc/support/avl.h>
#include "src/core/ext/client_config/client_channel.h" #include "src/core/ext/client_channel/client_channel.h"
#include "src/core/ext/client_config/initial_connect_string.h" #include "src/core/ext/client_channel/initial_connect_string.h"
#include "src/core/ext/client_config/subchannel_index.h" #include "src/core/ext/client_channel/subchannel_index.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer.h"

@ -31,10 +31,10 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_H
#include "src/core/ext/client_config/connector.h" #include "src/core/ext/client_channel/connector.h"
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/iomgr/polling_entity.h" #include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/connectivity_state.h"
@ -176,4 +176,4 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
grpc_connector *connector, grpc_connector *connector,
grpc_subchannel_args *args); grpc_subchannel_args *args);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_H */

@ -31,7 +31,7 @@
// //
// //
#include "src/core/ext/client_config/subchannel_index.h" #include "src/core/ext/client_channel/subchannel_index.h"
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>

@ -31,11 +31,11 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_INDEX_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_INDEX_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H
#include "src/core/ext/client_config/connector.h" #include "src/core/ext/client_channel/connector.h"
#include "src/core/ext/client_config/subchannel.h" #include "src/core/ext/client_channel/subchannel.h"
/** \file Provides an index of active subchannels so that they can be /** \file Provides an index of active subchannels so that they can be
shared amongst channels */ shared amongst channels */
@ -74,4 +74,4 @@ void grpc_subchannel_index_init(void);
/** Shutdown the subchannel index (global) */ /** Shutdown the subchannel index (global) */
void grpc_subchannel_index_shutdown(void); void grpc_subchannel_index_shutdown(void);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_SUBCHANNEL_INDEX_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */

@ -31,7 +31,7 @@
* *
*/ */
#include "src/core/ext/client_config/uri_parser.h" #include "src/core/ext/client_channel/uri_parser.h"
#include <string.h> #include <string.h>

@ -31,8 +31,8 @@
* *
*/ */
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_URI_PARSER_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_URI_PARSER_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_URI_PARSER_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_URI_PARSER_H
#include <stddef.h> #include <stddef.h>
@ -60,4 +60,4 @@ const char *grpc_uri_get_query_arg(const grpc_uri *uri, const char *key);
/** destroy a uri */ /** destroy a uri */
void grpc_uri_destroy(grpc_uri *uri); void grpc_uri_destroy(grpc_uri *uri);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_URI_PARSER_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_URI_PARSER_H */

@ -107,10 +107,10 @@
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include "src/core/ext/client_config/client_channel_factory.h" #include "src/core/ext/client_channel/client_channel_factory.h"
#include "src/core/ext/client_config/lb_policy_factory.h" #include "src/core/ext/client_channel/lb_policy_factory.h"
#include "src/core/ext/client_config/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/ext/client_config/parse_address.h" #include "src/core/ext/client_channel/parse_address.h"
#include "src/core/ext/lb_policy/grpclb/grpclb.h" #include "src/core/ext/lb_policy/grpclb/grpclb.h"
#include "src/core/ext/lb_policy/grpclb/load_balancer_api.h" #include "src/core/ext/lb_policy/grpclb/load_balancer_api.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"

@ -34,7 +34,7 @@
#ifndef GRPC_CORE_EXT_LB_POLICY_GRPCLB_GRPCLB_H #ifndef GRPC_CORE_EXT_LB_POLICY_GRPCLB_GRPCLB_H
#define GRPC_CORE_EXT_LB_POLICY_GRPCLB_GRPCLB_H #define GRPC_CORE_EXT_LB_POLICY_GRPCLB_GRPCLB_H
#include "src/core/ext/client_config/lb_policy_factory.h" #include "src/core/ext/client_channel/lb_policy_factory.h"
/** Returns a load balancing factory for the glb policy, which tries to connect /** Returns a load balancing factory for the glb policy, which tries to connect
* to a load balancing server to decide the next successfully connected * to a load balancing server to decide the next successfully connected

@ -36,7 +36,7 @@
#include <grpc/support/slice_buffer.h> #include <grpc/support/slice_buffer.h>
#include "src/core/ext/client_config/lb_policy_factory.h" #include "src/core/ext/client_channel/lb_policy_factory.h"
#include "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h" #include "src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h"
#ifdef __cplusplus #ifdef __cplusplus

@ -34,7 +34,7 @@
#include <string.h> #include <string.h>
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include "src/core/ext/client_config/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/connectivity_state.h"
typedef struct pending_pick { typedef struct pending_pick {

@ -63,7 +63,7 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include "src/core/ext/client_config/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/static_metadata.h" #include "src/core/lib/transport/static_metadata.h"

@ -51,7 +51,7 @@
* The value corresponding to this key is an opaque binary blob reported by the * The value corresponding to this key is an opaque binary blob reported by the
* backend as part of its trailing metadata containing cost information for the * backend as part of its trailing metadata containing cost information for the
* call. */ * call. */
#define GRPC_LB_COST_MD_KEY "lb-cost" #define GRPC_LB_COST_MD_KEY "lb-cost-bin"
/** Identifiers for the invocation point of the users LR callback */ /** Identifiers for the invocation point of the users LR callback */
typedef enum grpc_load_reporting_source { typedef enum grpc_load_reporting_source {

@ -193,7 +193,7 @@ static grpc_mdelem *lr_trailing_md_filter(void *user_data, grpc_mdelem *md) {
grpc_call_element *elem = user_data; grpc_call_element *elem = user_data;
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
if (md->key == GRPC_MDSTR_LB_COST) { if (md->key == GRPC_MDSTR_LB_COST_BIN) {
calld->trailing_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value)); calld->trailing_md_string = gpr_strdup(grpc_mdstr_as_c_string(md->value));
return NULL; return NULL;
} }

@ -37,9 +37,9 @@
#include <grpc/support/host_port.h> #include <grpc/support/host_port.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/ext/client_config/http_connect_handshaker.h" #include "src/core/ext/client_channel/http_connect_handshaker.h"
#include "src/core/ext/client_config/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/client_channel/resolver_registry.h"
#include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/support/backoff.h" #include "src/core/lib/support/backoff.h"

@ -41,9 +41,8 @@
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/ext/client_config/parse_address.h" #include "src/core/ext/client_channel/parse_address.h"
#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/client_channel/resolver_registry.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h" #include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/support/string.h" #include "src/core/lib/support/string.h"

@ -40,9 +40,9 @@
#include <grpc/support/slice.h> #include <grpc/support/slice.h>
#include <grpc/support/slice_buffer.h> #include <grpc/support/slice_buffer.h>
#include "src/core/ext/client_config/client_channel.h" #include "src/core/ext/client_channel/client_channel.h"
#include "src/core/ext/client_config/http_connect_handshaker.h" #include "src/core/ext/client_channel/http_connect_handshaker.h"
#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/client_channel/resolver_registry.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/compress_filter.h" #include "src/core/lib/channel/compress_filter.h"

@ -40,9 +40,9 @@
#include <grpc/support/slice.h> #include <grpc/support/slice.h>
#include <grpc/support/slice_buffer.h> #include <grpc/support/slice_buffer.h>
#include "src/core/ext/client_config/client_channel.h" #include "src/core/ext/client_channel/client_channel.h"
#include "src/core/ext/client_config/http_connect_handshaker.h" #include "src/core/ext/client_channel/http_connect_handshaker.h"
#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/client_channel/resolver_registry.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/handshaker.h" #include "src/core/lib/channel/handshaker.h"
@ -291,8 +291,6 @@ static grpc_channel *client_channel_factory_create_channel(
channel = NULL; channel = NULL;
} }
GRPC_SECURITY_CONNECTOR_UNREF(&f->security_connector->base,
"client_channel_factory_create_channel");
return channel; return channel;
} }
@ -361,6 +359,9 @@ grpc_channel *grpc_secure_channel_create(grpc_channel_credentials *creds,
grpc_channel *channel = client_channel_factory_create_channel( grpc_channel *channel = client_channel_factory_create_channel(
&exec_ctx, &f->base, target, GRPC_CLIENT_CHANNEL_TYPE_REGULAR, NULL); &exec_ctx, &f->base, target, GRPC_CLIENT_CHANNEL_TYPE_REGULAR, NULL);
GRPC_SECURITY_CONNECTOR_UNREF(&f->security_connector->base,
"client_channel_factory_create_channel");
grpc_client_channel_factory_unref(&exec_ctx, &f->base); grpc_client_channel_factory_unref(&exec_ctx, &f->base);
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);

@ -42,6 +42,8 @@
#define EXPECTED_CONTENT_TYPE "application/grpc" #define EXPECTED_CONTENT_TYPE "application/grpc"
#define EXPECTED_CONTENT_TYPE_LENGTH sizeof(EXPECTED_CONTENT_TYPE) - 1 #define EXPECTED_CONTENT_TYPE_LENGTH sizeof(EXPECTED_CONTENT_TYPE) - 1
extern int grpc_http_trace;
typedef struct call_data { typedef struct call_data {
uint8_t seen_path; uint8_t seen_path;
uint8_t seen_method; uint8_t seen_method;
@ -209,6 +211,11 @@ static void hs_on_recv(grpc_exec_ctx *exec_ctx, void *user_data,
err, GRPC_ERROR_CREATE("Missing te: trailers header")); err, GRPC_ERROR_CREATE("Missing te: trailers header"));
} }
/* Error this call out */ /* Error this call out */
if (grpc_http_trace) {
const char *error_str = grpc_error_string(err);
gpr_log(GPR_ERROR, "Invalid http2 headers: %s", error_str);
grpc_error_free_string(error_str);
}
grpc_call_element_send_cancel(exec_ctx, elem); grpc_call_element_send_cancel(exec_ctx, elem);
} }
} else { } else {

@ -38,13 +38,51 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/ext/client_config/method_config.h" #include "src/core/ext/client_channel/method_config.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#define DEFAULT_MAX_SEND_MESSAGE_LENGTH -1 // Unlimited. #define DEFAULT_MAX_SEND_MESSAGE_LENGTH -1 // Unlimited.
// The protobuf library will (by default) start warning at 100 megs. // The protobuf library will (by default) start warning at 100 megs.
#define DEFAULT_MAX_RECV_MESSAGE_LENGTH (4 * 1024 * 1024) #define DEFAULT_MAX_RECV_MESSAGE_LENGTH (4 * 1024 * 1024)
typedef struct message_size_limits {
int max_send_size;
int max_recv_size;
} message_size_limits;
static void* message_size_limits_copy(void* value) {
void* new_value = gpr_malloc(sizeof(message_size_limits));
memcpy(new_value, value, sizeof(message_size_limits));
return new_value;
}
static int message_size_limits_cmp(void* value1, void* value2) {
const message_size_limits* v1 = value1;
const message_size_limits* v2 = value2;
if (v1->max_send_size > v2->max_send_size) return 1;
if (v1->max_send_size < v2->max_send_size) return -1;
if (v1->max_recv_size > v2->max_recv_size) return 1;
if (v1->max_recv_size < v2->max_recv_size) return -1;
return 0;
}
static const grpc_mdstr_hash_table_vtable message_size_limits_vtable = {
gpr_free, message_size_limits_copy, message_size_limits_cmp};
static void* method_config_convert_value(
const grpc_method_config* method_config) {
message_size_limits* value = gpr_malloc(sizeof(message_size_limits));
const int32_t* max_request_message_bytes =
grpc_method_config_get_max_request_message_bytes(method_config);
value->max_send_size =
max_request_message_bytes != NULL ? *max_request_message_bytes : -1;
const int32_t* max_response_message_bytes =
grpc_method_config_get_max_response_message_bytes(method_config);
value->max_recv_size =
max_response_message_bytes != NULL ? *max_response_message_bytes : -1;
return value;
}
typedef struct call_data { typedef struct call_data {
int max_send_size; int max_send_size;
int max_recv_size; int max_recv_size;
@ -61,8 +99,8 @@ typedef struct call_data {
typedef struct channel_data { typedef struct channel_data {
int max_send_size; int max_send_size;
int max_recv_size; int max_recv_size;
// Method config table. // Maps path names to message_size_limits structs.
grpc_method_config_table* method_config_table; grpc_mdstr_hash_table* method_limit_table;
} channel_data; } channel_data;
// Callback invoked when we receive a message. Here we check the max // Callback invoked when we receive a message. Here we check the max
@ -132,24 +170,19 @@ static grpc_error* init_call_elem(grpc_exec_ctx* exec_ctx,
// size to the receive limit. // size to the receive limit.
calld->max_send_size = chand->max_send_size; calld->max_send_size = chand->max_send_size;
calld->max_recv_size = chand->max_recv_size; calld->max_recv_size = chand->max_recv_size;
if (chand->method_config_table != NULL) { if (chand->method_limit_table != NULL) {
grpc_method_config* method_config = message_size_limits* limits =
grpc_method_config_table_get_method_config(chand->method_config_table, grpc_method_config_table_get(chand->method_limit_table, args->path);
args->path); if (limits != NULL) {
if (method_config != NULL) { if (limits->max_send_size >= 0 &&
const int32_t* max_request_message_bytes = (limits->max_send_size < calld->max_send_size ||
grpc_method_config_get_max_request_message_bytes(method_config);
if (max_request_message_bytes != NULL &&
(*max_request_message_bytes < calld->max_send_size ||
calld->max_send_size < 0)) { calld->max_send_size < 0)) {
calld->max_send_size = *max_request_message_bytes; calld->max_send_size = limits->max_send_size;
} }
const int32_t* max_response_message_bytes = if (limits->max_recv_size >= 0 &&
grpc_method_config_get_max_response_message_bytes(method_config); (limits->max_recv_size < calld->max_recv_size ||
if (max_response_message_bytes != NULL &&
(*max_response_message_bytes < calld->max_recv_size ||
calld->max_recv_size < 0)) { calld->max_recv_size < 0)) {
calld->max_recv_size = *max_response_message_bytes; calld->max_recv_size = limits->max_recv_size;
} }
} }
} }
@ -191,8 +224,9 @@ static void init_channel_elem(grpc_exec_ctx* exec_ctx,
grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVICE_CONFIG); grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVICE_CONFIG);
if (channel_arg != NULL) { if (channel_arg != NULL) {
GPR_ASSERT(channel_arg->type == GRPC_ARG_POINTER); GPR_ASSERT(channel_arg->type == GRPC_ARG_POINTER);
chand->method_config_table = grpc_method_config_table_ref( chand->method_limit_table = grpc_method_config_table_convert(
(grpc_method_config_table*)channel_arg->value.pointer.p); (grpc_method_config_table*)channel_arg->value.pointer.p,
method_config_convert_value, &message_size_limits_vtable);
} }
} }
@ -200,7 +234,7 @@ static void init_channel_elem(grpc_exec_ctx* exec_ctx,
static void destroy_channel_elem(grpc_exec_ctx* exec_ctx, static void destroy_channel_elem(grpc_exec_ctx* exec_ctx,
grpc_channel_element* elem) { grpc_channel_element* elem) {
channel_data* chand = elem->channel_data; channel_data* chand = elem->channel_data;
grpc_method_config_table_unref(chand->method_config_table); grpc_mdstr_hash_table_unref(chand->method_limit_table);
} }
const grpc_channel_filter grpc_message_size_filter = { const grpc_channel_filter grpc_message_size_filter = {

@ -42,6 +42,7 @@
struct grpc_mdstr_hash_table { struct grpc_mdstr_hash_table {
gpr_refcount refs; gpr_refcount refs;
size_t num_entries; size_t num_entries;
size_t size;
grpc_mdstr_hash_table_entry* entries; grpc_mdstr_hash_table_entry* entries;
}; };
@ -50,13 +51,12 @@ struct grpc_mdstr_hash_table {
static size_t grpc_mdstr_hash_table_find_index( static size_t grpc_mdstr_hash_table_find_index(
const grpc_mdstr_hash_table* table, const grpc_mdstr* key, const grpc_mdstr_hash_table* table, const grpc_mdstr* key,
bool find_empty) { bool find_empty) {
for (size_t i = 0; i < table->num_entries; ++i) { for (size_t i = 0; i < table->size; ++i) {
const size_t idx = (key->hash + i * i) % table->num_entries; const size_t idx = (key->hash + i * i) % table->size;
if (table->entries[idx].key == NULL) if (table->entries[idx].key == NULL) return find_empty ? idx : table->size;
return find_empty ? idx : table->num_entries;
if (table->entries[idx].key == key) return idx; if (table->entries[idx].key == key) return idx;
} }
return table->num_entries; // Not found. return table->size; // Not found.
} }
static void grpc_mdstr_hash_table_add( static void grpc_mdstr_hash_table_add(
@ -65,7 +65,7 @@ static void grpc_mdstr_hash_table_add(
GPR_ASSERT(value != NULL); GPR_ASSERT(value != NULL);
const size_t idx = const size_t idx =
grpc_mdstr_hash_table_find_index(table, key, true /* find_empty */); grpc_mdstr_hash_table_find_index(table, key, true /* find_empty */);
GPR_ASSERT(idx != table->num_entries); // Table should never be full. GPR_ASSERT(idx != table->size); // Table should never be full.
grpc_mdstr_hash_table_entry* entry = &table->entries[idx]; grpc_mdstr_hash_table_entry* entry = &table->entries[idx];
entry->key = GRPC_MDSTR_REF(key); entry->key = GRPC_MDSTR_REF(key);
entry->value = vtable->copy_value(value); entry->value = vtable->copy_value(value);
@ -77,11 +77,11 @@ grpc_mdstr_hash_table* grpc_mdstr_hash_table_create(
grpc_mdstr_hash_table* table = gpr_malloc(sizeof(*table)); grpc_mdstr_hash_table* table = gpr_malloc(sizeof(*table));
memset(table, 0, sizeof(*table)); memset(table, 0, sizeof(*table));
gpr_ref_init(&table->refs, 1); gpr_ref_init(&table->refs, 1);
table->num_entries = num_entries;
// Quadratic probing gets best performance when the table is no more // Quadratic probing gets best performance when the table is no more
// than half full. // than half full.
table->num_entries = num_entries * 2; table->size = num_entries * 2;
const size_t entry_size = const size_t entry_size = sizeof(grpc_mdstr_hash_table_entry) * table->size;
sizeof(grpc_mdstr_hash_table_entry) * table->num_entries;
table->entries = gpr_malloc(entry_size); table->entries = gpr_malloc(entry_size);
memset(table->entries, 0, entry_size); memset(table->entries, 0, entry_size);
for (size_t i = 0; i < num_entries; ++i) { for (size_t i = 0; i < num_entries; ++i) {
@ -98,7 +98,7 @@ grpc_mdstr_hash_table* grpc_mdstr_hash_table_ref(grpc_mdstr_hash_table* table) {
int grpc_mdstr_hash_table_unref(grpc_mdstr_hash_table* table) { int grpc_mdstr_hash_table_unref(grpc_mdstr_hash_table* table) {
if (table != NULL && gpr_unref(&table->refs)) { if (table != NULL && gpr_unref(&table->refs)) {
for (size_t i = 0; i < table->num_entries; ++i) { for (size_t i = 0; i < table->size; ++i) {
grpc_mdstr_hash_table_entry* entry = &table->entries[i]; grpc_mdstr_hash_table_entry* entry = &table->entries[i];
if (entry->key != NULL) { if (entry->key != NULL) {
GRPC_MDSTR_UNREF(entry->key); GRPC_MDSTR_UNREF(entry->key);
@ -112,11 +112,15 @@ int grpc_mdstr_hash_table_unref(grpc_mdstr_hash_table* table) {
return 0; return 0;
} }
size_t grpc_mdstr_hash_table_num_entries(const grpc_mdstr_hash_table* table) {
return table->num_entries;
}
void* grpc_mdstr_hash_table_get(const grpc_mdstr_hash_table* table, void* grpc_mdstr_hash_table_get(const grpc_mdstr_hash_table* table,
const grpc_mdstr* key) { const grpc_mdstr* key) {
const size_t idx = const size_t idx =
grpc_mdstr_hash_table_find_index(table, key, false /* find_empty */); grpc_mdstr_hash_table_find_index(table, key, false /* find_empty */);
if (idx == table->num_entries) return NULL; // Not found. if (idx == table->size) return NULL; // Not found.
return table->entries[idx].value; return table->entries[idx].value;
} }
@ -140,3 +144,14 @@ int grpc_mdstr_hash_table_cmp(const grpc_mdstr_hash_table* table1,
} }
return 0; return 0;
} }
void grpc_mdstr_hash_table_iterate(
const grpc_mdstr_hash_table* table,
void (*func)(const grpc_mdstr_hash_table_entry* entry, void* user_data),
void* user_data) {
for (size_t i = 0; i < table->size; ++i) {
if (table->entries[i].key != NULL) {
func(&table->entries[i], user_data);
}
}
}

@ -70,6 +70,9 @@ grpc_mdstr_hash_table* grpc_mdstr_hash_table_ref(grpc_mdstr_hash_table* table);
/** Returns 1 when \a table is destroyed. */ /** Returns 1 when \a table is destroyed. */
int grpc_mdstr_hash_table_unref(grpc_mdstr_hash_table* table); int grpc_mdstr_hash_table_unref(grpc_mdstr_hash_table* table);
/** Returns the number of entries in \a table. */
size_t grpc_mdstr_hash_table_num_entries(const grpc_mdstr_hash_table* table);
/** Returns the value from \a table associated with \a key. /** Returns the value from \a table associated with \a key.
Returns NULL if \a key is not found. */ Returns NULL if \a key is not found. */
void* grpc_mdstr_hash_table_get(const grpc_mdstr_hash_table* table, void* grpc_mdstr_hash_table_get(const grpc_mdstr_hash_table* table,
@ -80,4 +83,10 @@ void* grpc_mdstr_hash_table_get(const grpc_mdstr_hash_table* table,
int grpc_mdstr_hash_table_cmp(const grpc_mdstr_hash_table* table1, int grpc_mdstr_hash_table_cmp(const grpc_mdstr_hash_table* table1,
const grpc_mdstr_hash_table* table2); const grpc_mdstr_hash_table* table2);
/** Iterates over the entries in \a table, calling \a func for each entry. */
void grpc_mdstr_hash_table_iterate(
const grpc_mdstr_hash_table* table,
void (*func)(const grpc_mdstr_hash_table_entry* entry, void* user_data),
void* user_data);
#endif /* GRPC_CORE_LIB_TRANSPORT_MDSTR_HASH_TABLE_H */ #endif /* GRPC_CORE_LIB_TRANSPORT_MDSTR_HASH_TABLE_H */

@ -126,7 +126,7 @@ const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = {
"if-range", "if-range",
"if-unmodified-since", "if-unmodified-since",
"last-modified", "last-modified",
"lb-cost", "lb-cost-bin",
"lb-token", "lb-token",
"link", "link",
"location", "location",

@ -175,8 +175,8 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT];
#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (&grpc_static_mdstr_table[62]) #define GRPC_MDSTR_IF_UNMODIFIED_SINCE (&grpc_static_mdstr_table[62])
/* "last-modified" */ /* "last-modified" */
#define GRPC_MDSTR_LAST_MODIFIED (&grpc_static_mdstr_table[63]) #define GRPC_MDSTR_LAST_MODIFIED (&grpc_static_mdstr_table[63])
/* "lb-cost" */ /* "lb-cost-bin" */
#define GRPC_MDSTR_LB_COST (&grpc_static_mdstr_table[64]) #define GRPC_MDSTR_LB_COST_BIN (&grpc_static_mdstr_table[64])
/* "lb-token" */ /* "lb-token" */
#define GRPC_MDSTR_LB_TOKEN (&grpc_static_mdstr_table[65]) #define GRPC_MDSTR_LB_TOKEN (&grpc_static_mdstr_table[65])
/* "link" */ /* "link" */
@ -337,8 +337,8 @@ extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];
#define GRPC_MDELEM_IF_UNMODIFIED_SINCE_EMPTY (&grpc_static_mdelem_table[44]) #define GRPC_MDELEM_IF_UNMODIFIED_SINCE_EMPTY (&grpc_static_mdelem_table[44])
/* "last-modified": "" */ /* "last-modified": "" */
#define GRPC_MDELEM_LAST_MODIFIED_EMPTY (&grpc_static_mdelem_table[45]) #define GRPC_MDELEM_LAST_MODIFIED_EMPTY (&grpc_static_mdelem_table[45])
/* "lb-cost": "" */ /* "lb-cost-bin": "" */
#define GRPC_MDELEM_LB_COST_EMPTY (&grpc_static_mdelem_table[46]) #define GRPC_MDELEM_LB_COST_BIN_EMPTY (&grpc_static_mdelem_table[46])
/* "lb-token": "" */ /* "lb-token": "" */
#define GRPC_MDELEM_LB_TOKEN_EMPTY (&grpc_static_mdelem_table[47]) #define GRPC_MDELEM_LB_TOKEN_EMPTY (&grpc_static_mdelem_table[47])
/* "link": "" */ /* "link": "" */

@ -35,12 +35,12 @@
extern void grpc_chttp2_plugin_init(void); extern void grpc_chttp2_plugin_init(void);
extern void grpc_chttp2_plugin_shutdown(void); extern void grpc_chttp2_plugin_shutdown(void);
extern void grpc_client_config_init(void); extern void grpc_client_channel_init(void);
extern void grpc_client_config_shutdown(void); extern void grpc_client_channel_shutdown(void);
void grpc_register_built_in_plugins(void) { void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_chttp2_plugin_init, grpc_register_plugin(grpc_chttp2_plugin_init,
grpc_chttp2_plugin_shutdown); grpc_chttp2_plugin_shutdown);
grpc_register_plugin(grpc_client_config_init, grpc_register_plugin(grpc_client_channel_init,
grpc_client_config_shutdown); grpc_client_channel_shutdown);
} }

@ -35,8 +35,8 @@
extern void grpc_chttp2_plugin_init(void); extern void grpc_chttp2_plugin_init(void);
extern void grpc_chttp2_plugin_shutdown(void); extern void grpc_chttp2_plugin_shutdown(void);
extern void grpc_client_config_init(void); extern void grpc_client_channel_init(void);
extern void grpc_client_config_shutdown(void); extern void grpc_client_channel_shutdown(void);
extern void grpc_lb_policy_grpclb_init(void); extern void grpc_lb_policy_grpclb_init(void);
extern void grpc_lb_policy_grpclb_shutdown(void); extern void grpc_lb_policy_grpclb_shutdown(void);
extern void grpc_lb_policy_pick_first_init(void); extern void grpc_lb_policy_pick_first_init(void);
@ -55,8 +55,8 @@ extern void census_grpc_plugin_shutdown(void);
void grpc_register_built_in_plugins(void) { void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_chttp2_plugin_init, grpc_register_plugin(grpc_chttp2_plugin_init,
grpc_chttp2_plugin_shutdown); grpc_chttp2_plugin_shutdown);
grpc_register_plugin(grpc_client_config_init, grpc_register_plugin(grpc_client_channel_init,
grpc_client_config_shutdown); grpc_client_channel_shutdown);
grpc_register_plugin(grpc_lb_policy_grpclb_init, grpc_register_plugin(grpc_lb_policy_grpclb_init,
grpc_lb_policy_grpclb_shutdown); grpc_lb_policy_grpclb_shutdown);
grpc_register_plugin(grpc_lb_policy_pick_first_init, grpc_register_plugin(grpc_lb_policy_pick_first_init,

@ -35,8 +35,8 @@
extern void grpc_chttp2_plugin_init(void); extern void grpc_chttp2_plugin_init(void);
extern void grpc_chttp2_plugin_shutdown(void); extern void grpc_chttp2_plugin_shutdown(void);
extern void grpc_client_config_init(void); extern void grpc_client_channel_init(void);
extern void grpc_client_config_shutdown(void); extern void grpc_client_channel_shutdown(void);
extern void grpc_resolver_dns_native_init(void); extern void grpc_resolver_dns_native_init(void);
extern void grpc_resolver_dns_native_shutdown(void); extern void grpc_resolver_dns_native_shutdown(void);
extern void grpc_resolver_sockaddr_init(void); extern void grpc_resolver_sockaddr_init(void);
@ -55,8 +55,8 @@ extern void census_grpc_plugin_shutdown(void);
void grpc_register_built_in_plugins(void) { void grpc_register_built_in_plugins(void) {
grpc_register_plugin(grpc_chttp2_plugin_init, grpc_register_plugin(grpc_chttp2_plugin_init,
grpc_chttp2_plugin_shutdown); grpc_chttp2_plugin_shutdown);
grpc_register_plugin(grpc_client_config_init, grpc_register_plugin(grpc_client_channel_init,
grpc_client_config_shutdown); grpc_client_channel_shutdown);
grpc_register_plugin(grpc_resolver_dns_native_init, grpc_register_plugin(grpc_resolver_dns_native_init,
grpc_resolver_dns_native_shutdown); grpc_resolver_dns_native_shutdown);
grpc_register_plugin(grpc_resolver_sockaddr_init, grpc_register_plugin(grpc_resolver_sockaddr_init,

@ -33,6 +33,7 @@
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
using Google.Apis.Auth.OAuth2; using Google.Apis.Auth.OAuth2;
using Grpc.Core; using Grpc.Core;
@ -72,9 +73,10 @@ namespace Grpc.Auth
public static AsyncAuthInterceptor FromAccessToken(string accessToken) public static AsyncAuthInterceptor FromAccessToken(string accessToken)
{ {
GrpcPreconditions.CheckNotNull(accessToken); GrpcPreconditions.CheckNotNull(accessToken);
return new AsyncAuthInterceptor(async (context, metadata) => return new AsyncAuthInterceptor((context, metadata) =>
{ {
metadata.Add(CreateBearerTokenHeader(accessToken)); metadata.Add(CreateBearerTokenHeader(accessToken));
return Task.FromResult<object>(null);
}); });
} }

@ -102,6 +102,7 @@ namespace Grpc.Core
return Calls.AsyncDuplexStreamingCall(call); return Calls.AsyncDuplexStreamingCall(call);
} }
/// <summary>Creates call invocation details for given method.</summary>
protected virtual CallInvocationDetails<TRequest, TResponse> CreateCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options) protected virtual CallInvocationDetails<TRequest, TResponse> CreateCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options)
where TRequest : class where TRequest : class
where TResponse : class where TResponse : class

@ -138,6 +138,7 @@
<Compile Include="Internal\CallError.cs" /> <Compile Include="Internal\CallError.cs" />
<Compile Include="Logging\LogLevel.cs" /> <Compile Include="Logging\LogLevel.cs" />
<Compile Include="Logging\LogLevelFilterLogger.cs" /> <Compile Include="Logging\LogLevelFilterLogger.cs" />
<Compile Include="Internal\RequestCallContextSafeHandle.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Grpc.Core.nuspec" /> <None Include="Grpc.Core.nuspec" />

@ -59,7 +59,6 @@ namespace Grpc.Core
static ILogger logger = new NullLogger(); static ILogger logger = new NullLogger();
readonly object myLock = new object();
readonly GrpcThreadPool threadPool; readonly GrpcThreadPool threadPool;
readonly DebugStats debugStats = new DebugStats(); readonly DebugStats debugStats = new DebugStats();
readonly AtomicCounter cqPickerCounter = new AtomicCounter(); readonly AtomicCounter cqPickerCounter = new AtomicCounter();

@ -93,21 +93,6 @@ namespace Grpc.Core.Internal
return data; return data;
} }
// Gets data of server_rpc_new completion.
public ServerRpcNew GetServerRpcNew(Server server)
{
var call = Native.grpcsharp_batch_context_server_rpc_new_call(this);
var method = Marshal.PtrToStringAnsi(Native.grpcsharp_batch_context_server_rpc_new_method(this));
var host = Marshal.PtrToStringAnsi(Native.grpcsharp_batch_context_server_rpc_new_host(this));
var deadline = Native.grpcsharp_batch_context_server_rpc_new_deadline(this);
IntPtr metadataArrayPtr = Native.grpcsharp_batch_context_server_rpc_new_request_metadata(this);
var metadata = MetadataArraySafeHandle.ReadMetadataFromPtrUnsafe(metadataArrayPtr);
return new ServerRpcNew(server, call, method, host, deadline, metadata);
}
// Gets data of receive_close_on_server completion. // Gets data of receive_close_on_server completion.
public bool GetReceivedCloseOnServerCancelled() public bool GetReceivedCloseOnServerCancelled()
{ {

@ -44,6 +44,8 @@ namespace Grpc.Core.Internal
internal delegate void BatchCompletionDelegate(bool success, BatchContextSafeHandle ctx); internal delegate void BatchCompletionDelegate(bool success, BatchContextSafeHandle ctx);
internal delegate void RequestCallCompletionDelegate(bool success, RequestCallContextSafeHandle ctx);
internal class CompletionRegistry internal class CompletionRegistry
{ {
static readonly ILogger Logger = GrpcEnvironment.Logger.ForType<CompletionRegistry>(); static readonly ILogger Logger = GrpcEnvironment.Logger.ForType<CompletionRegistry>();
@ -68,6 +70,12 @@ namespace Grpc.Core.Internal
Register(ctx.Handle, opCallback); Register(ctx.Handle, opCallback);
} }
public void RegisterRequestCallCompletion(RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback)
{
OpCompletionDelegate opCallback = ((success) => HandleRequestCallCompletion(success, ctx, callback));
Register(ctx.Handle, opCallback);
}
public OpCompletionDelegate Extract(IntPtr key) public OpCompletionDelegate Extract(IntPtr key)
{ {
OpCompletionDelegate value; OpCompletionDelegate value;
@ -84,7 +92,26 @@ namespace Grpc.Core.Internal
} }
catch (Exception e) catch (Exception e)
{ {
Logger.Error(e, "Exception occured while invoking completion delegate."); Logger.Error(e, "Exception occured while invoking batch completion delegate.");
}
finally
{
if (ctx != null)
{
ctx.Dispose();
}
}
}
private static void HandleRequestCallCompletion(bool success, RequestCallContextSafeHandle ctx, RequestCallCompletionDelegate callback)
{
try
{
callback(success, ctx);
}
catch (Exception e)
{
Logger.Error(e, "Exception occured while invoking request call completion delegate.");
} }
finally finally
{ {

@ -48,7 +48,7 @@ namespace Grpc.Core.Internal
readonly Func<CallOptions, CallOptions> callOptionsInterceptor; readonly Func<CallOptions, CallOptions> callOptionsInterceptor;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="Grpc.Core.InterceptingCallInvoker"/> class. /// Initializes a new instance of the <see cref="Grpc.Core.Internal.InterceptingCallInvoker"/> class.
/// </summary> /// </summary>
public InterceptingCallInvoker(CallInvoker callInvoker, public InterceptingCallInvoker(CallInvoker callInvoker,
Func<string, string> hostInterceptor = null, Func<string, string> hostInterceptor = null,

@ -78,7 +78,10 @@ namespace Grpc.Core.Internal
{ {
var context = new AuthInterceptorContext(Marshal.PtrToStringAnsi(serviceUrlPtr), var context = new AuthInterceptorContext(Marshal.PtrToStringAnsi(serviceUrlPtr),
Marshal.PtrToStringAnsi(methodNamePtr)); Marshal.PtrToStringAnsi(methodNamePtr));
StartGetMetadata(context, callbackPtr, userDataPtr); // Don't await, we are in a native callback and need to return.
#pragma warning disable 4014
GetMetadataAsync(context, callbackPtr, userDataPtr);
#pragma warning restore 4014
} }
catch (Exception e) catch (Exception e)
{ {
@ -87,7 +90,7 @@ namespace Grpc.Core.Internal
} }
} }
private async Task StartGetMetadata(AuthInterceptorContext context, IntPtr callbackPtr, IntPtr userDataPtr) private async Task GetMetadataAsync(AuthInterceptorContext context, IntPtr callbackPtr, IntPtr userDataPtr)
{ {
try try
{ {

@ -64,14 +64,17 @@ namespace Grpc.Core.Internal
public readonly Delegates.grpcsharp_batch_context_recv_status_on_client_status_delegate grpcsharp_batch_context_recv_status_on_client_status; public readonly Delegates.grpcsharp_batch_context_recv_status_on_client_status_delegate grpcsharp_batch_context_recv_status_on_client_status;
public readonly Delegates.grpcsharp_batch_context_recv_status_on_client_details_delegate grpcsharp_batch_context_recv_status_on_client_details; public readonly Delegates.grpcsharp_batch_context_recv_status_on_client_details_delegate grpcsharp_batch_context_recv_status_on_client_details;
public readonly Delegates.grpcsharp_batch_context_recv_status_on_client_trailing_metadata_delegate grpcsharp_batch_context_recv_status_on_client_trailing_metadata; public readonly Delegates.grpcsharp_batch_context_recv_status_on_client_trailing_metadata_delegate grpcsharp_batch_context_recv_status_on_client_trailing_metadata;
public readonly Delegates.grpcsharp_batch_context_server_rpc_new_call_delegate grpcsharp_batch_context_server_rpc_new_call;
public readonly Delegates.grpcsharp_batch_context_server_rpc_new_method_delegate grpcsharp_batch_context_server_rpc_new_method;
public readonly Delegates.grpcsharp_batch_context_server_rpc_new_host_delegate grpcsharp_batch_context_server_rpc_new_host;
public readonly Delegates.grpcsharp_batch_context_server_rpc_new_deadline_delegate grpcsharp_batch_context_server_rpc_new_deadline;
public readonly Delegates.grpcsharp_batch_context_server_rpc_new_request_metadata_delegate grpcsharp_batch_context_server_rpc_new_request_metadata;
public readonly Delegates.grpcsharp_batch_context_recv_close_on_server_cancelled_delegate grpcsharp_batch_context_recv_close_on_server_cancelled; public readonly Delegates.grpcsharp_batch_context_recv_close_on_server_cancelled_delegate grpcsharp_batch_context_recv_close_on_server_cancelled;
public readonly Delegates.grpcsharp_batch_context_destroy_delegate grpcsharp_batch_context_destroy; public readonly Delegates.grpcsharp_batch_context_destroy_delegate grpcsharp_batch_context_destroy;
public readonly Delegates.grpcsharp_request_call_context_create_delegate grpcsharp_request_call_context_create;
public readonly Delegates.grpcsharp_request_call_context_call_delegate grpcsharp_request_call_context_call;
public readonly Delegates.grpcsharp_request_call_context_method_delegate grpcsharp_request_call_context_method;
public readonly Delegates.grpcsharp_request_call_context_host_delegate grpcsharp_request_call_context_host;
public readonly Delegates.grpcsharp_request_call_context_deadline_delegate grpcsharp_request_call_context_deadline;
public readonly Delegates.grpcsharp_request_call_context_request_metadata_delegate grpcsharp_request_call_context_request_metadata;
public readonly Delegates.grpcsharp_request_call_context_destroy_delegate grpcsharp_request_call_context_destroy;
public readonly Delegates.grpcsharp_composite_call_credentials_create_delegate grpcsharp_composite_call_credentials_create; public readonly Delegates.grpcsharp_composite_call_credentials_create_delegate grpcsharp_composite_call_credentials_create;
public readonly Delegates.grpcsharp_call_credentials_release_delegate grpcsharp_call_credentials_release; public readonly Delegates.grpcsharp_call_credentials_release_delegate grpcsharp_call_credentials_release;
@ -170,14 +173,17 @@ namespace Grpc.Core.Internal
this.grpcsharp_batch_context_recv_status_on_client_status = GetMethodDelegate<Delegates.grpcsharp_batch_context_recv_status_on_client_status_delegate>(library); this.grpcsharp_batch_context_recv_status_on_client_status = GetMethodDelegate<Delegates.grpcsharp_batch_context_recv_status_on_client_status_delegate>(library);
this.grpcsharp_batch_context_recv_status_on_client_details = GetMethodDelegate<Delegates.grpcsharp_batch_context_recv_status_on_client_details_delegate>(library); this.grpcsharp_batch_context_recv_status_on_client_details = GetMethodDelegate<Delegates.grpcsharp_batch_context_recv_status_on_client_details_delegate>(library);
this.grpcsharp_batch_context_recv_status_on_client_trailing_metadata = GetMethodDelegate<Delegates.grpcsharp_batch_context_recv_status_on_client_trailing_metadata_delegate>(library); this.grpcsharp_batch_context_recv_status_on_client_trailing_metadata = GetMethodDelegate<Delegates.grpcsharp_batch_context_recv_status_on_client_trailing_metadata_delegate>(library);
this.grpcsharp_batch_context_server_rpc_new_call = GetMethodDelegate<Delegates.grpcsharp_batch_context_server_rpc_new_call_delegate>(library);
this.grpcsharp_batch_context_server_rpc_new_method = GetMethodDelegate<Delegates.grpcsharp_batch_context_server_rpc_new_method_delegate>(library);
this.grpcsharp_batch_context_server_rpc_new_host = GetMethodDelegate<Delegates.grpcsharp_batch_context_server_rpc_new_host_delegate>(library);
this.grpcsharp_batch_context_server_rpc_new_deadline = GetMethodDelegate<Delegates.grpcsharp_batch_context_server_rpc_new_deadline_delegate>(library);
this.grpcsharp_batch_context_server_rpc_new_request_metadata = GetMethodDelegate<Delegates.grpcsharp_batch_context_server_rpc_new_request_metadata_delegate>(library);
this.grpcsharp_batch_context_recv_close_on_server_cancelled = GetMethodDelegate<Delegates.grpcsharp_batch_context_recv_close_on_server_cancelled_delegate>(library); this.grpcsharp_batch_context_recv_close_on_server_cancelled = GetMethodDelegate<Delegates.grpcsharp_batch_context_recv_close_on_server_cancelled_delegate>(library);
this.grpcsharp_batch_context_destroy = GetMethodDelegate<Delegates.grpcsharp_batch_context_destroy_delegate>(library); this.grpcsharp_batch_context_destroy = GetMethodDelegate<Delegates.grpcsharp_batch_context_destroy_delegate>(library);
this.grpcsharp_request_call_context_create = GetMethodDelegate<Delegates.grpcsharp_request_call_context_create_delegate>(library);
this.grpcsharp_request_call_context_call = GetMethodDelegate<Delegates.grpcsharp_request_call_context_call_delegate>(library);
this.grpcsharp_request_call_context_method = GetMethodDelegate<Delegates.grpcsharp_request_call_context_method_delegate>(library);
this.grpcsharp_request_call_context_host = GetMethodDelegate<Delegates.grpcsharp_request_call_context_host_delegate>(library);
this.grpcsharp_request_call_context_deadline = GetMethodDelegate<Delegates.grpcsharp_request_call_context_deadline_delegate>(library);
this.grpcsharp_request_call_context_request_metadata = GetMethodDelegate<Delegates.grpcsharp_request_call_context_request_metadata_delegate>(library);
this.grpcsharp_request_call_context_destroy = GetMethodDelegate<Delegates.grpcsharp_request_call_context_destroy_delegate>(library);
this.grpcsharp_composite_call_credentials_create = GetMethodDelegate<Delegates.grpcsharp_composite_call_credentials_create_delegate>(library); this.grpcsharp_composite_call_credentials_create = GetMethodDelegate<Delegates.grpcsharp_composite_call_credentials_create_delegate>(library);
this.grpcsharp_call_credentials_release = GetMethodDelegate<Delegates.grpcsharp_call_credentials_release_delegate>(library); this.grpcsharp_call_credentials_release = GetMethodDelegate<Delegates.grpcsharp_call_credentials_release_delegate>(library);
@ -302,14 +308,17 @@ namespace Grpc.Core.Internal
public delegate StatusCode grpcsharp_batch_context_recv_status_on_client_status_delegate(BatchContextSafeHandle ctx); public delegate StatusCode grpcsharp_batch_context_recv_status_on_client_status_delegate(BatchContextSafeHandle ctx);
public delegate IntPtr grpcsharp_batch_context_recv_status_on_client_details_delegate(BatchContextSafeHandle ctx); // returns const char* public delegate IntPtr grpcsharp_batch_context_recv_status_on_client_details_delegate(BatchContextSafeHandle ctx); // returns const char*
public delegate IntPtr grpcsharp_batch_context_recv_status_on_client_trailing_metadata_delegate(BatchContextSafeHandle ctx); public delegate IntPtr grpcsharp_batch_context_recv_status_on_client_trailing_metadata_delegate(BatchContextSafeHandle ctx);
public delegate CallSafeHandle grpcsharp_batch_context_server_rpc_new_call_delegate(BatchContextSafeHandle ctx);
public delegate IntPtr grpcsharp_batch_context_server_rpc_new_method_delegate(BatchContextSafeHandle ctx); // returns const char*
public delegate IntPtr grpcsharp_batch_context_server_rpc_new_host_delegate(BatchContextSafeHandle ctx); // returns const char*
public delegate Timespec grpcsharp_batch_context_server_rpc_new_deadline_delegate(BatchContextSafeHandle ctx);
public delegate IntPtr grpcsharp_batch_context_server_rpc_new_request_metadata_delegate(BatchContextSafeHandle ctx);
public delegate int grpcsharp_batch_context_recv_close_on_server_cancelled_delegate(BatchContextSafeHandle ctx); public delegate int grpcsharp_batch_context_recv_close_on_server_cancelled_delegate(BatchContextSafeHandle ctx);
public delegate void grpcsharp_batch_context_destroy_delegate(IntPtr ctx); public delegate void grpcsharp_batch_context_destroy_delegate(IntPtr ctx);
public delegate RequestCallContextSafeHandle grpcsharp_request_call_context_create_delegate();
public delegate CallSafeHandle grpcsharp_request_call_context_call_delegate(RequestCallContextSafeHandle ctx);
public delegate IntPtr grpcsharp_request_call_context_method_delegate(RequestCallContextSafeHandle ctx); // returns const char*
public delegate IntPtr grpcsharp_request_call_context_host_delegate(RequestCallContextSafeHandle ctx); // returns const char*
public delegate Timespec grpcsharp_request_call_context_deadline_delegate(RequestCallContextSafeHandle ctx);
public delegate IntPtr grpcsharp_request_call_context_request_metadata_delegate(RequestCallContextSafeHandle ctx);
public delegate void grpcsharp_request_call_context_destroy_delegate(IntPtr ctx);
public delegate CallCredentialsSafeHandle grpcsharp_composite_call_credentials_create_delegate(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2); public delegate CallCredentialsSafeHandle grpcsharp_composite_call_credentials_create_delegate(CallCredentialsSafeHandle creds1, CallCredentialsSafeHandle creds2);
public delegate void grpcsharp_call_credentials_release_delegate(IntPtr credentials); public delegate void grpcsharp_call_credentials_release_delegate(IntPtr credentials);
@ -393,7 +402,7 @@ namespace Grpc.Core.Internal
public delegate int grpcsharp_server_add_insecure_http2_port_delegate(ServerSafeHandle server, string addr); public delegate int grpcsharp_server_add_insecure_http2_port_delegate(ServerSafeHandle server, string addr);
public delegate int grpcsharp_server_add_secure_http2_port_delegate(ServerSafeHandle server, string addr, ServerCredentialsSafeHandle creds); public delegate int grpcsharp_server_add_secure_http2_port_delegate(ServerSafeHandle server, string addr, ServerCredentialsSafeHandle creds);
public delegate void grpcsharp_server_start_delegate(ServerSafeHandle server); public delegate void grpcsharp_server_start_delegate(ServerSafeHandle server);
public delegate CallError grpcsharp_server_request_call_delegate(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx); public delegate CallError grpcsharp_server_request_call_delegate(ServerSafeHandle server, CompletionQueueSafeHandle cq, RequestCallContextSafeHandle ctx);
public delegate void grpcsharp_server_cancel_all_calls_delegate(ServerSafeHandle server); public delegate void grpcsharp_server_cancel_all_calls_delegate(ServerSafeHandle server);
public delegate void grpcsharp_server_shutdown_and_notify_callback_delegate(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx); public delegate void grpcsharp_server_shutdown_and_notify_callback_delegate(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
public delegate void grpcsharp_server_destroy_delegate(IntPtr server); public delegate void grpcsharp_server_destroy_delegate(IntPtr server);

@ -0,0 +1,85 @@
#region Copyright notice and license
// 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.
#endregion
using System;
using System.Runtime.InteropServices;
using Grpc.Core;
namespace Grpc.Core.Internal
{
/// <summary>
/// grpcsharp_request_call_context
/// </summary>
internal class RequestCallContextSafeHandle : SafeHandleZeroIsInvalid
{
static readonly NativeMethods Native = NativeMethods.Get();
private RequestCallContextSafeHandle()
{
}
public static RequestCallContextSafeHandle Create()
{
return Native.grpcsharp_request_call_context_create();
}
public IntPtr Handle
{
get
{
return handle;
}
}
// Gets data of server_rpc_new completion.
public ServerRpcNew GetServerRpcNew(Server server)
{
var call = Native.grpcsharp_request_call_context_call(this);
var method = Marshal.PtrToStringAnsi(Native.grpcsharp_request_call_context_method(this));
var host = Marshal.PtrToStringAnsi(Native.grpcsharp_request_call_context_host(this));
var deadline = Native.grpcsharp_request_call_context_deadline(this);
IntPtr metadataArrayPtr = Native.grpcsharp_request_call_context_request_metadata(this);
var metadata = MetadataArraySafeHandle.ReadMetadataFromPtrUnsafe(metadataArrayPtr);
return new ServerRpcNew(server, call, method, host, deadline, metadata);
}
protected override bool ReleaseHandle()
{
Native.grpcsharp_request_call_context_destroy(handle);
return true;
}
}
}

@ -85,12 +85,12 @@ namespace Grpc.Core.Internal
} }
} }
public void RequestCall(BatchCompletionDelegate callback, CompletionQueueSafeHandle completionQueue) public void RequestCall(RequestCallCompletionDelegate callback, CompletionQueueSafeHandle completionQueue)
{ {
using (completionQueue.NewScope()) using (completionQueue.NewScope())
{ {
var ctx = BatchContextSafeHandle.Create(); var ctx = RequestCallContextSafeHandle.Create();
completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, callback); completionQueue.CompletionRegistry.RegisterRequestCallCompletion(ctx, callback);
Native.grpcsharp_server_request_call(this, completionQueue, ctx).CheckOk(); Native.grpcsharp_server_request_call(this, completionQueue, ctx).CheckOk();
} }
} }

@ -134,7 +134,11 @@ namespace Grpc.Core.Internal
{ {
throw new MissingMethodException(string.Format("The native method \"{0}\" does not exist", methodName)); throw new MissingMethodException(string.Format("The native method \"{0}\" does not exist", methodName));
} }
return Marshal.GetDelegateForFunctionPointer(ptr, typeof(T)) as T; #if NETSTANDARD1_5
return Marshal.GetDelegateForFunctionPointer<T>(ptr); // non-generic version is obsolete
#else
return Marshal.GetDelegateForFunctionPointer(ptr, typeof(T)) as T; // generic version not available in .NET45
#endif
} }
/// <summary> /// <summary>

@ -95,11 +95,18 @@ namespace Grpc.Core
#region IList members #region IList members
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public int IndexOf(Metadata.Entry item) public int IndexOf(Metadata.Entry item)
{ {
return entries.IndexOf(item); return entries.IndexOf(item);
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public void Insert(int index, Metadata.Entry item) public void Insert(int index, Metadata.Entry item)
{ {
GrpcPreconditions.CheckNotNull(item); GrpcPreconditions.CheckNotNull(item);
@ -107,12 +114,18 @@ namespace Grpc.Core
entries.Insert(index, item); entries.Insert(index, item);
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public void RemoveAt(int index) public void RemoveAt(int index)
{ {
CheckWriteable(); CheckWriteable();
entries.RemoveAt(index); entries.RemoveAt(index);
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public Metadata.Entry this[int index] public Metadata.Entry this[int index]
{ {
get get
@ -128,6 +141,9 @@ namespace Grpc.Core
} }
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public void Add(Metadata.Entry item) public void Add(Metadata.Entry item)
{ {
GrpcPreconditions.CheckNotNull(item); GrpcPreconditions.CheckNotNull(item);
@ -135,48 +151,75 @@ namespace Grpc.Core
entries.Add(item); entries.Add(item);
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public void Add(string key, string value) public void Add(string key, string value)
{ {
Add(new Entry(key, value)); Add(new Entry(key, value));
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public void Add(string key, byte[] valueBytes) public void Add(string key, byte[] valueBytes)
{ {
Add(new Entry(key, valueBytes)); Add(new Entry(key, valueBytes));
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public void Clear() public void Clear()
{ {
CheckWriteable(); CheckWriteable();
entries.Clear(); entries.Clear();
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public bool Contains(Metadata.Entry item) public bool Contains(Metadata.Entry item)
{ {
return entries.Contains(item); return entries.Contains(item);
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public void CopyTo(Metadata.Entry[] array, int arrayIndex) public void CopyTo(Metadata.Entry[] array, int arrayIndex)
{ {
entries.CopyTo(array, arrayIndex); entries.CopyTo(array, arrayIndex);
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public int Count public int Count
{ {
get { return entries.Count; } get { return entries.Count; }
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public bool IsReadOnly public bool IsReadOnly
{ {
get { return readOnly; } get { return readOnly; }
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public bool Remove(Metadata.Entry item) public bool Remove(Metadata.Entry item)
{ {
CheckWriteable(); CheckWriteable();
return entries.Remove(item); return entries.Remove(item);
} }
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public IEnumerator<Metadata.Entry> GetEnumerator() public IEnumerator<Metadata.Entry> GetEnumerator()
{ {
return entries.GetEnumerator(); return entries.GetEnumerator();
@ -221,7 +264,7 @@ namespace Grpc.Core
public Entry(string key, byte[] valueBytes) public Entry(string key, byte[] valueBytes)
{ {
this.key = NormalizeKey(key); this.key = NormalizeKey(key);
GrpcPreconditions.CheckArgument(this.key.EndsWith(BinaryHeaderSuffix), GrpcPreconditions.CheckArgument(HasBinaryHeaderSuffix(this.key),
"Key for binary valued metadata entry needs to have suffix indicating binary value."); "Key for binary valued metadata entry needs to have suffix indicating binary value.");
this.value = null; this.value = null;
GrpcPreconditions.CheckNotNull(valueBytes, "valueBytes"); GrpcPreconditions.CheckNotNull(valueBytes, "valueBytes");
@ -237,7 +280,7 @@ namespace Grpc.Core
public Entry(string key, string value) public Entry(string key, string value)
{ {
this.key = NormalizeKey(key); this.key = NormalizeKey(key);
GrpcPreconditions.CheckArgument(!this.key.EndsWith(BinaryHeaderSuffix), GrpcPreconditions.CheckArgument(!HasBinaryHeaderSuffix(this.key),
"Key for ASCII valued metadata entry cannot have suffix indicating binary value."); "Key for ASCII valued metadata entry cannot have suffix indicating binary value.");
this.value = GrpcPreconditions.CheckNotNull(value, "value"); this.value = GrpcPreconditions.CheckNotNull(value, "value");
this.valueBytes = null; this.valueBytes = null;
@ -324,7 +367,7 @@ namespace Grpc.Core
/// </summary> /// </summary>
internal static Entry CreateUnsafe(string key, byte[] valueBytes) internal static Entry CreateUnsafe(string key, byte[] valueBytes)
{ {
if (key.EndsWith(BinaryHeaderSuffix)) if (HasBinaryHeaderSuffix(key))
{ {
return new Entry(key, null, valueBytes); return new Entry(key, null, valueBytes);
} }
@ -338,6 +381,27 @@ namespace Grpc.Core
"Metadata entry key not valid. Keys can only contain lowercase alphanumeric characters, underscores and hyphens."); "Metadata entry key not valid. Keys can only contain lowercase alphanumeric characters, underscores and hyphens.");
return normalized; return normalized;
} }
/// <summary>
/// Returns <c>true</c> if the key has "-bin" binary header suffix.
/// </summary>
private static bool HasBinaryHeaderSuffix(string key)
{
// We don't use just string.EndsWith because its implementation is extremely slow
// on CoreCLR and we've seen significant differences in gRPC benchmarks caused by it.
// See https://github.com/dotnet/coreclr/issues/5612
int len = key.Length;
if (len >= 4 &&
key[len - 4] == '-' &&
key[len - 3] == 'b' &&
key[len - 2] == 'i' &&
key[len - 1] == 'n')
{
return true;
}
return false;
}
} }
} }
} }

@ -47,7 +47,7 @@ namespace Grpc.Core
/// </summary> /// </summary>
public class Server public class Server
{ {
const int InitialAllowRpcTokenCountPerCq = 10; const int DefaultRequestCallTokensPerCq = 2000;
static readonly ILogger Logger = GrpcEnvironment.Logger.ForType<Server>(); static readonly ILogger Logger = GrpcEnvironment.Logger.ForType<Server>();
readonly AtomicCounter activeCallCounter = new AtomicCounter(); readonly AtomicCounter activeCallCounter = new AtomicCounter();
@ -66,7 +66,7 @@ namespace Grpc.Core
bool startRequested; bool startRequested;
volatile bool shutdownRequested; volatile bool shutdownRequested;
int requestCallTokensPerCq = DefaultRequestCallTokensPerCq;
/// <summary> /// <summary>
/// Creates a new server. /// Creates a new server.
@ -132,6 +132,27 @@ namespace Grpc.Core
} }
} }
/// <summary>
/// Experimental API. Might anytime change without prior notice.
/// Number or calls requested via grpc_server_request_call at any given time for each completion queue.
/// </summary>
public int RequestCallTokensPerCompletionQueue
{
get
{
return requestCallTokensPerCq;
}
set
{
lock (myLock)
{
GrpcPreconditions.CheckState(!startRequested);
GrpcPreconditions.CheckArgument(value > 0);
requestCallTokensPerCq = value;
}
}
}
/// <summary> /// <summary>
/// Starts the server. /// Starts the server.
/// </summary> /// </summary>
@ -145,9 +166,7 @@ namespace Grpc.Core
handle.Start(); handle.Start();
// Starting with more than one AllowOneRpc tokens can significantly increase for (int i = 0; i < requestCallTokensPerCq; i++)
// unary RPC throughput.
for (int i = 0; i < InitialAllowRpcTokenCountPerCq; i++)
{ {
foreach (var cq in environment.CompletionQueues) foreach (var cq in environment.CompletionQueues)
{ {
@ -310,7 +329,7 @@ namespace Grpc.Core
/// <summary> /// <summary>
/// Selects corresponding handler for given call and handles the call. /// Selects corresponding handler for given call and handles the call.
/// </summary> /// </summary>
private async Task HandleCallAsync(ServerRpcNew newRpc, CompletionQueueSafeHandle cq) private async Task HandleCallAsync(ServerRpcNew newRpc, CompletionQueueSafeHandle cq, Action continuation)
{ {
try try
{ {
@ -325,25 +344,40 @@ namespace Grpc.Core
{ {
Logger.Warning(e, "Exception while handling RPC."); Logger.Warning(e, "Exception while handling RPC.");
} }
finally
{
continuation();
}
} }
/// <summary> /// <summary>
/// Handles the native callback. /// Handles the native callback.
/// </summary> /// </summary>
private void HandleNewServerRpc(bool success, BatchContextSafeHandle ctx, CompletionQueueSafeHandle cq) private void HandleNewServerRpc(bool success, RequestCallContextSafeHandle ctx, CompletionQueueSafeHandle cq)
{ {
Task.Run(() => AllowOneRpc(cq)); bool nextRpcRequested = false;
if (success) if (success)
{ {
ServerRpcNew newRpc = ctx.GetServerRpcNew(this); var newRpc = ctx.GetServerRpcNew(this);
// after server shutdown, the callback returns with null call // after server shutdown, the callback returns with null call
if (!newRpc.Call.IsInvalid) if (!newRpc.Call.IsInvalid)
{ {
HandleCallAsync(newRpc, cq); // we don't need to await. nextRpcRequested = true;
// Start asynchronous handler for the call.
// Don't await, the continuations will run on gRPC thread pool once triggered
// by cq.Next().
#pragma warning disable 4014
HandleCallAsync(newRpc, cq, () => AllowOneRpc(cq));
#pragma warning restore 4014
} }
} }
if (!nextRpcRequested)
{
AllowOneRpc(cq);
}
} }
/// <summary> /// <summary>

@ -67,5 +67,10 @@
} }
} }
} }
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
} }
} }

@ -195,8 +195,11 @@ namespace Grpc.IntegrationTesting
case "status_code_and_message": case "status_code_and_message":
await RunStatusCodeAndMessageAsync(client); await RunStatusCodeAndMessageAsync(client);
break; break;
case "unimplemented_service":
RunUnimplementedService(new UnimplementedService.UnimplementedServiceClient(channel));
break;
case "unimplemented_method": case "unimplemented_method":
RunUnimplementedMethod(new UnimplementedService.UnimplementedServiceClient(channel)); RunUnimplementedMethod(client);
break; break;
case "client_compressed_unary": case "client_compressed_unary":
RunClientCompressedUnary(client); RunClientCompressedUnary(client);
@ -577,7 +580,16 @@ namespace Grpc.IntegrationTesting
Console.WriteLine("Passed!"); Console.WriteLine("Passed!");
} }
public static void RunUnimplementedMethod(UnimplementedService.UnimplementedServiceClient client) public static void RunUnimplementedService(UnimplementedService.UnimplementedServiceClient client)
{
Console.WriteLine("running unimplemented_service");
var e = Assert.Throws<RpcException>(() => client.UnimplementedCall(new Empty()));
Assert.AreEqual(StatusCode.Unimplemented, e.Status.StatusCode);
Console.WriteLine("Passed!");
}
public static void RunUnimplementedMethod(TestService.TestServiceClient client)
{ {
Console.WriteLine("running unimplemented_method"); Console.WriteLine("running unimplemented_method");
var e = Assert.Throws<RpcException>(() => client.UnimplementedCall(new Empty())); var e = Assert.Throws<RpcException>(() => client.UnimplementedCall(new Empty()));

@ -145,10 +145,16 @@ namespace Grpc.IntegrationTesting
await InteropClient.RunStatusCodeAndMessageAsync(client); await InteropClient.RunStatusCodeAndMessageAsync(client);
} }
[Test]
public void UnimplementedService()
{
InteropClient.RunUnimplementedService(new UnimplementedService.UnimplementedServiceClient(channel));
}
[Test] [Test]
public void UnimplementedMethod() public void UnimplementedMethod()
{ {
InteropClient.RunUnimplementedMethod(new UnimplementedService.UnimplementedServiceClient(channel)); InteropClient.RunUnimplementedMethod(client);
} }
} }
} }

@ -76,6 +76,11 @@ namespace Grpc.IntegrationTesting
private async Task RunAsync() private async Task RunAsync()
{ {
// (ThreadPoolSize == ProcessorCount) gives best throughput in benchmarks
// and doesn't seem to harm performance even when server and client
// are running on the same machine.
GrpcEnvironment.SetThreadPoolSize(Environment.ProcessorCount);
string host = "0.0.0.0"; string host = "0.0.0.0";
int port = options.DriverPort; int port = options.DriverPort;

@ -24,25 +24,28 @@ namespace Grpc.Testing {
string.Concat( string.Concat(
"CiFzcmMvcHJvdG8vZ3JwYy90ZXN0aW5nL3Rlc3QucHJvdG8SDGdycGMudGVz", "CiFzcmMvcHJvdG8vZ3JwYy90ZXN0aW5nL3Rlc3QucHJvdG8SDGdycGMudGVz",
"dGluZxoic3JjL3Byb3RvL2dycGMvdGVzdGluZy9lbXB0eS5wcm90bxolc3Jj", "dGluZxoic3JjL3Byb3RvL2dycGMvdGVzdGluZy9lbXB0eS5wcm90bxolc3Jj",
"L3Byb3RvL2dycGMvdGVzdGluZy9tZXNzYWdlcy5wcm90bzK7BAoLVGVzdFNl", "L3Byb3RvL2dycGMvdGVzdGluZy9tZXNzYWdlcy5wcm90bzLLBQoLVGVzdFNl",
"cnZpY2USNQoJRW1wdHlDYWxsEhMuZ3JwYy50ZXN0aW5nLkVtcHR5GhMuZ3Jw", "cnZpY2USNQoJRW1wdHlDYWxsEhMuZ3JwYy50ZXN0aW5nLkVtcHR5GhMuZ3Jw",
"Yy50ZXN0aW5nLkVtcHR5EkYKCVVuYXJ5Q2FsbBIbLmdycGMudGVzdGluZy5T", "Yy50ZXN0aW5nLkVtcHR5EkYKCVVuYXJ5Q2FsbBIbLmdycGMudGVzdGluZy5T",
"aW1wbGVSZXF1ZXN0GhwuZ3JwYy50ZXN0aW5nLlNpbXBsZVJlc3BvbnNlEmwK", "aW1wbGVSZXF1ZXN0GhwuZ3JwYy50ZXN0aW5nLlNpbXBsZVJlc3BvbnNlEk8K",
"E1N0cmVhbWluZ091dHB1dENhbGwSKC5ncnBjLnRlc3RpbmcuU3RyZWFtaW5n", "EkNhY2hlYWJsZVVuYXJ5Q2FsbBIbLmdycGMudGVzdGluZy5TaW1wbGVSZXF1",
"T3V0cHV0Q2FsbFJlcXVlc3QaKS5ncnBjLnRlc3RpbmcuU3RyZWFtaW5nT3V0", "ZXN0GhwuZ3JwYy50ZXN0aW5nLlNpbXBsZVJlc3BvbnNlEmwKE1N0cmVhbWlu",
"cHV0Q2FsbFJlc3BvbnNlMAESaQoSU3RyZWFtaW5nSW5wdXRDYWxsEicuZ3Jw", "Z091dHB1dENhbGwSKC5ncnBjLnRlc3RpbmcuU3RyZWFtaW5nT3V0cHV0Q2Fs",
"Yy50ZXN0aW5nLlN0cmVhbWluZ0lucHV0Q2FsbFJlcXVlc3QaKC5ncnBjLnRl", "bFJlcXVlc3QaKS5ncnBjLnRlc3RpbmcuU3RyZWFtaW5nT3V0cHV0Q2FsbFJl",
"c3RpbmcuU3RyZWFtaW5nSW5wdXRDYWxsUmVzcG9uc2UoARJpCg5GdWxsRHVw", "c3BvbnNlMAESaQoSU3RyZWFtaW5nSW5wdXRDYWxsEicuZ3JwYy50ZXN0aW5n",
"bGV4Q2FsbBIoLmdycGMudGVzdGluZy5TdHJlYW1pbmdPdXRwdXRDYWxsUmVx", "LlN0cmVhbWluZ0lucHV0Q2FsbFJlcXVlc3QaKC5ncnBjLnRlc3RpbmcuU3Ry",
"dWVzdBopLmdycGMudGVzdGluZy5TdHJlYW1pbmdPdXRwdXRDYWxsUmVzcG9u", "ZWFtaW5nSW5wdXRDYWxsUmVzcG9uc2UoARJpCg5GdWxsRHVwbGV4Q2FsbBIo",
"c2UoATABEmkKDkhhbGZEdXBsZXhDYWxsEiguZ3JwYy50ZXN0aW5nLlN0cmVh", "LmdycGMudGVzdGluZy5TdHJlYW1pbmdPdXRwdXRDYWxsUmVxdWVzdBopLmdy",
"bWluZ091dHB1dENhbGxSZXF1ZXN0GikuZ3JwYy50ZXN0aW5nLlN0cmVhbWlu", "cGMudGVzdGluZy5TdHJlYW1pbmdPdXRwdXRDYWxsUmVzcG9uc2UoATABEmkK",
"Z091dHB1dENhbGxSZXNwb25zZSgBMAEyVQoUVW5pbXBsZW1lbnRlZFNlcnZp", "DkhhbGZEdXBsZXhDYWxsEiguZ3JwYy50ZXN0aW5nLlN0cmVhbWluZ091dHB1",
"Y2USPQoRVW5pbXBsZW1lbnRlZENhbGwSEy5ncnBjLnRlc3RpbmcuRW1wdHka", "dENhbGxSZXF1ZXN0GikuZ3JwYy50ZXN0aW5nLlN0cmVhbWluZ091dHB1dENh",
"Ey5ncnBjLnRlc3RpbmcuRW1wdHkyiQEKEFJlY29ubmVjdFNlcnZpY2USOwoF", "bGxSZXNwb25zZSgBMAESPQoRVW5pbXBsZW1lbnRlZENhbGwSEy5ncnBjLnRl",
"U3RhcnQSHS5ncnBjLnRlc3RpbmcuUmVjb25uZWN0UGFyYW1zGhMuZ3JwYy50", "c3RpbmcuRW1wdHkaEy5ncnBjLnRlc3RpbmcuRW1wdHkyVQoUVW5pbXBsZW1l",
"ZXN0aW5nLkVtcHR5EjgKBFN0b3ASEy5ncnBjLnRlc3RpbmcuRW1wdHkaGy5n", "bnRlZFNlcnZpY2USPQoRVW5pbXBsZW1lbnRlZENhbGwSEy5ncnBjLnRlc3Rp",
"cnBjLnRlc3RpbmcuUmVjb25uZWN0SW5mb2IGcHJvdG8z")); "bmcuRW1wdHkaEy5ncnBjLnRlc3RpbmcuRW1wdHkyiQEKEFJlY29ubmVjdFNl",
"cnZpY2USOwoFU3RhcnQSHS5ncnBjLnRlc3RpbmcuUmVjb25uZWN0UGFyYW1z",
"GhMuZ3JwYy50ZXN0aW5nLkVtcHR5EjgKBFN0b3ASEy5ncnBjLnRlc3Rpbmcu",
"RW1wdHkaGy5ncnBjLnRlc3RpbmcuUmVjb25uZWN0SW5mb2IGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Grpc.Testing.EmptyReflection.Descriptor, global::Grpc.Testing.MessagesReflection.Descriptor, }, new pbr::FileDescriptor[] { global::Grpc.Testing.EmptyReflection.Descriptor, global::Grpc.Testing.MessagesReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null)); new pbr::GeneratedClrTypeInfo(null, null));

@ -71,6 +71,13 @@ namespace Grpc.Testing {
__Marshaller_SimpleRequest, __Marshaller_SimpleRequest,
__Marshaller_SimpleResponse); __Marshaller_SimpleResponse);
static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_CacheableUnaryCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
MethodType.Unary,
__ServiceName,
"CacheableUnaryCall",
__Marshaller_SimpleRequest,
__Marshaller_SimpleResponse);
static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>( static readonly Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse> __Method_StreamingOutputCall = new Method<global::Grpc.Testing.StreamingOutputCallRequest, global::Grpc.Testing.StreamingOutputCallResponse>(
MethodType.ServerStreaming, MethodType.ServerStreaming,
__ServiceName, __ServiceName,
@ -99,6 +106,13 @@ namespace Grpc.Testing {
__Marshaller_StreamingOutputCallRequest, __Marshaller_StreamingOutputCallRequest,
__Marshaller_StreamingOutputCallResponse); __Marshaller_StreamingOutputCallResponse);
static readonly Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty> __Method_UnimplementedCall = new Method<global::Grpc.Testing.Empty, global::Grpc.Testing.Empty>(
MethodType.Unary,
__ServiceName,
"UnimplementedCall",
__Marshaller_Empty,
__Marshaller_Empty);
/// <summary>Service descriptor</summary> /// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{ {
@ -124,6 +138,16 @@ namespace Grpc.Testing {
throw new RpcException(new Status(StatusCode.Unimplemented, "")); throw new RpcException(new Status(StatusCode.Unimplemented, ""));
} }
/// <summary>
/// One request followed by one response. Response has cache control
/// headers set such that a caching HTTP proxy (such as GFE) can
/// satisfy subsequent requests.
/// </summary>
public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> CacheableUnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context)
{
throw new RpcException(new Status(StatusCode.Unimplemented, ""));
}
/// <summary> /// <summary>
/// One request followed by a sequence of responses (streamed download). /// One request followed by a sequence of responses (streamed download).
/// The server returns the payload with client desired type and sizes. /// The server returns the payload with client desired type and sizes.
@ -163,6 +187,15 @@ namespace Grpc.Testing {
throw new RpcException(new Status(StatusCode.Unimplemented, "")); throw new RpcException(new Status(StatusCode.Unimplemented, ""));
} }
/// <summary>
/// The test server will not implement this method. It will be used
/// to test the behavior when clients call unimplemented methods.
/// </summary>
public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Empty> UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context)
{
throw new RpcException(new Status(StatusCode.Unimplemented, ""));
}
} }
/// <summary>Client for TestService</summary> /// <summary>Client for TestService</summary>
@ -245,6 +278,42 @@ namespace Grpc.Testing {
return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request);
} }
/// <summary> /// <summary>
/// One request followed by one response. Response has cache control
/// headers set such that a caching HTTP proxy (such as GFE) can
/// satisfy subsequent requests.
/// </summary>
public virtual global::Grpc.Testing.SimpleResponse CacheableUnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return CacheableUnaryCall(request, new CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// One request followed by one response. Response has cache control
/// headers set such that a caching HTTP proxy (such as GFE) can
/// satisfy subsequent requests.
/// </summary>
public virtual global::Grpc.Testing.SimpleResponse CacheableUnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_CacheableUnaryCall, null, options, request);
}
/// <summary>
/// One request followed by one response. Response has cache control
/// headers set such that a caching HTTP proxy (such as GFE) can
/// satisfy subsequent requests.
/// </summary>
public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> CacheableUnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return CacheableUnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// One request followed by one response. Response has cache control
/// headers set such that a caching HTTP proxy (such as GFE) can
/// satisfy subsequent requests.
/// </summary>
public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> CacheableUnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_CacheableUnaryCall, null, options, request);
}
/// <summary>
/// One request followed by a sequence of responses (streamed download). /// One request followed by a sequence of responses (streamed download).
/// The server returns the payload with client desired type and sizes. /// The server returns the payload with client desired type and sizes.
/// </summary> /// </summary>
@ -314,6 +383,38 @@ namespace Grpc.Testing {
{ {
return CallInvoker.AsyncDuplexStreamingCall(__Method_HalfDuplexCall, null, options); return CallInvoker.AsyncDuplexStreamingCall(__Method_HalfDuplexCall, null, options);
} }
/// <summary>
/// The test server will not implement this method. It will be used
/// to test the behavior when clients call unimplemented methods.
/// </summary>
public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return UnimplementedCall(request, new CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// The test server will not implement this method. It will be used
/// to test the behavior when clients call unimplemented methods.
/// </summary>
public virtual global::Grpc.Testing.Empty UnimplementedCall(global::Grpc.Testing.Empty request, CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_UnimplementedCall, null, options, request);
}
/// <summary>
/// The test server will not implement this method. It will be used
/// to test the behavior when clients call unimplemented methods.
/// </summary>
public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return UnimplementedCallAsync(request, new CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// The test server will not implement this method. It will be used
/// to test the behavior when clients call unimplemented methods.
/// </summary>
public virtual AsyncUnaryCall<global::Grpc.Testing.Empty> UnimplementedCallAsync(global::Grpc.Testing.Empty request, CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_UnimplementedCall, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override TestServiceClient NewInstance(ClientBaseConfiguration configuration) protected override TestServiceClient NewInstance(ClientBaseConfiguration configuration)
{ {
@ -327,10 +428,12 @@ namespace Grpc.Testing {
return ServerServiceDefinition.CreateBuilder() return ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall) .AddMethod(__Method_EmptyCall, serviceImpl.EmptyCall)
.AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
.AddMethod(__Method_CacheableUnaryCall, serviceImpl.CacheableUnaryCall)
.AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall) .AddMethod(__Method_StreamingOutputCall, serviceImpl.StreamingOutputCall)
.AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall) .AddMethod(__Method_StreamingInputCall, serviceImpl.StreamingInputCall)
.AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall) .AddMethod(__Method_FullDuplexCall, serviceImpl.FullDuplexCall)
.AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall).Build(); .AddMethod(__Method_HalfDuplexCall, serviceImpl.HalfDuplexCall)
.AddMethod(__Method_UnimplementedCall, serviceImpl.UnimplementedCall).Build();
} }
} }

@ -84,11 +84,6 @@ typedef struct grpcsharp_batch_context {
size_t status_details_capacity; size_t status_details_capacity;
} recv_status_on_client; } recv_status_on_client;
int recv_close_on_server_cancelled; int recv_close_on_server_cancelled;
struct {
grpc_call *call;
grpc_call_details call_details;
grpc_metadata_array request_metadata;
} server_rpc_new;
} grpcsharp_batch_context; } grpcsharp_batch_context;
GPR_EXPORT grpcsharp_batch_context *GPR_CALLTYPE grpcsharp_batch_context_create() { GPR_EXPORT grpcsharp_batch_context *GPR_CALLTYPE grpcsharp_batch_context_create() {
@ -97,6 +92,18 @@ GPR_EXPORT grpcsharp_batch_context *GPR_CALLTYPE grpcsharp_batch_context_create(
return ctx; return ctx;
} }
typedef struct {
grpc_call *call;
grpc_call_details call_details;
grpc_metadata_array request_metadata;
} grpcsharp_request_call_context;
GPR_EXPORT grpcsharp_request_call_context *GPR_CALLTYPE grpcsharp_request_call_context_create() {
grpcsharp_request_call_context *ctx = gpr_malloc(sizeof(grpcsharp_request_call_context));
memset(ctx, 0, sizeof(grpcsharp_request_call_context));
return ctx;
}
/* /*
* Destroys array->metadata. * Destroys array->metadata.
* The array pointer itself is not freed. * The array pointer itself is not freed.
@ -230,13 +237,20 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_batch_context_destroy(grpcsharp_batch_con
&(ctx->recv_status_on_client.trailing_metadata)); &(ctx->recv_status_on_client.trailing_metadata));
gpr_free((void *)ctx->recv_status_on_client.status_details); gpr_free((void *)ctx->recv_status_on_client.status_details);
gpr_free(ctx);
}
GPR_EXPORT void GPR_CALLTYPE grpcsharp_request_call_context_destroy(grpcsharp_request_call_context *ctx) {
if (!ctx) {
return;
}
/* NOTE: ctx->server_rpc_new.call is not destroyed because callback handler is /* NOTE: ctx->server_rpc_new.call is not destroyed because callback handler is
supposed supposed
to take its ownership. */ to take its ownership. */
grpc_call_details_destroy(&(ctx->server_rpc_new.call_details)); grpc_call_details_destroy(&(ctx->call_details));
grpcsharp_metadata_array_destroy_metadata_only( grpcsharp_metadata_array_destroy_metadata_only(
&(ctx->server_rpc_new.request_metadata)); &(ctx->request_metadata));
gpr_free(ctx); gpr_free(ctx);
} }
@ -303,32 +317,32 @@ grpcsharp_batch_context_recv_status_on_client_trailing_metadata(
return &(ctx->recv_status_on_client.trailing_metadata); return &(ctx->recv_status_on_client.trailing_metadata);
} }
GPR_EXPORT grpc_call *GPR_CALLTYPE grpcsharp_batch_context_server_rpc_new_call( GPR_EXPORT grpc_call *GPR_CALLTYPE grpcsharp_request_call_context_call(
const grpcsharp_batch_context *ctx) { const grpcsharp_request_call_context *ctx) {
return ctx->server_rpc_new.call; return ctx->call;
} }
GPR_EXPORT const char *GPR_CALLTYPE GPR_EXPORT const char *GPR_CALLTYPE
grpcsharp_batch_context_server_rpc_new_method( grpcsharp_request_call_context_method(
const grpcsharp_batch_context *ctx) { const grpcsharp_request_call_context *ctx) {
return ctx->server_rpc_new.call_details.method; return ctx->call_details.method;
} }
GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_batch_context_server_rpc_new_host( GPR_EXPORT const char *GPR_CALLTYPE grpcsharp_request_call_context_host(
const grpcsharp_batch_context *ctx) { const grpcsharp_request_call_context *ctx) {
return ctx->server_rpc_new.call_details.host; return ctx->call_details.host;
} }
GPR_EXPORT gpr_timespec GPR_CALLTYPE GPR_EXPORT gpr_timespec GPR_CALLTYPE
grpcsharp_batch_context_server_rpc_new_deadline( grpcsharp_request_call_context_deadline(
const grpcsharp_batch_context *ctx) { const grpcsharp_request_call_context *ctx) {
return ctx->server_rpc_new.call_details.deadline; return ctx->call_details.deadline;
} }
GPR_EXPORT const grpc_metadata_array *GPR_CALLTYPE GPR_EXPORT const grpc_metadata_array *GPR_CALLTYPE
grpcsharp_batch_context_server_rpc_new_request_metadata( grpcsharp_request_call_context_request_metadata(
const grpcsharp_batch_context *ctx) { const grpcsharp_request_call_context *ctx) {
return &(ctx->server_rpc_new.request_metadata); return &(ctx->request_metadata);
} }
GPR_EXPORT int32_t GPR_CALLTYPE GPR_EXPORT int32_t GPR_CALLTYPE
@ -853,10 +867,10 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_server_destroy(grpc_server *server) {
GPR_EXPORT grpc_call_error GPR_CALLTYPE GPR_EXPORT grpc_call_error GPR_CALLTYPE
grpcsharp_server_request_call(grpc_server *server, grpc_completion_queue *cq, grpcsharp_server_request_call(grpc_server *server, grpc_completion_queue *cq,
grpcsharp_batch_context *ctx) { grpcsharp_request_call_context *ctx) {
return grpc_server_request_call( return grpc_server_request_call(
server, &(ctx->server_rpc_new.call), &(ctx->server_rpc_new.call_details), server, &(ctx->call), &(ctx->call_details),
&(ctx->server_rpc_new.request_metadata), cq, cq, ctx); &(ctx->request_metadata), cq, cq, ctx);
} }
/* Security */ /* Security */

@ -261,10 +261,10 @@ void InitLogConstants(Local<Object> exports) {
Nan::HandleScope scope; Nan::HandleScope scope;
Local<Object> log_verbosity = Nan::New<Object>(); Local<Object> log_verbosity = Nan::New<Object>();
Nan::Set(exports, Nan::New("logVerbosity").ToLocalChecked(), log_verbosity); Nan::Set(exports, Nan::New("logVerbosity").ToLocalChecked(), log_verbosity);
Local<Value> DEBUG(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_DEBUG)); Local<Value> LOG_DEBUG(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_DEBUG));
Nan::Set(log_verbosity, Nan::New("DEBUG").ToLocalChecked(), DEBUG); Nan::Set(log_verbosity, Nan::New("DEBUG").ToLocalChecked(), LOG_DEBUG);
Local<Value> INFO(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_INFO)); Local<Value> LOG_INFO(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_INFO));
Nan::Set(log_verbosity, Nan::New("INFO").ToLocalChecked(), INFO); Nan::Set(log_verbosity, Nan::New("INFO").ToLocalChecked(), LOG_INFO);
Local<Value> LOG_ERROR(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_ERROR)); Local<Value> LOG_ERROR(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_ERROR));
Nan::Set(log_verbosity, Nan::New("ERROR").ToLocalChecked(), LOG_ERROR); Nan::Set(log_verbosity, Nan::New("ERROR").ToLocalChecked(), LOG_ERROR);
} }

@ -375,7 +375,8 @@ function statusCodeAndMessage(client, done) {
duplex.end(); duplex.end();
} }
function unimplementedMethod(client, done) { // NOTE: the client param to this function is from UnimplementedService
function unimplementedService(client, done) {
client.unimplementedCall({}, function(err, resp) { client.unimplementedCall({}, function(err, resp) {
assert(err); assert(err);
assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED); assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED);
@ -384,6 +385,15 @@ function unimplementedMethod(client, done) {
}); });
} }
// NOTE: the client param to this function is from TestService
function unimplementedMethod(client, done) {
client.unimplementedCall({}, function(err, resp) {
assert(err);
assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED);
done();
});
}
/** /**
* Run one of the authentication tests. * Run one of the authentication tests.
* @param {string} expected_user The expected username in the response * @param {string} expected_user The expected username in the response
@ -527,8 +537,10 @@ var test_cases = {
Client: testProto.TestService}, Client: testProto.TestService},
status_code_and_message: {run: statusCodeAndMessage, status_code_and_message: {run: statusCodeAndMessage,
Client: testProto.TestService}, Client: testProto.TestService},
unimplemented_method: {run: unimplementedMethod, unimplemented_service: {run: unimplementedService,
Client: testProto.UnimplementedService}, Client: testProto.UnimplementedService},
unimplemented_method: {run: unimplementedMethod,
Client: testProto.TestService},
compute_engine_creds: {run: computeEngineCreds, compute_engine_creds: {run: computeEngineCreds,
Client: testProto.TestService, Client: testProto.TestService,
getCreds: getApplicationCreds}, getCreds: getApplicationCreds},

@ -98,6 +98,10 @@ describe('Interop tests', function() {
interop_client.runTest(port, name_override, 'status_code_and_message', interop_client.runTest(port, name_override, 'status_code_and_message',
true, true, done); true, true, done);
}); });
it('should pass unimplemented_service', function(done) {
interop_client.runTest(port, name_override, 'unimplemented_service',
true, true, done);
});
it('should pass unimplemented_method', function(done) { it('should pass unimplemented_method', function(done) {
interop_client.runTest(port, name_override, 'unimplemented_method', interop_client.runTest(port, name_override, 'unimplemented_method',
true, true, done); true, true, done);

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 48; objectVersion = 46;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -129,7 +129,7 @@
6369A2621A9322E20015FC5C /* Project object */ = { 6369A2621A9322E20015FC5C /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 0800; LastUpgradeCheck = 0730;
ORGANIZATIONNAME = gRPC; ORGANIZATIONNAME = gRPC;
TargetAttributes = { TargetAttributes = {
6369A2691A9322E20015FC5C = { 6369A2691A9322E20015FC5C = {
@ -138,7 +138,7 @@
}; };
}; };
buildConfigurationList = 6369A2651A9322E20015FC5C /* Build configuration list for PBXProject "Sample" */; buildConfigurationList = 6369A2651A9322E20015FC5C /* Build configuration list for PBXProject "Sample" */;
compatibilityVersion = "Xcode 8.0"; compatibilityVersion = "Xcode 3.2";
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
@ -253,10 +253,8 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@ -265,7 +263,6 @@
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO; GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0; GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1", "DEBUG=1",
@ -299,10 +296,8 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@ -310,7 +305,6 @@
ENABLE_NS_ASSERTIONS = NO; ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99; GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNDECLARED_SELECTOR = YES;

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0800" LastUpgradeVersion = "0730"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 48; objectVersion = 46;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -123,17 +123,16 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastSwiftUpdateCheck = 0710; LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0800; LastUpgradeCheck = 0730;
ORGANIZATIONNAME = gRPC; ORGANIZATIONNAME = gRPC;
TargetAttributes = { TargetAttributes = {
633BFFC11B950B210007E424 = { 633BFFC11B950B210007E424 = {
CreatedOnToolsVersion = 6.4; CreatedOnToolsVersion = 6.4;
LastSwiftMigration = 0800;
}; };
}; };
}; };
buildConfigurationList = 633BFFBD1B950B210007E424 /* Build configuration list for PBXProject "SwiftSample" */; buildConfigurationList = 633BFFBD1B950B210007E424 /* Build configuration list for PBXProject "SwiftSample" */;
compatibilityVersion = "Xcode 8.0"; compatibilityVersion = "Xcode 3.2";
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
@ -247,10 +246,8 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@ -295,10 +292,8 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@ -317,7 +312,6 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.4; IPHONEOS_DEPLOYMENT_TARGET = 8.4;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
@ -333,7 +327,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 3.0;
USER_HEADER_SEARCH_PATHS = ""; USER_HEADER_SEARCH_PATHS = "";
}; };
name = Debug; name = Debug;
@ -348,7 +341,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_BUNDLE_IDENTIFIER = "io.grpc.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 3.0;
USER_HEADER_SEARCH_PATHS = ""; USER_HEADER_SEARCH_PATHS = "";
}; };
name = Release; name = Release;
@ -363,7 +355,7 @@
633BFFE01B950B210007E424 /* Release */, 633BFFE01B950B210007E424 /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug; defaultConfigurationName = Release;
}; };
633BFFE11B950B210007E424 /* Build configuration list for PBXNativeTarget "SwiftSample" */ = { 633BFFE11B950B210007E424 /* Build configuration list for PBXNativeTarget "SwiftSample" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
@ -372,7 +364,7 @@
633BFFE31B950B210007E424 /* Release */, 633BFFE31B950B210007E424 /* Release */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Debug; defaultConfigurationName = Release;
}; };
/* End XCConfigurationList section */ /* End XCConfigurationList section */
}; };

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0800" LastUpgradeVersion = "0730"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

@ -51,7 +51,7 @@ class ViewController: UIViewController {
// Example gRPC call using a generated proto client library: // Example gRPC call using a generated proto client library:
let service = RMTTestService(host: RemoteHost) let service = RMTTestService(host: RemoteHost)
service.unaryCall(with: request) { response, error in service.unaryCallWithRequest(request) { response, error in
if let response = response { if let response = response {
NSLog("1. Finished successfully with response:\n\(response)") NSLog("1. Finished successfully with response:\n\(response)")
} else { } else {
@ -63,39 +63,40 @@ class ViewController: UIViewController {
// Same but manipulating headers: // Same but manipulating headers:
var RPC : GRPCProtoCall! // Needed to convince Swift to capture by reference (__block) var RPC : GRPCProtoCall! // Needed to convince Swift to capture by reference (__block)
RPC = service.rpcToUnaryCall(with: request) { response, error in RPC = service.RPCToUnaryCallWithRequest(request) { response, error in
if let response = response { if let response = response {
NSLog("2. Finished successfully with response:\n\(response)") NSLog("2. Finished successfully with response:\n\(response)")
} else { } else {
NSLog("2. Finished with error: \(error!)") NSLog("2. Finished with error: \(error!)")
} }
NSLog("2. Response headers: \(RPC.responseHeaders!)") NSLog("2. Response headers: \(RPC.responseHeaders)")
NSLog("2. Response trailers: \(RPC.responseTrailers!)") NSLog("2. Response trailers: \(RPC.responseTrailers)")
} }
RPC.requestHeaders["My-Header"] = "My value"; // TODO(jcanizales): Revert to using subscript syntax once XCode 8 is released.
RPC.requestHeaders.setObject("My value", forKey: "My-Header")
RPC.start() RPC.start()
// Same example call using the generic gRPC client library: // Same example call using the generic gRPC client library:
let method = GRPCProtoMethod(package: "grpc.testing", service: "TestService", method: "UnaryCall")! let method = GRPCProtoMethod(package: "grpc.testing", service: "TestService", method: "UnaryCall")
let requestsWriter = GRXWriter(value: request.data()) let requestsWriter = GRXWriter(value: request.data())
let call = GRPCCall(host: RemoteHost, path: method.httpPath, requestsWriter: requestsWriter)! let call = GRPCCall(host: RemoteHost, path: method.HTTPPath, requestsWriter: requestsWriter)
call.requestHeaders["My-Header"] = "My value"; call.requestHeaders.setObject("My value", forKey: "My-Header")
call.start(with: GRXWriteable { response, error in call.startWithWriteable(GRXWriteable { response, error in
if let response = response as? Data { if let response = response as? NSData {
NSLog("3. Received response:\n\(try! RMTSimpleResponse(data: response))") NSLog("3. Received response:\n\(try! RMTSimpleResponse(data: response))")
} else { } else {
NSLog("3. Finished with error: \(error!)") NSLog("3. Finished with error: \(error!)")
} }
NSLog("3. Response headers: \(call.responseHeaders!)") NSLog("3. Response headers: \(call.responseHeaders)")
NSLog("3. Response trailers: \(call.responseTrailers!)") NSLog("3. Response trailers: \(call.responseTrailers)")
}) })
} }
} }

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>gRPC.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>

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

Loading…
Cancel
Save