瀏覽代碼

Merge branch 'codegen_proto_utils_fix' into codegen_lib

David Garcia Quintas 9 年之前
父節點
當前提交
a9d0629677
共有 100 個文件被更改,包括 4175 次插入1630 次删除
  1. 1 0
      .gitignore
  2. 3 0
      .gitmodules
  3. 2 2
      .travis.yml
  4. 124 92
      BUILD
  5. 1 9
      INSTALL
  6. 160 112
      Makefile
  7. 2 1
      PYTHON-MANIFEST.in
  8. 31 26
      binding.gyp
  9. 179 73
      build.yaml
  10. 606 0
      config.m4
  11. 2 2
      doc/health-checking.md
  12. 97 0
      doc/load-balancing.md
  13. 1 1
      examples/csharp/helloworld/.nuget/packages.config
  14. 12 13
      examples/csharp/helloworld/Greeter/Greeter.csproj
  15. 23 13
      examples/csharp/helloworld/Greeter/Helloworld.cs
  16. 1 1
      examples/csharp/helloworld/Greeter/HelloworldGrpc.cs
  17. 5 7
      examples/csharp/helloworld/Greeter/packages.config
  18. 12 13
      examples/csharp/helloworld/GreeterClient/GreeterClient.csproj
  19. 5 7
      examples/csharp/helloworld/GreeterClient/packages.config
  20. 12 13
      examples/csharp/helloworld/GreeterServer/GreeterServer.csproj
  21. 5 7
      examples/csharp/helloworld/GreeterServer/packages.config
  22. 5 24
      examples/csharp/helloworld/README.md
  23. 1 1
      examples/csharp/helloworld/generate_protos.bat
  24. 1 1
      examples/csharp/route_guide/.nuget/packages.config
  25. 117 51
      examples/csharp/route_guide/RouteGuide/RouteGuide.cs
  26. 9 11
      examples/csharp/route_guide/RouteGuide/RouteGuide.csproj
  27. 1 1
      examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs
  28. 4 6
      examples/csharp/route_guide/RouteGuide/packages.config
  29. 9 11
      examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj
  30. 4 6
      examples/csharp/route_guide/RouteGuideClient/packages.config
  31. 9 11
      examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj
  32. 4 6
      examples/csharp/route_guide/RouteGuideServer/packages.config
  33. 1 1
      examples/csharp/route_guide/generate_protos.bat
  34. 10 16
      examples/python/README.md
  35. 79 62
      gRPC.podspec
  36. 1 0
      grpc.def
  37. 54 43
      grpc.gemspec
  38. 14 3
      include/grpc++/alarm.h
  39. 3 0
      include/grpc++/impl/codegen/call.h
  40. 46 10
      include/grpc++/impl/codegen/proto_utils.h
  41. 4 2
      include/grpc++/server.h
  42. 33 49
      include/grpc/census.h
  43. 4 0
      include/grpc/impl/codegen/sync.h
  44. 455 444
      package.json
  45. 982 0
      package.xml
  46. 0 1
      setup.py
  47. 64 85
      src/core/census/context.c
  48. 1 1
      src/core/census/mlog.c
  49. 4 2
      src/core/census/mlog.h
  50. 15 16
      src/core/channel/client_channel.c
  51. 163 0
      src/core/client_config/lb_policies/load_balancer_api.c
  52. 85 0
      src/core/client_config/lb_policies/load_balancer_api.h
  53. 10 11
      src/core/client_config/lb_policies/pick_first.c
  54. 7 8
      src/core/client_config/lb_policies/round_robin.c
  55. 3 3
      src/core/client_config/lb_policy.c
  56. 3 2
      src/core/client_config/lb_policy.h
  57. 10 14
      src/core/client_config/subchannel.c
  58. 2 0
      src/core/client_config/subchannel_index.c
  59. 0 0
      src/core/compression/compression_algorithm.c
  60. 13 11
      src/core/httpcli/httpcli.c
  61. 3 2
      src/core/httpcli/httpcli.h
  62. 7 7
      src/core/httpcli/httpcli_security_connector.c
  63. 4 2
      src/core/iomgr/fd_posix.c
  64. 1 1
      src/core/iomgr/iocp_windows.c
  65. 18 2
      src/core/iomgr/iomgr.c
  66. 5 1
      src/core/iomgr/iomgr_internal.h
  67. 9 10
      src/core/iomgr/pollset.h
  68. 1 0
      src/core/iomgr/pollset_multipoller_with_epoll.c
  69. 5 3
      src/core/iomgr/pollset_multipoller_with_poll_posix.c
  70. 30 35
      src/core/iomgr/pollset_posix.c
  71. 10 6
      src/core/iomgr/pollset_posix.h
  72. 3 9
      src/core/iomgr/pollset_set.h
  73. 23 3
      src/core/iomgr/pollset_set_posix.c
  74. 2 18
      src/core/iomgr/pollset_set_posix.h
  75. 3 3
      src/core/iomgr/pollset_set_windows.c
  76. 2 2
      src/core/iomgr/pollset_set_windows.h
  77. 24 21
      src/core/iomgr/pollset_windows.c
  78. 1 5
      src/core/iomgr/pollset_windows.h
  79. 7 5
      src/core/iomgr/tcp_client_posix.c
  80. 4 2
      src/core/iomgr/tcp_posix.c
  81. 2 3
      src/core/iomgr/timer.c
  82. 21 1
      src/core/iomgr/timer.h
  83. 0 61
      src/core/iomgr/timer_internal.h
  84. 1 0
      src/core/iomgr/udp_server.h
  85. 1 0
      src/core/iomgr/workqueue_posix.c
  86. 3 1
      src/core/iomgr/workqueue_posix.h
  87. 119 0
      src/core/proto/grpc/lb/v0/load_balancer.pb.c
  88. 182 0
      src/core/proto/grpc/lb/v0/load_balancer.pb.h
  89. 1 1
      src/core/security/b64.c
  90. 1 1
      src/core/security/b64.h
  91. 0 1
      src/core/security/client_auth_filter.c
  92. 3 3
      src/core/security/credentials.c
  93. 3 3
      src/core/security/credentials.h
  94. 24 19
      src/core/security/google_default_credentials.c
  95. 15 7
      src/core/security/handshake.c
  96. 2 1
      src/core/security/handshake.h
  97. 1 1
      src/core/security/json_token.c
  98. 1 1
      src/core/security/jwt_verifier.c
  99. 77 62
      src/core/security/security_connector.c
  100. 42 22
      src/core/security/security_connector.h

+ 1 - 0
.gitignore

@@ -35,6 +35,7 @@ coverage
 
 # cache for run_tests.py
 .run_tests_cache
+.preprocessed_build
 
 # emacs temp files
 *~

+ 3 - 0
.gitmodules

@@ -14,3 +14,6 @@
 [submodule "third_party/boringssl"]
 	path = third_party/boringssl
 	url = https://boringssl.googlesource.com/boringssl
+[submodule "third_party/nanopb"]
+	path = third_party/nanopb
+	url = https://github.com/nanopb/nanopb.git

+ 2 - 2
.travis.yml

@@ -1,5 +1,5 @@
 language: objective-c
-osx_image: xcode7.1
+osx_image: xcode7.2
 env:
   global:
     - CONFIG=opt
@@ -27,6 +27,6 @@ xcode_scheme:
   - InteropTestsLocalCleartext
   # TODO(jcanizales): Investigate why they time out:
   # - InteropTestsRemote
-xcode_sdk: iphonesimulator9.1
+xcode_sdk: iphonesimulator9.2
 notifications:
   email: false

+ 124 - 92
BUILD

@@ -47,13 +47,14 @@ cc_library(
     "src/core/profiling/timers.h",
     "src/core/support/block_annotate.h",
     "src/core/support/env.h",
-    "src/core/support/file.h",
+    "src/core/support/load_file.h",
     "src/core/support/murmur_hash.h",
     "src/core/support/stack_lockfree.h",
     "src/core/support/string.h",
     "src/core/support/string_win32.h",
     "src/core/support/thd_internal.h",
     "src/core/support/time_precise.h",
+    "src/core/support/tmpfile.h",
     "src/core/profiling/basic_timers.c",
     "src/core/profiling/stap_timers.c",
     "src/core/support/alloc.c",
@@ -66,11 +67,9 @@ cc_library(
     "src/core/support/env_linux.c",
     "src/core/support/env_posix.c",
     "src/core/support/env_win32.c",
-    "src/core/support/file.c",
-    "src/core/support/file_posix.c",
-    "src/core/support/file_win32.c",
     "src/core/support/histogram.c",
     "src/core/support/host_port.c",
+    "src/core/support/load_file.c",
     "src/core/support/log.c",
     "src/core/support/log_android.c",
     "src/core/support/log_linux.c",
@@ -96,6 +95,8 @@ cc_library(
     "src/core/support/time_precise.c",
     "src/core/support/time_win32.c",
     "src/core/support/tls_pthread.c",
+    "src/core/support/tmpfile_posix.c",
+    "src/core/support/tmpfile_win32.c",
     "src/core/support/wrap_memcpy.c",
   ],
   hdrs = [
@@ -154,20 +155,6 @@ cc_library(
 cc_library(
   name = "grpc",
   srcs = [
-    "src/core/security/auth_filters.h",
-    "src/core/security/base64.h",
-    "src/core/security/credentials.h",
-    "src/core/security/handshake.h",
-    "src/core/security/json_token.h",
-    "src/core/security/jwt_verifier.h",
-    "src/core/security/secure_endpoint.h",
-    "src/core/security/security_connector.h",
-    "src/core/security/security_context.h",
-    "src/core/tsi/fake_transport_security.h",
-    "src/core/tsi/ssl_transport_security.h",
-    "src/core/tsi/ssl_types.h",
-    "src/core/tsi/transport_security.h",
-    "src/core/tsi/transport_security_interface.h",
     "src/core/census/grpc_filter.h",
     "src/core/channel/channel_args.h",
     "src/core/channel/channel_stack.h",
@@ -182,6 +169,7 @@ cc_library(
     "src/core/client_config/client_config.h",
     "src/core/client_config/connector.h",
     "src/core/client_config/initial_connect_string.h",
+    "src/core/client_config/lb_policies/load_balancer_api.h",
     "src/core/client_config/lb_policies/pick_first.h",
     "src/core/client_config/lb_policies/round_robin.h",
     "src/core/client_config/lb_policy.h",
@@ -232,7 +220,6 @@ cc_library(
     "src/core/iomgr/time_averaged_stats.h",
     "src/core/iomgr/timer.h",
     "src/core/iomgr/timer_heap.h",
-    "src/core/iomgr/timer_internal.h",
     "src/core/iomgr/udp_server.h",
     "src/core/iomgr/wakeup_fd_pipe.h",
     "src/core/iomgr/wakeup_fd_posix.h",
@@ -243,6 +230,7 @@ cc_library(
     "src/core/json/json_common.h",
     "src/core/json/json_reader.h",
     "src/core/json/json_writer.h",
+    "src/core/proto/grpc/lb/v0/load_balancer.pb.h",
     "src/core/statistics/census_interface.h",
     "src/core/statistics/census_rpc_stats.h",
     "src/core/surface/api_trace.h",
@@ -282,30 +270,27 @@ cc_library(
     "src/core/transport/static_metadata.h",
     "src/core/transport/transport.h",
     "src/core/transport/transport_impl.h",
+    "src/core/security/auth_filters.h",
+    "src/core/security/b64.h",
+    "src/core/security/credentials.h",
+    "src/core/security/handshake.h",
+    "src/core/security/json_token.h",
+    "src/core/security/jwt_verifier.h",
+    "src/core/security/secure_endpoint.h",
+    "src/core/security/security_connector.h",
+    "src/core/security/security_context.h",
+    "src/core/tsi/fake_transport_security.h",
+    "src/core/tsi/ssl_transport_security.h",
+    "src/core/tsi/ssl_types.h",
+    "src/core/tsi/transport_security.h",
+    "src/core/tsi/transport_security_interface.h",
     "src/core/census/aggregation.h",
-    "src/core/census/log.h",
+    "src/core/census/mlog.h",
     "src/core/census/rpc_metric_id.h",
-    "src/core/httpcli/httpcli_security_connector.c",
-    "src/core/security/base64.c",
-    "src/core/security/client_auth_filter.c",
-    "src/core/security/credentials.c",
-    "src/core/security/credentials_metadata.c",
-    "src/core/security/credentials_posix.c",
-    "src/core/security/credentials_win32.c",
-    "src/core/security/google_default_credentials.c",
-    "src/core/security/handshake.c",
-    "src/core/security/json_token.c",
-    "src/core/security/jwt_verifier.c",
-    "src/core/security/secure_endpoint.c",
-    "src/core/security/security_connector.c",
-    "src/core/security/security_context.c",
-    "src/core/security/server_auth_filter.c",
-    "src/core/security/server_secure_chttp2.c",
-    "src/core/surface/init_secure.c",
-    "src/core/surface/secure_channel_create.c",
-    "src/core/tsi/fake_transport_security.c",
-    "src/core/tsi/ssl_transport_security.c",
-    "src/core/tsi/transport_security.c",
+    "third_party/nanopb/pb.h",
+    "third_party/nanopb/pb_common.h",
+    "third_party/nanopb/pb_decode.h",
+    "third_party/nanopb/pb_encode.h",
     "src/core/census/grpc_context.c",
     "src/core/census/grpc_filter.c",
     "src/core/channel/channel_args.c",
@@ -321,6 +306,7 @@ cc_library(
     "src/core/client_config/connector.c",
     "src/core/client_config/default_initial_connect_string.c",
     "src/core/client_config/initial_connect_string.c",
+    "src/core/client_config/lb_policies/load_balancer_api.c",
     "src/core/client_config/lb_policies/pick_first.c",
     "src/core/client_config/lb_policies/round_robin.c",
     "src/core/client_config/lb_policy.c",
@@ -335,7 +321,7 @@ cc_library(
     "src/core/client_config/subchannel_factory.c",
     "src/core/client_config/subchannel_index.c",
     "src/core/client_config/uri_parser.c",
-    "src/core/compression/algorithm.c",
+    "src/core/compression/compression_algorithm.c",
     "src/core/compression/message_compress.c",
     "src/core/debug/trace.c",
     "src/core/httpcli/format_request.c",
@@ -385,6 +371,7 @@ cc_library(
     "src/core/json/json_reader.c",
     "src/core/json/json_string.c",
     "src/core/json/json_writer.c",
+    "src/core/proto/grpc/lb/v0/load_balancer.pb.c",
     "src/core/surface/alarm.c",
     "src/core/surface/api_trace.c",
     "src/core/surface/byte_buffer.c",
@@ -434,12 +421,36 @@ cc_library(
     "src/core/transport/static_metadata.c",
     "src/core/transport/transport.c",
     "src/core/transport/transport_op_string.c",
+    "src/core/httpcli/httpcli_security_connector.c",
+    "src/core/security/b64.c",
+    "src/core/security/client_auth_filter.c",
+    "src/core/security/credentials.c",
+    "src/core/security/credentials_metadata.c",
+    "src/core/security/credentials_posix.c",
+    "src/core/security/credentials_win32.c",
+    "src/core/security/google_default_credentials.c",
+    "src/core/security/handshake.c",
+    "src/core/security/json_token.c",
+    "src/core/security/jwt_verifier.c",
+    "src/core/security/secure_endpoint.c",
+    "src/core/security/security_connector.c",
+    "src/core/security/security_context.c",
+    "src/core/security/server_auth_filter.c",
+    "src/core/security/server_secure_chttp2.c",
+    "src/core/surface/init_secure.c",
+    "src/core/surface/secure_channel_create.c",
+    "src/core/tsi/fake_transport_security.c",
+    "src/core/tsi/ssl_transport_security.c",
+    "src/core/tsi/transport_security.c",
     "src/core/census/context.c",
     "src/core/census/initialize.c",
-    "src/core/census/log.c",
+    "src/core/census/mlog.c",
     "src/core/census/operation.c",
     "src/core/census/placeholders.c",
     "src/core/census/tracing.c",
+    "third_party/nanopb/pb_common.c",
+    "third_party/nanopb/pb_decode.c",
+    "third_party/nanopb/pb_encode.c",
   ],
   hdrs = [
     "include/grpc/grpc_security.h",
@@ -483,6 +494,7 @@ cc_library(
     "src/core/client_config/client_config.h",
     "src/core/client_config/connector.h",
     "src/core/client_config/initial_connect_string.h",
+    "src/core/client_config/lb_policies/load_balancer_api.h",
     "src/core/client_config/lb_policies/pick_first.h",
     "src/core/client_config/lb_policies/round_robin.h",
     "src/core/client_config/lb_policy.h",
@@ -533,7 +545,6 @@ cc_library(
     "src/core/iomgr/time_averaged_stats.h",
     "src/core/iomgr/timer.h",
     "src/core/iomgr/timer_heap.h",
-    "src/core/iomgr/timer_internal.h",
     "src/core/iomgr/udp_server.h",
     "src/core/iomgr/wakeup_fd_pipe.h",
     "src/core/iomgr/wakeup_fd_posix.h",
@@ -544,6 +555,7 @@ cc_library(
     "src/core/json/json_common.h",
     "src/core/json/json_reader.h",
     "src/core/json/json_writer.h",
+    "src/core/proto/grpc/lb/v0/load_balancer.pb.h",
     "src/core/statistics/census_interface.h",
     "src/core/statistics/census_rpc_stats.h",
     "src/core/surface/api_trace.h",
@@ -584,8 +596,12 @@ cc_library(
     "src/core/transport/transport.h",
     "src/core/transport/transport_impl.h",
     "src/core/census/aggregation.h",
-    "src/core/census/log.h",
+    "src/core/census/mlog.h",
     "src/core/census/rpc_metric_id.h",
+    "third_party/nanopb/pb.h",
+    "third_party/nanopb/pb_common.h",
+    "third_party/nanopb/pb_decode.h",
+    "third_party/nanopb/pb_encode.h",
     "src/core/surface/init_unsecure.c",
     "src/core/census/grpc_context.c",
     "src/core/census/grpc_filter.c",
@@ -602,6 +618,7 @@ cc_library(
     "src/core/client_config/connector.c",
     "src/core/client_config/default_initial_connect_string.c",
     "src/core/client_config/initial_connect_string.c",
+    "src/core/client_config/lb_policies/load_balancer_api.c",
     "src/core/client_config/lb_policies/pick_first.c",
     "src/core/client_config/lb_policies/round_robin.c",
     "src/core/client_config/lb_policy.c",
@@ -616,7 +633,7 @@ cc_library(
     "src/core/client_config/subchannel_factory.c",
     "src/core/client_config/subchannel_index.c",
     "src/core/client_config/uri_parser.c",
-    "src/core/compression/algorithm.c",
+    "src/core/compression/compression_algorithm.c",
     "src/core/compression/message_compress.c",
     "src/core/debug/trace.c",
     "src/core/httpcli/format_request.c",
@@ -666,6 +683,7 @@ cc_library(
     "src/core/json/json_reader.c",
     "src/core/json/json_string.c",
     "src/core/json/json_writer.c",
+    "src/core/proto/grpc/lb/v0/load_balancer.pb.c",
     "src/core/surface/alarm.c",
     "src/core/surface/api_trace.c",
     "src/core/surface/byte_buffer.c",
@@ -717,10 +735,13 @@ cc_library(
     "src/core/transport/transport_op_string.c",
     "src/core/census/context.c",
     "src/core/census/initialize.c",
-    "src/core/census/log.c",
+    "src/core/census/mlog.c",
     "src/core/census/operation.c",
     "src/core/census/placeholders.c",
     "src/core/census/tracing.c",
+    "third_party/nanopb/pb_common.c",
+    "third_party/nanopb/pb_decode.c",
+    "third_party/nanopb/pb_encode.c",
   ],
   hdrs = [
     "include/grpc/byte_buffer.h",
@@ -788,11 +809,11 @@ cc_library(
     "src/cpp/client/credentials.cc",
     "src/cpp/client/generic_stub.cc",
     "src/cpp/client/insecure_credentials.cc",
-    "src/cpp/common/alarm.cc",
     "src/cpp/common/call.cc",
     "src/cpp/common/channel_arguments.cc",
     "src/cpp/common/completion_queue.cc",
     "src/cpp/common/rpc_method.cc",
+    "src/cpp/proto/proto_serializer.cc",
     "src/cpp/proto/proto_utils.cc",
     "src/cpp/server/async_generic_service.cc",
     "src/cpp/server/create_default_thread_pool.cc",
@@ -882,11 +903,11 @@ cc_library(
     "src/cpp/client/credentials.cc",
     "src/cpp/client/generic_stub.cc",
     "src/cpp/client/insecure_credentials.cc",
-    "src/cpp/common/alarm.cc",
     "src/cpp/common/call.cc",
     "src/cpp/common/channel_arguments.cc",
     "src/cpp/common/completion_queue.cc",
     "src/cpp/common/rpc_method.cc",
+    "src/cpp/proto/proto_serializer.cc",
     "src/cpp/proto/proto_utils.cc",
     "src/cpp/server/async_generic_service.cc",
     "src/cpp/server/create_default_thread_pool.cc",
@@ -1047,11 +1068,9 @@ objc_library(
     "src/core/support/env_linux.c",
     "src/core/support/env_posix.c",
     "src/core/support/env_win32.c",
-    "src/core/support/file.c",
-    "src/core/support/file_posix.c",
-    "src/core/support/file_win32.c",
     "src/core/support/histogram.c",
     "src/core/support/host_port.c",
+    "src/core/support/load_file.c",
     "src/core/support/log.c",
     "src/core/support/log_android.c",
     "src/core/support/log_linux.c",
@@ -1077,6 +1096,8 @@ objc_library(
     "src/core/support/time_precise.c",
     "src/core/support/time_win32.c",
     "src/core/support/tls_pthread.c",
+    "src/core/support/tmpfile_posix.c",
+    "src/core/support/tmpfile_win32.c",
     "src/core/support/wrap_memcpy.c",
   ],
   hdrs = [
@@ -1125,13 +1146,14 @@ objc_library(
     "src/core/profiling/timers.h",
     "src/core/support/block_annotate.h",
     "src/core/support/env.h",
-    "src/core/support/file.h",
+    "src/core/support/load_file.h",
     "src/core/support/murmur_hash.h",
     "src/core/support/stack_lockfree.h",
     "src/core/support/string.h",
     "src/core/support/string_win32.h",
     "src/core/support/thd_internal.h",
     "src/core/support/time_precise.h",
+    "src/core/support/tmpfile.h",
   ],
   includes = [
     "include",
@@ -1145,27 +1167,6 @@ objc_library(
 objc_library(
   name = "grpc_objc",
   srcs = [
-    "src/core/httpcli/httpcli_security_connector.c",
-    "src/core/security/base64.c",
-    "src/core/security/client_auth_filter.c",
-    "src/core/security/credentials.c",
-    "src/core/security/credentials_metadata.c",
-    "src/core/security/credentials_posix.c",
-    "src/core/security/credentials_win32.c",
-    "src/core/security/google_default_credentials.c",
-    "src/core/security/handshake.c",
-    "src/core/security/json_token.c",
-    "src/core/security/jwt_verifier.c",
-    "src/core/security/secure_endpoint.c",
-    "src/core/security/security_connector.c",
-    "src/core/security/security_context.c",
-    "src/core/security/server_auth_filter.c",
-    "src/core/security/server_secure_chttp2.c",
-    "src/core/surface/init_secure.c",
-    "src/core/surface/secure_channel_create.c",
-    "src/core/tsi/fake_transport_security.c",
-    "src/core/tsi/ssl_transport_security.c",
-    "src/core/tsi/transport_security.c",
     "src/core/census/grpc_context.c",
     "src/core/census/grpc_filter.c",
     "src/core/channel/channel_args.c",
@@ -1181,6 +1182,7 @@ objc_library(
     "src/core/client_config/connector.c",
     "src/core/client_config/default_initial_connect_string.c",
     "src/core/client_config/initial_connect_string.c",
+    "src/core/client_config/lb_policies/load_balancer_api.c",
     "src/core/client_config/lb_policies/pick_first.c",
     "src/core/client_config/lb_policies/round_robin.c",
     "src/core/client_config/lb_policy.c",
@@ -1195,7 +1197,7 @@ objc_library(
     "src/core/client_config/subchannel_factory.c",
     "src/core/client_config/subchannel_index.c",
     "src/core/client_config/uri_parser.c",
-    "src/core/compression/algorithm.c",
+    "src/core/compression/compression_algorithm.c",
     "src/core/compression/message_compress.c",
     "src/core/debug/trace.c",
     "src/core/httpcli/format_request.c",
@@ -1245,6 +1247,7 @@ objc_library(
     "src/core/json/json_reader.c",
     "src/core/json/json_string.c",
     "src/core/json/json_writer.c",
+    "src/core/proto/grpc/lb/v0/load_balancer.pb.c",
     "src/core/surface/alarm.c",
     "src/core/surface/api_trace.c",
     "src/core/surface/byte_buffer.c",
@@ -1294,12 +1297,36 @@ objc_library(
     "src/core/transport/static_metadata.c",
     "src/core/transport/transport.c",
     "src/core/transport/transport_op_string.c",
+    "src/core/httpcli/httpcli_security_connector.c",
+    "src/core/security/b64.c",
+    "src/core/security/client_auth_filter.c",
+    "src/core/security/credentials.c",
+    "src/core/security/credentials_metadata.c",
+    "src/core/security/credentials_posix.c",
+    "src/core/security/credentials_win32.c",
+    "src/core/security/google_default_credentials.c",
+    "src/core/security/handshake.c",
+    "src/core/security/json_token.c",
+    "src/core/security/jwt_verifier.c",
+    "src/core/security/secure_endpoint.c",
+    "src/core/security/security_connector.c",
+    "src/core/security/security_context.c",
+    "src/core/security/server_auth_filter.c",
+    "src/core/security/server_secure_chttp2.c",
+    "src/core/surface/init_secure.c",
+    "src/core/surface/secure_channel_create.c",
+    "src/core/tsi/fake_transport_security.c",
+    "src/core/tsi/ssl_transport_security.c",
+    "src/core/tsi/transport_security.c",
     "src/core/census/context.c",
     "src/core/census/initialize.c",
-    "src/core/census/log.c",
+    "src/core/census/mlog.c",
     "src/core/census/operation.c",
     "src/core/census/placeholders.c",
     "src/core/census/tracing.c",
+    "third_party/nanopb/pb_common.c",
+    "third_party/nanopb/pb_decode.c",
+    "third_party/nanopb/pb_encode.c",
   ],
   hdrs = [
     "include/grpc/grpc_security.h",
@@ -1309,20 +1336,6 @@ objc_library(
     "include/grpc/grpc.h",
     "include/grpc/status.h",
     "include/grpc/census.h",
-    "src/core/security/auth_filters.h",
-    "src/core/security/base64.h",
-    "src/core/security/credentials.h",
-    "src/core/security/handshake.h",
-    "src/core/security/json_token.h",
-    "src/core/security/jwt_verifier.h",
-    "src/core/security/secure_endpoint.h",
-    "src/core/security/security_connector.h",
-    "src/core/security/security_context.h",
-    "src/core/tsi/fake_transport_security.h",
-    "src/core/tsi/ssl_transport_security.h",
-    "src/core/tsi/ssl_types.h",
-    "src/core/tsi/transport_security.h",
-    "src/core/tsi/transport_security_interface.h",
     "src/core/census/grpc_filter.h",
     "src/core/channel/channel_args.h",
     "src/core/channel/channel_stack.h",
@@ -1337,6 +1350,7 @@ objc_library(
     "src/core/client_config/client_config.h",
     "src/core/client_config/connector.h",
     "src/core/client_config/initial_connect_string.h",
+    "src/core/client_config/lb_policies/load_balancer_api.h",
     "src/core/client_config/lb_policies/pick_first.h",
     "src/core/client_config/lb_policies/round_robin.h",
     "src/core/client_config/lb_policy.h",
@@ -1387,7 +1401,6 @@ objc_library(
     "src/core/iomgr/time_averaged_stats.h",
     "src/core/iomgr/timer.h",
     "src/core/iomgr/timer_heap.h",
-    "src/core/iomgr/timer_internal.h",
     "src/core/iomgr/udp_server.h",
     "src/core/iomgr/wakeup_fd_pipe.h",
     "src/core/iomgr/wakeup_fd_posix.h",
@@ -1398,6 +1411,7 @@ objc_library(
     "src/core/json/json_common.h",
     "src/core/json/json_reader.h",
     "src/core/json/json_writer.h",
+    "src/core/proto/grpc/lb/v0/load_balancer.pb.h",
     "src/core/statistics/census_interface.h",
     "src/core/statistics/census_rpc_stats.h",
     "src/core/surface/api_trace.h",
@@ -1437,9 +1451,27 @@ objc_library(
     "src/core/transport/static_metadata.h",
     "src/core/transport/transport.h",
     "src/core/transport/transport_impl.h",
+    "src/core/security/auth_filters.h",
+    "src/core/security/b64.h",
+    "src/core/security/credentials.h",
+    "src/core/security/handshake.h",
+    "src/core/security/json_token.h",
+    "src/core/security/jwt_verifier.h",
+    "src/core/security/secure_endpoint.h",
+    "src/core/security/security_connector.h",
+    "src/core/security/security_context.h",
+    "src/core/tsi/fake_transport_security.h",
+    "src/core/tsi/ssl_transport_security.h",
+    "src/core/tsi/ssl_types.h",
+    "src/core/tsi/transport_security.h",
+    "src/core/tsi/transport_security_interface.h",
     "src/core/census/aggregation.h",
-    "src/core/census/log.h",
+    "src/core/census/mlog.h",
     "src/core/census/rpc_metric_id.h",
+    "third_party/nanopb/pb.h",
+    "third_party/nanopb/pb_common.h",
+    "third_party/nanopb/pb_decode.h",
+    "third_party/nanopb/pb_encode.h",
   ],
   includes = [
     "include",

+ 1 - 9
INSTALL

@@ -141,15 +141,7 @@ Then execute the following for all the needed build dependencies
   $ make gtest.a gtest_main.a
   $ sudo cp libgtest.a libgtest_main.a /opt/local/lib
   $ sudo mkdir /opt/local/include/gtest
-  $ sudo cp -pr ../gtest-svn/include/gtest /opt/local/include/gtest 
-
-We will also need to make openssl and install it appropriately
-
-  $ cd <git directory>
-  $ cd third_party/openssl
-  $ ./config
-  $ sudo make install
-  $ cd ../../
+  $ sudo cp -pr ../gtest-svn/include/gtest /opt/local/include/gtest
 
 If you are going to make changes and need to regenerate the projects file,
 you will need to install certain modules for python.

文件差異過大導致無法顯示
+ 160 - 112
Makefile


+ 2 - 1
PYTHON-MANIFEST.in

@@ -1,4 +1,5 @@
-graft src/python/grpcio/grpc
+recursive-include src/python/grpcio/grpc *.c *.h *.py *.pyx *.pxd *.pxi *.python *.pem
+recursive-exclude src/python/grpcio/grpc/_cython *.so *.pyd
 graft src/python/grpcio/tests
 graft src/core
 graft include/grpc

+ 31 - 26
binding.gyp

@@ -504,11 +504,9 @@
         'src/core/support/env_linux.c',
         'src/core/support/env_posix.c',
         'src/core/support/env_win32.c',
-        'src/core/support/file.c',
-        'src/core/support/file_posix.c',
-        'src/core/support/file_win32.c',
         'src/core/support/histogram.c',
         'src/core/support/host_port.c',
+        'src/core/support/load_file.c',
         'src/core/support/log.c',
         'src/core/support/log_android.c',
         'src/core/support/log_linux.c',
@@ -534,6 +532,8 @@
         'src/core/support/time_precise.c',
         'src/core/support/time_win32.c',
         'src/core/support/tls_pthread.c',
+        'src/core/support/tmpfile_posix.c',
+        'src/core/support/tmpfile_win32.c',
         'src/core/support/wrap_memcpy.c',
       ],
       "conditions": [
@@ -558,27 +558,6 @@
         'grpc_codegen_lib',
       ],
       'sources': [
-        'src/core/httpcli/httpcli_security_connector.c',
-        'src/core/security/base64.c',
-        'src/core/security/client_auth_filter.c',
-        'src/core/security/credentials.c',
-        'src/core/security/credentials_metadata.c',
-        'src/core/security/credentials_posix.c',
-        'src/core/security/credentials_win32.c',
-        'src/core/security/google_default_credentials.c',
-        'src/core/security/handshake.c',
-        'src/core/security/json_token.c',
-        'src/core/security/jwt_verifier.c',
-        'src/core/security/secure_endpoint.c',
-        'src/core/security/security_connector.c',
-        'src/core/security/security_context.c',
-        'src/core/security/server_auth_filter.c',
-        'src/core/security/server_secure_chttp2.c',
-        'src/core/surface/init_secure.c',
-        'src/core/surface/secure_channel_create.c',
-        'src/core/tsi/fake_transport_security.c',
-        'src/core/tsi/ssl_transport_security.c',
-        'src/core/tsi/transport_security.c',
         'src/core/census/grpc_context.c',
         'src/core/census/grpc_filter.c',
         'src/core/channel/channel_args.c',
@@ -594,6 +573,7 @@
         'src/core/client_config/connector.c',
         'src/core/client_config/default_initial_connect_string.c',
         'src/core/client_config/initial_connect_string.c',
+        'src/core/client_config/lb_policies/load_balancer_api.c',
         'src/core/client_config/lb_policies/pick_first.c',
         'src/core/client_config/lb_policies/round_robin.c',
         'src/core/client_config/lb_policy.c',
@@ -608,7 +588,7 @@
         'src/core/client_config/subchannel_factory.c',
         'src/core/client_config/subchannel_index.c',
         'src/core/client_config/uri_parser.c',
-        'src/core/compression/algorithm.c',
+        'src/core/compression/compression_algorithm.c',
         'src/core/compression/message_compress.c',
         'src/core/debug/trace.c',
         'src/core/httpcli/format_request.c',
@@ -658,6 +638,7 @@
         'src/core/json/json_reader.c',
         'src/core/json/json_string.c',
         'src/core/json/json_writer.c',
+        'src/core/proto/grpc/lb/v0/load_balancer.pb.c',
         'src/core/surface/alarm.c',
         'src/core/surface/api_trace.c',
         'src/core/surface/byte_buffer.c',
@@ -707,12 +688,36 @@
         'src/core/transport/static_metadata.c',
         'src/core/transport/transport.c',
         'src/core/transport/transport_op_string.c',
+        'src/core/httpcli/httpcli_security_connector.c',
+        'src/core/security/b64.c',
+        'src/core/security/client_auth_filter.c',
+        'src/core/security/credentials.c',
+        'src/core/security/credentials_metadata.c',
+        'src/core/security/credentials_posix.c',
+        'src/core/security/credentials_win32.c',
+        'src/core/security/google_default_credentials.c',
+        'src/core/security/handshake.c',
+        'src/core/security/json_token.c',
+        'src/core/security/jwt_verifier.c',
+        'src/core/security/secure_endpoint.c',
+        'src/core/security/security_connector.c',
+        'src/core/security/security_context.c',
+        'src/core/security/server_auth_filter.c',
+        'src/core/security/server_secure_chttp2.c',
+        'src/core/surface/init_secure.c',
+        'src/core/surface/secure_channel_create.c',
+        'src/core/tsi/fake_transport_security.c',
+        'src/core/tsi/ssl_transport_security.c',
+        'src/core/tsi/transport_security.c',
         'src/core/census/context.c',
         'src/core/census/initialize.c',
-        'src/core/census/log.c',
+        'src/core/census/mlog.c',
         'src/core/census/operation.c',
         'src/core/census/placeholders.c',
         'src/core/census/tracing.c',
+        'third_party/nanopb/pb_common.c',
+        'third_party/nanopb/pb_decode.c',
+        'third_party/nanopb/pb_encode.c',
       ],
       "conditions": [
         ['OS == "mac"', {

+ 179 - 73
build.yaml

@@ -14,12 +14,12 @@ filegroups:
   - include/grpc/census.h
   headers:
   - src/core/census/aggregation.h
-  - src/core/census/log.h
+  - src/core/census/mlog.h
   - src/core/census/rpc_metric_id.h
   src:
   - src/core/census/context.c
   - src/core/census/initialize.c
-  - src/core/census/log.c
+  - src/core/census/mlog.c
   - src/core/census/operation.c
   - src/core/census/placeholders.c
   - src/core/census/tracing.c
@@ -57,13 +57,14 @@ filegroups:
   - src/core/profiling/timers.h
   - src/core/support/block_annotate.h
   - src/core/support/env.h
-  - src/core/support/file.h
+  - src/core/support/load_file.h
   - src/core/support/murmur_hash.h
   - src/core/support/stack_lockfree.h
   - src/core/support/string.h
   - src/core/support/string_win32.h
   - src/core/support/thd_internal.h
   - src/core/support/time_precise.h
+  - src/core/support/tmpfile.h
   src:
   - src/core/profiling/basic_timers.c
   - src/core/profiling/stap_timers.c
@@ -77,11 +78,9 @@ filegroups:
   - src/core/support/env_linux.c
   - src/core/support/env_posix.c
   - src/core/support/env_win32.c
-  - src/core/support/file.c
-  - src/core/support/file_posix.c
-  - src/core/support/file_win32.c
   - src/core/support/histogram.c
   - src/core/support/host_port.c
+  - src/core/support/load_file.c
   - src/core/support/log.c
   - src/core/support/log_android.c
   - src/core/support/log_linux.c
@@ -107,6 +106,8 @@ filegroups:
   - src/core/support/time_precise.c
   - src/core/support/time_win32.c
   - src/core/support/tls_pthread.c
+  - src/core/support/tmpfile_posix.c
+  - src/core/support/tmpfile_win32.c
   - src/core/support/wrap_memcpy.c
 - name: gpr_codegen
   public_headers:
@@ -183,11 +184,11 @@ filegroups:
   - src/cpp/client/credentials.cc
   - src/cpp/client/generic_stub.cc
   - src/cpp/client/insecure_credentials.cc
-  - src/cpp/common/alarm.cc
   - src/cpp/common/call.cc
   - src/cpp/common/channel_arguments.cc
   - src/cpp/common/completion_queue.cc
   - src/cpp/common/rpc_method.cc
+  - src/cpp/proto/proto_serializer.cc
   - src/cpp/proto/proto_utils.cc
   - src/cpp/server/async_generic_service.cc
   - src/cpp/server/create_default_thread_pool.cc
@@ -224,6 +225,7 @@ filegroups:
   - src/core/client_config/client_config.h
   - src/core/client_config/connector.h
   - src/core/client_config/initial_connect_string.h
+  - src/core/client_config/lb_policies/load_balancer_api.h
   - src/core/client_config/lb_policies/pick_first.h
   - src/core/client_config/lb_policies/round_robin.h
   - src/core/client_config/lb_policy.h
@@ -274,7 +276,6 @@ filegroups:
   - src/core/iomgr/time_averaged_stats.h
   - src/core/iomgr/timer.h
   - src/core/iomgr/timer_heap.h
-  - src/core/iomgr/timer_internal.h
   - src/core/iomgr/udp_server.h
   - src/core/iomgr/wakeup_fd_pipe.h
   - src/core/iomgr/wakeup_fd_posix.h
@@ -285,6 +286,7 @@ filegroups:
   - src/core/json/json_common.h
   - src/core/json/json_reader.h
   - src/core/json/json_writer.h
+  - src/core/proto/grpc/lb/v0/load_balancer.pb.h
   - src/core/statistics/census_interface.h
   - src/core/statistics/census_rpc_stats.h
   - src/core/surface/api_trace.h
@@ -340,6 +342,7 @@ filegroups:
   - src/core/client_config/connector.c
   - src/core/client_config/default_initial_connect_string.c
   - src/core/client_config/initial_connect_string.c
+  - src/core/client_config/lb_policies/load_balancer_api.c
   - src/core/client_config/lb_policies/pick_first.c
   - src/core/client_config/lb_policies/round_robin.c
   - src/core/client_config/lb_policy.c
@@ -354,7 +357,7 @@ filegroups:
   - src/core/client_config/subchannel_factory.c
   - src/core/client_config/subchannel_index.c
   - src/core/client_config/uri_parser.c
-  - src/core/compression/algorithm.c
+  - src/core/compression/compression_algorithm.c
   - src/core/compression/message_compress.c
   - src/core/debug/trace.c
   - src/core/httpcli/format_request.c
@@ -404,6 +407,7 @@ filegroups:
   - src/core/json/json_reader.c
   - src/core/json/json_string.c
   - src/core/json/json_writer.c
+  - src/core/proto/grpc/lb/v0/load_balancer.pb.c
   - src/core/surface/alarm.c
   - src/core/surface/api_trace.c
   - src/core/surface/byte_buffer.c
@@ -453,6 +457,44 @@ filegroups:
   - src/core/transport/static_metadata.c
   - src/core/transport/transport.c
   - src/core/transport/transport_op_string.c
+- name: grpc_secure
+  headers:
+  - src/core/security/auth_filters.h
+  - src/core/security/b64.h
+  - src/core/security/credentials.h
+  - src/core/security/handshake.h
+  - src/core/security/json_token.h
+  - src/core/security/jwt_verifier.h
+  - src/core/security/secure_endpoint.h
+  - src/core/security/security_connector.h
+  - src/core/security/security_context.h
+  - src/core/tsi/fake_transport_security.h
+  - src/core/tsi/ssl_transport_security.h
+  - src/core/tsi/ssl_types.h
+  - src/core/tsi/transport_security.h
+  - src/core/tsi/transport_security_interface.h
+  src:
+  - src/core/httpcli/httpcli_security_connector.c
+  - src/core/security/b64.c
+  - src/core/security/client_auth_filter.c
+  - src/core/security/credentials.c
+  - src/core/security/credentials_metadata.c
+  - src/core/security/credentials_posix.c
+  - src/core/security/credentials_win32.c
+  - src/core/security/google_default_credentials.c
+  - src/core/security/handshake.c
+  - src/core/security/json_token.c
+  - src/core/security/jwt_verifier.c
+  - src/core/security/secure_endpoint.c
+  - src/core/security/security_connector.c
+  - src/core/security/security_context.c
+  - src/core/security/server_auth_filter.c
+  - src/core/security/server_secure_chttp2.c
+  - src/core/surface/init_secure.c
+  - src/core/surface/secure_channel_create.c
+  - src/core/tsi/fake_transport_security.c
+  - src/core/tsi/ssl_transport_security.c
+  - src/core/tsi/transport_security.c
 - name: grpc_test_util_base
   headers:
   - test/core/end2end/cq_verifier.h
@@ -471,6 +513,16 @@ filegroups:
   - test/core/util/port_posix.c
   - test/core/util/port_windows.c
   - test/core/util/slice_splitter.c
+- name: nanopb
+  headers:
+  - third_party/nanopb/pb.h
+  - third_party/nanopb/pb_common.h
+  - third_party/nanopb/pb_decode.h
+  - third_party/nanopb/pb_encode.h
+  src:
+  - third_party/nanopb/pb_common.c
+  - third_party/nanopb/pb_decode.c
+  - third_party/nanopb/pb_encode.c
 libs:
 - name: gpr
   build: all
@@ -496,43 +548,6 @@ libs:
   language: c
   public_headers:
   - include/grpc/grpc_security.h
-  headers:
-  - src/core/security/auth_filters.h
-  - src/core/security/base64.h
-  - src/core/security/credentials.h
-  - src/core/security/handshake.h
-  - src/core/security/json_token.h
-  - src/core/security/jwt_verifier.h
-  - src/core/security/secure_endpoint.h
-  - src/core/security/security_connector.h
-  - src/core/security/security_context.h
-  - src/core/tsi/fake_transport_security.h
-  - src/core/tsi/ssl_transport_security.h
-  - src/core/tsi/ssl_types.h
-  - src/core/tsi/transport_security.h
-  - src/core/tsi/transport_security_interface.h
-  src:
-  - src/core/httpcli/httpcli_security_connector.c
-  - src/core/security/base64.c
-  - src/core/security/client_auth_filter.c
-  - src/core/security/credentials.c
-  - src/core/security/credentials_metadata.c
-  - src/core/security/credentials_posix.c
-  - src/core/security/credentials_win32.c
-  - src/core/security/google_default_credentials.c
-  - src/core/security/handshake.c
-  - src/core/security/json_token.c
-  - src/core/security/jwt_verifier.c
-  - src/core/security/secure_endpoint.c
-  - src/core/security/security_connector.c
-  - src/core/security/security_context.c
-  - src/core/security/server_auth_filter.c
-  - src/core/security/server_secure_chttp2.c
-  - src/core/surface/init_secure.c
-  - src/core/surface/secure_channel_create.c
-  - src/core/tsi/fake_transport_security.c
-  - src/core/tsi/ssl_transport_security.c
-  - src/core/tsi/transport_security.c
   deps:
   - gpr
   - grpc_codegen_lib
@@ -541,7 +556,9 @@ libs:
   dll: true
   filegroups:
   - grpc_base
+  - grpc_secure
   - census
+  - nanopb
   secure: true
   vs_packages:
   - grpc.dependencies.openssl
@@ -563,6 +580,27 @@ libs:
   - gpr_codegen
   secure: false
   vs_project_guid: '{A828FD72-44CE-4EA5-8966-6E4624458D58}'
+- name: grpc_dll
+  build: private
+  language: c
+  src: []
+  deps:
+  - gpr
+  - grpc
+  build_system:
+  - visual_studio
+  deps_linkage: static
+  dll_def: grpc.def
+  vs_config_type: DynamicLibrary
+  vs_packages:
+  - grpc.dependencies.openssl
+  - grpc.dependencies.zlib
+  vs_project_guid: '{A2F6CBBA-A553-41B3-A7DE-F26DECCC27F0}'
+  vs_props:
+  - zlib
+  - openssl
+  - winsock
+  - global
 - name: grpc_test_util
   build: private
   language: c
@@ -606,6 +644,7 @@ libs:
   filegroups:
   - grpc_base
   - census
+  - nanopb
   secure: false
   vs_project_guid: '{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}'
 - name: grpc_zookeeper
@@ -733,6 +772,7 @@ libs:
   - test/cpp/util/create_test_channel.h
   - test/cpp/util/string_ref_helper.h
   - test/cpp/util/subprocess.h
+  - test/cpp/util/test_credentials_provider.h
   src:
   - src/proto/grpc/testing/echo_messages.proto
   - src/proto/grpc/testing/echo.proto
@@ -743,6 +783,7 @@ libs:
   - test/cpp/util/create_test_channel.cc
   - test/cpp/util/string_ref_helper.cc
   - test/cpp/util/subprocess.cc
+  - test/cpp/util/test_credentials_provider.cc
   deps:
   - grpc++
   - grpc_test_util
@@ -793,6 +834,8 @@ libs:
   - gpr_codegen
   secure: false
   vs_project_guid: '{B6E81D84-2ACB-41B8-8781-493A944C7817}'
+  vs_props:
+  - protoc
 - name: interop_client_helper
   build: private
   language: c++
@@ -846,7 +889,7 @@ libs:
   - src/proto/grpc/testing/empty.proto
   - src/proto/grpc/testing/messages.proto
   - src/proto/grpc/testing/test.proto
-  - test/cpp/interop/server.cc
+  - test/cpp/interop/server_main.cc
   deps:
   - interop_server_helper
   - grpc++_test_util
@@ -870,7 +913,7 @@ libs:
   - test/cpp/qps/report.h
   - test/cpp/qps/server.h
   - test/cpp/qps/stats.h
-  - test/cpp/qps/timer.h
+  - test/cpp/qps/usage_timer.h
   - test/cpp/util/benchmark_config.h
   src:
   - src/proto/grpc/testing/messages.proto
@@ -888,7 +931,7 @@ libs:
   - test/cpp/qps/report.cc
   - test/cpp/qps/server_async.cc
   - test/cpp/qps/server_sync.cc
-  - test/cpp/qps/timer.cc
+  - test/cpp/qps/usage_timer.cc
   - test/cpp/util/benchmark_config.cc
   deps:
   - grpc_test_util
@@ -972,16 +1015,6 @@ targets:
   - grpc
   - gpr_test_util
   - gpr
-- name: census_log_test
-  build: test
-  language: c
-  src:
-  - test/core/census/log_test.c
-  deps:
-  - grpc_test_util
-  - grpc
-  - gpr_test_util
-  - gpr
 - name: channel_create_test
   build: test
   language: c
@@ -1203,27 +1236,27 @@ targets:
   deps:
   - gpr_test_util
   - gpr
-- name: gpr_file_test
+- name: gpr_histogram_test
   build: test
   language: c
   src:
-  - test/core/support/file_test.c
+  - test/core/support/histogram_test.c
   deps:
   - gpr_test_util
   - gpr
-- name: gpr_histogram_test
+- name: gpr_host_port_test
   build: test
   language: c
   src:
-  - test/core/support/histogram_test.c
+  - test/core/support/host_port_test.c
   deps:
   - gpr_test_util
   - gpr
-- name: gpr_host_port_test
+- name: gpr_load_file_test
   build: test
   language: c
   src:
-  - test/core/support/host_port_test.c
+  - test/core/support/load_file_test.c
   deps:
   - gpr_test_util
   - gpr
@@ -1320,11 +1353,11 @@ targets:
   - grpc
   - gpr_test_util
   - gpr
-- name: grpc_base64_test
+- name: grpc_b64_test
   build: test
   language: c
   src:
-  - test/core/security/base64_test.c
+  - test/core/security/b64_test.c
   deps:
   - grpc_test_util
   - grpc
@@ -1636,6 +1669,16 @@ targets:
   - grpc
   - gpr_test_util
   - gpr
+- name: mlog_test
+  build: test
+  language: c
+  src:
+  - test/core/census/mlog_test.c
+  deps:
+  - grpc_test_util
+  - grpc
+  - gpr_test_util
+  - gpr
 - name: multiple_server_queues_test
   build: test
   language: c
@@ -1928,6 +1971,7 @@ targets:
   - linux
   - posix
 - name: alarm_cpp_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -1940,6 +1984,7 @@ targets:
   - gpr_test_util
   - gpr
 - name: async_end2end_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -1986,6 +2031,7 @@ targets:
   - linux
   - posix
 - name: auth_property_iterator_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -1998,6 +2044,7 @@ targets:
   - gpr_test_util
   - gpr
 - name: channel_arguments_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2007,6 +2054,7 @@ targets:
   - grpc
   - gpr
 - name: cli_call_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2019,6 +2067,7 @@ targets:
   - gpr_test_util
   - gpr
 - name: client_crash_test
+  gtest: true
   cpu_cost: 0.1
   build: test
   language: c++
@@ -2049,6 +2098,7 @@ targets:
   - gpr_test_util
   - gpr
 - name: credentials_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2058,6 +2108,7 @@ targets:
   - grpc
   - gpr
 - name: cxx_byte_buffer_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2069,6 +2120,7 @@ targets:
   - gpr_test_util
   - gpr
 - name: cxx_slice_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2080,6 +2132,7 @@ targets:
   - gpr_test_util
   - gpr
 - name: cxx_string_ref_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2087,6 +2140,7 @@ targets:
   deps:
   - grpc++
 - name: cxx_time_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2098,6 +2152,7 @@ targets:
   - gpr_test_util
   - gpr
 - name: end2end_test
+  gtest: true
   cpu_cost: 0.5
   build: test
   language: c++
@@ -2128,6 +2183,7 @@ targets:
   - linux
   - posix
 - name: generic_end2end_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2203,7 +2259,20 @@ targets:
   secure: false
   vs_config_type: Application
   vs_project_guid: '{069E9D05-B78B-4751-9252-D21EBAE7DE8E}'
+- name: grpclb_api_test
+  gtest: true
+  build: test
+  language: c++
+  src:
+  - src/proto/grpc/lb/v0/load_balancer.proto
+  - test/cpp/grpclb/grpclb_api_test.cc
+  deps:
+  - grpc++_test_util
+  - grpc_test_util
+  - grpc++
+  - grpc
 - name: hybrid_end2end_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2283,6 +2352,7 @@ targets:
   - gpr
   - grpc++_test_config
 - name: mock_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2327,6 +2397,7 @@ targets:
   - linux
   - posix
 - name: qps_openloop_test
+  cpu_cost: 10
   build: test
   language: c++
   src:
@@ -2359,8 +2430,6 @@ targets:
   - gpr_test_util
   - gpr
   - grpc++_test_config
-  exclude_configs:
-  - tsan
   platforms:
   - mac
   - linux
@@ -2419,6 +2488,7 @@ targets:
   - gpr
   - grpc++_test_config
 - name: secure_auth_context_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2448,6 +2518,7 @@ targets:
   - linux
   - posix
 - name: server_crash_test
+  gtest: true
   cpu_cost: 0.1
   build: test
   language: c++
@@ -2478,6 +2549,7 @@ targets:
   - gpr_test_util
   - gpr
 - name: shutdown_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2501,6 +2573,7 @@ targets:
   - gpr_test_util
   - gpr
 - name: streaming_throughput_test
+  gtest: true
   build: test
   language: c++
   src:
@@ -2577,6 +2650,7 @@ targets:
   - linux
   - posix
 - name: thread_stress_test
+  gtest: true
   cpu_cost: 100
   build: test
   language: c++
@@ -2590,6 +2664,7 @@ targets:
   - gpr_test_util
   - gpr
 - name: zookeeper_test
+  gtest: true
   build: test
   run: false
   language: c++
@@ -2648,7 +2723,7 @@ configs:
     test_environ:
       ASAN_OPTIONS: detect_leaks=1:color=always
       LSAN_OPTIONS: suppressions=tools/lsan_suppressions.txt:report_objects=1
-    timeout_multiplier: 1.5
+    timeout_multiplier: 3
   asan-noleaks:
     CC: clang
     CPPFLAGS: -O0 -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument
@@ -2660,7 +2735,7 @@ configs:
     compile_the_world: true
     test_environ:
       ASAN_OPTIONS: detect_leaks=0:color=always
-    timeout_multiplier: 1.5
+    timeout_multiplier: 3
   basicprof:
     CPPFLAGS: -O2 -DGRPC_BASIC_PROFILER -DGRPC_TIMERS_RDTSC
     DEFINES: NDEBUG
@@ -2699,7 +2774,7 @@ configs:
       -fPIE -pie $(if $(JENKINS_BUILD),-Wl$(comma)-Ttext-segment=0x7e0000000000,)
     LDXX: clang++
     compile_the_world: true
-    timeout_multiplier: 2
+    timeout_multiplier: 4
   mutrace:
     CPPFLAGS: -O0
     DEFINES: _DEBUG DEBUG
@@ -2721,7 +2796,7 @@ configs:
     compile_the_world: true
     test_environ:
       TSAN_OPTIONS: suppressions=tools/tsan_suppressions.txt:halt_on_error=1:second_deadlock_stack=1
-    timeout_multiplier: 2
+    timeout_multiplier: 5
   ubsan:
     CC: clang
     CPPFLAGS: -O1 -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument
@@ -2780,6 +2855,37 @@ node_modules:
   - src/node/ext/server.cc
   - src/node/ext/server_credentials.cc
   - src/node/ext/timeval.cc
+openssl_fallback:
+  base_uri: http://openssl.org/source/
+  extraction_dir: openssl-1.0.2f
+  tarball: openssl-1.0.2f.tar.gz
+php_config_m4:
+  deps:
+  - grpc
+  - gpr
+  - boringssl
+  headers:
+  - src/php/ext/grpc/byte_buffer.h
+  - src/php/ext/grpc/call.h
+  - src/php/ext/grpc/call_credentials.h
+  - src/php/ext/grpc/channel.h
+  - src/php/ext/grpc/channel_credentials.h
+  - src/php/ext/grpc/completion_queue.h
+  - src/php/ext/grpc/php_grpc.h
+  - src/php/ext/grpc/server.h
+  - src/php/ext/grpc/server_credentials.h
+  - src/php/ext/grpc/timeval.h
+  src:
+  - src/php/ext/grpc/byte_buffer.c
+  - src/php/ext/grpc/call.c
+  - src/php/ext/grpc/call_credentials.c
+  - src/php/ext/grpc/channel.c
+  - src/php/ext/grpc/channel_credentials.c
+  - src/php/ext/grpc/completion_queue.c
+  - src/php/ext/grpc/php_grpc.c
+  - src/php/ext/grpc/server.c
+  - src/php/ext/grpc/server_credentials.c
+  - src/php/ext/grpc/timeval.c
 python_dependencies:
   deps:
   - grpc

+ 606 - 0
config.m4

@@ -0,0 +1,606 @@
+PHP_ARG_ENABLE(grpc, whether to enable grpc support,
+[  --enable-grpc           Enable grpc support])
+
+if test "$PHP_GRPC" != "no"; then
+  dnl Write more examples of tests here...
+
+  dnl # --with-grpc -> add include path
+  PHP_ADD_INCLUDE(../../grpc/include)
+  PHP_ADD_INCLUDE(../../grpc/src/php/ext/grpc)
+  PHP_ADD_INCLUDE(../../grpc/third_party/boringssl/include)
+
+  LIBS="-lpthread $LIBS"
+
+  GRPC_SHARED_LIBADD="-lpthread $GRPC_SHARED_LIBADD"
+  PHP_ADD_LIBRARY(pthread)
+
+  PHP_ADD_LIBRARY(dl,,GRPC_SHARED_LIBADD)
+  PHP_ADD_LIBRARY(dl)
+
+  case $host in
+    *darwin*) ;;
+    *)
+      PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD)
+      PHP_ADD_LIBRARY(rt)
+      ;;
+  esac
+
+  PHP_NEW_EXTENSION(grpc,
+    src/php/ext/grpc/byte_buffer.c \
+    src/php/ext/grpc/call.c \
+    src/php/ext/grpc/call_credentials.c \
+    src/php/ext/grpc/channel.c \
+    src/php/ext/grpc/channel_credentials.c \
+    src/php/ext/grpc/completion_queue.c \
+    src/php/ext/grpc/php_grpc.c \
+    src/php/ext/grpc/server.c \
+    src/php/ext/grpc/server_credentials.c \
+    src/php/ext/grpc/timeval.c \
+    src/core/profiling/basic_timers.c \
+    src/core/profiling/stap_timers.c \
+    src/core/support/alloc.c \
+    src/core/support/avl.c \
+    src/core/support/cmdline.c \
+    src/core/support/cpu_iphone.c \
+    src/core/support/cpu_linux.c \
+    src/core/support/cpu_posix.c \
+    src/core/support/cpu_windows.c \
+    src/core/support/env_linux.c \
+    src/core/support/env_posix.c \
+    src/core/support/env_win32.c \
+    src/core/support/histogram.c \
+    src/core/support/host_port.c \
+    src/core/support/load_file.c \
+    src/core/support/log.c \
+    src/core/support/log_android.c \
+    src/core/support/log_linux.c \
+    src/core/support/log_posix.c \
+    src/core/support/log_win32.c \
+    src/core/support/murmur_hash.c \
+    src/core/support/slice.c \
+    src/core/support/slice_buffer.c \
+    src/core/support/stack_lockfree.c \
+    src/core/support/string.c \
+    src/core/support/string_posix.c \
+    src/core/support/string_win32.c \
+    src/core/support/subprocess_posix.c \
+    src/core/support/subprocess_windows.c \
+    src/core/support/sync.c \
+    src/core/support/sync_posix.c \
+    src/core/support/sync_win32.c \
+    src/core/support/thd.c \
+    src/core/support/thd_posix.c \
+    src/core/support/thd_win32.c \
+    src/core/support/time.c \
+    src/core/support/time_posix.c \
+    src/core/support/time_precise.c \
+    src/core/support/time_win32.c \
+    src/core/support/tls_pthread.c \
+    src/core/support/tmpfile_posix.c \
+    src/core/support/tmpfile_win32.c \
+    src/core/support/wrap_memcpy.c \
+    src/core/census/grpc_context.c \
+    src/core/census/grpc_filter.c \
+    src/core/channel/channel_args.c \
+    src/core/channel/channel_stack.c \
+    src/core/channel/client_channel.c \
+    src/core/channel/client_uchannel.c \
+    src/core/channel/compress_filter.c \
+    src/core/channel/connected_channel.c \
+    src/core/channel/http_client_filter.c \
+    src/core/channel/http_server_filter.c \
+    src/core/channel/subchannel_call_holder.c \
+    src/core/client_config/client_config.c \
+    src/core/client_config/connector.c \
+    src/core/client_config/default_initial_connect_string.c \
+    src/core/client_config/initial_connect_string.c \
+    src/core/client_config/lb_policies/load_balancer_api.c \
+    src/core/client_config/lb_policies/pick_first.c \
+    src/core/client_config/lb_policies/round_robin.c \
+    src/core/client_config/lb_policy.c \
+    src/core/client_config/lb_policy_factory.c \
+    src/core/client_config/lb_policy_registry.c \
+    src/core/client_config/resolver.c \
+    src/core/client_config/resolver_factory.c \
+    src/core/client_config/resolver_registry.c \
+    src/core/client_config/resolvers/dns_resolver.c \
+    src/core/client_config/resolvers/sockaddr_resolver.c \
+    src/core/client_config/subchannel.c \
+    src/core/client_config/subchannel_factory.c \
+    src/core/client_config/subchannel_index.c \
+    src/core/client_config/uri_parser.c \
+    src/core/compression/compression_algorithm.c \
+    src/core/compression/message_compress.c \
+    src/core/debug/trace.c \
+    src/core/httpcli/format_request.c \
+    src/core/httpcli/httpcli.c \
+    src/core/httpcli/parser.c \
+    src/core/iomgr/closure.c \
+    src/core/iomgr/endpoint.c \
+    src/core/iomgr/endpoint_pair_posix.c \
+    src/core/iomgr/endpoint_pair_windows.c \
+    src/core/iomgr/exec_ctx.c \
+    src/core/iomgr/executor.c \
+    src/core/iomgr/fd_posix.c \
+    src/core/iomgr/iocp_windows.c \
+    src/core/iomgr/iomgr.c \
+    src/core/iomgr/iomgr_posix.c \
+    src/core/iomgr/iomgr_windows.c \
+    src/core/iomgr/pollset_multipoller_with_epoll.c \
+    src/core/iomgr/pollset_multipoller_with_poll_posix.c \
+    src/core/iomgr/pollset_posix.c \
+    src/core/iomgr/pollset_set_posix.c \
+    src/core/iomgr/pollset_set_windows.c \
+    src/core/iomgr/pollset_windows.c \
+    src/core/iomgr/resolve_address_posix.c \
+    src/core/iomgr/resolve_address_windows.c \
+    src/core/iomgr/sockaddr_utils.c \
+    src/core/iomgr/socket_utils_common_posix.c \
+    src/core/iomgr/socket_utils_linux.c \
+    src/core/iomgr/socket_utils_posix.c \
+    src/core/iomgr/socket_windows.c \
+    src/core/iomgr/tcp_client_posix.c \
+    src/core/iomgr/tcp_client_windows.c \
+    src/core/iomgr/tcp_posix.c \
+    src/core/iomgr/tcp_server_posix.c \
+    src/core/iomgr/tcp_server_windows.c \
+    src/core/iomgr/tcp_windows.c \
+    src/core/iomgr/time_averaged_stats.c \
+    src/core/iomgr/timer.c \
+    src/core/iomgr/timer_heap.c \
+    src/core/iomgr/udp_server.c \
+    src/core/iomgr/wakeup_fd_eventfd.c \
+    src/core/iomgr/wakeup_fd_nospecial.c \
+    src/core/iomgr/wakeup_fd_pipe.c \
+    src/core/iomgr/wakeup_fd_posix.c \
+    src/core/iomgr/workqueue_posix.c \
+    src/core/iomgr/workqueue_windows.c \
+    src/core/json/json.c \
+    src/core/json/json_reader.c \
+    src/core/json/json_string.c \
+    src/core/json/json_writer.c \
+    src/core/proto/grpc/lb/v0/load_balancer.pb.c \
+    src/core/surface/alarm.c \
+    src/core/surface/api_trace.c \
+    src/core/surface/byte_buffer.c \
+    src/core/surface/byte_buffer_reader.c \
+    src/core/surface/call.c \
+    src/core/surface/call_details.c \
+    src/core/surface/call_log_batch.c \
+    src/core/surface/channel.c \
+    src/core/surface/channel_connectivity.c \
+    src/core/surface/channel_create.c \
+    src/core/surface/channel_ping.c \
+    src/core/surface/completion_queue.c \
+    src/core/surface/event_string.c \
+    src/core/surface/init.c \
+    src/core/surface/lame_client.c \
+    src/core/surface/metadata_array.c \
+    src/core/surface/server.c \
+    src/core/surface/server_chttp2.c \
+    src/core/surface/server_create.c \
+    src/core/surface/validate_metadata.c \
+    src/core/surface/version.c \
+    src/core/transport/byte_stream.c \
+    src/core/transport/chttp2/alpn.c \
+    src/core/transport/chttp2/bin_encoder.c \
+    src/core/transport/chttp2/frame_data.c \
+    src/core/transport/chttp2/frame_goaway.c \
+    src/core/transport/chttp2/frame_ping.c \
+    src/core/transport/chttp2/frame_rst_stream.c \
+    src/core/transport/chttp2/frame_settings.c \
+    src/core/transport/chttp2/frame_window_update.c \
+    src/core/transport/chttp2/hpack_encoder.c \
+    src/core/transport/chttp2/hpack_parser.c \
+    src/core/transport/chttp2/hpack_table.c \
+    src/core/transport/chttp2/huffsyms.c \
+    src/core/transport/chttp2/incoming_metadata.c \
+    src/core/transport/chttp2/parsing.c \
+    src/core/transport/chttp2/status_conversion.c \
+    src/core/transport/chttp2/stream_lists.c \
+    src/core/transport/chttp2/stream_map.c \
+    src/core/transport/chttp2/timeout_encoding.c \
+    src/core/transport/chttp2/varint.c \
+    src/core/transport/chttp2/writing.c \
+    src/core/transport/chttp2_transport.c \
+    src/core/transport/connectivity_state.c \
+    src/core/transport/metadata.c \
+    src/core/transport/metadata_batch.c \
+    src/core/transport/static_metadata.c \
+    src/core/transport/transport.c \
+    src/core/transport/transport_op_string.c \
+    src/core/httpcli/httpcli_security_connector.c \
+    src/core/security/b64.c \
+    src/core/security/client_auth_filter.c \
+    src/core/security/credentials.c \
+    src/core/security/credentials_metadata.c \
+    src/core/security/credentials_posix.c \
+    src/core/security/credentials_win32.c \
+    src/core/security/google_default_credentials.c \
+    src/core/security/handshake.c \
+    src/core/security/json_token.c \
+    src/core/security/jwt_verifier.c \
+    src/core/security/secure_endpoint.c \
+    src/core/security/security_connector.c \
+    src/core/security/security_context.c \
+    src/core/security/server_auth_filter.c \
+    src/core/security/server_secure_chttp2.c \
+    src/core/surface/init_secure.c \
+    src/core/surface/secure_channel_create.c \
+    src/core/tsi/fake_transport_security.c \
+    src/core/tsi/ssl_transport_security.c \
+    src/core/tsi/transport_security.c \
+    src/core/census/context.c \
+    src/core/census/initialize.c \
+    src/core/census/mlog.c \
+    src/core/census/operation.c \
+    src/core/census/placeholders.c \
+    src/core/census/tracing.c \
+    third_party/nanopb/pb_common.c \
+    third_party/nanopb/pb_decode.c \
+    third_party/nanopb/pb_encode.c \
+    src/boringssl/err_data.c \
+    third_party/boringssl/crypto/aes/aes.c \
+    third_party/boringssl/crypto/aes/mode_wrappers.c \
+    third_party/boringssl/crypto/asn1/a_bitstr.c \
+    third_party/boringssl/crypto/asn1/a_bool.c \
+    third_party/boringssl/crypto/asn1/a_bytes.c \
+    third_party/boringssl/crypto/asn1/a_d2i_fp.c \
+    third_party/boringssl/crypto/asn1/a_dup.c \
+    third_party/boringssl/crypto/asn1/a_enum.c \
+    third_party/boringssl/crypto/asn1/a_gentm.c \
+    third_party/boringssl/crypto/asn1/a_i2d_fp.c \
+    third_party/boringssl/crypto/asn1/a_int.c \
+    third_party/boringssl/crypto/asn1/a_mbstr.c \
+    third_party/boringssl/crypto/asn1/a_object.c \
+    third_party/boringssl/crypto/asn1/a_octet.c \
+    third_party/boringssl/crypto/asn1/a_print.c \
+    third_party/boringssl/crypto/asn1/a_strnid.c \
+    third_party/boringssl/crypto/asn1/a_time.c \
+    third_party/boringssl/crypto/asn1/a_type.c \
+    third_party/boringssl/crypto/asn1/a_utctm.c \
+    third_party/boringssl/crypto/asn1/a_utf8.c \
+    third_party/boringssl/crypto/asn1/asn1_lib.c \
+    third_party/boringssl/crypto/asn1/asn1_par.c \
+    third_party/boringssl/crypto/asn1/asn_pack.c \
+    third_party/boringssl/crypto/asn1/bio_asn1.c \
+    third_party/boringssl/crypto/asn1/bio_ndef.c \
+    third_party/boringssl/crypto/asn1/f_enum.c \
+    third_party/boringssl/crypto/asn1/f_int.c \
+    third_party/boringssl/crypto/asn1/f_string.c \
+    third_party/boringssl/crypto/asn1/t_bitst.c \
+    third_party/boringssl/crypto/asn1/t_pkey.c \
+    third_party/boringssl/crypto/asn1/tasn_dec.c \
+    third_party/boringssl/crypto/asn1/tasn_enc.c \
+    third_party/boringssl/crypto/asn1/tasn_fre.c \
+    third_party/boringssl/crypto/asn1/tasn_new.c \
+    third_party/boringssl/crypto/asn1/tasn_prn.c \
+    third_party/boringssl/crypto/asn1/tasn_typ.c \
+    third_party/boringssl/crypto/asn1/tasn_utl.c \
+    third_party/boringssl/crypto/asn1/x_bignum.c \
+    third_party/boringssl/crypto/asn1/x_long.c \
+    third_party/boringssl/crypto/base64/base64.c \
+    third_party/boringssl/crypto/bio/bio.c \
+    third_party/boringssl/crypto/bio/bio_mem.c \
+    third_party/boringssl/crypto/bio/buffer.c \
+    third_party/boringssl/crypto/bio/connect.c \
+    third_party/boringssl/crypto/bio/fd.c \
+    third_party/boringssl/crypto/bio/file.c \
+    third_party/boringssl/crypto/bio/hexdump.c \
+    third_party/boringssl/crypto/bio/pair.c \
+    third_party/boringssl/crypto/bio/printf.c \
+    third_party/boringssl/crypto/bio/socket.c \
+    third_party/boringssl/crypto/bio/socket_helper.c \
+    third_party/boringssl/crypto/bn/add.c \
+    third_party/boringssl/crypto/bn/asm/x86_64-gcc.c \
+    third_party/boringssl/crypto/bn/bn.c \
+    third_party/boringssl/crypto/bn/bn_asn1.c \
+    third_party/boringssl/crypto/bn/cmp.c \
+    third_party/boringssl/crypto/bn/convert.c \
+    third_party/boringssl/crypto/bn/ctx.c \
+    third_party/boringssl/crypto/bn/div.c \
+    third_party/boringssl/crypto/bn/exponentiation.c \
+    third_party/boringssl/crypto/bn/gcd.c \
+    third_party/boringssl/crypto/bn/generic.c \
+    third_party/boringssl/crypto/bn/kronecker.c \
+    third_party/boringssl/crypto/bn/montgomery.c \
+    third_party/boringssl/crypto/bn/mul.c \
+    third_party/boringssl/crypto/bn/prime.c \
+    third_party/boringssl/crypto/bn/random.c \
+    third_party/boringssl/crypto/bn/rsaz_exp.c \
+    third_party/boringssl/crypto/bn/shift.c \
+    third_party/boringssl/crypto/bn/sqrt.c \
+    third_party/boringssl/crypto/buf/buf.c \
+    third_party/boringssl/crypto/bytestring/ber.c \
+    third_party/boringssl/crypto/bytestring/cbb.c \
+    third_party/boringssl/crypto/bytestring/cbs.c \
+    third_party/boringssl/crypto/chacha/chacha_generic.c \
+    third_party/boringssl/crypto/chacha/chacha_vec.c \
+    third_party/boringssl/crypto/cipher/aead.c \
+    third_party/boringssl/crypto/cipher/cipher.c \
+    third_party/boringssl/crypto/cipher/derive_key.c \
+    third_party/boringssl/crypto/cipher/e_aes.c \
+    third_party/boringssl/crypto/cipher/e_chacha20poly1305.c \
+    third_party/boringssl/crypto/cipher/e_des.c \
+    third_party/boringssl/crypto/cipher/e_null.c \
+    third_party/boringssl/crypto/cipher/e_rc2.c \
+    third_party/boringssl/crypto/cipher/e_rc4.c \
+    third_party/boringssl/crypto/cipher/e_ssl3.c \
+    third_party/boringssl/crypto/cipher/e_tls.c \
+    third_party/boringssl/crypto/cipher/tls_cbc.c \
+    third_party/boringssl/crypto/cmac/cmac.c \
+    third_party/boringssl/crypto/conf/conf.c \
+    third_party/boringssl/crypto/cpu-arm.c \
+    third_party/boringssl/crypto/cpu-intel.c \
+    third_party/boringssl/crypto/crypto.c \
+    third_party/boringssl/crypto/curve25519/curve25519.c \
+    third_party/boringssl/crypto/des/des.c \
+    third_party/boringssl/crypto/dh/check.c \
+    third_party/boringssl/crypto/dh/dh.c \
+    third_party/boringssl/crypto/dh/dh_asn1.c \
+    third_party/boringssl/crypto/dh/params.c \
+    third_party/boringssl/crypto/digest/digest.c \
+    third_party/boringssl/crypto/digest/digests.c \
+    third_party/boringssl/crypto/directory_posix.c \
+    third_party/boringssl/crypto/directory_win.c \
+    third_party/boringssl/crypto/dsa/dsa.c \
+    third_party/boringssl/crypto/dsa/dsa_asn1.c \
+    third_party/boringssl/crypto/ec/ec.c \
+    third_party/boringssl/crypto/ec/ec_asn1.c \
+    third_party/boringssl/crypto/ec/ec_key.c \
+    third_party/boringssl/crypto/ec/ec_montgomery.c \
+    third_party/boringssl/crypto/ec/oct.c \
+    third_party/boringssl/crypto/ec/p224-64.c \
+    third_party/boringssl/crypto/ec/p256-64.c \
+    third_party/boringssl/crypto/ec/p256-x86_64.c \
+    third_party/boringssl/crypto/ec/simple.c \
+    third_party/boringssl/crypto/ec/util-64.c \
+    third_party/boringssl/crypto/ec/wnaf.c \
+    third_party/boringssl/crypto/ecdh/ecdh.c \
+    third_party/boringssl/crypto/ecdsa/ecdsa.c \
+    third_party/boringssl/crypto/ecdsa/ecdsa_asn1.c \
+    third_party/boringssl/crypto/engine/engine.c \
+    third_party/boringssl/crypto/err/err.c \
+    third_party/boringssl/crypto/evp/algorithm.c \
+    third_party/boringssl/crypto/evp/digestsign.c \
+    third_party/boringssl/crypto/evp/evp.c \
+    third_party/boringssl/crypto/evp/evp_asn1.c \
+    third_party/boringssl/crypto/evp/evp_ctx.c \
+    third_party/boringssl/crypto/evp/p_dsa_asn1.c \
+    third_party/boringssl/crypto/evp/p_ec.c \
+    third_party/boringssl/crypto/evp/p_ec_asn1.c \
+    third_party/boringssl/crypto/evp/p_rsa.c \
+    third_party/boringssl/crypto/evp/p_rsa_asn1.c \
+    third_party/boringssl/crypto/evp/pbkdf.c \
+    third_party/boringssl/crypto/evp/sign.c \
+    third_party/boringssl/crypto/ex_data.c \
+    third_party/boringssl/crypto/hkdf/hkdf.c \
+    third_party/boringssl/crypto/hmac/hmac.c \
+    third_party/boringssl/crypto/lhash/lhash.c \
+    third_party/boringssl/crypto/md4/md4.c \
+    third_party/boringssl/crypto/md5/md5.c \
+    third_party/boringssl/crypto/mem.c \
+    third_party/boringssl/crypto/modes/cbc.c \
+    third_party/boringssl/crypto/modes/cfb.c \
+    third_party/boringssl/crypto/modes/ctr.c \
+    third_party/boringssl/crypto/modes/gcm.c \
+    third_party/boringssl/crypto/modes/ofb.c \
+    third_party/boringssl/crypto/obj/obj.c \
+    third_party/boringssl/crypto/obj/obj_xref.c \
+    third_party/boringssl/crypto/pem/pem_all.c \
+    third_party/boringssl/crypto/pem/pem_info.c \
+    third_party/boringssl/crypto/pem/pem_lib.c \
+    third_party/boringssl/crypto/pem/pem_oth.c \
+    third_party/boringssl/crypto/pem/pem_pk8.c \
+    third_party/boringssl/crypto/pem/pem_pkey.c \
+    third_party/boringssl/crypto/pem/pem_x509.c \
+    third_party/boringssl/crypto/pem/pem_xaux.c \
+    third_party/boringssl/crypto/pkcs8/p5_pbe.c \
+    third_party/boringssl/crypto/pkcs8/p5_pbev2.c \
+    third_party/boringssl/crypto/pkcs8/p8_pkey.c \
+    third_party/boringssl/crypto/pkcs8/pkcs8.c \
+    third_party/boringssl/crypto/poly1305/poly1305.c \
+    third_party/boringssl/crypto/poly1305/poly1305_arm.c \
+    third_party/boringssl/crypto/poly1305/poly1305_vec.c \
+    third_party/boringssl/crypto/rand/rand.c \
+    third_party/boringssl/crypto/rand/urandom.c \
+    third_party/boringssl/crypto/rand/windows.c \
+    third_party/boringssl/crypto/rc4/rc4.c \
+    third_party/boringssl/crypto/refcount_c11.c \
+    third_party/boringssl/crypto/refcount_lock.c \
+    third_party/boringssl/crypto/rsa/blinding.c \
+    third_party/boringssl/crypto/rsa/padding.c \
+    third_party/boringssl/crypto/rsa/rsa.c \
+    third_party/boringssl/crypto/rsa/rsa_asn1.c \
+    third_party/boringssl/crypto/rsa/rsa_impl.c \
+    third_party/boringssl/crypto/sha/sha1.c \
+    third_party/boringssl/crypto/sha/sha256.c \
+    third_party/boringssl/crypto/sha/sha512.c \
+    third_party/boringssl/crypto/stack/stack.c \
+    third_party/boringssl/crypto/thread.c \
+    third_party/boringssl/crypto/thread_none.c \
+    third_party/boringssl/crypto/thread_pthread.c \
+    third_party/boringssl/crypto/thread_win.c \
+    third_party/boringssl/crypto/time_support.c \
+    third_party/boringssl/crypto/x509/a_digest.c \
+    third_party/boringssl/crypto/x509/a_sign.c \
+    third_party/boringssl/crypto/x509/a_strex.c \
+    third_party/boringssl/crypto/x509/a_verify.c \
+    third_party/boringssl/crypto/x509/asn1_gen.c \
+    third_party/boringssl/crypto/x509/by_dir.c \
+    third_party/boringssl/crypto/x509/by_file.c \
+    third_party/boringssl/crypto/x509/i2d_pr.c \
+    third_party/boringssl/crypto/x509/pkcs7.c \
+    third_party/boringssl/crypto/x509/t_crl.c \
+    third_party/boringssl/crypto/x509/t_req.c \
+    third_party/boringssl/crypto/x509/t_x509.c \
+    third_party/boringssl/crypto/x509/t_x509a.c \
+    third_party/boringssl/crypto/x509/x509.c \
+    third_party/boringssl/crypto/x509/x509_att.c \
+    third_party/boringssl/crypto/x509/x509_cmp.c \
+    third_party/boringssl/crypto/x509/x509_d2.c \
+    third_party/boringssl/crypto/x509/x509_def.c \
+    third_party/boringssl/crypto/x509/x509_ext.c \
+    third_party/boringssl/crypto/x509/x509_lu.c \
+    third_party/boringssl/crypto/x509/x509_obj.c \
+    third_party/boringssl/crypto/x509/x509_r2x.c \
+    third_party/boringssl/crypto/x509/x509_req.c \
+    third_party/boringssl/crypto/x509/x509_set.c \
+    third_party/boringssl/crypto/x509/x509_trs.c \
+    third_party/boringssl/crypto/x509/x509_txt.c \
+    third_party/boringssl/crypto/x509/x509_v3.c \
+    third_party/boringssl/crypto/x509/x509_vfy.c \
+    third_party/boringssl/crypto/x509/x509_vpm.c \
+    third_party/boringssl/crypto/x509/x509cset.c \
+    third_party/boringssl/crypto/x509/x509name.c \
+    third_party/boringssl/crypto/x509/x509rset.c \
+    third_party/boringssl/crypto/x509/x509spki.c \
+    third_party/boringssl/crypto/x509/x509type.c \
+    third_party/boringssl/crypto/x509/x_algor.c \
+    third_party/boringssl/crypto/x509/x_all.c \
+    third_party/boringssl/crypto/x509/x_attrib.c \
+    third_party/boringssl/crypto/x509/x_crl.c \
+    third_party/boringssl/crypto/x509/x_exten.c \
+    third_party/boringssl/crypto/x509/x_info.c \
+    third_party/boringssl/crypto/x509/x_name.c \
+    third_party/boringssl/crypto/x509/x_pkey.c \
+    third_party/boringssl/crypto/x509/x_pubkey.c \
+    third_party/boringssl/crypto/x509/x_req.c \
+    third_party/boringssl/crypto/x509/x_sig.c \
+    third_party/boringssl/crypto/x509/x_spki.c \
+    third_party/boringssl/crypto/x509/x_val.c \
+    third_party/boringssl/crypto/x509/x_x509.c \
+    third_party/boringssl/crypto/x509/x_x509a.c \
+    third_party/boringssl/crypto/x509v3/pcy_cache.c \
+    third_party/boringssl/crypto/x509v3/pcy_data.c \
+    third_party/boringssl/crypto/x509v3/pcy_lib.c \
+    third_party/boringssl/crypto/x509v3/pcy_map.c \
+    third_party/boringssl/crypto/x509v3/pcy_node.c \
+    third_party/boringssl/crypto/x509v3/pcy_tree.c \
+    third_party/boringssl/crypto/x509v3/v3_akey.c \
+    third_party/boringssl/crypto/x509v3/v3_akeya.c \
+    third_party/boringssl/crypto/x509v3/v3_alt.c \
+    third_party/boringssl/crypto/x509v3/v3_bcons.c \
+    third_party/boringssl/crypto/x509v3/v3_bitst.c \
+    third_party/boringssl/crypto/x509v3/v3_conf.c \
+    third_party/boringssl/crypto/x509v3/v3_cpols.c \
+    third_party/boringssl/crypto/x509v3/v3_crld.c \
+    third_party/boringssl/crypto/x509v3/v3_enum.c \
+    third_party/boringssl/crypto/x509v3/v3_extku.c \
+    third_party/boringssl/crypto/x509v3/v3_genn.c \
+    third_party/boringssl/crypto/x509v3/v3_ia5.c \
+    third_party/boringssl/crypto/x509v3/v3_info.c \
+    third_party/boringssl/crypto/x509v3/v3_int.c \
+    third_party/boringssl/crypto/x509v3/v3_lib.c \
+    third_party/boringssl/crypto/x509v3/v3_ncons.c \
+    third_party/boringssl/crypto/x509v3/v3_pci.c \
+    third_party/boringssl/crypto/x509v3/v3_pcia.c \
+    third_party/boringssl/crypto/x509v3/v3_pcons.c \
+    third_party/boringssl/crypto/x509v3/v3_pku.c \
+    third_party/boringssl/crypto/x509v3/v3_pmaps.c \
+    third_party/boringssl/crypto/x509v3/v3_prn.c \
+    third_party/boringssl/crypto/x509v3/v3_purp.c \
+    third_party/boringssl/crypto/x509v3/v3_skey.c \
+    third_party/boringssl/crypto/x509v3/v3_sxnet.c \
+    third_party/boringssl/crypto/x509v3/v3_utl.c \
+    third_party/boringssl/ssl/custom_extensions.c \
+    third_party/boringssl/ssl/d1_both.c \
+    third_party/boringssl/ssl/d1_clnt.c \
+    third_party/boringssl/ssl/d1_lib.c \
+    third_party/boringssl/ssl/d1_meth.c \
+    third_party/boringssl/ssl/d1_pkt.c \
+    third_party/boringssl/ssl/d1_srtp.c \
+    third_party/boringssl/ssl/d1_srvr.c \
+    third_party/boringssl/ssl/dtls_record.c \
+    third_party/boringssl/ssl/pqueue/pqueue.c \
+    third_party/boringssl/ssl/s3_both.c \
+    third_party/boringssl/ssl/s3_clnt.c \
+    third_party/boringssl/ssl/s3_enc.c \
+    third_party/boringssl/ssl/s3_lib.c \
+    third_party/boringssl/ssl/s3_meth.c \
+    third_party/boringssl/ssl/s3_pkt.c \
+    third_party/boringssl/ssl/s3_srvr.c \
+    third_party/boringssl/ssl/ssl_aead_ctx.c \
+    third_party/boringssl/ssl/ssl_asn1.c \
+    third_party/boringssl/ssl/ssl_buffer.c \
+    third_party/boringssl/ssl/ssl_cert.c \
+    third_party/boringssl/ssl/ssl_cipher.c \
+    third_party/boringssl/ssl/ssl_file.c \
+    third_party/boringssl/ssl/ssl_lib.c \
+    third_party/boringssl/ssl/ssl_rsa.c \
+    third_party/boringssl/ssl/ssl_session.c \
+    third_party/boringssl/ssl/ssl_stat.c \
+    third_party/boringssl/ssl/t1_enc.c \
+    third_party/boringssl/ssl/t1_lib.c \
+    third_party/boringssl/ssl/tls_record.c \
+    , $ext_shared, , -Wall -Werror \
+    -Wno-parentheses-equality -Wno-unused-value -std=c11 \
+    -fvisibility=hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN \
+    -D_HAS_EXCEPTIONS=0 -DNOMINMAX)
+
+  PHP_ADD_BUILD_DIR($ext_builddir/src/php/ext/grpc)
+
+  PHP_ADD_BUILD_DIR($ext_builddir/src/boringssl)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/census)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/channel)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_config)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_config/lb_policies)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/client_config/resolvers)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/compression)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/debug)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/httpcli)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/iomgr)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/json)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/profiling)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/proto/grpc/lb/v0)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/security)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/support)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/surface)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/transport)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/transport/chttp2)
+  PHP_ADD_BUILD_DIR($ext_builddir/src/core/tsi)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/aes)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/asn1)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/base64)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bio)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bn)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bn/asm)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/buf)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/bytestring)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/chacha)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/cipher)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/cmac)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/conf)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/curve25519)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/des)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/dh)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/digest)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/dsa)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/ec)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/ecdh)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/ecdsa)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/engine)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/err)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/evp)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/hkdf)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/hmac)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/lhash)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/md4)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/md5)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/modes)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/obj)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/pem)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/pkcs8)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/poly1305)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/rand)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/rc4)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/rsa)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/sha)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/stack)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/crypto/x509v3)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/boringssl/ssl/pqueue)
+  PHP_ADD_BUILD_DIR($ext_builddir/third_party/nanopb)
+fi

+ 2 - 2
doc/health-checking.md

@@ -26,7 +26,7 @@ The server should export a service defined in the following proto:
 ```
 syntax = "proto3";
 
-package grpc.health.v1alpha;
+package grpc.health.v1;
 
 message HealthCheckRequest {
   string service = 1;
@@ -49,7 +49,7 @@ service Health {
 A client can query the server’s health status by calling the `Check` method, and
 a deadline should be set on the rpc. The client can optionally set the service
 name it wants to query for health status. The suggested format of service name
-is `package_names.ServiceName`, such as `grpc.health.v1alpha.Health`.
+is `package_names.ServiceName`, such as `grpc.health.v1.Health`.
 
 The server should register all the services manually and set
 the individual status, including an empty service name and its status. For each

+ 97 - 0
doc/load-balancing.md

@@ -0,0 +1,97 @@
+Load Balancing in gRPC
+=======================
+
+# Objective
+
+To design a load balancing API between a gRPC client and a Load Balancer to
+instruct the client how to send load to multiple backend servers. 
+
+# Background
+
+Prior to any gRPC specifics, we explore some usual ways to approach load
+balancing.
+
+### Proxy Model
+
+Using a proxy provides a solid trustable client that can report load to the load
+balancing system. Proxies typically require more resources to operate since they
+have temporary copies of the RPC request and response. This model also increases
+latency to the RPCs.
+
+The proxy model was deemed inefficient when considering request heavy services
+like storage. 
+
+### Balancing-aware Client
+
+This thicker client places more of the load balancing logic in the client. For
+example, the client could contain many load balancing policies (Round Robin,
+Random, etc) used to select servers from a list. In this model, a list of
+servers would be either statically configured in the client, provided by the
+name resolution system, an external load balancer, etc. In any case, the client
+is responsible for choosing the preferred server from the list. 
+
+One of the drawbacks of this approach is writing and maintaining the load
+balancing policies in multiple languages and/or versions of the clients. These
+policies can be fairly complicated. Some of the algorithms also require client
+to server communication so the client would need to get thicker to support
+additional RPCs to get health or load information in addition to sending RPCs
+for user requests.
+
+It would also significantly complicate the client's code: the new design hides
+the load balancing complexity of multiple layers and presents it as a simple
+list of servers to the client.
+
+### External Load Balancing Service
+
+The client load balancing code is kept simple and portable, implementing
+well-known algorithms (ie, Round Robin) for server selection.
+Complex load balancing algorithms are instead provided by the load balancer. The
+client relies on the load balancer to provide _load balancing configuration_ and
+_the list of servers_ to which the client should send requests. The balancer
+updates the server list as needed to balance the load as well as handle server
+unavailability or health issues. The load balancer will make any necessary
+complex decisions and inform the client. The load balancer may communicate with
+the backend servers to collect load and health information.
+
+# Proposed Architecture
+
+The gRPC load balancing approach follows the third approach, by having an
+external load balancer which provides simple clients with a list of servers.
+
+## Client
+
+When establishing a gRPC stream to the balancer, the client will send an initial
+request to the load balancer (via a regular gRPC message). The load balancer
+will respond with client config (including, for example, settings for flow
+control, RPC deadlines, etc.) or a redirect to another load balancer. If the
+balancer did not redirect the client, it will then send a list of servers to the
+client. The client will contain simple load balancing logic for choosing the
+next server when it needs to send a request.
+
+## Load Balancer
+
+The Load Balancer is responsible for providing the client with a list of servers
+and client RPC parameters. The balancer chooses when to update the list of
+servers and can decide whether to provide a complete list, a subset, or a
+specific list of “picked” servers in a particular order. The balancer can
+optionally provide an expiration interval after which the server list should no
+longer be trusted and should be updated by the balancer.
+
+The load balancer may open reporting streams to each server contained in the
+server list. These streams are primarily used for load reporting. For example,
+Weighted Round Robin requires that the servers report utilization to the load
+balancer in order to compute the next list of servers.
+
+## Server
+
+The gRPC Server is responsible for answering RPC requests and providing
+responses to the client. The server will also report load to the load balancer
+if a reporting stream was opened for this purpose.
+
+### Security 
+
+The load balancer may be separate from the actual server backends and a
+compromise of the load balancer should only lead to a compromise of the
+loadbalancing functionality. In other words, a compromised load balancer should
+not be able to cause a client to trust a (potentially malicious) backend server
+any more than in a comparable situation without loadbalancing. 

+ 1 - 1
examples/csharp/helloworld/.nuget/packages.config

@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="Grpc.Tools" version="0.12.0" />
+  <package id="Grpc.Tools" version="0.13.0" />
 </packages>

+ 12 - 13
examples/csharp/helloworld/Greeter/Greeter.csproj

@@ -10,7 +10,7 @@
     <RootNamespace>Greeter</RootNamespace>
     <AssemblyName>Greeter</AssemblyName>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <NuGetPackageImportStamp>4eea1d1c</NuGetPackageImportStamp>
+    <NuGetPackageImportStamp>39f4a691</NuGetPackageImportStamp>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -31,15 +31,18 @@
     <ConsolePause>false</ConsolePause>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Google.Protobuf">
-      <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
+    <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
     </Reference>
-    <Reference Include="Grpc.Core">
-      <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath>
+    <Reference Include="Grpc.Core, Version=0.13.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath>
     </Reference>
     <Reference Include="System" />
-    <Reference Include="System.Interactive.Async">
-      <HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath>
+    <Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
@@ -53,15 +56,11 @@
     <None Include="protos\helloworld.proto" />
   </ItemGroup>
   <ItemGroup />
-  <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" />
+  <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>
       <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
     </PropertyGroup>
-    <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
+    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
   </Target>
-  <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" />
-  <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
 </Project>

+ 23 - 13
examples/csharp/helloworld/Greeter/Helloworld.cs

@@ -9,41 +9,46 @@ using pbr = global::Google.Protobuf.Reflection;
 using scg = global::System.Collections.Generic;
 namespace Helloworld {
 
+  /// <summary>Holder for reflection information generated from helloworld.proto</summary>
   [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-  public static partial class Helloworld {
+  public static partial class HelloworldReflection {
 
     #region Descriptor
+    /// <summary>File descriptor for helloworld.proto</summary>
     public static pbr::FileDescriptor Descriptor {
       get { return descriptor; }
     }
     private static pbr::FileDescriptor descriptor;
 
-    static Helloworld() {
+    static HelloworldReflection() {
       byte[] descriptorData = global::System.Convert.FromBase64String(
           string.Concat(
-            "ChBoZWxsb3dvcmxkLnByb3RvEgpoZWxsb3dvcmxkIhwKDEhlbGxvUmVxdWVz", 
-            "dBIMCgRuYW1lGAEgASgJIh0KCkhlbGxvUmVwbHkSDwoHbWVzc2FnZRgBIAEo", 
-            "CTJJCgdHcmVldGVyEj4KCFNheUhlbGxvEhguaGVsbG93b3JsZC5IZWxsb1Jl", 
-            "cXVlc3QaFi5oZWxsb3dvcmxkLkhlbGxvUmVwbHkiAEIYChBpby5ncnBjLmV4", 
+            "ChBoZWxsb3dvcmxkLnByb3RvEgpoZWxsb3dvcmxkIhwKDEhlbGxvUmVxdWVz",
+            "dBIMCgRuYW1lGAEgASgJIh0KCkhlbGxvUmVwbHkSDwoHbWVzc2FnZRgBIAEo",
+            "CTJJCgdHcmVldGVyEj4KCFNheUhlbGxvEhguaGVsbG93b3JsZC5IZWxsb1Jl",
+            "cXVlc3QaFi5oZWxsb3dvcmxkLkhlbGxvUmVwbHkiAEIYChBpby5ncnBjLmV4",
             "YW1wbGVzogIDSExXYgZwcm90bzM="));
-      descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
+      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
           new pbr::FileDescriptor[] { },
           new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
-            new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloRequest), new[]{ "Name" }, null, null, null),
-            new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloReply), new[]{ "Message" }, null, null, null)
+            new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloRequest), global::Helloworld.HelloRequest.Parser, new[]{ "Name" }, null, null, null),
+            new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloReply), global::Helloworld.HelloReply.Parser, new[]{ "Message" }, null, null, null)
           }));
     }
     #endregion
 
   }
   #region Messages
+  /// <summary>
+  ///  The request message containing the user's name.
+  /// </summary>
   [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
   public sealed partial class HelloRequest : pb::IMessage<HelloRequest> {
     private static readonly pb::MessageParser<HelloRequest> _parser = new pb::MessageParser<HelloRequest>(() => new HelloRequest());
     public static pb::MessageParser<HelloRequest> Parser { get { return _parser; } }
 
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Helloworld.Helloworld.Descriptor.MessageTypes[0]; }
+      get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[0]; }
     }
 
     pbr::MessageDescriptor pb::IMessage.Descriptor {
@@ -64,6 +69,7 @@ namespace Helloworld {
       return new HelloRequest(this);
     }
 
+    /// <summary>Field number for the "name" field.</summary>
     public const int NameFieldNumber = 1;
     private string name_ = "";
     public string Name {
@@ -95,7 +101,7 @@ namespace Helloworld {
     }
 
     public override string ToString() {
-      return pb::JsonFormatter.Default.Format(this);
+      return pb::JsonFormatter.ToDiagnosticString(this);
     }
 
     public void WriteTo(pb::CodedOutputStream output) {
@@ -139,13 +145,16 @@ namespace Helloworld {
 
   }
 
+  /// <summary>
+  ///  The response message containing the greetings
+  /// </summary>
   [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
   public sealed partial class HelloReply : pb::IMessage<HelloReply> {
     private static readonly pb::MessageParser<HelloReply> _parser = new pb::MessageParser<HelloReply>(() => new HelloReply());
     public static pb::MessageParser<HelloReply> Parser { get { return _parser; } }
 
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Helloworld.Helloworld.Descriptor.MessageTypes[1]; }
+      get { return global::Helloworld.HelloworldReflection.Descriptor.MessageTypes[1]; }
     }
 
     pbr::MessageDescriptor pb::IMessage.Descriptor {
@@ -166,6 +175,7 @@ namespace Helloworld {
       return new HelloReply(this);
     }
 
+    /// <summary>Field number for the "message" field.</summary>
     public const int MessageFieldNumber = 1;
     private string message_ = "";
     public string Message {
@@ -197,7 +207,7 @@ namespace Helloworld {
     }
 
     public override string ToString() {
-      return pb::JsonFormatter.Default.Format(this);
+      return pb::JsonFormatter.ToDiagnosticString(this);
     }
 
     public void WriteTo(pb::CodedOutputStream output) {

+ 1 - 1
examples/csharp/helloworld/Greeter/HelloworldGrpc.cs

@@ -25,7 +25,7 @@ namespace Helloworld {
     // service descriptor
     public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
     {
-      get { return global::Helloworld.Helloworld.Descriptor.Services[0]; }
+      get { return global::Helloworld.HelloworldReflection.Descriptor.Services[0]; }
     }
 
     // client interface

+ 5 - 7
examples/csharp/helloworld/Greeter/packages.config

@@ -1,10 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
-  <package id="Grpc" version="0.12.0" targetFramework="net45" />
-  <package id="Grpc.Core" version="0.12.0" targetFramework="net45" />
-  <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" />
-  <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" />
-  <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" />
-  <package id="Ix-Async" version="1.2.3" targetFramework="net45" />
+  <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
+  <package id="Grpc" version="0.13.0" targetFramework="net45" />
+  <package id="Grpc.Core" version="0.13.0" targetFramework="net45" />
+  <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" />
+  <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
 </packages>

+ 12 - 13
examples/csharp/helloworld/GreeterClient/GreeterClient.csproj

@@ -10,7 +10,7 @@
     <RootNamespace>GreeterClient</RootNamespace>
     <AssemblyName>GreeterClient</AssemblyName>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <NuGetPackageImportStamp>29206d49</NuGetPackageImportStamp>
+    <NuGetPackageImportStamp>dcebbc77</NuGetPackageImportStamp>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -31,15 +31,18 @@
     <Externalconsole>true</Externalconsole>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Google.Protobuf">
-      <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
+    <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
     </Reference>
-    <Reference Include="Grpc.Core">
-      <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath>
+    <Reference Include="Grpc.Core, Version=0.13.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath>
     </Reference>
     <Reference Include="System" />
-    <Reference Include="System.Interactive.Async">
-      <HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath>
+    <Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
@@ -56,15 +59,11 @@
   <ItemGroup>
     <None Include="packages.config" />
   </ItemGroup>
-  <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" />
+  <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>
       <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
     </PropertyGroup>
-    <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
+    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
   </Target>
-  <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" />
-  <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
 </Project>

+ 5 - 7
examples/csharp/helloworld/GreeterClient/packages.config

@@ -1,10 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
-  <package id="Grpc" version="0.12.0" targetFramework="net45" />
-  <package id="Grpc.Core" version="0.12.0" targetFramework="net45" />
-  <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" />
-  <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" />
-  <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" />
-  <package id="Ix-Async" version="1.2.3" targetFramework="net45" />
+  <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
+  <package id="Grpc" version="0.13.0" targetFramework="net45" />
+  <package id="Grpc.Core" version="0.13.0" targetFramework="net45" />
+  <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" />
+  <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
 </packages>

+ 12 - 13
examples/csharp/helloworld/GreeterServer/GreeterServer.csproj

@@ -10,7 +10,7 @@
     <RootNamespace>GreeterServer</RootNamespace>
     <AssemblyName>GreeterServer</AssemblyName>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <NuGetPackageImportStamp>8a2cae0f</NuGetPackageImportStamp>
+    <NuGetPackageImportStamp>2ea5dfd0</NuGetPackageImportStamp>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -31,15 +31,18 @@
     <Externalconsole>true</Externalconsole>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Google.Protobuf">
-      <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
+    <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
     </Reference>
-    <Reference Include="Grpc.Core">
-      <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath>
+    <Reference Include="Grpc.Core, Version=0.13.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath>
     </Reference>
     <Reference Include="System" />
-    <Reference Include="System.Interactive.Async">
-      <HintPath>..\packages\Ix-Async.1.2.3\lib\net45\System.Interactive.Async.dll</HintPath>
+    <Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Ix-Async.1.2.5\lib\net45\System.Interactive.Async.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
@@ -56,15 +59,11 @@
   <ItemGroup>
     <None Include="packages.config" />
   </ItemGroup>
-  <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" />
+  <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>
       <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
     </PropertyGroup>
-    <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
+    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
   </Target>
-  <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" />
-  <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
 </Project>

+ 5 - 7
examples/csharp/helloworld/GreeterServer/packages.config

@@ -1,10 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
-  <package id="Grpc" version="0.12.0" targetFramework="net45" />
-  <package id="Grpc.Core" version="0.12.0" targetFramework="net45" />
-  <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" />
-  <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" />
-  <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" />
-  <package id="Ix-Async" version="1.2.3" targetFramework="net45" />
+  <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
+  <package id="Grpc" version="0.13.0" targetFramework="net45" />
+  <package id="Grpc.Core" version="0.13.0" targetFramework="net45" />
+  <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" />
+  <package id="Ix-Async" version="1.2.5" targetFramework="net45" />
 </packages>

+ 5 - 24
examples/csharp/helloworld/README.md

@@ -16,35 +16,17 @@ PREREQUISITES
 - Visual Studio 2013 or 2015
 
 **Linux**
-- Mono
-- Monodevelop 5.9 with NuGet Add-in installed
+- Mono 4.0+
+- Monodevelop 5.9+ (with NuGet plugin installed)
 
 **Mac OS X**
-- Xamarin Studio (with NuGet plugin installed)
+- Xamarin Studio 5.9+
 - [homebrew][]
 
 BUILD
 -------
 
-**Windows**
-
-- Open solution `Greeter.sln` with Visual Studio
-
-- Build the solution (this will automatically download NuGet dependencies)
-
-**Linux (Debian)**
-
-- Install gRPC C core and C# native extension using [How to use gRPC C#][] instructions
-
-- Open solution `Greeter.sln` in MonoDevelop.
-
-- Build the solution (you need to manually restore dependencies by using `mono nuget.exe restore` if you don't have NuGet add-in)
-
-**Mac OS X**
-
-- Install gRPC C core and C# native extension using [How to use gRPC C#][] instructions
-
-- Open solution `Greeter.sln` with Xamarin Studio
+- Open solution `Greeter.sln` with Visual Studio, Monodevelop (on Linux) or Xamarin Studio (on Mac OS X)
 
 - Build the solution (this will automatically download NuGet dependencies)
 
@@ -65,7 +47,7 @@ Try it!
   > GreeterClient.exe
   ```
 
-You can also run the server and client directly from Visual Studio.
+You can also run the server and client directly from the IDE.
 
 On Linux or Mac, use `mono GreeterServer.exe` and `mono GreeterClient.exe` to run the server and client.
 
@@ -76,5 +58,4 @@ You can find a more detailed tutorial in [gRPC Basics: C#][]
 
 [homebrew]:http://brew.sh
 [helloworld.proto]:../../protos/helloworld.proto
-[How to use gRPC C#]:../../../src/csharp#how-to-use
 [gRPC Basics: C#]:http://www.grpc.io/docs/tutorials/basic/csharp.html

+ 1 - 1
examples/csharp/helloworld/generate_protos.bat

@@ -5,6 +5,6 @@ setlocal
 @rem enter this directory
 cd /d %~dp0
 
-packages\Google.Protobuf.3.0.0-alpha4\tools\protoc.exe -I../../protos --csharp_out Greeter  ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=packages\Grpc.Tools.0.12.0\tools\grpc_csharp_plugin.exe
+packages\Google.Protobuf.3.0.0-beta2\tools\protoc.exe -I../../protos --csharp_out Greeter  ../../protos/helloworld.proto --grpc_out Greeter --plugin=protoc-gen-grpc=packages\Grpc.Tools.0.13.0\tools\grpc_csharp_plugin.exe
 
 endlocal

+ 1 - 1
examples/csharp/route_guide/.nuget/packages.config

@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="Grpc.Tools" version="0.12.0" />
+  <package id="Grpc.Tools" version="0.13.0" />
 </packages>

+ 117 - 51
examples/csharp/route_guide/RouteGuide/RouteGuide.cs

@@ -9,57 +9,62 @@ using pbr = global::Google.Protobuf.Reflection;
 using scg = global::System.Collections.Generic;
 namespace Routeguide {
 
-  namespace Proto {
-
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    public static partial class RouteGuide {
-
-      #region Descriptor
-      public static pbr::FileDescriptor Descriptor {
-        get { return descriptor; }
-      }
-      private static pbr::FileDescriptor descriptor;
-
-      static RouteGuide() {
-        byte[] descriptorData = global::System.Convert.FromBase64String(
-            string.Concat(
-              "ChFyb3V0ZV9ndWlkZS5wcm90bxIKcm91dGVndWlkZSIsCgVQb2ludBIQCghs", 
-              "YXRpdHVkZRgBIAEoBRIRCglsb25naXR1ZGUYAiABKAUiSQoJUmVjdGFuZ2xl", 
-              "Eh0KAmxvGAEgASgLMhEucm91dGVndWlkZS5Qb2ludBIdCgJoaRgCIAEoCzIR", 
-              "LnJvdXRlZ3VpZGUuUG9pbnQiPAoHRmVhdHVyZRIMCgRuYW1lGAEgASgJEiMK", 
-              "CGxvY2F0aW9uGAIgASgLMhEucm91dGVndWlkZS5Qb2ludCJBCglSb3V0ZU5v", 
-              "dGUSIwoIbG9jYXRpb24YASABKAsyES5yb3V0ZWd1aWRlLlBvaW50Eg8KB21l", 
-              "c3NhZ2UYAiABKAkiYgoMUm91dGVTdW1tYXJ5EhMKC3BvaW50X2NvdW50GAEg", 
-              "ASgFEhUKDWZlYXR1cmVfY291bnQYAiABKAUSEAoIZGlzdGFuY2UYAyABKAUS", 
-              "FAoMZWxhcHNlZF90aW1lGAQgASgFMoUCCgpSb3V0ZUd1aWRlEjYKCkdldEZl", 
-              "YXR1cmUSES5yb3V0ZWd1aWRlLlBvaW50GhMucm91dGVndWlkZS5GZWF0dXJl", 
-              "IgASPgoMTGlzdEZlYXR1cmVzEhUucm91dGVndWlkZS5SZWN0YW5nbGUaEy5y", 
-              "b3V0ZWd1aWRlLkZlYXR1cmUiADABEj4KC1JlY29yZFJvdXRlEhEucm91dGVn", 
-              "dWlkZS5Qb2ludBoYLnJvdXRlZ3VpZGUuUm91dGVTdW1tYXJ5IgAoARI/CglS", 
-              "b3V0ZUNoYXQSFS5yb3V0ZWd1aWRlLlJvdXRlTm90ZRoVLnJvdXRlZ3VpZGUu", 
-              "Um91dGVOb3RlIgAoATABQg8KB2V4LmdycGOiAgNSVEdiBnByb3RvMw=="));
-        descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
-            new pbr::FileDescriptor[] { },
-            new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
-              new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Point), new[]{ "Latitude", "Longitude" }, null, null, null),
-              new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Rectangle), new[]{ "Lo", "Hi" }, null, null, null),
-              new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Feature), new[]{ "Name", "Location" }, null, null, null),
-              new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteNote), new[]{ "Location", "Message" }, null, null, null),
-              new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteSummary), new[]{ "PointCount", "FeatureCount", "Distance", "ElapsedTime" }, null, null, null)
-            }));
-      }
-      #endregion
+  /// <summary>Holder for reflection information generated from route_guide.proto</summary>
+  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+  public static partial class RouteGuideReflection {
+
+    #region Descriptor
+    /// <summary>File descriptor for route_guide.proto</summary>
+    public static pbr::FileDescriptor Descriptor {
+      get { return descriptor; }
+    }
+    private static pbr::FileDescriptor descriptor;
+
+    static RouteGuideReflection() {
+      byte[] descriptorData = global::System.Convert.FromBase64String(
+          string.Concat(
+            "ChFyb3V0ZV9ndWlkZS5wcm90bxIKcm91dGVndWlkZSIsCgVQb2ludBIQCghs",
+            "YXRpdHVkZRgBIAEoBRIRCglsb25naXR1ZGUYAiABKAUiSQoJUmVjdGFuZ2xl",
+            "Eh0KAmxvGAEgASgLMhEucm91dGVndWlkZS5Qb2ludBIdCgJoaRgCIAEoCzIR",
+            "LnJvdXRlZ3VpZGUuUG9pbnQiPAoHRmVhdHVyZRIMCgRuYW1lGAEgASgJEiMK",
+            "CGxvY2F0aW9uGAIgASgLMhEucm91dGVndWlkZS5Qb2ludCJBCglSb3V0ZU5v",
+            "dGUSIwoIbG9jYXRpb24YASABKAsyES5yb3V0ZWd1aWRlLlBvaW50Eg8KB21l",
+            "c3NhZ2UYAiABKAkiYgoMUm91dGVTdW1tYXJ5EhMKC3BvaW50X2NvdW50GAEg",
+            "ASgFEhUKDWZlYXR1cmVfY291bnQYAiABKAUSEAoIZGlzdGFuY2UYAyABKAUS",
+            "FAoMZWxhcHNlZF90aW1lGAQgASgFMoUCCgpSb3V0ZUd1aWRlEjYKCkdldEZl",
+            "YXR1cmUSES5yb3V0ZWd1aWRlLlBvaW50GhMucm91dGVndWlkZS5GZWF0dXJl",
+            "IgASPgoMTGlzdEZlYXR1cmVzEhUucm91dGVndWlkZS5SZWN0YW5nbGUaEy5y",
+            "b3V0ZWd1aWRlLkZlYXR1cmUiADABEj4KC1JlY29yZFJvdXRlEhEucm91dGVn",
+            "dWlkZS5Qb2ludBoYLnJvdXRlZ3VpZGUuUm91dGVTdW1tYXJ5IgAoARI/CglS",
+            "b3V0ZUNoYXQSFS5yb3V0ZWd1aWRlLlJvdXRlTm90ZRoVLnJvdXRlZ3VpZGUu",
+            "Um91dGVOb3RlIgAoATABQg8KB2V4LmdycGOiAgNSVEdiBnByb3RvMw=="));
+      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+          new pbr::FileDescriptor[] { },
+          new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
+            new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Point), global::Routeguide.Point.Parser, new[]{ "Latitude", "Longitude" }, null, null, null),
+            new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Rectangle), global::Routeguide.Rectangle.Parser, new[]{ "Lo", "Hi" }, null, null, null),
+            new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Feature), global::Routeguide.Feature.Parser, new[]{ "Name", "Location" }, null, null, null),
+            new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteNote), global::Routeguide.RouteNote.Parser, new[]{ "Location", "Message" }, null, null, null),
+            new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteSummary), global::Routeguide.RouteSummary.Parser, new[]{ "PointCount", "FeatureCount", "Distance", "ElapsedTime" }, null, null, null)
+          }));
+    }
+    #endregion
 
-    }
   }
   #region Messages
+  /// <summary>
+  ///  Points are represented as latitude-longitude pairs in the E7 representation
+  ///  (degrees multiplied by 10**7 and rounded to the nearest integer).
+  ///  Latitudes should be in the range +/- 90 degrees and longitude should be in
+  ///  the range +/- 180 degrees (inclusive).
+  /// </summary>
   [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
   public sealed partial class Point : pb::IMessage<Point> {
     private static readonly pb::MessageParser<Point> _parser = new pb::MessageParser<Point>(() => new Point());
     public static pb::MessageParser<Point> Parser { get { return _parser; } }
 
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Routeguide.Proto.RouteGuide.Descriptor.MessageTypes[0]; }
+      get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTypes[0]; }
     }
 
     pbr::MessageDescriptor pb::IMessage.Descriptor {
@@ -81,6 +86,7 @@ namespace Routeguide {
       return new Point(this);
     }
 
+    /// <summary>Field number for the "latitude" field.</summary>
     public const int LatitudeFieldNumber = 1;
     private int latitude_;
     public int Latitude {
@@ -90,6 +96,7 @@ namespace Routeguide {
       }
     }
 
+    /// <summary>Field number for the "longitude" field.</summary>
     public const int LongitudeFieldNumber = 2;
     private int longitude_;
     public int Longitude {
@@ -123,7 +130,7 @@ namespace Routeguide {
     }
 
     public override string ToString() {
-      return pb::JsonFormatter.Default.Format(this);
+      return pb::JsonFormatter.ToDiagnosticString(this);
     }
 
     public void WriteTo(pb::CodedOutputStream output) {
@@ -181,13 +188,17 @@ namespace Routeguide {
 
   }
 
+  /// <summary>
+  ///  A latitude-longitude rectangle, represented as two diagonally opposite
+  ///  points "lo" and "hi".
+  /// </summary>
   [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
   public sealed partial class Rectangle : pb::IMessage<Rectangle> {
     private static readonly pb::MessageParser<Rectangle> _parser = new pb::MessageParser<Rectangle>(() => new Rectangle());
     public static pb::MessageParser<Rectangle> Parser { get { return _parser; } }
 
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Routeguide.Proto.RouteGuide.Descriptor.MessageTypes[1]; }
+      get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTypes[1]; }
     }
 
     pbr::MessageDescriptor pb::IMessage.Descriptor {
@@ -209,8 +220,12 @@ namespace Routeguide {
       return new Rectangle(this);
     }
 
+    /// <summary>Field number for the "lo" field.</summary>
     public const int LoFieldNumber = 1;
     private global::Routeguide.Point lo_;
+    /// <summary>
+    ///  One corner of the rectangle.
+    /// </summary>
     public global::Routeguide.Point Lo {
       get { return lo_; }
       set {
@@ -218,8 +233,12 @@ namespace Routeguide {
       }
     }
 
+    /// <summary>Field number for the "hi" field.</summary>
     public const int HiFieldNumber = 2;
     private global::Routeguide.Point hi_;
+    /// <summary>
+    ///  The other corner of the rectangle.
+    /// </summary>
     public global::Routeguide.Point Hi {
       get { return hi_; }
       set {
@@ -251,7 +270,7 @@ namespace Routeguide {
     }
 
     public override string ToString() {
-      return pb::JsonFormatter.Default.Format(this);
+      return pb::JsonFormatter.ToDiagnosticString(this);
     }
 
     public void WriteTo(pb::CodedOutputStream output) {
@@ -321,13 +340,18 @@ namespace Routeguide {
 
   }
 
+  /// <summary>
+  ///  A feature names something at a given point.
+  ///
+  ///  If a feature could not be named, the name is empty.
+  /// </summary>
   [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
   public sealed partial class Feature : pb::IMessage<Feature> {
     private static readonly pb::MessageParser<Feature> _parser = new pb::MessageParser<Feature>(() => new Feature());
     public static pb::MessageParser<Feature> Parser { get { return _parser; } }
 
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Routeguide.Proto.RouteGuide.Descriptor.MessageTypes[2]; }
+      get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTypes[2]; }
     }
 
     pbr::MessageDescriptor pb::IMessage.Descriptor {
@@ -349,8 +373,12 @@ namespace Routeguide {
       return new Feature(this);
     }
 
+    /// <summary>Field number for the "name" field.</summary>
     public const int NameFieldNumber = 1;
     private string name_ = "";
+    /// <summary>
+    ///  The name of the feature.
+    /// </summary>
     public string Name {
       get { return name_; }
       set {
@@ -358,8 +386,12 @@ namespace Routeguide {
       }
     }
 
+    /// <summary>Field number for the "location" field.</summary>
     public const int LocationFieldNumber = 2;
     private global::Routeguide.Point location_;
+    /// <summary>
+    ///  The point where the feature is detected.
+    /// </summary>
     public global::Routeguide.Point Location {
       get { return location_; }
       set {
@@ -391,7 +423,7 @@ namespace Routeguide {
     }
 
     public override string ToString() {
-      return pb::JsonFormatter.Default.Format(this);
+      return pb::JsonFormatter.ToDiagnosticString(this);
     }
 
     public void WriteTo(pb::CodedOutputStream output) {
@@ -455,13 +487,16 @@ namespace Routeguide {
 
   }
 
+  /// <summary>
+  ///  A RouteNote is a message sent while at a given point.
+  /// </summary>
   [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
   public sealed partial class RouteNote : pb::IMessage<RouteNote> {
     private static readonly pb::MessageParser<RouteNote> _parser = new pb::MessageParser<RouteNote>(() => new RouteNote());
     public static pb::MessageParser<RouteNote> Parser { get { return _parser; } }
 
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Routeguide.Proto.RouteGuide.Descriptor.MessageTypes[3]; }
+      get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTypes[3]; }
     }
 
     pbr::MessageDescriptor pb::IMessage.Descriptor {
@@ -483,8 +518,12 @@ namespace Routeguide {
       return new RouteNote(this);
     }
 
+    /// <summary>Field number for the "location" field.</summary>
     public const int LocationFieldNumber = 1;
     private global::Routeguide.Point location_;
+    /// <summary>
+    ///  The location from which the message is sent.
+    /// </summary>
     public global::Routeguide.Point Location {
       get { return location_; }
       set {
@@ -492,8 +531,12 @@ namespace Routeguide {
       }
     }
 
+    /// <summary>Field number for the "message" field.</summary>
     public const int MessageFieldNumber = 2;
     private string message_ = "";
+    /// <summary>
+    ///  The message to be sent.
+    /// </summary>
     public string Message {
       get { return message_; }
       set {
@@ -525,7 +568,7 @@ namespace Routeguide {
     }
 
     public override string ToString() {
-      return pb::JsonFormatter.Default.Format(this);
+      return pb::JsonFormatter.ToDiagnosticString(this);
     }
 
     public void WriteTo(pb::CodedOutputStream output) {
@@ -589,13 +632,20 @@ namespace Routeguide {
 
   }
 
+  /// <summary>
+  ///  A RouteSummary is received in response to a RecordRoute rpc.
+  ///
+  ///  It contains the number of individual points received, the number of
+  ///  detected features, and the total distance covered as the cumulative sum of
+  ///  the distance between each point.
+  /// </summary>
   [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
   public sealed partial class RouteSummary : pb::IMessage<RouteSummary> {
     private static readonly pb::MessageParser<RouteSummary> _parser = new pb::MessageParser<RouteSummary>(() => new RouteSummary());
     public static pb::MessageParser<RouteSummary> Parser { get { return _parser; } }
 
     public static pbr::MessageDescriptor Descriptor {
-      get { return global::Routeguide.Proto.RouteGuide.Descriptor.MessageTypes[4]; }
+      get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTypes[4]; }
     }
 
     pbr::MessageDescriptor pb::IMessage.Descriptor {
@@ -619,8 +669,12 @@ namespace Routeguide {
       return new RouteSummary(this);
     }
 
+    /// <summary>Field number for the "point_count" field.</summary>
     public const int PointCountFieldNumber = 1;
     private int pointCount_;
+    /// <summary>
+    ///  The number of points received.
+    /// </summary>
     public int PointCount {
       get { return pointCount_; }
       set {
@@ -628,8 +682,12 @@ namespace Routeguide {
       }
     }
 
+    /// <summary>Field number for the "feature_count" field.</summary>
     public const int FeatureCountFieldNumber = 2;
     private int featureCount_;
+    /// <summary>
+    ///  The number of known features passed while traversing the route.
+    /// </summary>
     public int FeatureCount {
       get { return featureCount_; }
       set {
@@ -637,8 +695,12 @@ namespace Routeguide {
       }
     }
 
+    /// <summary>Field number for the "distance" field.</summary>
     public const int DistanceFieldNumber = 3;
     private int distance_;
+    /// <summary>
+    ///  The distance covered in metres.
+    /// </summary>
     public int Distance {
       get { return distance_; }
       set {
@@ -646,8 +708,12 @@ namespace Routeguide {
       }
     }
 
+    /// <summary>Field number for the "elapsed_time" field.</summary>
     public const int ElapsedTimeFieldNumber = 4;
     private int elapsedTime_;
+    /// <summary>
+    ///  The duration of the traversal in seconds.
+    /// </summary>
     public int ElapsedTime {
       get { return elapsedTime_; }
       set {
@@ -683,7 +749,7 @@ namespace Routeguide {
     }
 
     public override string ToString() {
-      return pb::JsonFormatter.Default.Format(this);
+      return pb::JsonFormatter.ToDiagnosticString(this);
     }
 
     public void WriteTo(pb::CodedOutputStream output) {

+ 9 - 11
examples/csharp/route_guide/RouteGuide/RouteGuide.csproj

@@ -11,7 +11,7 @@
     <AssemblyName>RouteGuide</AssemblyName>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
-    <NuGetPackageImportStamp>68b3dd23</NuGetPackageImportStamp>
+    <NuGetPackageImportStamp>5b6d924a</NuGetPackageImportStamp>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -31,11 +31,13 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Google.Protobuf">
-      <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
+    <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
     </Reference>
-    <Reference Include="Grpc.Core">
-      <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath>
+    <Reference Include="Grpc.Core, Version=0.12.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath>
     </Reference>
     <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -65,17 +67,13 @@
     </None>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" />
+  <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>
       <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
     </PropertyGroup>
-    <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
+    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
   </Target>
-  <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" />
-  <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

+ 1 - 1
examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs

@@ -49,7 +49,7 @@ namespace Routeguide {
     // service descriptor
     public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
     {
-      get { return global::Routeguide.Proto.RouteGuide.Descriptor.Services[0]; }
+      get { return global::Routeguide.RouteGuideReflection.Descriptor.Services[0]; }
     }
 
     // client interface

+ 4 - 6
examples/csharp/route_guide/RouteGuide/packages.config

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
-  <package id="Grpc" version="0.12.0" targetFramework="net45" />
-  <package id="Grpc.Core" version="0.12.0" targetFramework="net45" />
-  <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" />
-  <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" />
-  <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" />
+  <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
+  <package id="Grpc" version="0.13.0" targetFramework="net45" />
+  <package id="Grpc.Core" version="0.13.0" targetFramework="net45" />
+  <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" />
   <package id="Ix-Async" version="1.2.3" targetFramework="net45" />
   <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
 </packages>

+ 9 - 11
examples/csharp/route_guide/RouteGuideClient/RouteGuideClient.csproj

@@ -11,7 +11,7 @@
     <AssemblyName>RouteGuideClient</AssemblyName>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
-    <NuGetPackageImportStamp>f5579f73</NuGetPackageImportStamp>
+    <NuGetPackageImportStamp>69015b00</NuGetPackageImportStamp>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -33,11 +33,13 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Google.Protobuf">
-      <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
+    <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
     </Reference>
-    <Reference Include="Grpc.Core">
-      <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath>
+    <Reference Include="Grpc.Core, Version=0.12.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath>
     </Reference>
     <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -68,17 +70,13 @@
     </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" />
+  <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>
       <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
     </PropertyGroup>
-    <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
+    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
   </Target>
-  <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" />
-  <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

+ 4 - 6
examples/csharp/route_guide/RouteGuideClient/packages.config

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
-  <package id="Grpc" version="0.12.0" targetFramework="net45" />
-  <package id="Grpc.Core" version="0.12.0" targetFramework="net45" />
-  <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" />
-  <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" />
-  <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" />
+  <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
+  <package id="Grpc" version="0.13.0" targetFramework="net45" />
+  <package id="Grpc.Core" version="0.13.0" targetFramework="net45" />
+  <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" />
   <package id="Ix-Async" version="1.2.3" targetFramework="net45" />
   <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
 </packages>

+ 9 - 11
examples/csharp/route_guide/RouteGuideServer/RouteGuideServer.csproj

@@ -11,7 +11,7 @@
     <AssemblyName>RouteGuideServer</AssemblyName>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
-    <NuGetPackageImportStamp>89e15444</NuGetPackageImportStamp>
+    <NuGetPackageImportStamp>656158d8</NuGetPackageImportStamp>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -33,11 +33,13 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Google.Protobuf">
-      <HintPath>..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
+    <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Google.Protobuf.3.0.0-beta2\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
     </Reference>
-    <Reference Include="Grpc.Core">
-      <HintPath>..\packages\Grpc.Core.0.12.0\lib\net45\Grpc.Core.dll</HintPath>
+    <Reference Include="Grpc.Core, Version=0.12.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\Grpc.Core.0.13.0\lib\net45\Grpc.Core.dll</HintPath>
     </Reference>
     <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -69,17 +71,13 @@
     </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <Import Project="..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets" Condition="Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" />
+  <Import Project="..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>
       <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
     </PropertyGroup>
-    <Error Condition="!Exists('..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.zlib.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets'))" />
-    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
+    <Error Condition="!Exists('..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\grpc.native.csharp.0.13.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets'))" />
   </Target>
-  <Import Project="..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets" Condition="Exists('..\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\portable-net45+netcore45+wpa81+wp8\grpc.dependencies.openssl.redist.targets')" />
-  <Import Project="..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets" Condition="Exists('..\packages\grpc.native.csharp.0.12.0\build\portable-net45+netcore45+wpa81+wp8\grpc.native.csharp.targets')" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

+ 4 - 6
examples/csharp/route_guide/RouteGuideServer/packages.config

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="Google.Protobuf" version="3.0.0-alpha4" targetFramework="net45" />
-  <package id="Grpc" version="0.12.0" targetFramework="net45" />
-  <package id="Grpc.Core" version="0.12.0" targetFramework="net45" />
-  <package id="grpc.dependencies.openssl.redist" version="1.0.204.1" targetFramework="net45" />
-  <package id="grpc.dependencies.zlib.redist" version="1.2.8.10" targetFramework="net45" />
-  <package id="grpc.native.csharp" version="0.12.0" targetFramework="net45" />
+  <package id="Google.Protobuf" version="3.0.0-beta2" targetFramework="net45" />
+  <package id="Grpc" version="0.13.0" targetFramework="net45" />
+  <package id="Grpc.Core" version="0.13.0" targetFramework="net45" />
+  <package id="grpc.native.csharp" version="0.13.0" targetFramework="net45" />
   <package id="Ix-Async" version="1.2.3" targetFramework="net45" />
   <package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
 </packages>

+ 1 - 1
examples/csharp/route_guide/generate_protos.bat

@@ -5,6 +5,6 @@ setlocal
 @rem enter this directory
 cd /d %~dp0
 
-packages\Google.Protobuf.3.0.0-alpha4\tools\protoc.exe -I../../protos --csharp_out RouteGuide  ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=packages\Grpc.Tools.0.12.0\tools\grpc_csharp_plugin.exe
+packages\Google.Protobuf.3.0.0-beta2\tools\protoc.exe -I../../protos --csharp_out RouteGuide  ../../protos/route_guide.proto --grpc_out RouteGuide --plugin=protoc-gen-grpc=packages\Grpc.Tools.0.13.0\tools\grpc_csharp_plugin.exe
 
 endlocal

+ 10 - 16
examples/python/README.md

@@ -6,24 +6,18 @@ Background
 For this sample, we've already generated the server and client stubs from
 [helloworld.proto][] and we'll be using a specific reference platform.
 
-Prerequisites
--------------
-
-- Debian 8.2 "Jessie" platform with `root` access
-- `git`
-- `python2.7`
-- `pip`
-- Python development headers
 
-Set-up
--------
+Install gRPC:
   ```sh
-  $ # install the gRPC Core:
-  $ sudo apt-get install libgrpc-dev
-  $ # install gRPC Python:
-  $ sudo pip install -U grpcio==0.11.0b1
-  $ # Since this "hello, world" example uses protocol buffers:
-  $ sudo pip install -U protobuf==3.0.0a3
+  $ pip install grpcio
+```
+Or, to install it system wide:
+```sh
+	$ sudo pip install grpcio
+```
+
+Download the example
+```sh
   $ # Clone the repository to get the example code:
   $ git clone https://github.com/grpc/grpc
   $ # Navigate to the "hello, world" Python example:

+ 79 - 62
gRPC.podspec

@@ -66,13 +66,14 @@ Pod::Spec.new do |s|
     ss.source_files = 'src/core/profiling/timers.h',
                       'src/core/support/block_annotate.h',
                       'src/core/support/env.h',
-                      'src/core/support/file.h',
+                      'src/core/support/load_file.h',
                       'src/core/support/murmur_hash.h',
                       'src/core/support/stack_lockfree.h',
                       'src/core/support/string.h',
                       'src/core/support/string_win32.h',
                       'src/core/support/thd_internal.h',
                       'src/core/support/time_precise.h',
+                      'src/core/support/tmpfile.h',
                       'include/grpc/support/alloc.h',
                       'include/grpc/support/atm.h',
                       'include/grpc/support/atm_gcc_atomic.h',
@@ -127,11 +128,9 @@ Pod::Spec.new do |s|
                       'src/core/support/env_linux.c',
                       'src/core/support/env_posix.c',
                       'src/core/support/env_win32.c',
-                      'src/core/support/file.c',
-                      'src/core/support/file_posix.c',
-                      'src/core/support/file_win32.c',
                       'src/core/support/histogram.c',
                       'src/core/support/host_port.c',
+                      'src/core/support/load_file.c',
                       'src/core/support/log.c',
                       'src/core/support/log_android.c',
                       'src/core/support/log_linux.c',
@@ -157,21 +156,9 @@ Pod::Spec.new do |s|
                       'src/core/support/time_precise.c',
                       'src/core/support/time_win32.c',
                       'src/core/support/tls_pthread.c',
+                      'src/core/support/tmpfile_posix.c',
+                      'src/core/support/tmpfile_win32.c',
                       'src/core/support/wrap_memcpy.c',
-                      'src/core/security/auth_filters.h',
-                      'src/core/security/base64.h',
-                      'src/core/security/credentials.h',
-                      'src/core/security/handshake.h',
-                      'src/core/security/json_token.h',
-                      'src/core/security/jwt_verifier.h',
-                      'src/core/security/secure_endpoint.h',
-                      'src/core/security/security_connector.h',
-                      'src/core/security/security_context.h',
-                      'src/core/tsi/fake_transport_security.h',
-                      'src/core/tsi/ssl_transport_security.h',
-                      'src/core/tsi/ssl_types.h',
-                      'src/core/tsi/transport_security.h',
-                      'src/core/tsi/transport_security_interface.h',
                       'src/core/census/grpc_filter.h',
                       'src/core/channel/channel_args.h',
                       'src/core/channel/channel_stack.h',
@@ -186,6 +173,7 @@ Pod::Spec.new do |s|
                       'src/core/client_config/client_config.h',
                       'src/core/client_config/connector.h',
                       'src/core/client_config/initial_connect_string.h',
+                      'src/core/client_config/lb_policies/load_balancer_api.h',
                       'src/core/client_config/lb_policies/pick_first.h',
                       'src/core/client_config/lb_policies/round_robin.h',
                       'src/core/client_config/lb_policy.h',
@@ -236,7 +224,6 @@ Pod::Spec.new do |s|
                       'src/core/iomgr/time_averaged_stats.h',
                       'src/core/iomgr/timer.h',
                       'src/core/iomgr/timer_heap.h',
-                      'src/core/iomgr/timer_internal.h',
                       'src/core/iomgr/udp_server.h',
                       'src/core/iomgr/wakeup_fd_pipe.h',
                       'src/core/iomgr/wakeup_fd_posix.h',
@@ -247,6 +234,7 @@ Pod::Spec.new do |s|
                       'src/core/json/json_common.h',
                       'src/core/json/json_reader.h',
                       'src/core/json/json_writer.h',
+                      'src/core/proto/grpc/lb/v0/load_balancer.pb.h',
                       'src/core/statistics/census_interface.h',
                       'src/core/statistics/census_rpc_stats.h',
                       'src/core/surface/api_trace.h',
@@ -286,9 +274,27 @@ Pod::Spec.new do |s|
                       'src/core/transport/static_metadata.h',
                       'src/core/transport/transport.h',
                       'src/core/transport/transport_impl.h',
+                      'src/core/security/auth_filters.h',
+                      'src/core/security/b64.h',
+                      'src/core/security/credentials.h',
+                      'src/core/security/handshake.h',
+                      'src/core/security/json_token.h',
+                      'src/core/security/jwt_verifier.h',
+                      'src/core/security/secure_endpoint.h',
+                      'src/core/security/security_connector.h',
+                      'src/core/security/security_context.h',
+                      'src/core/tsi/fake_transport_security.h',
+                      'src/core/tsi/ssl_transport_security.h',
+                      'src/core/tsi/ssl_types.h',
+                      'src/core/tsi/transport_security.h',
+                      'src/core/tsi/transport_security_interface.h',
                       'src/core/census/aggregation.h',
-                      'src/core/census/log.h',
+                      'src/core/census/mlog.h',
                       'src/core/census/rpc_metric_id.h',
+                      'third_party/nanopb/pb.h',
+                      'third_party/nanopb/pb_common.h',
+                      'third_party/nanopb/pb_decode.h',
+                      'third_party/nanopb/pb_encode.h',
                       'include/grpc/grpc_security.h',
                       'include/grpc/byte_buffer.h',
                       'include/grpc/byte_buffer_reader.h',
@@ -296,27 +302,6 @@ Pod::Spec.new do |s|
                       'include/grpc/grpc.h',
                       'include/grpc/status.h',
                       'include/grpc/census.h',
-                      'src/core/httpcli/httpcli_security_connector.c',
-                      'src/core/security/base64.c',
-                      'src/core/security/client_auth_filter.c',
-                      'src/core/security/credentials.c',
-                      'src/core/security/credentials_metadata.c',
-                      'src/core/security/credentials_posix.c',
-                      'src/core/security/credentials_win32.c',
-                      'src/core/security/google_default_credentials.c',
-                      'src/core/security/handshake.c',
-                      'src/core/security/json_token.c',
-                      'src/core/security/jwt_verifier.c',
-                      'src/core/security/secure_endpoint.c',
-                      'src/core/security/security_connector.c',
-                      'src/core/security/security_context.c',
-                      'src/core/security/server_auth_filter.c',
-                      'src/core/security/server_secure_chttp2.c',
-                      'src/core/surface/init_secure.c',
-                      'src/core/surface/secure_channel_create.c',
-                      'src/core/tsi/fake_transport_security.c',
-                      'src/core/tsi/ssl_transport_security.c',
-                      'src/core/tsi/transport_security.c',
                       'src/core/census/grpc_context.c',
                       'src/core/census/grpc_filter.c',
                       'src/core/channel/channel_args.c',
@@ -332,6 +317,7 @@ Pod::Spec.new do |s|
                       'src/core/client_config/connector.c',
                       'src/core/client_config/default_initial_connect_string.c',
                       'src/core/client_config/initial_connect_string.c',
+                      'src/core/client_config/lb_policies/load_balancer_api.c',
                       'src/core/client_config/lb_policies/pick_first.c',
                       'src/core/client_config/lb_policies/round_robin.c',
                       'src/core/client_config/lb_policy.c',
@@ -346,7 +332,7 @@ Pod::Spec.new do |s|
                       'src/core/client_config/subchannel_factory.c',
                       'src/core/client_config/subchannel_index.c',
                       'src/core/client_config/uri_parser.c',
-                      'src/core/compression/algorithm.c',
+                      'src/core/compression/compression_algorithm.c',
                       'src/core/compression/message_compress.c',
                       'src/core/debug/trace.c',
                       'src/core/httpcli/format_request.c',
@@ -396,6 +382,7 @@ Pod::Spec.new do |s|
                       'src/core/json/json_reader.c',
                       'src/core/json/json_string.c',
                       'src/core/json/json_writer.c',
+                      'src/core/proto/grpc/lb/v0/load_balancer.pb.c',
                       'src/core/surface/alarm.c',
                       'src/core/surface/api_trace.c',
                       'src/core/surface/byte_buffer.c',
@@ -445,37 +432,48 @@ Pod::Spec.new do |s|
                       'src/core/transport/static_metadata.c',
                       'src/core/transport/transport.c',
                       'src/core/transport/transport_op_string.c',
+                      'src/core/httpcli/httpcli_security_connector.c',
+                      'src/core/security/b64.c',
+                      'src/core/security/client_auth_filter.c',
+                      'src/core/security/credentials.c',
+                      'src/core/security/credentials_metadata.c',
+                      'src/core/security/credentials_posix.c',
+                      'src/core/security/credentials_win32.c',
+                      'src/core/security/google_default_credentials.c',
+                      'src/core/security/handshake.c',
+                      'src/core/security/json_token.c',
+                      'src/core/security/jwt_verifier.c',
+                      'src/core/security/secure_endpoint.c',
+                      'src/core/security/security_connector.c',
+                      'src/core/security/security_context.c',
+                      'src/core/security/server_auth_filter.c',
+                      'src/core/security/server_secure_chttp2.c',
+                      'src/core/surface/init_secure.c',
+                      'src/core/surface/secure_channel_create.c',
+                      'src/core/tsi/fake_transport_security.c',
+                      'src/core/tsi/ssl_transport_security.c',
+                      'src/core/tsi/transport_security.c',
                       'src/core/census/context.c',
                       'src/core/census/initialize.c',
-                      'src/core/census/log.c',
+                      'src/core/census/mlog.c',
                       'src/core/census/operation.c',
                       'src/core/census/placeholders.c',
-                      'src/core/census/tracing.c'
+                      'src/core/census/tracing.c',
+                      'third_party/nanopb/pb_common.c',
+                      'third_party/nanopb/pb_decode.c',
+                      'third_party/nanopb/pb_encode.c'
 
     ss.private_header_files = 'src/core/profiling/timers.h',
                               'src/core/support/block_annotate.h',
                               'src/core/support/env.h',
-                              'src/core/support/file.h',
+                              'src/core/support/load_file.h',
                               'src/core/support/murmur_hash.h',
                               'src/core/support/stack_lockfree.h',
                               'src/core/support/string.h',
                               'src/core/support/string_win32.h',
                               'src/core/support/thd_internal.h',
                               'src/core/support/time_precise.h',
-                              'src/core/security/auth_filters.h',
-                              'src/core/security/base64.h',
-                              'src/core/security/credentials.h',
-                              'src/core/security/handshake.h',
-                              'src/core/security/json_token.h',
-                              'src/core/security/jwt_verifier.h',
-                              'src/core/security/secure_endpoint.h',
-                              'src/core/security/security_connector.h',
-                              'src/core/security/security_context.h',
-                              'src/core/tsi/fake_transport_security.h',
-                              'src/core/tsi/ssl_transport_security.h',
-                              'src/core/tsi/ssl_types.h',
-                              'src/core/tsi/transport_security.h',
-                              'src/core/tsi/transport_security_interface.h',
+                              'src/core/support/tmpfile.h',
                               'src/core/census/grpc_filter.h',
                               'src/core/channel/channel_args.h',
                               'src/core/channel/channel_stack.h',
@@ -490,6 +488,7 @@ Pod::Spec.new do |s|
                               'src/core/client_config/client_config.h',
                               'src/core/client_config/connector.h',
                               'src/core/client_config/initial_connect_string.h',
+                              'src/core/client_config/lb_policies/load_balancer_api.h',
                               'src/core/client_config/lb_policies/pick_first.h',
                               'src/core/client_config/lb_policies/round_robin.h',
                               'src/core/client_config/lb_policy.h',
@@ -540,7 +539,6 @@ Pod::Spec.new do |s|
                               'src/core/iomgr/time_averaged_stats.h',
                               'src/core/iomgr/timer.h',
                               'src/core/iomgr/timer_heap.h',
-                              'src/core/iomgr/timer_internal.h',
                               'src/core/iomgr/udp_server.h',
                               'src/core/iomgr/wakeup_fd_pipe.h',
                               'src/core/iomgr/wakeup_fd_posix.h',
@@ -551,6 +549,7 @@ Pod::Spec.new do |s|
                               'src/core/json/json_common.h',
                               'src/core/json/json_reader.h',
                               'src/core/json/json_writer.h',
+                              'src/core/proto/grpc/lb/v0/load_balancer.pb.h',
                               'src/core/statistics/census_interface.h',
                               'src/core/statistics/census_rpc_stats.h',
                               'src/core/surface/api_trace.h',
@@ -590,9 +589,27 @@ Pod::Spec.new do |s|
                               'src/core/transport/static_metadata.h',
                               'src/core/transport/transport.h',
                               'src/core/transport/transport_impl.h',
+                              'src/core/security/auth_filters.h',
+                              'src/core/security/b64.h',
+                              'src/core/security/credentials.h',
+                              'src/core/security/handshake.h',
+                              'src/core/security/json_token.h',
+                              'src/core/security/jwt_verifier.h',
+                              'src/core/security/secure_endpoint.h',
+                              'src/core/security/security_connector.h',
+                              'src/core/security/security_context.h',
+                              'src/core/tsi/fake_transport_security.h',
+                              'src/core/tsi/ssl_transport_security.h',
+                              'src/core/tsi/ssl_types.h',
+                              'src/core/tsi/transport_security.h',
+                              'src/core/tsi/transport_security_interface.h',
                               'src/core/census/aggregation.h',
-                              'src/core/census/log.h',
-                              'src/core/census/rpc_metric_id.h'
+                              'src/core/census/mlog.h',
+                              'src/core/census/rpc_metric_id.h',
+                              'third_party/nanopb/pb.h',
+                              'third_party/nanopb/pb_common.h',
+                              'third_party/nanopb/pb_decode.h',
+                              'third_party/nanopb/pb_encode.h'
 
     ss.header_mappings_dir = '.'
     # This isn't officially supported in Cocoapods. We've asked for an alternative:

+ 1 - 0
grpc.def

@@ -182,6 +182,7 @@ EXPORTS
     gpr_event_wait
     gpr_ref_init
     gpr_ref
+    gpr_ref_non_zero
     gpr_refn
     gpr_unref
     gpr_stats_init

+ 54 - 43
grpc.gemspec

@@ -91,13 +91,14 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/profiling/timers.h )
   s.files += %w( src/core/support/block_annotate.h )
   s.files += %w( src/core/support/env.h )
-  s.files += %w( src/core/support/file.h )
+  s.files += %w( src/core/support/load_file.h )
   s.files += %w( src/core/support/murmur_hash.h )
   s.files += %w( src/core/support/stack_lockfree.h )
   s.files += %w( src/core/support/string.h )
   s.files += %w( src/core/support/string_win32.h )
   s.files += %w( src/core/support/thd_internal.h )
   s.files += %w( src/core/support/time_precise.h )
+  s.files += %w( src/core/support/tmpfile.h )
   s.files += %w( src/core/profiling/basic_timers.c )
   s.files += %w( src/core/profiling/stap_timers.c )
   s.files += %w( src/core/support/alloc.c )
@@ -110,11 +111,9 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/support/env_linux.c )
   s.files += %w( src/core/support/env_posix.c )
   s.files += %w( src/core/support/env_win32.c )
-  s.files += %w( src/core/support/file.c )
-  s.files += %w( src/core/support/file_posix.c )
-  s.files += %w( src/core/support/file_win32.c )
   s.files += %w( src/core/support/histogram.c )
   s.files += %w( src/core/support/host_port.c )
+  s.files += %w( src/core/support/load_file.c )
   s.files += %w( src/core/support/log.c )
   s.files += %w( src/core/support/log_android.c )
   s.files += %w( src/core/support/log_linux.c )
@@ -140,6 +139,8 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/support/time_precise.c )
   s.files += %w( src/core/support/time_win32.c )
   s.files += %w( src/core/support/tls_pthread.c )
+  s.files += %w( src/core/support/tmpfile_posix.c )
+  s.files += %w( src/core/support/tmpfile_win32.c )
   s.files += %w( src/core/support/wrap_memcpy.c )
   s.files += %w( include/grpc/grpc_security.h )
   s.files += %w( include/grpc/byte_buffer.h )
@@ -148,20 +149,6 @@ Gem::Specification.new do |s|
   s.files += %w( include/grpc/grpc.h )
   s.files += %w( include/grpc/status.h )
   s.files += %w( include/grpc/census.h )
-  s.files += %w( src/core/security/auth_filters.h )
-  s.files += %w( src/core/security/base64.h )
-  s.files += %w( src/core/security/credentials.h )
-  s.files += %w( src/core/security/handshake.h )
-  s.files += %w( src/core/security/json_token.h )
-  s.files += %w( src/core/security/jwt_verifier.h )
-  s.files += %w( src/core/security/secure_endpoint.h )
-  s.files += %w( src/core/security/security_connector.h )
-  s.files += %w( src/core/security/security_context.h )
-  s.files += %w( src/core/tsi/fake_transport_security.h )
-  s.files += %w( src/core/tsi/ssl_transport_security.h )
-  s.files += %w( src/core/tsi/ssl_types.h )
-  s.files += %w( src/core/tsi/transport_security.h )
-  s.files += %w( src/core/tsi/transport_security_interface.h )
   s.files += %w( src/core/census/grpc_filter.h )
   s.files += %w( src/core/channel/channel_args.h )
   s.files += %w( src/core/channel/channel_stack.h )
@@ -176,6 +163,7 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/client_config/client_config.h )
   s.files += %w( src/core/client_config/connector.h )
   s.files += %w( src/core/client_config/initial_connect_string.h )
+  s.files += %w( src/core/client_config/lb_policies/load_balancer_api.h )
   s.files += %w( src/core/client_config/lb_policies/pick_first.h )
   s.files += %w( src/core/client_config/lb_policies/round_robin.h )
   s.files += %w( src/core/client_config/lb_policy.h )
@@ -226,7 +214,6 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/iomgr/time_averaged_stats.h )
   s.files += %w( src/core/iomgr/timer.h )
   s.files += %w( src/core/iomgr/timer_heap.h )
-  s.files += %w( src/core/iomgr/timer_internal.h )
   s.files += %w( src/core/iomgr/udp_server.h )
   s.files += %w( src/core/iomgr/wakeup_fd_pipe.h )
   s.files += %w( src/core/iomgr/wakeup_fd_posix.h )
@@ -237,6 +224,7 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/json/json_common.h )
   s.files += %w( src/core/json/json_reader.h )
   s.files += %w( src/core/json/json_writer.h )
+  s.files += %w( src/core/proto/grpc/lb/v0/load_balancer.pb.h )
   s.files += %w( src/core/statistics/census_interface.h )
   s.files += %w( src/core/statistics/census_rpc_stats.h )
   s.files += %w( src/core/surface/api_trace.h )
@@ -276,30 +264,27 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/transport/static_metadata.h )
   s.files += %w( src/core/transport/transport.h )
   s.files += %w( src/core/transport/transport_impl.h )
+  s.files += %w( src/core/security/auth_filters.h )
+  s.files += %w( src/core/security/b64.h )
+  s.files += %w( src/core/security/credentials.h )
+  s.files += %w( src/core/security/handshake.h )
+  s.files += %w( src/core/security/json_token.h )
+  s.files += %w( src/core/security/jwt_verifier.h )
+  s.files += %w( src/core/security/secure_endpoint.h )
+  s.files += %w( src/core/security/security_connector.h )
+  s.files += %w( src/core/security/security_context.h )
+  s.files += %w( src/core/tsi/fake_transport_security.h )
+  s.files += %w( src/core/tsi/ssl_transport_security.h )
+  s.files += %w( src/core/tsi/ssl_types.h )
+  s.files += %w( src/core/tsi/transport_security.h )
+  s.files += %w( src/core/tsi/transport_security_interface.h )
   s.files += %w( src/core/census/aggregation.h )
-  s.files += %w( src/core/census/log.h )
+  s.files += %w( src/core/census/mlog.h )
   s.files += %w( src/core/census/rpc_metric_id.h )
-  s.files += %w( src/core/httpcli/httpcli_security_connector.c )
-  s.files += %w( src/core/security/base64.c )
-  s.files += %w( src/core/security/client_auth_filter.c )
-  s.files += %w( src/core/security/credentials.c )
-  s.files += %w( src/core/security/credentials_metadata.c )
-  s.files += %w( src/core/security/credentials_posix.c )
-  s.files += %w( src/core/security/credentials_win32.c )
-  s.files += %w( src/core/security/google_default_credentials.c )
-  s.files += %w( src/core/security/handshake.c )
-  s.files += %w( src/core/security/json_token.c )
-  s.files += %w( src/core/security/jwt_verifier.c )
-  s.files += %w( src/core/security/secure_endpoint.c )
-  s.files += %w( src/core/security/security_connector.c )
-  s.files += %w( src/core/security/security_context.c )
-  s.files += %w( src/core/security/server_auth_filter.c )
-  s.files += %w( src/core/security/server_secure_chttp2.c )
-  s.files += %w( src/core/surface/init_secure.c )
-  s.files += %w( src/core/surface/secure_channel_create.c )
-  s.files += %w( src/core/tsi/fake_transport_security.c )
-  s.files += %w( src/core/tsi/ssl_transport_security.c )
-  s.files += %w( src/core/tsi/transport_security.c )
+  s.files += %w( third_party/nanopb/pb.h )
+  s.files += %w( third_party/nanopb/pb_common.h )
+  s.files += %w( third_party/nanopb/pb_decode.h )
+  s.files += %w( third_party/nanopb/pb_encode.h )
   s.files += %w( src/core/census/grpc_context.c )
   s.files += %w( src/core/census/grpc_filter.c )
   s.files += %w( src/core/channel/channel_args.c )
@@ -315,6 +300,7 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/client_config/connector.c )
   s.files += %w( src/core/client_config/default_initial_connect_string.c )
   s.files += %w( src/core/client_config/initial_connect_string.c )
+  s.files += %w( src/core/client_config/lb_policies/load_balancer_api.c )
   s.files += %w( src/core/client_config/lb_policies/pick_first.c )
   s.files += %w( src/core/client_config/lb_policies/round_robin.c )
   s.files += %w( src/core/client_config/lb_policy.c )
@@ -329,7 +315,7 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/client_config/subchannel_factory.c )
   s.files += %w( src/core/client_config/subchannel_index.c )
   s.files += %w( src/core/client_config/uri_parser.c )
-  s.files += %w( src/core/compression/algorithm.c )
+  s.files += %w( src/core/compression/compression_algorithm.c )
   s.files += %w( src/core/compression/message_compress.c )
   s.files += %w( src/core/debug/trace.c )
   s.files += %w( src/core/httpcli/format_request.c )
@@ -379,6 +365,7 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/json/json_reader.c )
   s.files += %w( src/core/json/json_string.c )
   s.files += %w( src/core/json/json_writer.c )
+  s.files += %w( src/core/proto/grpc/lb/v0/load_balancer.pb.c )
   s.files += %w( src/core/surface/alarm.c )
   s.files += %w( src/core/surface/api_trace.c )
   s.files += %w( src/core/surface/byte_buffer.c )
@@ -428,12 +415,36 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/transport/static_metadata.c )
   s.files += %w( src/core/transport/transport.c )
   s.files += %w( src/core/transport/transport_op_string.c )
+  s.files += %w( src/core/httpcli/httpcli_security_connector.c )
+  s.files += %w( src/core/security/b64.c )
+  s.files += %w( src/core/security/client_auth_filter.c )
+  s.files += %w( src/core/security/credentials.c )
+  s.files += %w( src/core/security/credentials_metadata.c )
+  s.files += %w( src/core/security/credentials_posix.c )
+  s.files += %w( src/core/security/credentials_win32.c )
+  s.files += %w( src/core/security/google_default_credentials.c )
+  s.files += %w( src/core/security/handshake.c )
+  s.files += %w( src/core/security/json_token.c )
+  s.files += %w( src/core/security/jwt_verifier.c )
+  s.files += %w( src/core/security/secure_endpoint.c )
+  s.files += %w( src/core/security/security_connector.c )
+  s.files += %w( src/core/security/security_context.c )
+  s.files += %w( src/core/security/server_auth_filter.c )
+  s.files += %w( src/core/security/server_secure_chttp2.c )
+  s.files += %w( src/core/surface/init_secure.c )
+  s.files += %w( src/core/surface/secure_channel_create.c )
+  s.files += %w( src/core/tsi/fake_transport_security.c )
+  s.files += %w( src/core/tsi/ssl_transport_security.c )
+  s.files += %w( src/core/tsi/transport_security.c )
   s.files += %w( src/core/census/context.c )
   s.files += %w( src/core/census/initialize.c )
-  s.files += %w( src/core/census/log.c )
+  s.files += %w( src/core/census/mlog.c )
   s.files += %w( src/core/census/operation.c )
   s.files += %w( src/core/census/placeholders.c )
   s.files += %w( src/core/census/tracing.c )
+  s.files += %w( third_party/nanopb/pb_common.c )
+  s.files += %w( third_party/nanopb/pb_decode.c )
+  s.files += %w( third_party/nanopb/pb_encode.c )
   s.files += %w( third_party/boringssl/crypto/aes/internal.h )
   s.files += %w( third_party/boringssl/crypto/asn1/asn1_locl.h )
   s.files += %w( third_party/boringssl/crypto/bio/internal.h )

+ 14 - 3
include/grpc++/alarm.h

@@ -36,9 +36,12 @@
 #ifndef GRPCXX_ALARM_H
 #define GRPCXX_ALARM_H
 
+#include <grpc++/impl/codegen/completion_queue.h>
 #include <grpc++/impl/codegen/completion_queue_tag.h>
 #include <grpc++/impl/codegen/grpc_library.h>
 #include <grpc++/impl/codegen/time.h>
+#include <grpc++/impl/grpc_library.h>
+#include <grpc/grpc.h>
 
 struct grpc_alarm;
 
@@ -54,14 +57,22 @@ class Alarm : private GrpcLibrary {
   /// Once the alarm expires (at \a deadline) or it's cancelled (see \a Cancel),
   /// an event with tag \a tag will be added to \a cq. If the alarm expired, the
   /// event's success bit will be true, false otherwise (ie, upon cancellation).
-  Alarm(CompletionQueue* cq, gpr_timespec deadline, void* tag);
+  /// \internal We rely on the presence of \a cq for grpc initialization. If \a
+  /// cq were ever to be removed, a reference to a static
+  /// internal::GrpcLibraryInitializer instance would need to be introduced
+  /// here. \endinternal.
+  template <typename T>
+  Alarm(CompletionQueue* cq, const T& deadline, void* tag)
+      : tag_(tag),
+        alarm_(grpc_alarm_create(cq->cq(), TimePoint<T>(deadline).raw_time(),
+                                 static_cast<void*>(&tag_))) {}
 
   /// Destroy the given completion queue alarm, cancelling it in the process.
-  ~Alarm();
+  ~Alarm() { grpc_alarm_destroy(alarm_); }
 
   /// Cancel a completion queue alarm. Calling this function over an alarm that
   /// has already fired has no effect.
-  void Cancel();
+  void Cancel() { grpc_alarm_cancel(alarm_); }
 
  private:
   class AlarmEntry : public CompletionQueueTag {

+ 3 - 0
include/grpc++/impl/codegen/call.h

@@ -272,6 +272,7 @@ namespace CallOpGenericRecvMessageHelper {
 class DeserializeFunc {
  public:
   virtual Status Deserialize(grpc_byte_buffer* buf, int max_message_size) = 0;
+  virtual ~DeserializeFunc() {}
 };
 
 template <class R>
@@ -283,6 +284,8 @@ class DeserializeFuncType GRPC_FINAL : public DeserializeFunc {
     return SerializationTraits<R>::Deserialize(buf, message_, max_message_size);
   }
 
+  ~DeserializeFuncType() override {}
+
  private:
   R* message_;  // Not a managed pointer because management is external to this
 };

+ 46 - 10
include/grpc++/impl/codegen/proto_utils.h

@@ -37,21 +37,50 @@
 #include <type_traits>
 
 #include <grpc/impl/codegen/byte_buffer.h>
+#include <grpc/impl/codegen/log.h>
 #include <grpc++/impl/codegen/serialization_traits.h>
 #include <grpc++/impl/codegen/config_protobuf.h>
 #include <grpc++/impl/codegen/status.h>
 
 namespace grpc {
 
-// Serialize the msg into a buffer created inside the function. The caller
-// should destroy the returned buffer when done with it. If serialization fails,
-// false is returned and buffer is left unchanged.
-Status SerializeProto(const grpc::protobuf::Message& msg,
-                      grpc_byte_buffer** buffer);
+class ProtoSerializerInterface {
+ public:
+  // Serialize the msg into a buffer created inside the function. The caller
+  // should destroy the returned buffer when done with it. If serialization
+  // fails,
+  // false is returned and buffer is left unchanged.
+  virtual Status SerializeProto(const grpc::protobuf::Message& msg,
+                                grpc_byte_buffer** buffer) = 0;
+
+  // The caller keeps ownership of buffer and msg.
+  virtual Status DeserializeProto(grpc_byte_buffer* buffer,
+                                  grpc::protobuf::Message* msg,
+                                  int max_message_size) = 0;
+};
+
+// TODO(dgq): This is a temporary fix to work around codegen issues. Its purpose
+// is to hold a polymorphic proto serializer/deserializer instance. It's
+// initialized as part of src/cpp/proto/proto_serializer.cc.
+//
+// This global variable plus all related code (ProtoSerializerInteface,
+// ProtoSerializer) will be removed in the future.
+extern ProtoSerializerInterface* g_proto_serializer;
 
-// The caller keeps ownership of buffer and msg.
-Status DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg,
-                        int max_message_size);
+class ProtoSerializer : public ProtoSerializerInterface {
+ public:
+  // Serialize the msg into a buffer created inside the function. The caller
+  // should destroy the returned buffer when done with it. If serialization
+  // fails,
+  // false is returned and buffer is left unchanged.
+  Status SerializeProto(const grpc::protobuf::Message& msg,
+                        grpc_byte_buffer** buffer) override;
+
+  // The caller keeps ownership of buffer and msg.
+  Status DeserializeProto(grpc_byte_buffer* buffer,
+                          grpc::protobuf::Message* msg,
+                          int max_message_size) override;
+};
 
 template <class T>
 class SerializationTraits<T, typename std::enable_if<std::is_base_of<
@@ -60,12 +89,19 @@ class SerializationTraits<T, typename std::enable_if<std::is_base_of<
   static Status Serialize(const grpc::protobuf::Message& msg,
                           grpc_byte_buffer** buffer, bool* own_buffer) {
     *own_buffer = true;
-    return SerializeProto(msg, buffer);
+    GPR_ASSERT(g_proto_serializer != nullptr &&
+               "No ProtoSerializer instance registered. Make sure grpc++ is "
+               "being initialized.");
+    return g_proto_serializer->SerializeProto(msg, buffer);
   }
   static Status Deserialize(grpc_byte_buffer* buffer,
                             grpc::protobuf::Message* msg,
                             int max_message_size) {
-    auto status = DeserializeProto(buffer, msg, max_message_size);
+    GPR_ASSERT(g_proto_serializer != nullptr &&
+               "No ProtoSerializer instance registered. Make sure grpc++ is "
+               "being initialized.");
+    auto status =
+        g_proto_serializer->DeserializeProto(buffer, msg, max_message_size);
     grpc_byte_buffer_destroy(buffer);
     return status;
   }

+ 4 - 2
include/grpc++/server.h

@@ -79,6 +79,8 @@ class Server GRPC_FINAL : public ServerInterface, private GrpcLibrary {
   class GlobalCallbacks {
    public:
     virtual ~GlobalCallbacks() {}
+    /// Called before server is created.
+    virtual void UpdateArguments(ChannelArguments* args) {}
     /// Called before application callback for each synchronous server request
     virtual void PreSynchronousRequest(ServerContext* context) = 0;
     /// Called after application callback for each synchronous server request
@@ -108,7 +110,7 @@ class Server GRPC_FINAL : public ServerInterface, private GrpcLibrary {
   /// \param max_message_size Maximum message length that the channel can
   /// receive.
   Server(ThreadPoolInterface* thread_pool, bool thread_pool_owned,
-         int max_message_size, const ChannelArguments& args);
+         int max_message_size, ChannelArguments* args);
 
   /// Register a service. This call does not take ownership of the service.
   /// The service must exist for the lifetime of the Server instance.
@@ -177,7 +179,7 @@ class Server GRPC_FINAL : public ServerInterface, private GrpcLibrary {
   bool has_generic_service_;
 
   // Pointer to the c grpc server.
-  grpc_server* const server_;
+  grpc_server* server_;
 
   ThreadPoolInterface* thread_pool_;
   // Whether the thread pool is created and owned by the server.

+ 33 - 49
include/grpc/census.h

@@ -80,18 +80,18 @@ CENSUSAPI int census_enabled(void);
   metrics will be recorded. Keys are unique within a context. */
 typedef struct census_context census_context;
 
-/* A tag is a key:value pair. The key is a non-empty, printable (UTF-8
-   encoded), nil-terminated string. The value is a binary string, that may be
-   printable. There are limits on the sizes of both keys and values (see
-   CENSUS_MAX_TAG_KB_LEN definition below), and the number of tags that can be
-   propagated (CENSUS_MAX_PROPAGATED_TAGS). Users should also remember that
-   some systems may have limits on, e.g., the number of bytes that can be
-   transmitted as metadata, and that larger tags means more memory consumed
-   and time in processing. */
+/* A tag is a key:value pair. Both keys and values are nil-terminated strings,
+   containing printable ASCII characters (decimal 32-126). Keys must be at
+   least one character in length. Both keys and values can have at most
+   CENSUS_MAX_TAG_KB_LEN characters (including the terminating nil). The
+   maximum number of tags that can be propagated is
+   CENSUS_MAX_PROPAGATED_TAGS. Users should also remember that some systems
+   may have limits on, e.g., the number of bytes that can be transmitted as
+   metadata, and that larger tags means more memory consumed and time in
+   processing. */
 typedef struct {
   const char *key;
   const char *value;
-  size_t value_len;
   uint8_t flags;
 } census_tag;
 
@@ -103,28 +103,25 @@ typedef struct {
 /* Tag flags. */
 #define CENSUS_TAG_PROPAGATE 1 /* Tag should be propagated over RPC */
 #define CENSUS_TAG_STATS 2     /* Tag will be used for statistics aggregation */
-#define CENSUS_TAG_BINARY 4    /* Tag value is not printable */
-#define CENSUS_TAG_RESERVED 8  /* Reserved for internal use. */
-/* Flag values 8,16,32,64,128 are reserved for future/internal use. Clients
+#define CENSUS_TAG_RESERVED 4  /* Reserved for internal use. */
+/* Flag values 4,8,16,32,64,128 are reserved for future/internal use. Clients
    should not use or rely on their values. */
 
 #define CENSUS_TAG_IS_PROPAGATED(flags) (flags & CENSUS_TAG_PROPAGATE)
 #define CENSUS_TAG_IS_STATS(flags) (flags & CENSUS_TAG_STATS)
-#define CENSUS_TAG_IS_BINARY(flags) (flags & CENSUS_TAG_BINARY)
 
 /* An instance of this structure is kept by every context, and records the
    basic information associated with the creation of that context. */
 typedef struct {
-  int n_propagated_tags;        /* number of propagated printable tags */
-  int n_propagated_binary_tags; /* number of propagated binary tags */
-  int n_local_tags;             /* number of non-propagated (local) tags */
-  int n_deleted_tags;           /* number of tags that were deleted */
-  int n_added_tags;             /* number of tags that were added */
-  int n_modified_tags;          /* number of tags that were modified */
-  int n_invalid_tags;           /* number of tags with bad keys or values (e.g.
-                                   longer than CENSUS_MAX_TAG_KV_LEN) */
-  int n_ignored_tags;           /* number of tags ignored because of
-                                   CENSUS_MAX_PROPAGATED_TAGS limit. */
+  int n_propagated_tags; /* number of propagated tags */
+  int n_local_tags;      /* number of non-propagated (local) tags */
+  int n_deleted_tags;    /* number of tags that were deleted */
+  int n_added_tags;      /* number of tags that were added */
+  int n_modified_tags;   /* number of tags that were modified */
+  int n_invalid_tags;    /* number of tags with bad keys or values (e.g.
+                            longer than CENSUS_MAX_TAG_KV_LEN) */
+  int n_ignored_tags;    /* number of tags ignored because of
+                            CENSUS_MAX_PROPAGATED_TAGS limit. */
 } census_context_status;
 
 /* Create a new context, adding and removing tags from an existing context.
@@ -132,10 +129,10 @@ typedef struct {
    to add as many tags in a single operation as is practical for the client.
    @param base Base context to build upon. Can be NULL.
    @param tags A set of tags to be added/changed/deleted. Tags with keys that
-   are in 'tags', but not 'base', are added to the tag set. Keys that are in
+   are in 'tags', but not 'base', are added to the context. Keys that are in
    both 'tags' and 'base' will have their value/flags modified. Tags with keys
-   in both, but with NULL or zero-length values, will be deleted from the tag
-   set. Tags with invalid (too long or short) keys or values will be ignored.
+   in both, but with NULL values, will be deleted from the context. Tags with
+   invalid (too long or short) keys or values will be ignored.
    If adding a tag will result in more than CENSUS_MAX_PROPAGATED_TAGS in either
    binary or non-binary tags, they will be ignored, as will deletions of
    tags that don't exist.
@@ -185,32 +182,19 @@ CENSUSAPI int census_context_get_tag(const census_context *context,
    for use by RPC systems only, for purposes of transmitting/receiving contexts.
    */
 
-/* Encode a context into a buffer. The propagated tags are encoded into the
-   buffer in two regions: one for printable tags, and one for binary tags.
+/* Encode a context into a buffer.
    @param context context to be encoded
-   @param buffer pointer to buffer. This address will be used to encode the
-                 printable tags.
+   @param buffer buffer into which the context will be encoded.
    @param buf_size number of available bytes in buffer.
-   @param print_buf_size Will be set to the number of bytes consumed by
-                         printable tags.
-   @param bin_buf_size Will be set to the number of bytes used to encode the
-                       binary tags.
-   @return A pointer to the binary tag's encoded, or NULL if the buffer was
-           insufficiently large to hold the encoded tags. Thus, if successful,
-           printable tags are encoded into
-           [buffer, buffer + *print_buf_size) and binary tags into
-           [returned-ptr, returned-ptr + *bin_buf_size) (and the returned
-           pointer should be buffer + *print_buf_size) */
-CENSUSAPI char *census_context_encode(const census_context *context,
-                                      char *buffer, size_t buf_size,
-                                      size_t *print_buf_size,
-                                      size_t *bin_buf_size);
-
-/* Decode context buffers encoded with census_context_encode(). Returns NULL
+   @return The number of buffer bytes consumed for the encoded context, or
+           zero if the buffer was of insufficient size. */
+CENSUSAPI size_t census_context_encode(const census_context *context,
+                                       char *buffer, size_t buf_size);
+
+/* Decode context buffer encoded with census_context_encode(). Returns NULL
    if there is an error in parsing either buffer. */
-CENSUSAPI census_context *census_context_decode(const char *buffer, size_t size,
-                                                const char *bin_buffer,
-                                                size_t bin_size);
+CENSUSAPI census_context *census_context_decode(const char *buffer,
+                                                size_t size);
 
 /* Distributed traces can have a number of options. */
 enum census_trace_mask_values {

+ 4 - 0
include/grpc/impl/codegen/sync.h

@@ -182,6 +182,10 @@ GPRAPI void gpr_ref_init(gpr_refcount *r, int n);
 /* Increment the reference count *r.  Requires *r initialized. */
 GPRAPI void gpr_ref(gpr_refcount *r);
 
+/* Increment the reference count *r.  Requires *r initialized.
+   Crashes if refcount is zero */
+GPRAPI void gpr_ref_non_zero(gpr_refcount *r);
+
 /* Increment the reference count *r by n.  Requires *r initialized, n > 0. */
 GPRAPI void gpr_refn(gpr_refcount *r, int n);
 

+ 455 - 444
package.json

@@ -86,407 +86,6 @@
     "src/node/src/grpc_extension.js",
     "src/node/src/metadata.js",
     "src/node/src/server.js",
-    "third_party/boringssl/crypto/aes/internal.h",
-    "third_party/boringssl/crypto/asn1/asn1_locl.h",
-    "third_party/boringssl/crypto/bio/internal.h",
-    "third_party/boringssl/crypto/bn/internal.h",
-    "third_party/boringssl/crypto/bn/rsaz_exp.h",
-    "third_party/boringssl/crypto/bytestring/internal.h",
-    "third_party/boringssl/crypto/cipher/internal.h",
-    "third_party/boringssl/crypto/conf/conf_def.h",
-    "third_party/boringssl/crypto/conf/internal.h",
-    "third_party/boringssl/crypto/des/internal.h",
-    "third_party/boringssl/crypto/dh/internal.h",
-    "third_party/boringssl/crypto/digest/internal.h",
-    "third_party/boringssl/crypto/digest/md32_common.h",
-    "third_party/boringssl/crypto/directory.h",
-    "third_party/boringssl/crypto/dsa/internal.h",
-    "third_party/boringssl/crypto/ec/internal.h",
-    "third_party/boringssl/crypto/ec/p256-x86_64-table.h",
-    "third_party/boringssl/crypto/evp/internal.h",
-    "third_party/boringssl/crypto/internal.h",
-    "third_party/boringssl/crypto/modes/internal.h",
-    "third_party/boringssl/crypto/obj/obj_dat.h",
-    "third_party/boringssl/crypto/obj/obj_xref.h",
-    "third_party/boringssl/crypto/pkcs8/internal.h",
-    "third_party/boringssl/crypto/rand/internal.h",
-    "third_party/boringssl/crypto/rsa/internal.h",
-    "third_party/boringssl/crypto/test/scoped_types.h",
-    "third_party/boringssl/crypto/test/test_util.h",
-    "third_party/boringssl/crypto/x509/charmap.h",
-    "third_party/boringssl/crypto/x509/vpm_int.h",
-    "third_party/boringssl/crypto/x509v3/ext_dat.h",
-    "third_party/boringssl/crypto/x509v3/pcy_int.h",
-    "third_party/boringssl/include/openssl/aead.h",
-    "third_party/boringssl/include/openssl/aes.h",
-    "third_party/boringssl/include/openssl/arm_arch.h",
-    "third_party/boringssl/include/openssl/asn1.h",
-    "third_party/boringssl/include/openssl/asn1_mac.h",
-    "third_party/boringssl/include/openssl/asn1t.h",
-    "third_party/boringssl/include/openssl/base.h",
-    "third_party/boringssl/include/openssl/base64.h",
-    "third_party/boringssl/include/openssl/bio.h",
-    "third_party/boringssl/include/openssl/blowfish.h",
-    "third_party/boringssl/include/openssl/bn.h",
-    "third_party/boringssl/include/openssl/buf.h",
-    "third_party/boringssl/include/openssl/buffer.h",
-    "third_party/boringssl/include/openssl/bytestring.h",
-    "third_party/boringssl/include/openssl/cast.h",
-    "third_party/boringssl/include/openssl/chacha.h",
-    "third_party/boringssl/include/openssl/cipher.h",
-    "third_party/boringssl/include/openssl/cmac.h",
-    "third_party/boringssl/include/openssl/conf.h",
-    "third_party/boringssl/include/openssl/cpu.h",
-    "third_party/boringssl/include/openssl/crypto.h",
-    "third_party/boringssl/include/openssl/curve25519.h",
-    "third_party/boringssl/include/openssl/des.h",
-    "third_party/boringssl/include/openssl/dh.h",
-    "third_party/boringssl/include/openssl/digest.h",
-    "third_party/boringssl/include/openssl/dsa.h",
-    "third_party/boringssl/include/openssl/dtls1.h",
-    "third_party/boringssl/include/openssl/ec.h",
-    "third_party/boringssl/include/openssl/ec_key.h",
-    "third_party/boringssl/include/openssl/ecdh.h",
-    "third_party/boringssl/include/openssl/ecdsa.h",
-    "third_party/boringssl/include/openssl/engine.h",
-    "third_party/boringssl/include/openssl/err.h",
-    "third_party/boringssl/include/openssl/evp.h",
-    "third_party/boringssl/include/openssl/ex_data.h",
-    "third_party/boringssl/include/openssl/hkdf.h",
-    "third_party/boringssl/include/openssl/hmac.h",
-    "third_party/boringssl/include/openssl/lhash.h",
-    "third_party/boringssl/include/openssl/lhash_macros.h",
-    "third_party/boringssl/include/openssl/md4.h",
-    "third_party/boringssl/include/openssl/md5.h",
-    "third_party/boringssl/include/openssl/mem.h",
-    "third_party/boringssl/include/openssl/obj.h",
-    "third_party/boringssl/include/openssl/obj_mac.h",
-    "third_party/boringssl/include/openssl/objects.h",
-    "third_party/boringssl/include/openssl/opensslfeatures.h",
-    "third_party/boringssl/include/openssl/opensslv.h",
-    "third_party/boringssl/include/openssl/ossl_typ.h",
-    "third_party/boringssl/include/openssl/pem.h",
-    "third_party/boringssl/include/openssl/pkcs12.h",
-    "third_party/boringssl/include/openssl/pkcs7.h",
-    "third_party/boringssl/include/openssl/pkcs8.h",
-    "third_party/boringssl/include/openssl/poly1305.h",
-    "third_party/boringssl/include/openssl/pqueue.h",
-    "third_party/boringssl/include/openssl/rand.h",
-    "third_party/boringssl/include/openssl/rc4.h",
-    "third_party/boringssl/include/openssl/rsa.h",
-    "third_party/boringssl/include/openssl/safestack.h",
-    "third_party/boringssl/include/openssl/sha.h",
-    "third_party/boringssl/include/openssl/srtp.h",
-    "third_party/boringssl/include/openssl/ssl.h",
-    "third_party/boringssl/include/openssl/ssl3.h",
-    "third_party/boringssl/include/openssl/stack.h",
-    "third_party/boringssl/include/openssl/stack_macros.h",
-    "third_party/boringssl/include/openssl/thread.h",
-    "third_party/boringssl/include/openssl/time_support.h",
-    "third_party/boringssl/include/openssl/tls1.h",
-    "third_party/boringssl/include/openssl/type_check.h",
-    "third_party/boringssl/include/openssl/x509.h",
-    "third_party/boringssl/include/openssl/x509_vfy.h",
-    "third_party/boringssl/include/openssl/x509v3.h",
-    "third_party/boringssl/ssl/internal.h",
-    "third_party/boringssl/ssl/test/async_bio.h",
-    "third_party/boringssl/ssl/test/packeted_bio.h",
-    "third_party/boringssl/ssl/test/scoped_types.h",
-    "third_party/boringssl/ssl/test/test_config.h",
-    "src/boringssl/err_data.c",
-    "third_party/boringssl/crypto/aes/aes.c",
-    "third_party/boringssl/crypto/aes/mode_wrappers.c",
-    "third_party/boringssl/crypto/asn1/a_bitstr.c",
-    "third_party/boringssl/crypto/asn1/a_bool.c",
-    "third_party/boringssl/crypto/asn1/a_bytes.c",
-    "third_party/boringssl/crypto/asn1/a_d2i_fp.c",
-    "third_party/boringssl/crypto/asn1/a_dup.c",
-    "third_party/boringssl/crypto/asn1/a_enum.c",
-    "third_party/boringssl/crypto/asn1/a_gentm.c",
-    "third_party/boringssl/crypto/asn1/a_i2d_fp.c",
-    "third_party/boringssl/crypto/asn1/a_int.c",
-    "third_party/boringssl/crypto/asn1/a_mbstr.c",
-    "third_party/boringssl/crypto/asn1/a_object.c",
-    "third_party/boringssl/crypto/asn1/a_octet.c",
-    "third_party/boringssl/crypto/asn1/a_print.c",
-    "third_party/boringssl/crypto/asn1/a_strnid.c",
-    "third_party/boringssl/crypto/asn1/a_time.c",
-    "third_party/boringssl/crypto/asn1/a_type.c",
-    "third_party/boringssl/crypto/asn1/a_utctm.c",
-    "third_party/boringssl/crypto/asn1/a_utf8.c",
-    "third_party/boringssl/crypto/asn1/asn1_lib.c",
-    "third_party/boringssl/crypto/asn1/asn1_par.c",
-    "third_party/boringssl/crypto/asn1/asn_pack.c",
-    "third_party/boringssl/crypto/asn1/bio_asn1.c",
-    "third_party/boringssl/crypto/asn1/bio_ndef.c",
-    "third_party/boringssl/crypto/asn1/f_enum.c",
-    "third_party/boringssl/crypto/asn1/f_int.c",
-    "third_party/boringssl/crypto/asn1/f_string.c",
-    "third_party/boringssl/crypto/asn1/t_bitst.c",
-    "third_party/boringssl/crypto/asn1/t_pkey.c",
-    "third_party/boringssl/crypto/asn1/tasn_dec.c",
-    "third_party/boringssl/crypto/asn1/tasn_enc.c",
-    "third_party/boringssl/crypto/asn1/tasn_fre.c",
-    "third_party/boringssl/crypto/asn1/tasn_new.c",
-    "third_party/boringssl/crypto/asn1/tasn_prn.c",
-    "third_party/boringssl/crypto/asn1/tasn_typ.c",
-    "third_party/boringssl/crypto/asn1/tasn_utl.c",
-    "third_party/boringssl/crypto/asn1/x_bignum.c",
-    "third_party/boringssl/crypto/asn1/x_long.c",
-    "third_party/boringssl/crypto/base64/base64.c",
-    "third_party/boringssl/crypto/bio/bio.c",
-    "third_party/boringssl/crypto/bio/bio_mem.c",
-    "third_party/boringssl/crypto/bio/buffer.c",
-    "third_party/boringssl/crypto/bio/connect.c",
-    "third_party/boringssl/crypto/bio/fd.c",
-    "third_party/boringssl/crypto/bio/file.c",
-    "third_party/boringssl/crypto/bio/hexdump.c",
-    "third_party/boringssl/crypto/bio/pair.c",
-    "third_party/boringssl/crypto/bio/printf.c",
-    "third_party/boringssl/crypto/bio/socket.c",
-    "third_party/boringssl/crypto/bio/socket_helper.c",
-    "third_party/boringssl/crypto/bn/add.c",
-    "third_party/boringssl/crypto/bn/asm/x86_64-gcc.c",
-    "third_party/boringssl/crypto/bn/bn.c",
-    "third_party/boringssl/crypto/bn/bn_asn1.c",
-    "third_party/boringssl/crypto/bn/cmp.c",
-    "third_party/boringssl/crypto/bn/convert.c",
-    "third_party/boringssl/crypto/bn/ctx.c",
-    "third_party/boringssl/crypto/bn/div.c",
-    "third_party/boringssl/crypto/bn/exponentiation.c",
-    "third_party/boringssl/crypto/bn/gcd.c",
-    "third_party/boringssl/crypto/bn/generic.c",
-    "third_party/boringssl/crypto/bn/kronecker.c",
-    "third_party/boringssl/crypto/bn/montgomery.c",
-    "third_party/boringssl/crypto/bn/mul.c",
-    "third_party/boringssl/crypto/bn/prime.c",
-    "third_party/boringssl/crypto/bn/random.c",
-    "third_party/boringssl/crypto/bn/rsaz_exp.c",
-    "third_party/boringssl/crypto/bn/shift.c",
-    "third_party/boringssl/crypto/bn/sqrt.c",
-    "third_party/boringssl/crypto/buf/buf.c",
-    "third_party/boringssl/crypto/bytestring/ber.c",
-    "third_party/boringssl/crypto/bytestring/cbb.c",
-    "third_party/boringssl/crypto/bytestring/cbs.c",
-    "third_party/boringssl/crypto/chacha/chacha_generic.c",
-    "third_party/boringssl/crypto/chacha/chacha_vec.c",
-    "third_party/boringssl/crypto/cipher/aead.c",
-    "third_party/boringssl/crypto/cipher/cipher.c",
-    "third_party/boringssl/crypto/cipher/derive_key.c",
-    "third_party/boringssl/crypto/cipher/e_aes.c",
-    "third_party/boringssl/crypto/cipher/e_chacha20poly1305.c",
-    "third_party/boringssl/crypto/cipher/e_des.c",
-    "third_party/boringssl/crypto/cipher/e_null.c",
-    "third_party/boringssl/crypto/cipher/e_rc2.c",
-    "third_party/boringssl/crypto/cipher/e_rc4.c",
-    "third_party/boringssl/crypto/cipher/e_ssl3.c",
-    "third_party/boringssl/crypto/cipher/e_tls.c",
-    "third_party/boringssl/crypto/cipher/tls_cbc.c",
-    "third_party/boringssl/crypto/cmac/cmac.c",
-    "third_party/boringssl/crypto/conf/conf.c",
-    "third_party/boringssl/crypto/cpu-arm.c",
-    "third_party/boringssl/crypto/cpu-intel.c",
-    "third_party/boringssl/crypto/crypto.c",
-    "third_party/boringssl/crypto/curve25519/curve25519.c",
-    "third_party/boringssl/crypto/des/des.c",
-    "third_party/boringssl/crypto/dh/check.c",
-    "third_party/boringssl/crypto/dh/dh.c",
-    "third_party/boringssl/crypto/dh/dh_asn1.c",
-    "third_party/boringssl/crypto/dh/params.c",
-    "third_party/boringssl/crypto/digest/digest.c",
-    "third_party/boringssl/crypto/digest/digests.c",
-    "third_party/boringssl/crypto/directory_posix.c",
-    "third_party/boringssl/crypto/directory_win.c",
-    "third_party/boringssl/crypto/dsa/dsa.c",
-    "third_party/boringssl/crypto/dsa/dsa_asn1.c",
-    "third_party/boringssl/crypto/ec/ec.c",
-    "third_party/boringssl/crypto/ec/ec_asn1.c",
-    "third_party/boringssl/crypto/ec/ec_key.c",
-    "third_party/boringssl/crypto/ec/ec_montgomery.c",
-    "third_party/boringssl/crypto/ec/oct.c",
-    "third_party/boringssl/crypto/ec/p224-64.c",
-    "third_party/boringssl/crypto/ec/p256-64.c",
-    "third_party/boringssl/crypto/ec/p256-x86_64.c",
-    "third_party/boringssl/crypto/ec/simple.c",
-    "third_party/boringssl/crypto/ec/util-64.c",
-    "third_party/boringssl/crypto/ec/wnaf.c",
-    "third_party/boringssl/crypto/ecdh/ecdh.c",
-    "third_party/boringssl/crypto/ecdsa/ecdsa.c",
-    "third_party/boringssl/crypto/ecdsa/ecdsa_asn1.c",
-    "third_party/boringssl/crypto/engine/engine.c",
-    "third_party/boringssl/crypto/err/err.c",
-    "third_party/boringssl/crypto/evp/algorithm.c",
-    "third_party/boringssl/crypto/evp/digestsign.c",
-    "third_party/boringssl/crypto/evp/evp.c",
-    "third_party/boringssl/crypto/evp/evp_asn1.c",
-    "third_party/boringssl/crypto/evp/evp_ctx.c",
-    "third_party/boringssl/crypto/evp/p_dsa_asn1.c",
-    "third_party/boringssl/crypto/evp/p_ec.c",
-    "third_party/boringssl/crypto/evp/p_ec_asn1.c",
-    "third_party/boringssl/crypto/evp/p_rsa.c",
-    "third_party/boringssl/crypto/evp/p_rsa_asn1.c",
-    "third_party/boringssl/crypto/evp/pbkdf.c",
-    "third_party/boringssl/crypto/evp/sign.c",
-    "third_party/boringssl/crypto/ex_data.c",
-    "third_party/boringssl/crypto/hkdf/hkdf.c",
-    "third_party/boringssl/crypto/hmac/hmac.c",
-    "third_party/boringssl/crypto/lhash/lhash.c",
-    "third_party/boringssl/crypto/md4/md4.c",
-    "third_party/boringssl/crypto/md5/md5.c",
-    "third_party/boringssl/crypto/mem.c",
-    "third_party/boringssl/crypto/modes/cbc.c",
-    "third_party/boringssl/crypto/modes/cfb.c",
-    "third_party/boringssl/crypto/modes/ctr.c",
-    "third_party/boringssl/crypto/modes/gcm.c",
-    "third_party/boringssl/crypto/modes/ofb.c",
-    "third_party/boringssl/crypto/obj/obj.c",
-    "third_party/boringssl/crypto/obj/obj_xref.c",
-    "third_party/boringssl/crypto/pem/pem_all.c",
-    "third_party/boringssl/crypto/pem/pem_info.c",
-    "third_party/boringssl/crypto/pem/pem_lib.c",
-    "third_party/boringssl/crypto/pem/pem_oth.c",
-    "third_party/boringssl/crypto/pem/pem_pk8.c",
-    "third_party/boringssl/crypto/pem/pem_pkey.c",
-    "third_party/boringssl/crypto/pem/pem_x509.c",
-    "third_party/boringssl/crypto/pem/pem_xaux.c",
-    "third_party/boringssl/crypto/pkcs8/p5_pbe.c",
-    "third_party/boringssl/crypto/pkcs8/p5_pbev2.c",
-    "third_party/boringssl/crypto/pkcs8/p8_pkey.c",
-    "third_party/boringssl/crypto/pkcs8/pkcs8.c",
-    "third_party/boringssl/crypto/poly1305/poly1305.c",
-    "third_party/boringssl/crypto/poly1305/poly1305_arm.c",
-    "third_party/boringssl/crypto/poly1305/poly1305_vec.c",
-    "third_party/boringssl/crypto/rand/rand.c",
-    "third_party/boringssl/crypto/rand/urandom.c",
-    "third_party/boringssl/crypto/rand/windows.c",
-    "third_party/boringssl/crypto/rc4/rc4.c",
-    "third_party/boringssl/crypto/refcount_c11.c",
-    "third_party/boringssl/crypto/refcount_lock.c",
-    "third_party/boringssl/crypto/rsa/blinding.c",
-    "third_party/boringssl/crypto/rsa/padding.c",
-    "third_party/boringssl/crypto/rsa/rsa.c",
-    "third_party/boringssl/crypto/rsa/rsa_asn1.c",
-    "third_party/boringssl/crypto/rsa/rsa_impl.c",
-    "third_party/boringssl/crypto/sha/sha1.c",
-    "third_party/boringssl/crypto/sha/sha256.c",
-    "third_party/boringssl/crypto/sha/sha512.c",
-    "third_party/boringssl/crypto/stack/stack.c",
-    "third_party/boringssl/crypto/thread.c",
-    "third_party/boringssl/crypto/thread_none.c",
-    "third_party/boringssl/crypto/thread_pthread.c",
-    "third_party/boringssl/crypto/thread_win.c",
-    "third_party/boringssl/crypto/time_support.c",
-    "third_party/boringssl/crypto/x509/a_digest.c",
-    "third_party/boringssl/crypto/x509/a_sign.c",
-    "third_party/boringssl/crypto/x509/a_strex.c",
-    "third_party/boringssl/crypto/x509/a_verify.c",
-    "third_party/boringssl/crypto/x509/asn1_gen.c",
-    "third_party/boringssl/crypto/x509/by_dir.c",
-    "third_party/boringssl/crypto/x509/by_file.c",
-    "third_party/boringssl/crypto/x509/i2d_pr.c",
-    "third_party/boringssl/crypto/x509/pkcs7.c",
-    "third_party/boringssl/crypto/x509/t_crl.c",
-    "third_party/boringssl/crypto/x509/t_req.c",
-    "third_party/boringssl/crypto/x509/t_x509.c",
-    "third_party/boringssl/crypto/x509/t_x509a.c",
-    "third_party/boringssl/crypto/x509/x509.c",
-    "third_party/boringssl/crypto/x509/x509_att.c",
-    "third_party/boringssl/crypto/x509/x509_cmp.c",
-    "third_party/boringssl/crypto/x509/x509_d2.c",
-    "third_party/boringssl/crypto/x509/x509_def.c",
-    "third_party/boringssl/crypto/x509/x509_ext.c",
-    "third_party/boringssl/crypto/x509/x509_lu.c",
-    "third_party/boringssl/crypto/x509/x509_obj.c",
-    "third_party/boringssl/crypto/x509/x509_r2x.c",
-    "third_party/boringssl/crypto/x509/x509_req.c",
-    "third_party/boringssl/crypto/x509/x509_set.c",
-    "third_party/boringssl/crypto/x509/x509_trs.c",
-    "third_party/boringssl/crypto/x509/x509_txt.c",
-    "third_party/boringssl/crypto/x509/x509_v3.c",
-    "third_party/boringssl/crypto/x509/x509_vfy.c",
-    "third_party/boringssl/crypto/x509/x509_vpm.c",
-    "third_party/boringssl/crypto/x509/x509cset.c",
-    "third_party/boringssl/crypto/x509/x509name.c",
-    "third_party/boringssl/crypto/x509/x509rset.c",
-    "third_party/boringssl/crypto/x509/x509spki.c",
-    "third_party/boringssl/crypto/x509/x509type.c",
-    "third_party/boringssl/crypto/x509/x_algor.c",
-    "third_party/boringssl/crypto/x509/x_all.c",
-    "third_party/boringssl/crypto/x509/x_attrib.c",
-    "third_party/boringssl/crypto/x509/x_crl.c",
-    "third_party/boringssl/crypto/x509/x_exten.c",
-    "third_party/boringssl/crypto/x509/x_info.c",
-    "third_party/boringssl/crypto/x509/x_name.c",
-    "third_party/boringssl/crypto/x509/x_pkey.c",
-    "third_party/boringssl/crypto/x509/x_pubkey.c",
-    "third_party/boringssl/crypto/x509/x_req.c",
-    "third_party/boringssl/crypto/x509/x_sig.c",
-    "third_party/boringssl/crypto/x509/x_spki.c",
-    "third_party/boringssl/crypto/x509/x_val.c",
-    "third_party/boringssl/crypto/x509/x_x509.c",
-    "third_party/boringssl/crypto/x509/x_x509a.c",
-    "third_party/boringssl/crypto/x509v3/pcy_cache.c",
-    "third_party/boringssl/crypto/x509v3/pcy_data.c",
-    "third_party/boringssl/crypto/x509v3/pcy_lib.c",
-    "third_party/boringssl/crypto/x509v3/pcy_map.c",
-    "third_party/boringssl/crypto/x509v3/pcy_node.c",
-    "third_party/boringssl/crypto/x509v3/pcy_tree.c",
-    "third_party/boringssl/crypto/x509v3/v3_akey.c",
-    "third_party/boringssl/crypto/x509v3/v3_akeya.c",
-    "third_party/boringssl/crypto/x509v3/v3_alt.c",
-    "third_party/boringssl/crypto/x509v3/v3_bcons.c",
-    "third_party/boringssl/crypto/x509v3/v3_bitst.c",
-    "third_party/boringssl/crypto/x509v3/v3_conf.c",
-    "third_party/boringssl/crypto/x509v3/v3_cpols.c",
-    "third_party/boringssl/crypto/x509v3/v3_crld.c",
-    "third_party/boringssl/crypto/x509v3/v3_enum.c",
-    "third_party/boringssl/crypto/x509v3/v3_extku.c",
-    "third_party/boringssl/crypto/x509v3/v3_genn.c",
-    "third_party/boringssl/crypto/x509v3/v3_ia5.c",
-    "third_party/boringssl/crypto/x509v3/v3_info.c",
-    "third_party/boringssl/crypto/x509v3/v3_int.c",
-    "third_party/boringssl/crypto/x509v3/v3_lib.c",
-    "third_party/boringssl/crypto/x509v3/v3_ncons.c",
-    "third_party/boringssl/crypto/x509v3/v3_pci.c",
-    "third_party/boringssl/crypto/x509v3/v3_pcia.c",
-    "third_party/boringssl/crypto/x509v3/v3_pcons.c",
-    "third_party/boringssl/crypto/x509v3/v3_pku.c",
-    "third_party/boringssl/crypto/x509v3/v3_pmaps.c",
-    "third_party/boringssl/crypto/x509v3/v3_prn.c",
-    "third_party/boringssl/crypto/x509v3/v3_purp.c",
-    "third_party/boringssl/crypto/x509v3/v3_skey.c",
-    "third_party/boringssl/crypto/x509v3/v3_sxnet.c",
-    "third_party/boringssl/crypto/x509v3/v3_utl.c",
-    "third_party/boringssl/ssl/custom_extensions.c",
-    "third_party/boringssl/ssl/d1_both.c",
-    "third_party/boringssl/ssl/d1_clnt.c",
-    "third_party/boringssl/ssl/d1_lib.c",
-    "third_party/boringssl/ssl/d1_meth.c",
-    "third_party/boringssl/ssl/d1_pkt.c",
-    "third_party/boringssl/ssl/d1_srtp.c",
-    "third_party/boringssl/ssl/d1_srvr.c",
-    "third_party/boringssl/ssl/dtls_record.c",
-    "third_party/boringssl/ssl/pqueue/pqueue.c",
-    "third_party/boringssl/ssl/s3_both.c",
-    "third_party/boringssl/ssl/s3_clnt.c",
-    "third_party/boringssl/ssl/s3_enc.c",
-    "third_party/boringssl/ssl/s3_lib.c",
-    "third_party/boringssl/ssl/s3_meth.c",
-    "third_party/boringssl/ssl/s3_pkt.c",
-    "third_party/boringssl/ssl/s3_srvr.c",
-    "third_party/boringssl/ssl/ssl_aead_ctx.c",
-    "third_party/boringssl/ssl/ssl_asn1.c",
-    "third_party/boringssl/ssl/ssl_buffer.c",
-    "third_party/boringssl/ssl/ssl_cert.c",
-    "third_party/boringssl/ssl/ssl_cipher.c",
-    "third_party/boringssl/ssl/ssl_file.c",
-    "third_party/boringssl/ssl/ssl_lib.c",
-    "third_party/boringssl/ssl/ssl_rsa.c",
-    "third_party/boringssl/ssl/ssl_session.c",
-    "third_party/boringssl/ssl/ssl_stat.c",
-    "third_party/boringssl/ssl/t1_enc.c",
-    "third_party/boringssl/ssl/t1_lib.c",
-    "third_party/boringssl/ssl/tls_record.c",
     "include/grpc/grpc_security.h",
     "include/grpc/byte_buffer.h",
     "include/grpc/byte_buffer_reader.h",
@@ -494,20 +93,6 @@
     "include/grpc/grpc.h",
     "include/grpc/status.h",
     "include/grpc/census.h",
-    "src/core/security/auth_filters.h",
-    "src/core/security/base64.h",
-    "src/core/security/credentials.h",
-    "src/core/security/handshake.h",
-    "src/core/security/json_token.h",
-    "src/core/security/jwt_verifier.h",
-    "src/core/security/secure_endpoint.h",
-    "src/core/security/security_connector.h",
-    "src/core/security/security_context.h",
-    "src/core/tsi/fake_transport_security.h",
-    "src/core/tsi/ssl_transport_security.h",
-    "src/core/tsi/ssl_types.h",
-    "src/core/tsi/transport_security.h",
-    "src/core/tsi/transport_security_interface.h",
     "src/core/census/grpc_filter.h",
     "src/core/channel/channel_args.h",
     "src/core/channel/channel_stack.h",
@@ -522,6 +107,7 @@
     "src/core/client_config/client_config.h",
     "src/core/client_config/connector.h",
     "src/core/client_config/initial_connect_string.h",
+    "src/core/client_config/lb_policies/load_balancer_api.h",
     "src/core/client_config/lb_policies/pick_first.h",
     "src/core/client_config/lb_policies/round_robin.h",
     "src/core/client_config/lb_policy.h",
@@ -572,7 +158,6 @@
     "src/core/iomgr/time_averaged_stats.h",
     "src/core/iomgr/timer.h",
     "src/core/iomgr/timer_heap.h",
-    "src/core/iomgr/timer_internal.h",
     "src/core/iomgr/udp_server.h",
     "src/core/iomgr/wakeup_fd_pipe.h",
     "src/core/iomgr/wakeup_fd_posix.h",
@@ -583,6 +168,7 @@
     "src/core/json/json_common.h",
     "src/core/json/json_reader.h",
     "src/core/json/json_writer.h",
+    "src/core/proto/grpc/lb/v0/load_balancer.pb.h",
     "src/core/statistics/census_interface.h",
     "src/core/statistics/census_rpc_stats.h",
     "src/core/surface/api_trace.h",
@@ -622,30 +208,27 @@
     "src/core/transport/static_metadata.h",
     "src/core/transport/transport.h",
     "src/core/transport/transport_impl.h",
+    "src/core/security/auth_filters.h",
+    "src/core/security/b64.h",
+    "src/core/security/credentials.h",
+    "src/core/security/handshake.h",
+    "src/core/security/json_token.h",
+    "src/core/security/jwt_verifier.h",
+    "src/core/security/secure_endpoint.h",
+    "src/core/security/security_connector.h",
+    "src/core/security/security_context.h",
+    "src/core/tsi/fake_transport_security.h",
+    "src/core/tsi/ssl_transport_security.h",
+    "src/core/tsi/ssl_types.h",
+    "src/core/tsi/transport_security.h",
+    "src/core/tsi/transport_security_interface.h",
     "src/core/census/aggregation.h",
-    "src/core/census/log.h",
+    "src/core/census/mlog.h",
     "src/core/census/rpc_metric_id.h",
-    "src/core/httpcli/httpcli_security_connector.c",
-    "src/core/security/base64.c",
-    "src/core/security/client_auth_filter.c",
-    "src/core/security/credentials.c",
-    "src/core/security/credentials_metadata.c",
-    "src/core/security/credentials_posix.c",
-    "src/core/security/credentials_win32.c",
-    "src/core/security/google_default_credentials.c",
-    "src/core/security/handshake.c",
-    "src/core/security/json_token.c",
-    "src/core/security/jwt_verifier.c",
-    "src/core/security/secure_endpoint.c",
-    "src/core/security/security_connector.c",
-    "src/core/security/security_context.c",
-    "src/core/security/server_auth_filter.c",
-    "src/core/security/server_secure_chttp2.c",
-    "src/core/surface/init_secure.c",
-    "src/core/surface/secure_channel_create.c",
-    "src/core/tsi/fake_transport_security.c",
-    "src/core/tsi/ssl_transport_security.c",
-    "src/core/tsi/transport_security.c",
+    "third_party/nanopb/pb.h",
+    "third_party/nanopb/pb_common.h",
+    "third_party/nanopb/pb_decode.h",
+    "third_party/nanopb/pb_encode.h",
     "src/core/census/grpc_context.c",
     "src/core/census/grpc_filter.c",
     "src/core/channel/channel_args.c",
@@ -661,6 +244,7 @@
     "src/core/client_config/connector.c",
     "src/core/client_config/default_initial_connect_string.c",
     "src/core/client_config/initial_connect_string.c",
+    "src/core/client_config/lb_policies/load_balancer_api.c",
     "src/core/client_config/lb_policies/pick_first.c",
     "src/core/client_config/lb_policies/round_robin.c",
     "src/core/client_config/lb_policy.c",
@@ -675,7 +259,7 @@
     "src/core/client_config/subchannel_factory.c",
     "src/core/client_config/subchannel_index.c",
     "src/core/client_config/uri_parser.c",
-    "src/core/compression/algorithm.c",
+    "src/core/compression/compression_algorithm.c",
     "src/core/compression/message_compress.c",
     "src/core/debug/trace.c",
     "src/core/httpcli/format_request.c",
@@ -725,6 +309,7 @@
     "src/core/json/json_reader.c",
     "src/core/json/json_string.c",
     "src/core/json/json_writer.c",
+    "src/core/proto/grpc/lb/v0/load_balancer.pb.c",
     "src/core/surface/alarm.c",
     "src/core/surface/api_trace.c",
     "src/core/surface/byte_buffer.c",
@@ -774,12 +359,36 @@
     "src/core/transport/static_metadata.c",
     "src/core/transport/transport.c",
     "src/core/transport/transport_op_string.c",
+    "src/core/httpcli/httpcli_security_connector.c",
+    "src/core/security/b64.c",
+    "src/core/security/client_auth_filter.c",
+    "src/core/security/credentials.c",
+    "src/core/security/credentials_metadata.c",
+    "src/core/security/credentials_posix.c",
+    "src/core/security/credentials_win32.c",
+    "src/core/security/google_default_credentials.c",
+    "src/core/security/handshake.c",
+    "src/core/security/json_token.c",
+    "src/core/security/jwt_verifier.c",
+    "src/core/security/secure_endpoint.c",
+    "src/core/security/security_connector.c",
+    "src/core/security/security_context.c",
+    "src/core/security/server_auth_filter.c",
+    "src/core/security/server_secure_chttp2.c",
+    "src/core/surface/init_secure.c",
+    "src/core/surface/secure_channel_create.c",
+    "src/core/tsi/fake_transport_security.c",
+    "src/core/tsi/ssl_transport_security.c",
+    "src/core/tsi/transport_security.c",
     "src/core/census/context.c",
     "src/core/census/initialize.c",
-    "src/core/census/log.c",
+    "src/core/census/mlog.c",
     "src/core/census/operation.c",
     "src/core/census/placeholders.c",
     "src/core/census/tracing.c",
+    "third_party/nanopb/pb_common.c",
+    "third_party/nanopb/pb_decode.c",
+    "third_party/nanopb/pb_encode.c",
     "include/grpc/impl/codegen/byte_buffer.h",
     "include/grpc/impl/codegen/compression_types.h",
     "include/grpc/impl/codegen/connectivity_state.h",
@@ -871,13 +480,14 @@
     "src/core/profiling/timers.h",
     "src/core/support/block_annotate.h",
     "src/core/support/env.h",
-    "src/core/support/file.h",
+    "src/core/support/load_file.h",
     "src/core/support/murmur_hash.h",
     "src/core/support/stack_lockfree.h",
     "src/core/support/string.h",
     "src/core/support/string_win32.h",
     "src/core/support/thd_internal.h",
     "src/core/support/time_precise.h",
+    "src/core/support/tmpfile.h",
     "src/core/profiling/basic_timers.c",
     "src/core/profiling/stap_timers.c",
     "src/core/support/alloc.c",
@@ -890,11 +500,9 @@
     "src/core/support/env_linux.c",
     "src/core/support/env_posix.c",
     "src/core/support/env_win32.c",
-    "src/core/support/file.c",
-    "src/core/support/file_posix.c",
-    "src/core/support/file_win32.c",
     "src/core/support/histogram.c",
     "src/core/support/host_port.c",
+    "src/core/support/load_file.c",
     "src/core/support/log.c",
     "src/core/support/log_android.c",
     "src/core/support/log_linux.c",
@@ -920,7 +528,410 @@
     "src/core/support/time_precise.c",
     "src/core/support/time_win32.c",
     "src/core/support/tls_pthread.c",
+    "src/core/support/tmpfile_posix.c",
+    "src/core/support/tmpfile_win32.c",
     "src/core/support/wrap_memcpy.c",
+    "third_party/boringssl/crypto/aes/internal.h",
+    "third_party/boringssl/crypto/asn1/asn1_locl.h",
+    "third_party/boringssl/crypto/bio/internal.h",
+    "third_party/boringssl/crypto/bn/internal.h",
+    "third_party/boringssl/crypto/bn/rsaz_exp.h",
+    "third_party/boringssl/crypto/bytestring/internal.h",
+    "third_party/boringssl/crypto/cipher/internal.h",
+    "third_party/boringssl/crypto/conf/conf_def.h",
+    "third_party/boringssl/crypto/conf/internal.h",
+    "third_party/boringssl/crypto/des/internal.h",
+    "third_party/boringssl/crypto/dh/internal.h",
+    "third_party/boringssl/crypto/digest/internal.h",
+    "third_party/boringssl/crypto/digest/md32_common.h",
+    "third_party/boringssl/crypto/directory.h",
+    "third_party/boringssl/crypto/dsa/internal.h",
+    "third_party/boringssl/crypto/ec/internal.h",
+    "third_party/boringssl/crypto/ec/p256-x86_64-table.h",
+    "third_party/boringssl/crypto/evp/internal.h",
+    "third_party/boringssl/crypto/internal.h",
+    "third_party/boringssl/crypto/modes/internal.h",
+    "third_party/boringssl/crypto/obj/obj_dat.h",
+    "third_party/boringssl/crypto/obj/obj_xref.h",
+    "third_party/boringssl/crypto/pkcs8/internal.h",
+    "third_party/boringssl/crypto/rand/internal.h",
+    "third_party/boringssl/crypto/rsa/internal.h",
+    "third_party/boringssl/crypto/test/scoped_types.h",
+    "third_party/boringssl/crypto/test/test_util.h",
+    "third_party/boringssl/crypto/x509/charmap.h",
+    "third_party/boringssl/crypto/x509/vpm_int.h",
+    "third_party/boringssl/crypto/x509v3/ext_dat.h",
+    "third_party/boringssl/crypto/x509v3/pcy_int.h",
+    "third_party/boringssl/include/openssl/aead.h",
+    "third_party/boringssl/include/openssl/aes.h",
+    "third_party/boringssl/include/openssl/arm_arch.h",
+    "third_party/boringssl/include/openssl/asn1.h",
+    "third_party/boringssl/include/openssl/asn1_mac.h",
+    "third_party/boringssl/include/openssl/asn1t.h",
+    "third_party/boringssl/include/openssl/base.h",
+    "third_party/boringssl/include/openssl/base64.h",
+    "third_party/boringssl/include/openssl/bio.h",
+    "third_party/boringssl/include/openssl/blowfish.h",
+    "third_party/boringssl/include/openssl/bn.h",
+    "third_party/boringssl/include/openssl/buf.h",
+    "third_party/boringssl/include/openssl/buffer.h",
+    "third_party/boringssl/include/openssl/bytestring.h",
+    "third_party/boringssl/include/openssl/cast.h",
+    "third_party/boringssl/include/openssl/chacha.h",
+    "third_party/boringssl/include/openssl/cipher.h",
+    "third_party/boringssl/include/openssl/cmac.h",
+    "third_party/boringssl/include/openssl/conf.h",
+    "third_party/boringssl/include/openssl/cpu.h",
+    "third_party/boringssl/include/openssl/crypto.h",
+    "third_party/boringssl/include/openssl/curve25519.h",
+    "third_party/boringssl/include/openssl/des.h",
+    "third_party/boringssl/include/openssl/dh.h",
+    "third_party/boringssl/include/openssl/digest.h",
+    "third_party/boringssl/include/openssl/dsa.h",
+    "third_party/boringssl/include/openssl/dtls1.h",
+    "third_party/boringssl/include/openssl/ec.h",
+    "third_party/boringssl/include/openssl/ec_key.h",
+    "third_party/boringssl/include/openssl/ecdh.h",
+    "third_party/boringssl/include/openssl/ecdsa.h",
+    "third_party/boringssl/include/openssl/engine.h",
+    "third_party/boringssl/include/openssl/err.h",
+    "third_party/boringssl/include/openssl/evp.h",
+    "third_party/boringssl/include/openssl/ex_data.h",
+    "third_party/boringssl/include/openssl/hkdf.h",
+    "third_party/boringssl/include/openssl/hmac.h",
+    "third_party/boringssl/include/openssl/lhash.h",
+    "third_party/boringssl/include/openssl/lhash_macros.h",
+    "third_party/boringssl/include/openssl/md4.h",
+    "third_party/boringssl/include/openssl/md5.h",
+    "third_party/boringssl/include/openssl/mem.h",
+    "third_party/boringssl/include/openssl/obj.h",
+    "third_party/boringssl/include/openssl/obj_mac.h",
+    "third_party/boringssl/include/openssl/objects.h",
+    "third_party/boringssl/include/openssl/opensslfeatures.h",
+    "third_party/boringssl/include/openssl/opensslv.h",
+    "third_party/boringssl/include/openssl/ossl_typ.h",
+    "third_party/boringssl/include/openssl/pem.h",
+    "third_party/boringssl/include/openssl/pkcs12.h",
+    "third_party/boringssl/include/openssl/pkcs7.h",
+    "third_party/boringssl/include/openssl/pkcs8.h",
+    "third_party/boringssl/include/openssl/poly1305.h",
+    "third_party/boringssl/include/openssl/pqueue.h",
+    "third_party/boringssl/include/openssl/rand.h",
+    "third_party/boringssl/include/openssl/rc4.h",
+    "third_party/boringssl/include/openssl/rsa.h",
+    "third_party/boringssl/include/openssl/safestack.h",
+    "third_party/boringssl/include/openssl/sha.h",
+    "third_party/boringssl/include/openssl/srtp.h",
+    "third_party/boringssl/include/openssl/ssl.h",
+    "third_party/boringssl/include/openssl/ssl3.h",
+    "third_party/boringssl/include/openssl/stack.h",
+    "third_party/boringssl/include/openssl/stack_macros.h",
+    "third_party/boringssl/include/openssl/thread.h",
+    "third_party/boringssl/include/openssl/time_support.h",
+    "third_party/boringssl/include/openssl/tls1.h",
+    "third_party/boringssl/include/openssl/type_check.h",
+    "third_party/boringssl/include/openssl/x509.h",
+    "third_party/boringssl/include/openssl/x509_vfy.h",
+    "third_party/boringssl/include/openssl/x509v3.h",
+    "third_party/boringssl/ssl/internal.h",
+    "third_party/boringssl/ssl/test/async_bio.h",
+    "third_party/boringssl/ssl/test/packeted_bio.h",
+    "third_party/boringssl/ssl/test/scoped_types.h",
+    "third_party/boringssl/ssl/test/test_config.h",
+    "src/boringssl/err_data.c",
+    "third_party/boringssl/crypto/aes/aes.c",
+    "third_party/boringssl/crypto/aes/mode_wrappers.c",
+    "third_party/boringssl/crypto/asn1/a_bitstr.c",
+    "third_party/boringssl/crypto/asn1/a_bool.c",
+    "third_party/boringssl/crypto/asn1/a_bytes.c",
+    "third_party/boringssl/crypto/asn1/a_d2i_fp.c",
+    "third_party/boringssl/crypto/asn1/a_dup.c",
+    "third_party/boringssl/crypto/asn1/a_enum.c",
+    "third_party/boringssl/crypto/asn1/a_gentm.c",
+    "third_party/boringssl/crypto/asn1/a_i2d_fp.c",
+    "third_party/boringssl/crypto/asn1/a_int.c",
+    "third_party/boringssl/crypto/asn1/a_mbstr.c",
+    "third_party/boringssl/crypto/asn1/a_object.c",
+    "third_party/boringssl/crypto/asn1/a_octet.c",
+    "third_party/boringssl/crypto/asn1/a_print.c",
+    "third_party/boringssl/crypto/asn1/a_strnid.c",
+    "third_party/boringssl/crypto/asn1/a_time.c",
+    "third_party/boringssl/crypto/asn1/a_type.c",
+    "third_party/boringssl/crypto/asn1/a_utctm.c",
+    "third_party/boringssl/crypto/asn1/a_utf8.c",
+    "third_party/boringssl/crypto/asn1/asn1_lib.c",
+    "third_party/boringssl/crypto/asn1/asn1_par.c",
+    "third_party/boringssl/crypto/asn1/asn_pack.c",
+    "third_party/boringssl/crypto/asn1/bio_asn1.c",
+    "third_party/boringssl/crypto/asn1/bio_ndef.c",
+    "third_party/boringssl/crypto/asn1/f_enum.c",
+    "third_party/boringssl/crypto/asn1/f_int.c",
+    "third_party/boringssl/crypto/asn1/f_string.c",
+    "third_party/boringssl/crypto/asn1/t_bitst.c",
+    "third_party/boringssl/crypto/asn1/t_pkey.c",
+    "third_party/boringssl/crypto/asn1/tasn_dec.c",
+    "third_party/boringssl/crypto/asn1/tasn_enc.c",
+    "third_party/boringssl/crypto/asn1/tasn_fre.c",
+    "third_party/boringssl/crypto/asn1/tasn_new.c",
+    "third_party/boringssl/crypto/asn1/tasn_prn.c",
+    "third_party/boringssl/crypto/asn1/tasn_typ.c",
+    "third_party/boringssl/crypto/asn1/tasn_utl.c",
+    "third_party/boringssl/crypto/asn1/x_bignum.c",
+    "third_party/boringssl/crypto/asn1/x_long.c",
+    "third_party/boringssl/crypto/base64/base64.c",
+    "third_party/boringssl/crypto/bio/bio.c",
+    "third_party/boringssl/crypto/bio/bio_mem.c",
+    "third_party/boringssl/crypto/bio/buffer.c",
+    "third_party/boringssl/crypto/bio/connect.c",
+    "third_party/boringssl/crypto/bio/fd.c",
+    "third_party/boringssl/crypto/bio/file.c",
+    "third_party/boringssl/crypto/bio/hexdump.c",
+    "third_party/boringssl/crypto/bio/pair.c",
+    "third_party/boringssl/crypto/bio/printf.c",
+    "third_party/boringssl/crypto/bio/socket.c",
+    "third_party/boringssl/crypto/bio/socket_helper.c",
+    "third_party/boringssl/crypto/bn/add.c",
+    "third_party/boringssl/crypto/bn/asm/x86_64-gcc.c",
+    "third_party/boringssl/crypto/bn/bn.c",
+    "third_party/boringssl/crypto/bn/bn_asn1.c",
+    "third_party/boringssl/crypto/bn/cmp.c",
+    "third_party/boringssl/crypto/bn/convert.c",
+    "third_party/boringssl/crypto/bn/ctx.c",
+    "third_party/boringssl/crypto/bn/div.c",
+    "third_party/boringssl/crypto/bn/exponentiation.c",
+    "third_party/boringssl/crypto/bn/gcd.c",
+    "third_party/boringssl/crypto/bn/generic.c",
+    "third_party/boringssl/crypto/bn/kronecker.c",
+    "third_party/boringssl/crypto/bn/montgomery.c",
+    "third_party/boringssl/crypto/bn/mul.c",
+    "third_party/boringssl/crypto/bn/prime.c",
+    "third_party/boringssl/crypto/bn/random.c",
+    "third_party/boringssl/crypto/bn/rsaz_exp.c",
+    "third_party/boringssl/crypto/bn/shift.c",
+    "third_party/boringssl/crypto/bn/sqrt.c",
+    "third_party/boringssl/crypto/buf/buf.c",
+    "third_party/boringssl/crypto/bytestring/ber.c",
+    "third_party/boringssl/crypto/bytestring/cbb.c",
+    "third_party/boringssl/crypto/bytestring/cbs.c",
+    "third_party/boringssl/crypto/chacha/chacha_generic.c",
+    "third_party/boringssl/crypto/chacha/chacha_vec.c",
+    "third_party/boringssl/crypto/cipher/aead.c",
+    "third_party/boringssl/crypto/cipher/cipher.c",
+    "third_party/boringssl/crypto/cipher/derive_key.c",
+    "third_party/boringssl/crypto/cipher/e_aes.c",
+    "third_party/boringssl/crypto/cipher/e_chacha20poly1305.c",
+    "third_party/boringssl/crypto/cipher/e_des.c",
+    "third_party/boringssl/crypto/cipher/e_null.c",
+    "third_party/boringssl/crypto/cipher/e_rc2.c",
+    "third_party/boringssl/crypto/cipher/e_rc4.c",
+    "third_party/boringssl/crypto/cipher/e_ssl3.c",
+    "third_party/boringssl/crypto/cipher/e_tls.c",
+    "third_party/boringssl/crypto/cipher/tls_cbc.c",
+    "third_party/boringssl/crypto/cmac/cmac.c",
+    "third_party/boringssl/crypto/conf/conf.c",
+    "third_party/boringssl/crypto/cpu-arm.c",
+    "third_party/boringssl/crypto/cpu-intel.c",
+    "third_party/boringssl/crypto/crypto.c",
+    "third_party/boringssl/crypto/curve25519/curve25519.c",
+    "third_party/boringssl/crypto/des/des.c",
+    "third_party/boringssl/crypto/dh/check.c",
+    "third_party/boringssl/crypto/dh/dh.c",
+    "third_party/boringssl/crypto/dh/dh_asn1.c",
+    "third_party/boringssl/crypto/dh/params.c",
+    "third_party/boringssl/crypto/digest/digest.c",
+    "third_party/boringssl/crypto/digest/digests.c",
+    "third_party/boringssl/crypto/directory_posix.c",
+    "third_party/boringssl/crypto/directory_win.c",
+    "third_party/boringssl/crypto/dsa/dsa.c",
+    "third_party/boringssl/crypto/dsa/dsa_asn1.c",
+    "third_party/boringssl/crypto/ec/ec.c",
+    "third_party/boringssl/crypto/ec/ec_asn1.c",
+    "third_party/boringssl/crypto/ec/ec_key.c",
+    "third_party/boringssl/crypto/ec/ec_montgomery.c",
+    "third_party/boringssl/crypto/ec/oct.c",
+    "third_party/boringssl/crypto/ec/p224-64.c",
+    "third_party/boringssl/crypto/ec/p256-64.c",
+    "third_party/boringssl/crypto/ec/p256-x86_64.c",
+    "third_party/boringssl/crypto/ec/simple.c",
+    "third_party/boringssl/crypto/ec/util-64.c",
+    "third_party/boringssl/crypto/ec/wnaf.c",
+    "third_party/boringssl/crypto/ecdh/ecdh.c",
+    "third_party/boringssl/crypto/ecdsa/ecdsa.c",
+    "third_party/boringssl/crypto/ecdsa/ecdsa_asn1.c",
+    "third_party/boringssl/crypto/engine/engine.c",
+    "third_party/boringssl/crypto/err/err.c",
+    "third_party/boringssl/crypto/evp/algorithm.c",
+    "third_party/boringssl/crypto/evp/digestsign.c",
+    "third_party/boringssl/crypto/evp/evp.c",
+    "third_party/boringssl/crypto/evp/evp_asn1.c",
+    "third_party/boringssl/crypto/evp/evp_ctx.c",
+    "third_party/boringssl/crypto/evp/p_dsa_asn1.c",
+    "third_party/boringssl/crypto/evp/p_ec.c",
+    "third_party/boringssl/crypto/evp/p_ec_asn1.c",
+    "third_party/boringssl/crypto/evp/p_rsa.c",
+    "third_party/boringssl/crypto/evp/p_rsa_asn1.c",
+    "third_party/boringssl/crypto/evp/pbkdf.c",
+    "third_party/boringssl/crypto/evp/sign.c",
+    "third_party/boringssl/crypto/ex_data.c",
+    "third_party/boringssl/crypto/hkdf/hkdf.c",
+    "third_party/boringssl/crypto/hmac/hmac.c",
+    "third_party/boringssl/crypto/lhash/lhash.c",
+    "third_party/boringssl/crypto/md4/md4.c",
+    "third_party/boringssl/crypto/md5/md5.c",
+    "third_party/boringssl/crypto/mem.c",
+    "third_party/boringssl/crypto/modes/cbc.c",
+    "third_party/boringssl/crypto/modes/cfb.c",
+    "third_party/boringssl/crypto/modes/ctr.c",
+    "third_party/boringssl/crypto/modes/gcm.c",
+    "third_party/boringssl/crypto/modes/ofb.c",
+    "third_party/boringssl/crypto/obj/obj.c",
+    "third_party/boringssl/crypto/obj/obj_xref.c",
+    "third_party/boringssl/crypto/pem/pem_all.c",
+    "third_party/boringssl/crypto/pem/pem_info.c",
+    "third_party/boringssl/crypto/pem/pem_lib.c",
+    "third_party/boringssl/crypto/pem/pem_oth.c",
+    "third_party/boringssl/crypto/pem/pem_pk8.c",
+    "third_party/boringssl/crypto/pem/pem_pkey.c",
+    "third_party/boringssl/crypto/pem/pem_x509.c",
+    "third_party/boringssl/crypto/pem/pem_xaux.c",
+    "third_party/boringssl/crypto/pkcs8/p5_pbe.c",
+    "third_party/boringssl/crypto/pkcs8/p5_pbev2.c",
+    "third_party/boringssl/crypto/pkcs8/p8_pkey.c",
+    "third_party/boringssl/crypto/pkcs8/pkcs8.c",
+    "third_party/boringssl/crypto/poly1305/poly1305.c",
+    "third_party/boringssl/crypto/poly1305/poly1305_arm.c",
+    "third_party/boringssl/crypto/poly1305/poly1305_vec.c",
+    "third_party/boringssl/crypto/rand/rand.c",
+    "third_party/boringssl/crypto/rand/urandom.c",
+    "third_party/boringssl/crypto/rand/windows.c",
+    "third_party/boringssl/crypto/rc4/rc4.c",
+    "third_party/boringssl/crypto/refcount_c11.c",
+    "third_party/boringssl/crypto/refcount_lock.c",
+    "third_party/boringssl/crypto/rsa/blinding.c",
+    "third_party/boringssl/crypto/rsa/padding.c",
+    "third_party/boringssl/crypto/rsa/rsa.c",
+    "third_party/boringssl/crypto/rsa/rsa_asn1.c",
+    "third_party/boringssl/crypto/rsa/rsa_impl.c",
+    "third_party/boringssl/crypto/sha/sha1.c",
+    "third_party/boringssl/crypto/sha/sha256.c",
+    "third_party/boringssl/crypto/sha/sha512.c",
+    "third_party/boringssl/crypto/stack/stack.c",
+    "third_party/boringssl/crypto/thread.c",
+    "third_party/boringssl/crypto/thread_none.c",
+    "third_party/boringssl/crypto/thread_pthread.c",
+    "third_party/boringssl/crypto/thread_win.c",
+    "third_party/boringssl/crypto/time_support.c",
+    "third_party/boringssl/crypto/x509/a_digest.c",
+    "third_party/boringssl/crypto/x509/a_sign.c",
+    "third_party/boringssl/crypto/x509/a_strex.c",
+    "third_party/boringssl/crypto/x509/a_verify.c",
+    "third_party/boringssl/crypto/x509/asn1_gen.c",
+    "third_party/boringssl/crypto/x509/by_dir.c",
+    "third_party/boringssl/crypto/x509/by_file.c",
+    "third_party/boringssl/crypto/x509/i2d_pr.c",
+    "third_party/boringssl/crypto/x509/pkcs7.c",
+    "third_party/boringssl/crypto/x509/t_crl.c",
+    "third_party/boringssl/crypto/x509/t_req.c",
+    "third_party/boringssl/crypto/x509/t_x509.c",
+    "third_party/boringssl/crypto/x509/t_x509a.c",
+    "third_party/boringssl/crypto/x509/x509.c",
+    "third_party/boringssl/crypto/x509/x509_att.c",
+    "third_party/boringssl/crypto/x509/x509_cmp.c",
+    "third_party/boringssl/crypto/x509/x509_d2.c",
+    "third_party/boringssl/crypto/x509/x509_def.c",
+    "third_party/boringssl/crypto/x509/x509_ext.c",
+    "third_party/boringssl/crypto/x509/x509_lu.c",
+    "third_party/boringssl/crypto/x509/x509_obj.c",
+    "third_party/boringssl/crypto/x509/x509_r2x.c",
+    "third_party/boringssl/crypto/x509/x509_req.c",
+    "third_party/boringssl/crypto/x509/x509_set.c",
+    "third_party/boringssl/crypto/x509/x509_trs.c",
+    "third_party/boringssl/crypto/x509/x509_txt.c",
+    "third_party/boringssl/crypto/x509/x509_v3.c",
+    "third_party/boringssl/crypto/x509/x509_vfy.c",
+    "third_party/boringssl/crypto/x509/x509_vpm.c",
+    "third_party/boringssl/crypto/x509/x509cset.c",
+    "third_party/boringssl/crypto/x509/x509name.c",
+    "third_party/boringssl/crypto/x509/x509rset.c",
+    "third_party/boringssl/crypto/x509/x509spki.c",
+    "third_party/boringssl/crypto/x509/x509type.c",
+    "third_party/boringssl/crypto/x509/x_algor.c",
+    "third_party/boringssl/crypto/x509/x_all.c",
+    "third_party/boringssl/crypto/x509/x_attrib.c",
+    "third_party/boringssl/crypto/x509/x_crl.c",
+    "third_party/boringssl/crypto/x509/x_exten.c",
+    "third_party/boringssl/crypto/x509/x_info.c",
+    "third_party/boringssl/crypto/x509/x_name.c",
+    "third_party/boringssl/crypto/x509/x_pkey.c",
+    "third_party/boringssl/crypto/x509/x_pubkey.c",
+    "third_party/boringssl/crypto/x509/x_req.c",
+    "third_party/boringssl/crypto/x509/x_sig.c",
+    "third_party/boringssl/crypto/x509/x_spki.c",
+    "third_party/boringssl/crypto/x509/x_val.c",
+    "third_party/boringssl/crypto/x509/x_x509.c",
+    "third_party/boringssl/crypto/x509/x_x509a.c",
+    "third_party/boringssl/crypto/x509v3/pcy_cache.c",
+    "third_party/boringssl/crypto/x509v3/pcy_data.c",
+    "third_party/boringssl/crypto/x509v3/pcy_lib.c",
+    "third_party/boringssl/crypto/x509v3/pcy_map.c",
+    "third_party/boringssl/crypto/x509v3/pcy_node.c",
+    "third_party/boringssl/crypto/x509v3/pcy_tree.c",
+    "third_party/boringssl/crypto/x509v3/v3_akey.c",
+    "third_party/boringssl/crypto/x509v3/v3_akeya.c",
+    "third_party/boringssl/crypto/x509v3/v3_alt.c",
+    "third_party/boringssl/crypto/x509v3/v3_bcons.c",
+    "third_party/boringssl/crypto/x509v3/v3_bitst.c",
+    "third_party/boringssl/crypto/x509v3/v3_conf.c",
+    "third_party/boringssl/crypto/x509v3/v3_cpols.c",
+    "third_party/boringssl/crypto/x509v3/v3_crld.c",
+    "third_party/boringssl/crypto/x509v3/v3_enum.c",
+    "third_party/boringssl/crypto/x509v3/v3_extku.c",
+    "third_party/boringssl/crypto/x509v3/v3_genn.c",
+    "third_party/boringssl/crypto/x509v3/v3_ia5.c",
+    "third_party/boringssl/crypto/x509v3/v3_info.c",
+    "third_party/boringssl/crypto/x509v3/v3_int.c",
+    "third_party/boringssl/crypto/x509v3/v3_lib.c",
+    "third_party/boringssl/crypto/x509v3/v3_ncons.c",
+    "third_party/boringssl/crypto/x509v3/v3_pci.c",
+    "third_party/boringssl/crypto/x509v3/v3_pcia.c",
+    "third_party/boringssl/crypto/x509v3/v3_pcons.c",
+    "third_party/boringssl/crypto/x509v3/v3_pku.c",
+    "third_party/boringssl/crypto/x509v3/v3_pmaps.c",
+    "third_party/boringssl/crypto/x509v3/v3_prn.c",
+    "third_party/boringssl/crypto/x509v3/v3_purp.c",
+    "third_party/boringssl/crypto/x509v3/v3_skey.c",
+    "third_party/boringssl/crypto/x509v3/v3_sxnet.c",
+    "third_party/boringssl/crypto/x509v3/v3_utl.c",
+    "third_party/boringssl/ssl/custom_extensions.c",
+    "third_party/boringssl/ssl/d1_both.c",
+    "third_party/boringssl/ssl/d1_clnt.c",
+    "third_party/boringssl/ssl/d1_lib.c",
+    "third_party/boringssl/ssl/d1_meth.c",
+    "third_party/boringssl/ssl/d1_pkt.c",
+    "third_party/boringssl/ssl/d1_srtp.c",
+    "third_party/boringssl/ssl/d1_srvr.c",
+    "third_party/boringssl/ssl/dtls_record.c",
+    "third_party/boringssl/ssl/pqueue/pqueue.c",
+    "third_party/boringssl/ssl/s3_both.c",
+    "third_party/boringssl/ssl/s3_clnt.c",
+    "third_party/boringssl/ssl/s3_enc.c",
+    "third_party/boringssl/ssl/s3_lib.c",
+    "third_party/boringssl/ssl/s3_meth.c",
+    "third_party/boringssl/ssl/s3_pkt.c",
+    "third_party/boringssl/ssl/s3_srvr.c",
+    "third_party/boringssl/ssl/ssl_aead_ctx.c",
+    "third_party/boringssl/ssl/ssl_asn1.c",
+    "third_party/boringssl/ssl/ssl_buffer.c",
+    "third_party/boringssl/ssl/ssl_cert.c",
+    "third_party/boringssl/ssl/ssl_cipher.c",
+    "third_party/boringssl/ssl/ssl_file.c",
+    "third_party/boringssl/ssl/ssl_lib.c",
+    "third_party/boringssl/ssl/ssl_rsa.c",
+    "third_party/boringssl/ssl/ssl_session.c",
+    "third_party/boringssl/ssl/ssl_stat.c",
+    "third_party/boringssl/ssl/t1_enc.c",
+    "third_party/boringssl/ssl/t1_lib.c",
+    "third_party/boringssl/ssl/tls_record.c",
     "binding.gyp"
   ],
   "main": "src/node/index.js",

+ 982 - 0
package.xml

@@ -0,0 +1,982 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package packagerversion="1.9.5" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
+ <name>grpc</name>
+ <channel>pecl.php.net</channel>
+ <summary>A high performance, open source, general RPC framework that puts mobile and HTTP/2 first.</summary>
+ <description>Remote Procedure Calls (RPCs) provide a useful abstraction for building distributed applications and services. The libraries in this repository provide a concrete implementation of the gRPC protocol, layered over HTTP/2. These libraries enable communication between clients and servers using any combination of the supported languages.</description>
+ <lead>
+  <name>Stanley Cheung</name>
+  <user>stanleycheung</user>
+  <email>grpc-packages@google.com</email>
+  <active>yes</active>
+ </lead>
+ <date>2016-03-01</date>
+ <time>16:06:07</time>
+ <version>
+  <release>0.14.0</release>
+  <api>0.14.0</api>
+ </version>
+ <stability>
+  <release>beta</release>
+  <api>beta</api>
+ </stability>
+ <license>BSD</license>
+ <notes>
+- Increase unit test code coverage #5225
+ </notes>
+ <contents>
+  <dir baseinstalldir="/" name="/">
+    <file baseinstalldir="/" name="config.m4" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/CREDITS" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/LICENSE" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/README.md" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/byte_buffer.c" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/call.c" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/call_credentials.c" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/channel.c" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/channel_credentials.c" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/completion_queue.c" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/php_grpc.c" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/server.c" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/server_credentials.c" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/timeval.c" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/byte_buffer.h" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/call.h" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/call_credentials.h" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/channel.h" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/channel_credentials.h" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/completion_queue.h" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/php_grpc.h" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/server.h" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/server_credentials.h" role="src" />
+    <file baseinstalldir="/" name="src/php/ext/grpc/timeval.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/alloc.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/atm.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/atm_gcc_atomic.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/atm_gcc_sync.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/atm_win32.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/avl.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/cmdline.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/cpu.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/histogram.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/host_port.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/log.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/log_win32.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/port_platform.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/slice.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/slice_buffer.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/string_util.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/subprocess.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/sync.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/sync_generic.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/sync_posix.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/sync_win32.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/thd.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/time.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/tls.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/tls_gcc.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/tls_msvc.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/tls_pthread.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/support/useful.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/alloc.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/atm.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_atomic.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_sync.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_win32.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/log.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/port_platform.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/slice.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/slice_buffer.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/sync.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/sync_generic.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/sync_posix.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/sync_win32.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/impl/codegen/time.h" role="src" />
+    <file baseinstalldir="/" name="src/core/profiling/timers.h" role="src" />
+    <file baseinstalldir="/" name="src/core/support/block_annotate.h" role="src" />
+    <file baseinstalldir="/" name="src/core/support/env.h" role="src" />
+    <file baseinstalldir="/" name="src/core/support/load_file.h" role="src" />
+    <file baseinstalldir="/" name="src/core/support/murmur_hash.h" role="src" />
+    <file baseinstalldir="/" name="src/core/support/stack_lockfree.h" role="src" />
+    <file baseinstalldir="/" name="src/core/support/string.h" role="src" />
+    <file baseinstalldir="/" name="src/core/support/string_win32.h" role="src" />
+    <file baseinstalldir="/" name="src/core/support/thd_internal.h" role="src" />
+    <file baseinstalldir="/" name="src/core/support/time_precise.h" role="src" />
+    <file baseinstalldir="/" name="src/core/support/tmpfile.h" role="src" />
+    <file baseinstalldir="/" name="src/core/profiling/basic_timers.c" role="src" />
+    <file baseinstalldir="/" name="src/core/profiling/stap_timers.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/alloc.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/avl.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/cmdline.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/cpu_iphone.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/cpu_linux.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/cpu_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/cpu_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/env_linux.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/env_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/env_win32.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/histogram.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/host_port.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/load_file.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/log.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/log_android.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/log_linux.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/log_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/log_win32.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/murmur_hash.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/slice.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/slice_buffer.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/stack_lockfree.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/string.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/string_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/string_win32.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/subprocess_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/subprocess_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/sync.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/sync_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/sync_win32.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/thd.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/thd_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/thd_win32.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/time.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/time_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/time_precise.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/time_win32.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/tls_pthread.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/tmpfile_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/tmpfile_win32.c" role="src" />
+    <file baseinstalldir="/" name="src/core/support/wrap_memcpy.c" role="src" />
+    <file baseinstalldir="/" name="include/grpc/grpc_security.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/byte_buffer.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/byte_buffer_reader.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/compression.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/grpc.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/status.h" role="src" />
+    <file baseinstalldir="/" name="include/grpc/census.h" role="src" />
+    <file baseinstalldir="/" name="src/core/census/grpc_filter.h" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/channel_args.h" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/channel_stack.h" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/client_channel.h" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/client_uchannel.h" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/compress_filter.h" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/connected_channel.h" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/context.h" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/http_client_filter.h" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/http_server_filter.h" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/subchannel_call_holder.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/client_config.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/connector.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/initial_connect_string.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policies/load_balancer_api.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policies/pick_first.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policies/round_robin.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policy.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policy_factory.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policy_registry.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/resolver.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/resolver_factory.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/resolver_registry.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/resolvers/dns_resolver.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/resolvers/sockaddr_resolver.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/subchannel.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/subchannel_factory.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/subchannel_index.h" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/uri_parser.h" role="src" />
+    <file baseinstalldir="/" name="src/core/compression/algorithm_metadata.h" role="src" />
+    <file baseinstalldir="/" name="src/core/compression/message_compress.h" role="src" />
+    <file baseinstalldir="/" name="src/core/debug/trace.h" role="src" />
+    <file baseinstalldir="/" name="src/core/httpcli/format_request.h" role="src" />
+    <file baseinstalldir="/" name="src/core/httpcli/httpcli.h" role="src" />
+    <file baseinstalldir="/" name="src/core/httpcli/parser.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/closure.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/endpoint.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/endpoint_pair.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/exec_ctx.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/executor.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/fd_posix.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/iocp_windows.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/iomgr.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/iomgr_internal.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/iomgr_posix.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_posix.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_set.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_set_posix.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_set_windows.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_windows.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/resolve_address.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/sockaddr.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/sockaddr_posix.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/sockaddr_utils.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/sockaddr_win32.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/socket_utils_posix.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/socket_windows.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/tcp_client.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/tcp_posix.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/tcp_server.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/tcp_windows.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/time_averaged_stats.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/timer.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/timer_heap.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/udp_server.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_pipe.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_posix.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/workqueue.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/workqueue_posix.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/workqueue_windows.h" role="src" />
+    <file baseinstalldir="/" name="src/core/json/json.h" role="src" />
+    <file baseinstalldir="/" name="src/core/json/json_common.h" role="src" />
+    <file baseinstalldir="/" name="src/core/json/json_reader.h" role="src" />
+    <file baseinstalldir="/" name="src/core/json/json_writer.h" role="src" />
+    <file baseinstalldir="/" name="src/core/proto/grpc/lb/v0/load_balancer.pb.h" role="src" />
+    <file baseinstalldir="/" name="src/core/statistics/census_interface.h" role="src" />
+    <file baseinstalldir="/" name="src/core/statistics/census_rpc_stats.h" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/api_trace.h" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/call.h" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/call_test_only.h" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/channel.h" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/completion_queue.h" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/event_string.h" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/init.h" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/server.h" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/surface_trace.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/byte_stream.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/alpn.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/bin_encoder.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_data.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_goaway.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_ping.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_rst_stream.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_settings.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_window_update.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/hpack_encoder.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/hpack_parser.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/hpack_table.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/http2_errors.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/huffsyms.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/incoming_metadata.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/internal.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/status_conversion.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/stream_map.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/timeout_encoding.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/varint.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2_transport.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/connectivity_state.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/metadata.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/metadata_batch.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/static_metadata.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/transport.h" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/transport_impl.h" role="src" />
+    <file baseinstalldir="/" name="src/core/security/auth_filters.h" role="src" />
+    <file baseinstalldir="/" name="src/core/security/b64.h" role="src" />
+    <file baseinstalldir="/" name="src/core/security/credentials.h" role="src" />
+    <file baseinstalldir="/" name="src/core/security/handshake.h" role="src" />
+    <file baseinstalldir="/" name="src/core/security/json_token.h" role="src" />
+    <file baseinstalldir="/" name="src/core/security/jwt_verifier.h" role="src" />
+    <file baseinstalldir="/" name="src/core/security/secure_endpoint.h" role="src" />
+    <file baseinstalldir="/" name="src/core/security/security_connector.h" role="src" />
+    <file baseinstalldir="/" name="src/core/security/security_context.h" role="src" />
+    <file baseinstalldir="/" name="src/core/tsi/fake_transport_security.h" role="src" />
+    <file baseinstalldir="/" name="src/core/tsi/ssl_transport_security.h" role="src" />
+    <file baseinstalldir="/" name="src/core/tsi/ssl_types.h" role="src" />
+    <file baseinstalldir="/" name="src/core/tsi/transport_security.h" role="src" />
+    <file baseinstalldir="/" name="src/core/tsi/transport_security_interface.h" role="src" />
+    <file baseinstalldir="/" name="src/core/census/aggregation.h" role="src" />
+    <file baseinstalldir="/" name="src/core/census/mlog.h" role="src" />
+    <file baseinstalldir="/" name="src/core/census/rpc_metric_id.h" role="src" />
+    <file baseinstalldir="/" name="third_party/nanopb/pb.h" role="src" />
+    <file baseinstalldir="/" name="third_party/nanopb/pb_common.h" role="src" />
+    <file baseinstalldir="/" name="third_party/nanopb/pb_decode.h" role="src" />
+    <file baseinstalldir="/" name="third_party/nanopb/pb_encode.h" role="src" />
+    <file baseinstalldir="/" name="src/core/census/grpc_context.c" role="src" />
+    <file baseinstalldir="/" name="src/core/census/grpc_filter.c" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/channel_args.c" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/channel_stack.c" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/client_channel.c" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/client_uchannel.c" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/compress_filter.c" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/connected_channel.c" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/http_client_filter.c" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/http_server_filter.c" role="src" />
+    <file baseinstalldir="/" name="src/core/channel/subchannel_call_holder.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/client_config.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/connector.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/default_initial_connect_string.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/initial_connect_string.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policies/load_balancer_api.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policies/pick_first.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policies/round_robin.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policy.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policy_factory.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/lb_policy_registry.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/resolver.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/resolver_factory.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/resolver_registry.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/resolvers/dns_resolver.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/resolvers/sockaddr_resolver.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/subchannel.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/subchannel_factory.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/subchannel_index.c" role="src" />
+    <file baseinstalldir="/" name="src/core/client_config/uri_parser.c" role="src" />
+    <file baseinstalldir="/" name="src/core/compression/compression_algorithm.c" role="src" />
+    <file baseinstalldir="/" name="src/core/compression/message_compress.c" role="src" />
+    <file baseinstalldir="/" name="src/core/debug/trace.c" role="src" />
+    <file baseinstalldir="/" name="src/core/httpcli/format_request.c" role="src" />
+    <file baseinstalldir="/" name="src/core/httpcli/httpcli.c" role="src" />
+    <file baseinstalldir="/" name="src/core/httpcli/parser.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/closure.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/endpoint.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/endpoint_pair_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/endpoint_pair_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/exec_ctx.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/executor.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/fd_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/iocp_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/iomgr.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/iomgr_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/iomgr_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_multipoller_with_epoll.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_multipoller_with_poll_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_set_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_set_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/pollset_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/resolve_address_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/resolve_address_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/sockaddr_utils.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/socket_utils_common_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/socket_utils_linux.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/socket_utils_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/socket_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/tcp_client_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/tcp_client_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/tcp_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/tcp_server_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/tcp_server_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/tcp_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/time_averaged_stats.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/timer.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/timer_heap.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/udp_server.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_eventfd.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_nospecial.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_pipe.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/workqueue_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/workqueue_windows.c" role="src" />
+    <file baseinstalldir="/" name="src/core/json/json.c" role="src" />
+    <file baseinstalldir="/" name="src/core/json/json_reader.c" role="src" />
+    <file baseinstalldir="/" name="src/core/json/json_string.c" role="src" />
+    <file baseinstalldir="/" name="src/core/json/json_writer.c" role="src" />
+    <file baseinstalldir="/" name="src/core/proto/grpc/lb/v0/load_balancer.pb.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/alarm.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/api_trace.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/byte_buffer.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/byte_buffer_reader.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/call.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/call_details.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/call_log_batch.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/channel.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/channel_connectivity.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/channel_create.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/channel_ping.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/completion_queue.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/event_string.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/init.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/lame_client.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/metadata_array.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/server.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/server_chttp2.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/server_create.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/validate_metadata.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/version.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/byte_stream.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/alpn.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/bin_encoder.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_data.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_goaway.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_ping.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_rst_stream.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_settings.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/frame_window_update.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/hpack_encoder.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/hpack_parser.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/hpack_table.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/huffsyms.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/incoming_metadata.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/parsing.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/status_conversion.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/stream_lists.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/stream_map.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/timeout_encoding.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/varint.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2/writing.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/chttp2_transport.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/connectivity_state.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/metadata.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/metadata_batch.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/static_metadata.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/transport.c" role="src" />
+    <file baseinstalldir="/" name="src/core/transport/transport_op_string.c" role="src" />
+    <file baseinstalldir="/" name="src/core/httpcli/httpcli_security_connector.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/b64.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/client_auth_filter.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/credentials.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/credentials_metadata.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/credentials_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/credentials_win32.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/google_default_credentials.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/handshake.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/json_token.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/jwt_verifier.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/secure_endpoint.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/security_connector.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/security_context.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/server_auth_filter.c" role="src" />
+    <file baseinstalldir="/" name="src/core/security/server_secure_chttp2.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/init_secure.c" role="src" />
+    <file baseinstalldir="/" name="src/core/surface/secure_channel_create.c" role="src" />
+    <file baseinstalldir="/" name="src/core/tsi/fake_transport_security.c" role="src" />
+    <file baseinstalldir="/" name="src/core/tsi/ssl_transport_security.c" role="src" />
+    <file baseinstalldir="/" name="src/core/tsi/transport_security.c" role="src" />
+    <file baseinstalldir="/" name="src/core/census/context.c" role="src" />
+    <file baseinstalldir="/" name="src/core/census/initialize.c" role="src" />
+    <file baseinstalldir="/" name="src/core/census/mlog.c" role="src" />
+    <file baseinstalldir="/" name="src/core/census/operation.c" role="src" />
+    <file baseinstalldir="/" name="src/core/census/placeholders.c" role="src" />
+    <file baseinstalldir="/" name="src/core/census/tracing.c" role="src" />
+    <file baseinstalldir="/" name="third_party/nanopb/pb_common.c" role="src" />
+    <file baseinstalldir="/" name="third_party/nanopb/pb_decode.c" role="src" />
+    <file baseinstalldir="/" name="third_party/nanopb/pb_encode.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/aes/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/asn1_locl.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/rsaz_exp.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bytestring/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/conf/conf_def.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/conf/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/des/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/dh/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/digest/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/digest/md32_common.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/directory.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/dsa/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/p256-x86_64-table.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/modes/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/obj/obj_dat.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/obj/obj_xref.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pkcs8/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rand/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rsa/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/test/scoped_types.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/test/test_util.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/charmap.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/vpm_int.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/ext_dat.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/pcy_int.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/aead.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/aes.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/arm_arch.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/asn1.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/asn1_mac.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/asn1t.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/base.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/base64.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/bio.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/blowfish.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/bn.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/buf.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/buffer.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/bytestring.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/cast.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/chacha.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/cipher.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/cmac.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/conf.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/cpu.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/crypto.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/curve25519.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/des.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/dh.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/digest.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/dsa.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/dtls1.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/ec.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/ec_key.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/ecdh.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/ecdsa.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/engine.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/err.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/evp.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/ex_data.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/hkdf.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/hmac.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/lhash.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/lhash_macros.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/md4.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/md5.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/mem.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/obj.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/obj_mac.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/objects.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/opensslfeatures.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/opensslv.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/ossl_typ.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/pem.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/pkcs12.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/pkcs7.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/pkcs8.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/poly1305.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/pqueue.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/rand.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/rc4.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/rsa.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/safestack.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/sha.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/srtp.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/ssl.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/ssl3.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/stack.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/stack_macros.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/thread.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/time_support.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/tls1.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/type_check.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/x509.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/x509_vfy.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/include/openssl/x509v3.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/internal.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/test/async_bio.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/test/packeted_bio.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/test/scoped_types.h" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/test/test_config.h" role="src" />
+    <file baseinstalldir="/" name="src/boringssl/err_data.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/aes/aes.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/aes/mode_wrappers.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_bitstr.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_bool.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_bytes.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_d2i_fp.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_dup.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_enum.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_gentm.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_i2d_fp.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_int.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_mbstr.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_object.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_octet.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_print.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_strnid.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_time.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_type.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_utctm.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/a_utf8.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/asn1_lib.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/asn1_par.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/asn_pack.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/bio_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/bio_ndef.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/f_enum.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/f_int.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/f_string.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/t_bitst.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/t_pkey.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/tasn_dec.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/tasn_enc.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/tasn_fre.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/tasn_new.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/tasn_prn.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/tasn_typ.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/tasn_utl.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/x_bignum.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/asn1/x_long.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/base64/base64.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/bio.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/bio_mem.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/buffer.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/connect.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/fd.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/file.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/hexdump.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/pair.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/printf.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/socket.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bio/socket_helper.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/add.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/asm/x86_64-gcc.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/bn.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/bn_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/cmp.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/convert.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/ctx.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/div.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/exponentiation.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/gcd.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/generic.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/kronecker.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/montgomery.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/mul.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/prime.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/random.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/rsaz_exp.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/shift.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bn/sqrt.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/buf/buf.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bytestring/ber.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bytestring/cbb.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/bytestring/cbs.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/chacha/chacha_generic.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/chacha/chacha_vec.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/aead.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/cipher.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/derive_key.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/e_aes.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/e_chacha20poly1305.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/e_des.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/e_null.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/e_rc2.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/e_rc4.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/e_ssl3.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/e_tls.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cipher/tls_cbc.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cmac/cmac.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/conf/conf.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cpu-arm.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/cpu-intel.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/crypto.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/curve25519/curve25519.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/des/des.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/dh/check.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/dh/dh.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/dh/dh_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/dh/params.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/digest/digest.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/digest/digests.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/directory_posix.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/directory_win.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/dsa/dsa.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/dsa/dsa_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/ec.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/ec_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/ec_key.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/ec_montgomery.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/oct.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/p224-64.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/p256-64.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/p256-x86_64.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/simple.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/util-64.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ec/wnaf.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ecdh/ecdh.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ecdsa/ecdsa.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ecdsa/ecdsa_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/engine/engine.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/err/err.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/algorithm.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/digestsign.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/evp.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/evp_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/evp_ctx.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/p_dsa_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/p_ec.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/p_ec_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/p_rsa.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/p_rsa_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/pbkdf.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/evp/sign.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/ex_data.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/hkdf/hkdf.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/hmac/hmac.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/lhash/lhash.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/md4/md4.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/md5/md5.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/mem.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/modes/cbc.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/modes/cfb.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/modes/ctr.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/modes/gcm.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/modes/ofb.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/obj/obj.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/obj/obj_xref.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pem/pem_all.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pem/pem_info.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pem/pem_lib.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pem/pem_oth.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pem/pem_pk8.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pem/pem_pkey.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pem/pem_x509.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pem/pem_xaux.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pkcs8/p5_pbe.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pkcs8/p5_pbev2.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pkcs8/p8_pkey.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/pkcs8/pkcs8.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/poly1305/poly1305.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/poly1305/poly1305_arm.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/poly1305/poly1305_vec.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rand/rand.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rand/urandom.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rand/windows.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rc4/rc4.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/refcount_c11.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/refcount_lock.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rsa/blinding.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rsa/padding.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rsa/rsa.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rsa/rsa_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/rsa/rsa_impl.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/sha/sha1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/sha/sha256.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/sha/sha512.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/stack/stack.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/thread.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/thread_none.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/thread_pthread.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/thread_win.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/time_support.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/a_digest.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/a_sign.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/a_strex.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/a_verify.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/asn1_gen.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/by_dir.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/by_file.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/i2d_pr.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/pkcs7.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/t_crl.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/t_req.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/t_x509.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/t_x509a.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_att.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_cmp.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_d2.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_def.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_ext.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_lu.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_obj.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_r2x.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_req.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_set.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_trs.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_txt.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_v3.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_vfy.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509_vpm.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509cset.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509name.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509rset.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509spki.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x509type.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_algor.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_all.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_attrib.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_crl.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_exten.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_info.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_name.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_pkey.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_pubkey.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_req.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_sig.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_spki.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_val.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_x509.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509/x_x509a.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/pcy_cache.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/pcy_data.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/pcy_lib.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/pcy_map.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/pcy_node.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/pcy_tree.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_akey.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_akeya.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_alt.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_bcons.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_bitst.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_conf.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_cpols.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_crld.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_enum.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_extku.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_genn.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_ia5.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_info.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_int.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_lib.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_ncons.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_pci.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_pcia.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_pcons.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_pku.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_pmaps.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_prn.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_purp.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_skey.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_sxnet.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/crypto/x509v3/v3_utl.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/custom_extensions.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/d1_both.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/d1_clnt.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/d1_lib.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/d1_meth.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/d1_pkt.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/d1_srtp.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/d1_srvr.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/dtls_record.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/pqueue/pqueue.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/s3_both.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/s3_clnt.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/s3_enc.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/s3_lib.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/s3_meth.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/s3_pkt.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/s3_srvr.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/ssl_aead_ctx.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/ssl_asn1.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/ssl_buffer.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/ssl_cert.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/ssl_cipher.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/ssl_file.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/ssl_lib.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/ssl_rsa.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/ssl_session.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/ssl_stat.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/t1_enc.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/t1_lib.c" role="src" />
+    <file baseinstalldir="/" name="third_party/boringssl/ssl/tls_record.c" role="src" />
+  </dir>
+ </contents>
+ <dependencies>
+  <required>
+   <php>
+    <min>5.5.0</min>
+   </php>
+   <pearinstaller>
+    <min>1.4.0</min>
+   </pearinstaller>
+  </required>
+ </dependencies>
+ <providesextension>grpc</providesextension>
+ <extsrcrelease />
+ <changelog>
+  <release>
+   <version>
+    <release>0.5.0</release>
+    <api>0.5.0</api>
+   </version>
+   <stability>
+    <release>alpha</release>
+    <api>alpha</api>
+   </stability>
+   <date>2015-06-16</date>
+   <license>BSD</license>
+   <notes>
+First alpha release
+   </notes>
+  </release>
+  <release>
+   <version>
+    <release>0.5.1</release>
+    <api>0.5.1</api>
+   </version>
+   <stability>
+    <release>alpha</release>
+    <api>alpha</api>
+   </stability>
+   <date>2015-07-09</date>
+   <license>BSD</license>
+   <notes>
+Update to wrap gRPC C Core version 0.10.0
+   </notes>
+  </release>
+  <release>
+   <version>
+    <release>0.6.0</release>
+    <api>0.6.0</api>
+   </version>
+   <stability>
+    <release>beta</release>
+    <api>beta</api>
+   </stability>
+   <date>2015-09-24</date>
+   <license>BSD</license>
+   <notes>
+- support per message compression disable
+- expose per-call host override option
+- expose connectivity API
+- expose channel target and call peer
+- add user-agent
+- update to wrap gRPC C core library beta version 0.11.0
+   </notes>
+  </release>
+  <release>
+   <version>
+    <release>0.6.1</release>
+    <api>0.6.0</api>
+   </version>
+   <stability>
+    <release>beta</release>
+    <api>beta</api>
+   </stability>
+   <date>2015-10-21</date>
+   <license>BSD</license>
+   <notes>
+- fixed undefined constant fatal error when run with apache/nginx #2275
+   </notes>
+  </release>
+  <release>
+   <version>
+    <release>0.7.0</release>
+    <api>0.7.0</api>
+   </version>
+   <stability>
+    <release>beta</release>
+    <api>beta</api>
+   </stability>
+   <date>2016-01-13</date>
+   <license>BSD</license>
+   <notes>
+- Breaking change to Credentials class (removed) #3765
+- Replaced by ChannelCredentials and CallCredentials class #3765
+- New plugin based metadata auth API #4394
+- Explicit ChannelCredentials::createInsecure() call
+   </notes>
+  </release>
+  <release>
+   <version>
+    <release>0.8.0</release>
+    <api>0.8.0</api>
+   </version>
+   <stability>
+    <release>beta</release>
+    <api>beta</api>
+   </stability>
+   <date>2016-02-24</date>
+   <license>BSD</license>
+   <notes>
+- Simplify gRPC PHP installation #4517
+   </notes>
+  </release>
+  <release>
+   <version>
+    <release>0.14.0</release>
+    <api>0.14.0</api>
+   </version>
+   <stability>
+    <release>beta</release>
+    <api>beta</api>
+   </stability>
+   <date>2016-03-01</date>
+   <license>BSD</license>
+   <notes>
+- Increase unit test code coverage #5225
+   </notes>
+  </release>
+ </changelog>
+</package>

+ 0 - 1
setup.py

@@ -208,7 +208,6 @@ PACKAGE_DATA = {
         '_credentials/roots.pem',
         '_windows/grpc_c.32.python',
         '_windows/grpc_c.64.python',
-        'cygrpc.so',
     ],
 }
 if INSTALL_TESTS:

+ 64 - 85
src/core/census/context.c

@@ -60,10 +60,10 @@
 //   limit of 255 for both CENSUS_MAX_TAG_KV_LEN and CENSUS_MAX_PROPAGATED_TAGS.
 // * Keep all tag information (keys/values/flags) in a single memory buffer,
 //   that can be directly copied to the wire.
-// * Binary tags share the same structure as, but are encoded separately from,
-//   non-binary tags. This is primarily because non-binary tags are far more
-//   likely to be repeated across multiple RPC calls, so are more efficiently
-//   cached and compressed in any metadata schemes.
+
+// min and max valid chars in tag keys and values. All printable ASCII is OK.
+#define MIN_VALID_TAG_CHAR 32   // ' '
+#define MAX_VALID_TAG_CHAR 126  // '~'
 
 // Structure representing a set of tags. Essentially a count of number of tags
 // present, and pointer to a chunk of memory that contains the per-tag details.
@@ -77,7 +77,7 @@ struct tag_set {
   char *kvm;        // key/value memory. Consists of repeated entries of:
   //   Offset  Size  Description
   //     0      1    Key length, including trailing 0. (K)
-  //     1      1    Value length. (V)
+  //     1      1    Value length, including trailing 0 (V)
   //     2      1    Flags
   //     3      K    Key bytes
   //     3 + K  V    Value bytes
@@ -108,19 +108,36 @@ struct raw_tag {
 #define CENSUS_TAG_DELETED CENSUS_TAG_RESERVED
 #define CENSUS_TAG_IS_DELETED(flags) (flags & CENSUS_TAG_DELETED)
 
-// Primary (external) representation of a context. Composed of 3 underlying
-// tag_set structs, one for each of the binary/printable propagated tags, and
-// one for everything else. This is to efficiently support tag
-// encoding/decoding.
+// Primary representation of a context. Composed of 2 underlying tag_set
+// structs, one each for propagated and local (non-propagated) tags. This is
+// to efficiently support tag encoding/decoding.
+// TODO(aveitch): need to add tracing id's/structure.
 struct census_context {
-  struct tag_set tags[3];
+  struct tag_set tags[2];
   census_context_status status;
 };
 
 // Indices into the tags member of census_context
 #define PROPAGATED_TAGS 0
-#define PROPAGATED_BINARY_TAGS 1
-#define LOCAL_TAGS 2
+#define LOCAL_TAGS 1
+
+// Validate (check all characters are in range and size is less than limit) a
+// key or value string. Returns 0 if the string is invalid, or the length
+// (including terminator) if valid.
+static size_t validate_tag(const char *kv) {
+  size_t len = 1;
+  char ch;
+  while ((ch = *kv++) != 0) {
+    if (ch < MIN_VALID_TAG_CHAR || ch > MAX_VALID_TAG_CHAR) {
+      return 0;
+    }
+    len++;
+  }
+  if (len > CENSUS_MAX_TAG_KV_LEN) {
+    return 0;
+  }
+  return len;
+}
 
 // Extract a raw tag given a pointer (raw) to the tag header. Allow for some
 // extra bytes in the tag header (see encode/decode functions for usage: this
@@ -166,9 +183,7 @@ static bool context_delete_tag(census_context *context, const census_tag *tag,
                                size_t key_len) {
   return (
       tag_set_delete_tag(&context->tags[LOCAL_TAGS], tag->key, key_len) ||
-      tag_set_delete_tag(&context->tags[PROPAGATED_TAGS], tag->key, key_len) ||
-      tag_set_delete_tag(&context->tags[PROPAGATED_BINARY_TAGS], tag->key,
-                         key_len));
+      tag_set_delete_tag(&context->tags[PROPAGATED_TAGS], tag->key, key_len));
 }
 
 // Add a tag to a tag_set. Return true on success, false if the tag could
@@ -176,11 +191,11 @@ static bool context_delete_tag(census_context *context, const census_tag *tag,
 // not be called if the tag may already exist (in a non-deleted state) in
 // the tag_set, as that would result in two tags with the same key.
 static bool tag_set_add_tag(struct tag_set *tags, const census_tag *tag,
-                            size_t key_len) {
+                            size_t key_len, size_t value_len) {
   if (tags->ntags == CENSUS_MAX_PROPAGATED_TAGS) {
     return false;
   }
-  const size_t tag_size = key_len + tag->value_len + TAG_HEADER_SIZE;
+  const size_t tag_size = key_len + value_len + TAG_HEADER_SIZE;
   if (tags->kvm_used + tag_size > tags->kvm_size) {
     // allocate new memory if needed
     tags->kvm_size += 2 * CENSUS_MAX_TAG_KV_LEN + TAG_HEADER_SIZE;
@@ -191,13 +206,12 @@ static bool tag_set_add_tag(struct tag_set *tags, const census_tag *tag,
   }
   char *kvp = tags->kvm + tags->kvm_used;
   *kvp++ = (char)key_len;
-  *kvp++ = (char)tag->value_len;
+  *kvp++ = (char)value_len;
   // ensure reserved flags are not used.
-  *kvp++ = (char)(tag->flags & (CENSUS_TAG_PROPAGATE | CENSUS_TAG_STATS |
-                                CENSUS_TAG_BINARY));
+  *kvp++ = (char)(tag->flags & (CENSUS_TAG_PROPAGATE | CENSUS_TAG_STATS));
   memcpy(kvp, tag->key, key_len);
   kvp += key_len;
-  memcpy(kvp, tag->value, tag->value_len);
+  memcpy(kvp, tag->value, value_len);
   tags->kvm_used += tag_size;
   tags->ntags++;
   tags->ntags_alloc++;
@@ -207,30 +221,20 @@ static bool tag_set_add_tag(struct tag_set *tags, const census_tag *tag,
 // Add/modify/delete a tag to/in a context. Caller must validate that tag key
 // etc. are valid.
 static void context_modify_tag(census_context *context, const census_tag *tag,
-                               size_t key_len) {
+                               size_t key_len, size_t value_len) {
   // First delete the tag if it is already present.
   bool deleted = context_delete_tag(context, tag, key_len);
-  // Determine if we need to add it back.
-  bool call_add = tag->value != NULL && tag->value_len != 0;
   bool added = false;
-  if (call_add) {
-    if (CENSUS_TAG_IS_PROPAGATED(tag->flags)) {
-      if (CENSUS_TAG_IS_BINARY(tag->flags)) {
-        added = tag_set_add_tag(&context->tags[PROPAGATED_BINARY_TAGS], tag,
-                                key_len);
-      } else {
-        added = tag_set_add_tag(&context->tags[PROPAGATED_TAGS], tag, key_len);
-      }
-    } else {
-      added = tag_set_add_tag(&context->tags[LOCAL_TAGS], tag, key_len);
-    }
+  if (CENSUS_TAG_IS_PROPAGATED(tag->flags)) {
+    added = tag_set_add_tag(&context->tags[PROPAGATED_TAGS], tag, key_len,
+                            value_len);
+  } else {
+    added =
+        tag_set_add_tag(&context->tags[LOCAL_TAGS], tag, key_len, value_len);
   }
+
   if (deleted) {
-    if (call_add) {
-      context->status.n_modified_tags++;
-    } else {
-      context->status.n_deleted_tags++;
-    }
+    context->status.n_modified_tags++;
   } else {
     if (added) {
       context->status.n_added_tags++;
@@ -292,8 +296,6 @@ census_context *census_context_create(const census_context *base,
     memset(context, 0, sizeof(census_context));
   } else {
     tag_set_copy(&context->tags[PROPAGATED_TAGS], &base->tags[PROPAGATED_TAGS]);
-    tag_set_copy(&context->tags[PROPAGATED_BINARY_TAGS],
-                 &base->tags[PROPAGATED_BINARY_TAGS]);
     tag_set_copy(&context->tags[LOCAL_TAGS], &base->tags[LOCAL_TAGS]);
     memset(&context->status, 0, sizeof(context->status));
   }
@@ -301,22 +303,29 @@ census_context *census_context_create(const census_context *base,
   // the context to add/replace/delete as required.
   for (int i = 0; i < ntags; i++) {
     const census_tag *tag = &tags[i];
-    size_t key_len = strlen(tag->key) + 1;
-    // ignore the tag if it is too long/short.
-    if (key_len != 1 && key_len <= CENSUS_MAX_TAG_KV_LEN &&
-        tag->value_len <= CENSUS_MAX_TAG_KV_LEN) {
-      context_modify_tag(context, tag, key_len);
-    } else {
+    size_t key_len = validate_tag(tag->key);
+    // ignore the tag if it is invalid or too short.
+    if (key_len <= 1) {
       context->status.n_invalid_tags++;
+    } else {
+      if (tag->value != NULL) {
+        size_t value_len = validate_tag(tag->value);
+        if (value_len != 0) {
+          context_modify_tag(context, tag, key_len, value_len);
+        } else {
+          context->status.n_invalid_tags++;
+        }
+      } else {
+        if (context_delete_tag(context, tag, key_len)) {
+          context->status.n_deleted_tags++;
+        }
+      }
     }
   }
   // Remove any deleted tags, update status if needed, and return.
   tag_set_flatten(&context->tags[PROPAGATED_TAGS]);
-  tag_set_flatten(&context->tags[PROPAGATED_BINARY_TAGS]);
   tag_set_flatten(&context->tags[LOCAL_TAGS]);
   context->status.n_propagated_tags = context->tags[PROPAGATED_TAGS].ntags;
-  context->status.n_propagated_binary_tags =
-      context->tags[PROPAGATED_BINARY_TAGS].ntags;
   context->status.n_local_tags = context->tags[LOCAL_TAGS].ntags;
   if (status) {
     *status = &context->status;
@@ -331,7 +340,6 @@ const census_context_status *census_context_get_status(
 
 void census_context_destroy(census_context *context) {
   gpr_free(context->tags[PROPAGATED_TAGS].kvm);
-  gpr_free(context->tags[PROPAGATED_BINARY_TAGS].kvm);
   gpr_free(context->tags[LOCAL_TAGS].kvm);
   gpr_free(context);
 }
@@ -343,9 +351,6 @@ void census_context_initialize_iterator(const census_context *context,
   if (context->tags[PROPAGATED_TAGS].ntags != 0) {
     iterator->base = PROPAGATED_TAGS;
     iterator->kvm = context->tags[PROPAGATED_TAGS].kvm;
-  } else if (context->tags[PROPAGATED_BINARY_TAGS].ntags != 0) {
-    iterator->base = PROPAGATED_BINARY_TAGS;
-    iterator->kvm = context->tags[PROPAGATED_BINARY_TAGS].kvm;
   } else if (context->tags[LOCAL_TAGS].ntags != 0) {
     iterator->base = LOCAL_TAGS;
     iterator->kvm = context->tags[LOCAL_TAGS].kvm;
@@ -363,7 +368,6 @@ int census_context_next_tag(census_context_iterator *iterator,
   iterator->kvm = decode_tag(&raw, iterator->kvm, 0);
   tag->key = raw.key;
   tag->value = raw.value;
-  tag->value_len = raw.value_len;
   tag->flags = raw.flags;
   if (++iterator->index == iterator->context->tags[iterator->base].ntags) {
     do {
@@ -388,7 +392,6 @@ static bool tag_set_get_tag(const struct tag_set *tags, const char *key,
     if (key_len == raw.key_len && memcmp(raw.key, key, key_len) == 0) {
       tag->key = raw.key;
       tag->value = raw.value;
-      tag->value_len = raw.value_len;
       tag->flags = raw.flags;
       return true;
     }
@@ -403,8 +406,6 @@ int census_context_get_tag(const census_context *context, const char *key,
     return 0;
   }
   if (tag_set_get_tag(&context->tags[PROPAGATED_TAGS], key, key_len, tag) ||
-      tag_set_get_tag(&context->tags[PROPAGATED_BINARY_TAGS], key, key_len,
-                      tag) ||
       tag_set_get_tag(&context->tags[LOCAL_TAGS], key, key_len, tag)) {
     return 1;
   }
@@ -447,21 +448,9 @@ static size_t tag_set_encode(const struct tag_set *tags, char *buffer,
   return ENCODED_HEADER_SIZE + tags->kvm_used;
 }
 
-char *census_context_encode(const census_context *context, char *buffer,
-                            size_t buf_size, size_t *print_buf_size,
-                            size_t *bin_buf_size) {
-  *print_buf_size =
-      tag_set_encode(&context->tags[PROPAGATED_TAGS], buffer, buf_size);
-  if (*print_buf_size == 0) {
-    return NULL;
-  }
-  char *b_buffer = buffer + *print_buf_size;
-  *bin_buf_size = tag_set_encode(&context->tags[PROPAGATED_BINARY_TAGS],
-                                 b_buffer, buf_size - *print_buf_size);
-  if (*bin_buf_size == 0) {
-    return NULL;
-  }
-  return b_buffer;
+size_t census_context_encode(const census_context *context, char *buffer,
+                             size_t buf_size) {
+  return tag_set_encode(&context->tags[PROPAGATED_TAGS], buffer, buf_size);
 }
 
 // Decode a tag set.
@@ -506,8 +495,7 @@ static void tag_set_decode(struct tag_set *tags, const char *buffer,
   }
 }
 
-census_context *census_context_decode(const char *buffer, size_t size,
-                                      const char *bin_buffer, size_t bin_size) {
+census_context *census_context_decode(const char *buffer, size_t size) {
   census_context *context = gpr_malloc(sizeof(census_context));
   memset(&context->tags[LOCAL_TAGS], 0, sizeof(struct tag_set));
   if (buffer == NULL) {
@@ -515,16 +503,7 @@ census_context *census_context_decode(const char *buffer, size_t size,
   } else {
     tag_set_decode(&context->tags[PROPAGATED_TAGS], buffer, size);
   }
-  if (bin_buffer == NULL) {
-    memset(&context->tags[PROPAGATED_BINARY_TAGS], 0, sizeof(struct tag_set));
-  } else {
-    tag_set_decode(&context->tags[PROPAGATED_BINARY_TAGS], bin_buffer,
-                   bin_size);
-  }
   memset(&context->status, 0, sizeof(context->status));
   context->status.n_propagated_tags = context->tags[PROPAGATED_TAGS].ntags;
-  context->status.n_propagated_binary_tags =
-      context->tags[PROPAGATED_BINARY_TAGS].ntags;
-  // TODO(aveitch): check that BINARY flag is correct for each type.
   return context;
 }

+ 1 - 1
src/core/census/log.c → src/core/census/mlog.c

@@ -88,7 +88,7 @@
 // include the name of the structure, which will be passed as the first
 // argument. E.g. cl_block_initialize() will initialize a cl_block.
 
-#include "src/core/census/log.h"
+#include "src/core/census/mlog.h"
 #include <grpc/support/alloc.h>
 #include <grpc/support/atm.h>
 #include <grpc/support/cpu.h>

+ 4 - 2
src/core/census/log.h → src/core/census/mlog.h

@@ -31,8 +31,10 @@
  *
  */
 
-#ifndef GRPC_INTERNAL_CORE_CENSUS_LOG_H
-#define GRPC_INTERNAL_CORE_CENSUS_LOG_H
+/* A very fast in-memory log, optimized for multiple writers. */
+
+#ifndef GRPC_INTERNAL_CORE_CENSUS_MLOG_H
+#define GRPC_INTERNAL_CORE_CENSUS_MLOG_H
 
 #include <grpc/support/port_platform.h>
 #include <stddef.h>

+ 15 - 16
src/core/channel/client_channel.c

@@ -78,8 +78,8 @@ typedef struct client_channel_channel_data {
   int exit_idle_when_lb_policy_arrives;
   /** owning stack */
   grpc_channel_stack *owning_stack;
-  /** interested parties */
-  grpc_pollset_set interested_parties;
+  /** interested parties (owned) */
+  grpc_pollset_set *interested_parties;
 } channel_data;
 
 /** We create one watcher for each new lb_policy that is returned from a
@@ -183,8 +183,8 @@ static void cc_on_config_changed(grpc_exec_ctx *exec_ctx, void *arg,
   chand->incoming_configuration = NULL;
 
   if (lb_policy != NULL) {
-    grpc_pollset_set_add_pollset_set(exec_ctx, &lb_policy->interested_parties,
-                                     &chand->interested_parties);
+    grpc_pollset_set_add_pollset_set(exec_ctx, lb_policy->interested_parties,
+                                     chand->interested_parties);
   }
 
   gpr_mu_lock(&chand->mu_config);
@@ -231,9 +231,8 @@ static void cc_on_config_changed(grpc_exec_ctx *exec_ctx, void *arg,
   }
 
   if (old_lb_policy != NULL) {
-    grpc_pollset_set_del_pollset_set(exec_ctx,
-                                     &old_lb_policy->interested_parties,
-                                     &chand->interested_parties);
+    grpc_pollset_set_del_pollset_set(
+        exec_ctx, old_lb_policy->interested_parties, chand->interested_parties);
     GRPC_LB_POLICY_UNREF(exec_ctx, old_lb_policy, "channel");
   }
 
@@ -254,7 +253,7 @@ static void cc_start_transport_op(grpc_exec_ctx *exec_ctx,
 
   GPR_ASSERT(op->set_accept_stream == NULL);
   if (op->bind_pollset != NULL) {
-    grpc_pollset_set_add_pollset(exec_ctx, &chand->interested_parties,
+    grpc_pollset_set_add_pollset(exec_ctx, chand->interested_parties,
                                  op->bind_pollset);
   }
 
@@ -284,8 +283,8 @@ static void cc_start_transport_op(grpc_exec_ctx *exec_ctx,
     chand->resolver = NULL;
     if (chand->lb_policy != NULL) {
       grpc_pollset_set_del_pollset_set(exec_ctx,
-                                       &chand->lb_policy->interested_parties,
-                                       &chand->interested_parties);
+                                       chand->lb_policy->interested_parties,
+                                       chand->interested_parties);
       GRPC_LB_POLICY_UNREF(exec_ctx, chand->lb_policy, "channel");
       chand->lb_policy = NULL;
     }
@@ -411,7 +410,7 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx,
 
   grpc_connectivity_state_init(&chand->state_tracker, GRPC_CHANNEL_IDLE,
                                "client_channel");
-  grpc_pollset_set_init(&chand->interested_parties);
+  chand->interested_parties = grpc_pollset_set_create();
 }
 
 /* Destructor for channel_data */
@@ -425,12 +424,12 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
   }
   if (chand->lb_policy != NULL) {
     grpc_pollset_set_del_pollset_set(exec_ctx,
-                                     &chand->lb_policy->interested_parties,
-                                     &chand->interested_parties);
+                                     chand->lb_policy->interested_parties,
+                                     chand->interested_parties);
     GRPC_LB_POLICY_UNREF(exec_ctx, chand->lb_policy, "channel");
   }
   grpc_connectivity_state_destroy(exec_ctx, &chand->state_tracker);
-  grpc_pollset_set_destroy(&chand->interested_parties);
+  grpc_pollset_set_destroy(chand->interested_parties);
   gpr_mu_destroy(&chand->mu_config);
 }
 
@@ -501,7 +500,7 @@ static void on_external_watch_complete(grpc_exec_ctx *exec_ctx, void *arg,
                                        bool iomgr_success) {
   external_connectivity_watcher *w = arg;
   grpc_closure *follow_up = w->on_complete;
-  grpc_pollset_set_del_pollset(exec_ctx, &w->chand->interested_parties,
+  grpc_pollset_set_del_pollset(exec_ctx, w->chand->interested_parties,
                                w->pollset);
   GRPC_CHANNEL_STACK_UNREF(exec_ctx, w->chand->owning_stack,
                            "external_connectivity_watcher");
@@ -517,7 +516,7 @@ void grpc_client_channel_watch_connectivity_state(
   w->chand = chand;
   w->pollset = pollset;
   w->on_complete = on_complete;
-  grpc_pollset_set_add_pollset(exec_ctx, &chand->interested_parties, pollset);
+  grpc_pollset_set_add_pollset(exec_ctx, chand->interested_parties, pollset);
   grpc_closure_init(&w->my_closure, on_external_watch_complete, w);
   GRPC_CHANNEL_STACK_REF(w->chand->owning_stack,
                          "external_connectivity_watcher");

+ 163 - 0
src/core/client_config/lb_policies/load_balancer_api.c

@@ -0,0 +1,163 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "src/core/client_config/lb_policies/load_balancer_api.h"
+#include "third_party/nanopb/pb_decode.h"
+#include "third_party/nanopb/pb_encode.h"
+
+#include <grpc/support/alloc.h>
+
+typedef struct decode_serverlist_arg {
+  int first_pass;
+  int i;
+  size_t num_servers;
+  grpc_grpclb_server **servers;
+} decode_serverlist_arg;
+
+/* invoked once for every Server in ServerList */
+static bool decode_serverlist(pb_istream_t *stream, const pb_field_t *field,
+                              void **arg) {
+  decode_serverlist_arg *dec_arg = *arg;
+  if (dec_arg->first_pass != 0) { /* first pass */
+    grpc_grpclb_server server;
+    if (!pb_decode(stream, grpc_lb_v0_Server_fields, &server)) {
+      return false;
+    }
+    dec_arg->num_servers++;
+  } else { /* second pass */
+    grpc_grpclb_server *server = gpr_malloc(sizeof(grpc_grpclb_server));
+    GPR_ASSERT(dec_arg->num_servers > 0);
+    if (dec_arg->i == 0) { /* first iteration of second pass */
+      dec_arg->servers =
+          gpr_malloc(sizeof(grpc_grpclb_server *) * dec_arg->num_servers);
+    }
+    if (!pb_decode(stream, grpc_lb_v0_Server_fields, server)) {
+      return false;
+    }
+    dec_arg->servers[dec_arg->i++] = server;
+  }
+
+  return true;
+}
+
+grpc_grpclb_request *grpc_grpclb_request_create(const char *lb_service_name) {
+  grpc_grpclb_request *req = gpr_malloc(sizeof(grpc_grpclb_request));
+
+  req->has_client_stats = 0; /* TODO(dgq): add support for stats once defined */
+  req->has_initial_request = 1;
+  req->initial_request.has_name = 1;
+  strncpy(req->initial_request.name, lb_service_name,
+          GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH);
+  return req;
+}
+
+gpr_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request) {
+  size_t encoded_length;
+  pb_ostream_t sizestream;
+  pb_ostream_t outputstream;
+  gpr_slice slice;
+  memset(&sizestream, 0, sizeof(pb_ostream_t));
+  pb_encode(&sizestream, grpc_lb_v0_LoadBalanceRequest_fields, request);
+  encoded_length = sizestream.bytes_written;
+
+  slice = gpr_slice_malloc(encoded_length);
+  outputstream =
+      pb_ostream_from_buffer(GPR_SLICE_START_PTR(slice), encoded_length);
+  GPR_ASSERT(pb_encode(&outputstream, grpc_lb_v0_LoadBalanceRequest_fields,
+                       request) != 0);
+  return slice;
+}
+
+void grpc_grpclb_request_destroy(grpc_grpclb_request *request) {
+  gpr_free(request);
+}
+
+grpc_grpclb_response *grpc_grpclb_response_parse(gpr_slice encoded_response) {
+  bool status;
+  pb_istream_t stream =
+      pb_istream_from_buffer(GPR_SLICE_START_PTR(encoded_response),
+                             GPR_SLICE_LENGTH(encoded_response));
+  grpc_grpclb_response *res = gpr_malloc(sizeof(grpc_grpclb_response));
+  memset(res, 0, sizeof(*res));
+  status = pb_decode(&stream, grpc_lb_v0_LoadBalanceResponse_fields, res);
+  GPR_ASSERT(status == true);
+  return res;
+}
+
+grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist(
+    gpr_slice encoded_response) {
+  grpc_grpclb_serverlist *sl = gpr_malloc(sizeof(grpc_grpclb_serverlist));
+  bool status;
+  decode_serverlist_arg arg;
+  pb_istream_t stream =
+      pb_istream_from_buffer(GPR_SLICE_START_PTR(encoded_response),
+                             GPR_SLICE_LENGTH(encoded_response));
+  pb_istream_t stream_at_start = stream;
+  grpc_grpclb_response *res = gpr_malloc(sizeof(grpc_grpclb_response));
+  memset(res, 0, sizeof(*res));
+  memset(&arg, 0, sizeof(decode_serverlist_arg));
+
+  res->server_list.servers.funcs.decode = decode_serverlist;
+  res->server_list.servers.arg = &arg;
+  arg.first_pass = 1;
+  status = pb_decode(&stream, grpc_lb_v0_LoadBalanceResponse_fields, res);
+  GPR_ASSERT(status == true);
+  GPR_ASSERT(arg.num_servers > 0);
+
+  arg.first_pass = 0;
+  status =
+      pb_decode(&stream_at_start, grpc_lb_v0_LoadBalanceResponse_fields, res);
+  GPR_ASSERT(status == true);
+  GPR_ASSERT(arg.servers != NULL);
+
+  sl->num_servers = arg.num_servers;
+  sl->servers = arg.servers;
+  if (res->server_list.has_expiration_interval) {
+    sl->expiration_interval = res->server_list.expiration_interval;
+  }
+  grpc_grpclb_response_destroy(res);
+  return sl;
+}
+
+void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist *serverlist) {
+  size_t i;
+  for (i = 0; i < serverlist->num_servers; i++) {
+    gpr_free(serverlist->servers[i]);
+  }
+  gpr_free(serverlist->servers);
+  gpr_free(serverlist);
+}
+
+void grpc_grpclb_response_destroy(grpc_grpclb_response *response) {
+  gpr_free(response);
+}

+ 85 - 0
src/core/client_config/lb_policies/load_balancer_api.h

@@ -0,0 +1,85 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_LB_POLICIES_LOAD_BALANCER_API_H
+#define GRPC_INTERNAL_CORE_CLIENT_CONFIG_LB_POLICIES_LOAD_BALANCER_API_H
+
+#include <grpc/support/slice_buffer.h>
+
+#include "src/core/client_config/lb_policy_factory.h"
+#include "src/core/proto/grpc/lb/v0/load_balancer.pb.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH 128
+
+typedef grpc_lb_v0_LoadBalanceRequest grpc_grpclb_request;
+typedef grpc_lb_v0_LoadBalanceResponse grpc_grpclb_response;
+typedef grpc_lb_v0_Server grpc_grpclb_server;
+typedef grpc_lb_v0_Duration grpc_grpclb_duration;
+typedef struct grpc_grpclb_serverlist {
+  grpc_grpclb_server **servers;
+  size_t num_servers;
+  grpc_grpclb_duration expiration_interval;
+} grpc_grpclb_serverlist;
+
+/** Create a request for a gRPC LB service under \a lb_service_name */
+grpc_grpclb_request *grpc_grpclb_request_create(const char *lb_service_name);
+
+/** Protocol Buffers v3-encode \a request */
+gpr_slice grpc_grpclb_request_encode(const grpc_grpclb_request *request);
+
+/** Destroy \a request */
+void grpc_grpclb_request_destroy(grpc_grpclb_request *request);
+
+/** Parse (ie, decode) the bytes in \a encoded_response as a \a
+ * grpc_grpclb_response */
+grpc_grpclb_response *grpc_grpclb_response_parse(gpr_slice encoded_response);
+
+/** Destroy \a serverlist */
+void grpc_grpclb_destroy_serverlist(grpc_grpclb_serverlist *serverlist);
+
+/** Parse the list of servers from an encoded \a grpc_grpclb_response */
+grpc_grpclb_serverlist *grpc_grpclb_response_parse_serverlist(
+    gpr_slice encoded_response);
+
+/** Destroy \a response */
+void grpc_grpclb_response_destroy(grpc_grpclb_response *response);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_INTERNAL_CORE_CLIENT_CONFIG_LB_POLICIES_LOAD_BALANCER_API_H */

+ 10 - 11
src/core/client_config/lb_policies/pick_first.c

@@ -31,8 +31,8 @@
  *
  */
 
-#include "src/core/client_config/lb_policy_factory.h"
 #include "src/core/client_config/lb_policies/pick_first.h"
+#include "src/core/client_config/lb_policy_factory.h"
 
 #include <string.h>
 
@@ -119,7 +119,7 @@ void pf_shutdown(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) {
   while (pp != NULL) {
     pending_pick *next = pp->next;
     *pp->target = NULL;
-    grpc_pollset_set_del_pollset(exec_ctx, &p->base.interested_parties,
+    grpc_pollset_set_del_pollset(exec_ctx, p->base.interested_parties,
                                  pp->pollset);
     grpc_exec_ctx_enqueue(exec_ctx, pp->on_complete, true, NULL);
     gpr_free(pp);
@@ -137,7 +137,7 @@ static void pf_cancel_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
   while (pp != NULL) {
     pending_pick *next = pp->next;
     if (pp->target == target) {
-      grpc_pollset_set_del_pollset(exec_ctx, &p->base.interested_parties,
+      grpc_pollset_set_del_pollset(exec_ctx, p->base.interested_parties,
                                    pp->pollset);
       *target = NULL;
       grpc_exec_ctx_enqueue(exec_ctx, pp->on_complete, false, NULL);
@@ -158,7 +158,7 @@ static void start_picking(grpc_exec_ctx *exec_ctx, pick_first_lb_policy *p) {
   GRPC_LB_POLICY_WEAK_REF(&p->base, "pick_first_connectivity");
   grpc_subchannel_notify_on_state_change(
       exec_ctx, p->subchannels[p->checking_subchannel],
-      &p->base.interested_parties, &p->checking_connectivity,
+      p->base.interested_parties, &p->checking_connectivity,
       &p->connectivity_changed);
 }
 
@@ -195,8 +195,7 @@ int pf_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_pollset *pollset,
     if (!p->started_picking) {
       start_picking(exec_ctx, p);
     }
-    grpc_pollset_set_add_pollset(exec_ctx, &p->base.interested_parties,
-                                 pollset);
+    grpc_pollset_set_add_pollset(exec_ctx, p->base.interested_parties, pollset);
     pp = gpr_malloc(sizeof(*pp));
     pp->next = p->pending_picks;
     pp->pollset = pollset;
@@ -253,7 +252,7 @@ static void pf_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg,
                                 p->checking_connectivity, "selected_changed");
     if (p->checking_connectivity != GRPC_CHANNEL_FATAL_FAILURE) {
       grpc_connected_subchannel_notify_on_state_change(
-          exec_ctx, selected, &p->base.interested_parties,
+          exec_ctx, selected, p->base.interested_parties,
           &p->checking_connectivity, &p->connectivity_changed);
     } else {
       GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "pick_first_connectivity");
@@ -278,13 +277,13 @@ static void pf_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg,
         while ((pp = p->pending_picks)) {
           p->pending_picks = pp->next;
           *pp->target = selected;
-          grpc_pollset_set_del_pollset(exec_ctx, &p->base.interested_parties,
+          grpc_pollset_set_del_pollset(exec_ctx, p->base.interested_parties,
                                        pp->pollset);
           grpc_exec_ctx_enqueue(exec_ctx, pp->on_complete, true, NULL);
           gpr_free(pp);
         }
         grpc_connected_subchannel_notify_on_state_change(
-            exec_ctx, selected, &p->base.interested_parties,
+            exec_ctx, selected, p->base.interested_parties,
             &p->checking_connectivity, &p->connectivity_changed);
         break;
       case GRPC_CHANNEL_TRANSIENT_FAILURE:
@@ -298,7 +297,7 @@ static void pf_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg,
         if (p->checking_connectivity == GRPC_CHANNEL_TRANSIENT_FAILURE) {
           grpc_subchannel_notify_on_state_change(
               exec_ctx, p->subchannels[p->checking_subchannel],
-              &p->base.interested_parties, &p->checking_connectivity,
+              p->base.interested_parties, &p->checking_connectivity,
               &p->connectivity_changed);
         } else {
           goto loop;
@@ -311,7 +310,7 @@ static void pf_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg,
                                     "connecting_changed");
         grpc_subchannel_notify_on_state_change(
             exec_ctx, p->subchannels[p->checking_subchannel],
-            &p->base.interested_parties, &p->checking_connectivity,
+            p->base.interested_parties, &p->checking_connectivity,
             &p->connectivity_changed);
         break;
       case GRPC_CHANNEL_FATAL_FAILURE:

+ 7 - 8
src/core/client_config/lb_policies/round_robin.c

@@ -260,7 +260,7 @@ static void rr_cancel_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
   while (pp != NULL) {
     pending_pick *next = pp->next;
     if (pp->target == target) {
-      grpc_pollset_set_del_pollset(exec_ctx, &p->base.interested_parties,
+      grpc_pollset_set_del_pollset(exec_ctx, p->base.interested_parties,
                                    pp->pollset);
       *target = NULL;
       grpc_exec_ctx_enqueue(exec_ctx, pp->on_complete, false, NULL);
@@ -285,7 +285,7 @@ static void start_picking(grpc_exec_ctx *exec_ctx, round_robin_lb_policy *p) {
     subchannel_data *sd = p->subchannels[i];
     sd->connectivity_state = GRPC_CHANNEL_IDLE;
     grpc_subchannel_notify_on_state_change(
-        exec_ctx, sd->subchannel, &p->base.interested_parties,
+        exec_ctx, sd->subchannel, p->base.interested_parties,
         &sd->connectivity_state, &sd->connectivity_changed_closure);
     GRPC_LB_POLICY_WEAK_REF(&p->base, "round_robin_connectivity");
   }
@@ -322,8 +322,7 @@ int rr_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_pollset *pollset,
     if (!p->started_picking) {
       start_picking(exec_ctx, p);
     }
-    grpc_pollset_set_add_pollset(exec_ctx, &p->base.interested_parties,
-                                 pollset);
+    grpc_pollset_set_add_pollset(exec_ctx, p->base.interested_parties, pollset);
     pp = gpr_malloc(sizeof(*pp));
     pp->next = p->pending_picks;
     pp->pollset = pollset;
@@ -374,13 +373,13 @@ static void rr_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg,
                     "[RR CONN CHANGED] TARGET <-- SUBCHANNEL %p (NODE %p)",
                     selected->subchannel, selected);
           }
-          grpc_pollset_set_del_pollset(exec_ctx, &p->base.interested_parties,
+          grpc_pollset_set_del_pollset(exec_ctx, p->base.interested_parties,
                                        pp->pollset);
           grpc_exec_ctx_enqueue(exec_ctx, pp->on_complete, true, NULL);
           gpr_free(pp);
         }
         grpc_subchannel_notify_on_state_change(
-            exec_ctx, sd->subchannel, &p->base.interested_parties,
+            exec_ctx, sd->subchannel, p->base.interested_parties,
             &sd->connectivity_state, &sd->connectivity_changed_closure);
         break;
       case GRPC_CHANNEL_CONNECTING:
@@ -389,13 +388,13 @@ static void rr_connectivity_changed(grpc_exec_ctx *exec_ctx, void *arg,
                                     sd->connectivity_state,
                                     "connecting_changed");
         grpc_subchannel_notify_on_state_change(
-            exec_ctx, sd->subchannel, &p->base.interested_parties,
+            exec_ctx, sd->subchannel, p->base.interested_parties,
             &sd->connectivity_state, &sd->connectivity_changed_closure);
         break;
       case GRPC_CHANNEL_TRANSIENT_FAILURE:
         /* renew state notification */
         grpc_subchannel_notify_on_state_change(
-            exec_ctx, sd->subchannel, &p->base.interested_parties,
+            exec_ctx, sd->subchannel, p->base.interested_parties,
             &sd->connectivity_state, &sd->connectivity_changed_closure);
 
         /* remove from ready list if still present */

+ 3 - 3
src/core/client_config/lb_policy.c

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@ void grpc_lb_policy_init(grpc_lb_policy *policy,
                          const grpc_lb_policy_vtable *vtable) {
   policy->vtable = vtable;
   gpr_atm_no_barrier_store(&policy->ref_pair, 1 << WEAK_REF_BITS);
-  grpc_pollset_set_init(&policy->interested_parties);
+  policy->interested_parties = grpc_pollset_set_create();
 }
 
 #ifdef GRPC_LB_POLICY_REFCOUNT_DEBUG
@@ -93,7 +93,7 @@ void grpc_lb_policy_weak_unref(grpc_exec_ctx *exec_ctx,
   gpr_atm old_val =
       ref_mutate(policy, -(gpr_atm)1, 1 REF_MUTATE_PASS_ARGS("WEAK_UNREF"));
   if (old_val == 1) {
-    grpc_pollset_set_destroy(&policy->interested_parties);
+    grpc_pollset_set_destroy(policy->interested_parties);
     policy->vtable->destroy(exec_ctx, policy);
   }
 }

+ 3 - 2
src/core/client_config/lb_policy.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,8 @@ typedef void (*grpc_lb_completion)(void *cb_arg, grpc_subchannel *subchannel,
 struct grpc_lb_policy {
   const grpc_lb_policy_vtable *vtable;
   gpr_atm ref_pair;
-  grpc_pollset_set interested_parties;
+  /* owned pointer to interested parties in load balancing decisions */
+  grpc_pollset_set *interested_parties;
 };
 
 struct grpc_lb_policy_vtable {

+ 10 - 14
src/core/client_config/subchannel.c

@@ -108,7 +108,7 @@ struct grpc_subchannel {
 
   /** pollset_set tracking who's interested in a connection
       being setup */
-  grpc_pollset_set pollset_set;
+  grpc_pollset_set *pollset_set;
 
   /** active connection, or null; of type grpc_connected_subchannel */
   gpr_atm connected_subchannel;
@@ -209,7 +209,7 @@ static void subchannel_destroy(grpc_exec_ctx *exec_ctx, void *arg,
   gpr_slice_unref(c->initial_connect_string);
   grpc_connectivity_state_destroy(exec_ctx, &c->state_tracker);
   grpc_connector_unref(exec_ctx, c->connector);
-  grpc_pollset_set_destroy(&c->pollset_set);
+  grpc_pollset_set_destroy(c->pollset_set);
   grpc_subchannel_key_destroy(exec_ctx, c->key);
   gpr_free(c);
 }
@@ -326,7 +326,7 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
   }
   c->addr = gpr_malloc(args->addr_len);
   memcpy(c->addr, args->addr, args->addr_len);
-  grpc_pollset_set_init(&c->pollset_set);
+  c->pollset_set = grpc_pollset_set_create();
   c->addr_len = args->addr_len;
   grpc_set_initial_connect_string(&c->addr, &c->addr_len,
                                   &c->initial_connect_string);
@@ -345,7 +345,7 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
 static void continue_connect(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) {
   grpc_connect_in_args args;
 
-  args.interested_parties = &c->pollset_set;
+  args.interested_parties = c->pollset_set;
   args.addr = c->addr;
   args.addr_len = c->addr_len;
   args.deadline = compute_connect_deadline(c);
@@ -379,7 +379,7 @@ static void on_external_state_watcher_done(grpc_exec_ctx *exec_ctx, void *arg,
   external_state_watcher *w = arg;
   grpc_closure *follow_up = w->notify;
   if (w->pollset_set != NULL) {
-    grpc_pollset_set_del_pollset_set(exec_ctx, &w->subchannel->pollset_set,
+    grpc_pollset_set_del_pollset_set(exec_ctx, w->subchannel->pollset_set,
                                      w->pollset_set);
   }
   gpr_mu_lock(&w->subchannel->mu);
@@ -395,7 +395,6 @@ void grpc_subchannel_notify_on_state_change(
     grpc_exec_ctx *exec_ctx, grpc_subchannel *c,
     grpc_pollset_set *interested_parties, grpc_connectivity_state *state,
     grpc_closure *notify) {
-  int do_connect = 0;
   external_state_watcher *w;
 
   if (state == NULL) {
@@ -415,7 +414,7 @@ void grpc_subchannel_notify_on_state_change(
     w->notify = notify;
     grpc_closure_init(&w->closure, on_external_state_watcher_done, w);
     if (interested_parties != NULL) {
-      grpc_pollset_set_add_pollset_set(exec_ctx, &c->pollset_set,
+      grpc_pollset_set_add_pollset_set(exec_ctx, c->pollset_set,
                                        interested_parties);
     }
     GRPC_SUBCHANNEL_WEAK_REF(c, "external_state_watcher");
@@ -425,17 +424,13 @@ void grpc_subchannel_notify_on_state_change(
     w->next->prev = w->prev->next = w;
     if (grpc_connectivity_state_notify_on_state_change(
             exec_ctx, &c->state_tracker, state, &w->closure)) {
-      do_connect = 1;
       c->connecting = 1;
       /* released by connection */
       GRPC_SUBCHANNEL_WEAK_REF(c, "connecting");
+      start_connect(exec_ctx, c);
     }
     gpr_mu_unlock(&c->mu);
   }
-
-  if (do_connect) {
-    start_connect(exec_ctx, c);
-  }
 }
 
 void grpc_connected_subchannel_process_transport_op(
@@ -573,7 +568,7 @@ static void publish_transport(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) {
   GRPC_SUBCHANNEL_WEAK_REF(c, "state_watcher");
   GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, c, "connecting");
   grpc_connected_subchannel_notify_on_state_change(
-      exec_ctx, con, &c->pollset_set, &sw_subchannel->connectivity_state,
+      exec_ctx, con, c->pollset_set, &sw_subchannel->connectivity_state,
       &sw_subchannel->closure);
 
   /* signal completion */
@@ -635,11 +630,12 @@ static void on_alarm(grpc_exec_ctx *exec_ctx, void *arg, bool iomgr_success) {
   if (c->disconnected) {
     iomgr_success = 0;
   }
-  gpr_mu_unlock(&c->mu);
   if (iomgr_success) {
     update_reconnect_parameters(c);
     continue_connect(exec_ctx, c);
+    gpr_mu_unlock(&c->mu);
   } else {
+    gpr_mu_unlock(&c->mu);
     GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, c, "connecting");
   }
 }

+ 2 - 0
src/core/client_config/subchannel_index.c

@@ -149,11 +149,13 @@ static const gpr_avl_vtable subchannel_avl_vtable = {
 void grpc_subchannel_index_init(void) {
   g_subchannel_index = gpr_avl_create(&subchannel_avl_vtable);
   gpr_mu_init(&g_mu);
+  gpr_tls_init(&subchannel_index_exec_ctx);
 }
 
 void grpc_subchannel_index_shutdown(void) {
   gpr_mu_destroy(&g_mu);
   gpr_avl_unref(g_subchannel_index);
+  gpr_tls_destroy(&subchannel_index_exec_ctx);
 }
 
 grpc_subchannel *grpc_subchannel_index_find(grpc_exec_ctx *exec_ctx,

+ 0 - 0
src/core/compression/algorithm.c → src/core/compression/compression_algorithm.c


+ 13 - 11
src/core/httpcli/httpcli.c

@@ -31,20 +31,22 @@
  *
  */
 
-#include "src/core/iomgr/sockaddr.h"
 #include "src/core/httpcli/httpcli.h"
+#include "src/core/iomgr/sockaddr.h"
 
 #include <string.h>
 
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/httpcli/format_request.h"
+#include "src/core/httpcli/parser.h"
 #include "src/core/iomgr/endpoint.h"
+#include "src/core/iomgr/iomgr_internal.h"
 #include "src/core/iomgr/resolve_address.h"
 #include "src/core/iomgr/tcp_client.h"
-#include "src/core/httpcli/format_request.h"
-#include "src/core/httpcli/parser.h"
 #include "src/core/support/string.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
 
 typedef struct {
   gpr_slice request_text;
@@ -84,18 +86,18 @@ const grpc_httpcli_handshaker grpc_httpcli_plaintext = {"http",
                                                         plaintext_handshake};
 
 void grpc_httpcli_context_init(grpc_httpcli_context *context) {
-  grpc_pollset_set_init(&context->pollset_set);
+  context->pollset_set = grpc_pollset_set_create();
 }
 
 void grpc_httpcli_context_destroy(grpc_httpcli_context *context) {
-  grpc_pollset_set_destroy(&context->pollset_set);
+  grpc_pollset_set_destroy(context->pollset_set);
 }
 
 static void next_address(grpc_exec_ctx *exec_ctx, internal_request *req);
 
 static void finish(grpc_exec_ctx *exec_ctx, internal_request *req,
                    int success) {
-  grpc_pollset_set_del_pollset(exec_ctx, &req->context->pollset_set,
+  grpc_pollset_set_del_pollset(exec_ctx, req->context->pollset_set,
                                req->pollset);
   req->on_response(exec_ctx, req->user_data, success ? &req->parser.r : NULL);
   grpc_httpcli_parser_destroy(&req->parser);
@@ -197,7 +199,7 @@ static void next_address(grpc_exec_ctx *exec_ctx, internal_request *req) {
   addr = &req->addresses->addrs[req->next_address++];
   grpc_closure_init(&req->connected, on_connected, req);
   grpc_tcp_client_connect(
-      exec_ctx, &req->connected, &req->ep, &req->context->pollset_set,
+      exec_ctx, &req->connected, &req->ep, req->context->pollset_set,
       (struct sockaddr *)&addr->addr, addr->len, req->deadline);
 }
 
@@ -237,7 +239,7 @@ static void internal_request_begin(
   req->host = gpr_strdup(request->host);
   req->ssl_host_override = gpr_strdup(request->ssl_host_override);
 
-  grpc_pollset_set_add_pollset(exec_ctx, &req->context->pollset_set,
+  grpc_pollset_set_add_pollset(exec_ctx, req->context->pollset_set,
                                req->pollset);
   grpc_resolve_address(request->host, req->handshaker->default_port,
                        on_resolved, req);

+ 3 - 2
src/core/httpcli/httpcli.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -39,6 +39,7 @@
 #include <grpc/support/time.h>
 
 #include "src/core/iomgr/endpoint.h"
+#include "src/core/iomgr/iomgr_internal.h"
 #include "src/core/iomgr/pollset_set.h"
 
 /* User agent this library reports */
@@ -56,7 +57,7 @@ typedef struct grpc_httpcli_header {
    TODO(ctiller): allow caching and capturing multiple requests for the
                   same content and combining them */
 typedef struct grpc_httpcli_context {
-  grpc_pollset_set pollset_set;
+  grpc_pollset_set *pollset_set;
 } grpc_httpcli_context;
 
 typedef struct {

+ 7 - 7
src/core/httpcli/httpcli_security_connector.c

@@ -59,7 +59,7 @@ static void httpcli_ssl_destroy(grpc_security_connector *sc) {
 }
 
 static void httpcli_ssl_do_handshake(grpc_exec_ctx *exec_ctx,
-                                     grpc_security_connector *sc,
+                                     grpc_channel_security_connector *sc,
                                      grpc_endpoint *nonsecure_endpoint,
                                      grpc_security_handshake_done_cb cb,
                                      void *user_data) {
@@ -78,8 +78,8 @@ static void httpcli_ssl_do_handshake(grpc_exec_ctx *exec_ctx,
             tsi_result_to_string(result));
     cb(exec_ctx, user_data, GRPC_SECURITY_ERROR, NULL, NULL);
   } else {
-    grpc_do_security_handshake(exec_ctx, handshaker, sc, nonsecure_endpoint, cb,
-                               user_data);
+    grpc_do_security_handshake(exec_ctx, handshaker, &sc->base, true,
+                               nonsecure_endpoint, cb, user_data);
   }
 }
 
@@ -103,7 +103,7 @@ static void httpcli_ssl_check_peer(grpc_exec_ctx *exec_ctx,
 }
 
 static grpc_security_connector_vtable httpcli_ssl_vtable = {
-    httpcli_ssl_destroy, httpcli_ssl_do_handshake, httpcli_ssl_check_peer};
+    httpcli_ssl_destroy, httpcli_ssl_check_peer};
 
 static grpc_security_status httpcli_ssl_channel_security_connector_create(
     const unsigned char *pem_root_certs, size_t pem_root_certs_size,
@@ -121,7 +121,6 @@ static grpc_security_status httpcli_ssl_channel_security_connector_create(
   memset(c, 0, sizeof(grpc_httpcli_ssl_channel_security_connector));
 
   gpr_ref_init(&c->base.base.refcount, 1);
-  c->base.base.is_client_side = 1;
   c->base.base.vtable = &httpcli_ssl_vtable;
   if (secure_peer_name != NULL) {
     c->secure_peer_name = gpr_strdup(secure_peer_name);
@@ -136,6 +135,7 @@ static grpc_security_status httpcli_ssl_channel_security_connector_create(
     *sc = NULL;
     return GRPC_SECURITY_ERROR;
   }
+  c->base.do_handshake = httpcli_ssl_do_handshake;
   *sc = &c->base;
   return GRPC_SECURITY_OK;
 }
@@ -180,8 +180,8 @@ static void ssl_handshake(grpc_exec_ctx *exec_ctx, void *arg,
   GPR_ASSERT(httpcli_ssl_channel_security_connector_create(
                  pem_root_certs, pem_root_certs_size, host, &sc) ==
              GRPC_SECURITY_OK);
-  grpc_security_connector_do_handshake(exec_ctx, &sc->base, tcp,
-                                       on_secure_transport_setup_done, c);
+  grpc_channel_security_connector_do_handshake(
+      exec_ctx, sc, tcp, on_secure_transport_setup_done, c);
   GRPC_SECURITY_CONNECTOR_UNREF(&sc->base, "httpcli");
 }
 

+ 4 - 2
src/core/iomgr/fd_posix.c

@@ -46,6 +46,8 @@
 #include <grpc/support/string_util.h>
 #include <grpc/support/useful.h>
 
+#include "src/core/iomgr/pollset_posix.h"
+
 #define CLOSURE_NOT_READY ((grpc_closure *)0)
 #define CLOSURE_READY ((grpc_closure *)1)
 
@@ -175,11 +177,11 @@ int grpc_fd_is_orphaned(grpc_fd *fd) {
 }
 
 static void pollset_kick_locked(grpc_fd_watcher *watcher) {
-  gpr_mu_lock(GRPC_POLLSET_MU(watcher->pollset));
+  gpr_mu_lock(&watcher->pollset->mu);
   GPR_ASSERT(watcher->worker);
   grpc_pollset_kick_ext(watcher->pollset, watcher->worker,
                         GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP);
-  gpr_mu_unlock(GRPC_POLLSET_MU(watcher->pollset));
+  gpr_mu_unlock(&watcher->pollset->mu);
 }
 
 static void maybe_wake_one_watcher_locked(grpc_fd *fd) {

+ 1 - 1
src/core/iomgr/iocp_windows.c

@@ -42,7 +42,7 @@
 #include <grpc/support/alloc.h>
 #include <grpc/support/thd.h>
 
-#include "src/core/iomgr/timer_internal.h"
+#include "src/core/iomgr/timer.h"
 #include "src/core/iomgr/iocp_windows.h"
 #include "src/core/iomgr/iomgr_internal.h"
 #include "src/core/iomgr/socket_windows.h"

+ 18 - 2
src/core/iomgr/iomgr.c

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,11 @@
 #include <grpc/support/string_util.h>
 #include <grpc/support/sync.h>
 #include <grpc/support/thd.h>
+#include <grpc/support/useful.h>
 
 #include "src/core/iomgr/iomgr_internal.h"
-#include "src/core/iomgr/timer_internal.h"
+#include "src/core/iomgr/timer.h"
+#include "src/core/support/env.h"
 #include "src/core/support/string.h"
 
 static gpr_mu g_mu;
@@ -116,6 +118,9 @@ void grpc_iomgr_shutdown(void) {
                     "memory leaks are likely",
                     count_objects());
             dump_objects("LEAKED");
+            if (grpc_iomgr_abort_on_leaks()) {
+              abort();
+            }
           }
           break;
         }
@@ -154,3 +159,14 @@ void grpc_iomgr_unregister_object(grpc_iomgr_object *obj) {
   gpr_mu_unlock(&g_mu);
   gpr_free(obj->name);
 }
+
+bool grpc_iomgr_abort_on_leaks(void) {
+  char *env = gpr_getenv("GRPC_ABORT_ON_LEAKS");
+  if (env == NULL) return false;
+  static const char *truthy[] = {"yes",  "Yes",  "YES", "true",
+                                 "True", "TRUE", "1"};
+  for (size_t i = 0; i < GPR_ARRAY_SIZE(truthy); i++) {
+    if (0 == strcmp(env, truthy[i])) return true;
+  }
+  return false;
+}

+ 5 - 1
src/core/iomgr/iomgr_internal.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,8 @@
 #ifndef GRPC_INTERNAL_CORE_IOMGR_IOMGR_INTERNAL_H
 #define GRPC_INTERNAL_CORE_IOMGR_IOMGR_INTERNAL_H
 
+#include <stdbool.h>
+
 #include "src/core/iomgr/iomgr.h"
 #include <grpc/support/sync.h>
 
@@ -55,4 +57,6 @@ void grpc_iomgr_platform_flush(void);
 /** tear down all platform specific global iomgr structures */
 void grpc_iomgr_platform_shutdown(void);
 
+bool grpc_iomgr_abort_on_leaks(void);
+
 #endif /* GRPC_INTERNAL_CORE_IOMGR_IOMGR_INTERNAL_H */

+ 9 - 10
src/core/iomgr/pollset.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,8 +35,11 @@
 #define GRPC_INTERNAL_CORE_IOMGR_POLLSET_H
 
 #include <grpc/support/port_platform.h>
+#include <grpc/support/sync.h>
 #include <grpc/support/time.h>
 
+#include "src/core/iomgr/exec_ctx.h"
+
 #define GRPC_POLLSET_KICK_BROADCAST ((grpc_pollset_worker *)1)
 
 /* A grpc_pollset is a set of file descriptors that a higher level item is
@@ -46,15 +49,11 @@
     - a completion queue might keep a pollset with an entry for each transport
       that is servicing a call that it's tracking */
 
-#ifdef GPR_POSIX_SOCKET
-#include "src/core/iomgr/pollset_posix.h"
-#endif
-
-#ifdef GPR_WIN32
-#include "src/core/iomgr/pollset_windows.h"
-#endif
+typedef struct grpc_pollset grpc_pollset;
+typedef struct grpc_pollset_worker grpc_pollset_worker;
 
-void grpc_pollset_init(grpc_pollset *pollset);
+size_t grpc_pollset_size(void);
+void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu);
 /* Begin shutting down the pollset, and call closure when done.
  * GRPC_POLLSET_MU(pollset) must be held */
 void grpc_pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
@@ -83,7 +82,7 @@ void grpc_pollset_destroy(grpc_pollset *pollset);
    pollset
    lock */
 void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                       grpc_pollset_worker *worker, gpr_timespec now,
+                       grpc_pollset_worker **worker, gpr_timespec now,
                        gpr_timespec deadline);
 
 /* Break one polling thread out of polling work for this pollset.

+ 1 - 0
src/core/iomgr/pollset_multipoller_with_epoll.c

@@ -45,6 +45,7 @@
 #include <grpc/support/log.h>
 #include <grpc/support/useful.h>
 #include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/pollset_posix.h"
 #include "src/core/profiling/timers.h"
 #include "src/core/support/block_annotate.h"
 

+ 5 - 3
src/core/iomgr/pollset_multipoller_with_poll_posix.c

@@ -42,13 +42,15 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "src/core/iomgr/fd_posix.h"
-#include "src/core/iomgr/iomgr_internal.h"
-#include "src/core/support/block_annotate.h"
 #include <grpc/support/alloc.h>
 #include <grpc/support/log.h>
 #include <grpc/support/useful.h>
 
+#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/iomgr_internal.h"
+#include "src/core/iomgr/pollset_posix.h"
+#include "src/core/support/block_annotate.h"
+
 typedef struct {
   /* all polled fds */
   size_t fd_count;

+ 30 - 35
src/core/iomgr/pollset_posix.c

@@ -42,17 +42,16 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "src/core/iomgr/timer_internal.h"
-#include "src/core/iomgr/fd_posix.h"
-#include "src/core/iomgr/iomgr_internal.h"
-#include "src/core/iomgr/socket_utils_posix.h"
-#include "src/core/profiling/timers.h"
-#include "src/core/support/block_annotate.h"
 #include <grpc/support/alloc.h>
 #include <grpc/support/log.h>
 #include <grpc/support/thd.h>
 #include <grpc/support/tls.h>
 #include <grpc/support/useful.h>
+#include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/iomgr_internal.h"
+#include "src/core/iomgr/socket_utils_posix.h"
+#include "src/core/profiling/timers.h"
+#include "src/core/support/block_annotate.h"
 
 GPR_TLS_DECL(g_current_thread_poller);
 GPR_TLS_DECL(g_current_thread_worker);
@@ -98,6 +97,8 @@ static void push_front_worker(grpc_pollset *p, grpc_pollset_worker *worker) {
   worker->prev->next = worker->next->prev = worker;
 }
 
+size_t grpc_pollset_size(void) { return sizeof(grpc_pollset); }
+
 void grpc_pollset_kick_ext(grpc_pollset *p,
                            grpc_pollset_worker *specific_worker,
                            uint32_t flags) {
@@ -187,8 +188,9 @@ void grpc_kick_poller(void) { grpc_wakeup_fd_wakeup(&grpc_global_wakeup_fd); }
 
 static void become_basic_pollset(grpc_pollset *pollset, grpc_fd *fd_or_null);
 
-void grpc_pollset_init(grpc_pollset *pollset) {
+void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
   gpr_mu_init(&pollset->mu);
+  *mu = &pollset->mu;
   pollset->root_worker.next = pollset->root_worker.prev = &pollset->root_worker;
   pollset->in_flight_cbs = 0;
   pollset->shutting_down = 0;
@@ -205,7 +207,6 @@ void grpc_pollset_destroy(grpc_pollset *pollset) {
   GPR_ASSERT(!grpc_pollset_has_workers(pollset));
   GPR_ASSERT(pollset->idle_jobs.head == pollset->idle_jobs.tail);
   pollset->vtable->destroy(pollset);
-  gpr_mu_destroy(&pollset->mu);
   while (pollset->local_wakeup_cache) {
     grpc_cached_wakeup_fd *next = pollset->local_wakeup_cache->next;
     grpc_wakeup_fd_destroy(&pollset->local_wakeup_cache->fd);
@@ -247,8 +248,11 @@ static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
 }
 
 void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                       grpc_pollset_worker *worker, gpr_timespec now,
+                       grpc_pollset_worker **worker_hdl, gpr_timespec now,
                        gpr_timespec deadline) {
+  grpc_pollset_worker worker;
+  *worker_hdl = &worker;
+
   /* pollset->mu already held */
   int added_worker = 0;
   int locked = 1;
@@ -256,16 +260,16 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
   int keep_polling = 0;
   GPR_TIMER_BEGIN("grpc_pollset_work", 0);
   /* this must happen before we (potentially) drop pollset->mu */
-  worker->next = worker->prev = NULL;
-  worker->reevaluate_polling_on_wakeup = 0;
+  worker.next = worker.prev = NULL;
+  worker.reevaluate_polling_on_wakeup = 0;
   if (pollset->local_wakeup_cache != NULL) {
-    worker->wakeup_fd = pollset->local_wakeup_cache;
-    pollset->local_wakeup_cache = worker->wakeup_fd->next;
+    worker.wakeup_fd = pollset->local_wakeup_cache;
+    pollset->local_wakeup_cache = worker.wakeup_fd->next;
   } else {
-    worker->wakeup_fd = gpr_malloc(sizeof(*worker->wakeup_fd));
-    grpc_wakeup_fd_init(&worker->wakeup_fd->fd);
+    worker.wakeup_fd = gpr_malloc(sizeof(*worker.wakeup_fd));
+    grpc_wakeup_fd_init(&worker.wakeup_fd->fd);
   }
-  worker->kicked_specifically = 0;
+  worker.kicked_specifically = 0;
   /* If there's work waiting for the pollset to be idle, and the
      pollset is idle, then do that work */
   if (!grpc_pollset_has_workers(pollset) &&
@@ -274,16 +278,6 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
     grpc_exec_ctx_enqueue_list(exec_ctx, &pollset->idle_jobs, NULL);
     goto done;
   }
-  /* Check alarms - these are a global resource so we just ping
-     each time through on every pollset.
-     May update deadline to ensure timely wakeups.
-     TODO(ctiller): can this work be localized? */
-  if (grpc_timer_check(exec_ctx, now, &deadline)) {
-    GPR_TIMER_MARK("grpc_pollset_work.alarm_triggered", 0);
-    gpr_mu_unlock(&pollset->mu);
-    locked = 0;
-    goto done;
-  }
   /* If we're shutting down then we don't execute any extended work */
   if (pollset->shutting_down) {
     GPR_TIMER_MARK("grpc_pollset_work.shutting_down", 0);
@@ -304,13 +298,13 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
     keep_polling = 0;
     if (!pollset->kicked_without_pollers) {
       if (!added_worker) {
-        push_front_worker(pollset, worker);
+        push_front_worker(pollset, &worker);
         added_worker = 1;
-        gpr_tls_set(&g_current_thread_worker, (intptr_t)worker);
+        gpr_tls_set(&g_current_thread_worker, (intptr_t)&worker);
       }
       gpr_tls_set(&g_current_thread_poller, (intptr_t)pollset);
       GPR_TIMER_BEGIN("maybe_work_and_unlock", 0);
-      pollset->vtable->maybe_work_and_unlock(exec_ctx, pollset, worker,
+      pollset->vtable->maybe_work_and_unlock(exec_ctx, pollset, &worker,
                                              deadline, now);
       GPR_TIMER_END("maybe_work_and_unlock", 0);
       locked = 0;
@@ -332,10 +326,10 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
     /* If we're forced to re-evaluate polling (via grpc_pollset_kick with
        GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) then we land here and force
        a loop */
-    if (worker->reevaluate_polling_on_wakeup) {
-      worker->reevaluate_polling_on_wakeup = 0;
+    if (worker.reevaluate_polling_on_wakeup) {
+      worker.reevaluate_polling_on_wakeup = 0;
       pollset->kicked_without_pollers = 0;
-      if (queued_work || worker->kicked_specifically) {
+      if (queued_work || worker.kicked_specifically) {
         /* If there's queued work on the list, then set the deadline to be
            immediate so we get back out of the polling loop quickly */
         deadline = gpr_inf_past(GPR_CLOCK_MONOTONIC);
@@ -344,12 +338,12 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
     }
   }
   if (added_worker) {
-    remove_worker(pollset, worker);
+    remove_worker(pollset, &worker);
     gpr_tls_set(&g_current_thread_worker, 0);
   }
   /* release wakeup fd to the local pool */
-  worker->wakeup_fd->next = pollset->local_wakeup_cache;
-  pollset->local_wakeup_cache = worker->wakeup_fd;
+  worker.wakeup_fd->next = pollset->local_wakeup_cache;
+  pollset->local_wakeup_cache = worker.wakeup_fd;
   /* check shutdown conditions */
   if (pollset->shutting_down) {
     if (grpc_pollset_has_workers(pollset)) {
@@ -371,6 +365,7 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
       gpr_mu_lock(&pollset->mu);
     }
   }
+  *worker_hdl = NULL;
   GPR_TIMER_END("grpc_pollset_work", 0);
 }
 

+ 10 - 6
src/core/iomgr/pollset_posix.h

@@ -37,8 +37,10 @@
 #include <poll.h>
 
 #include <grpc/support/sync.h>
+
 #include "src/core/iomgr/exec_ctx.h"
 #include "src/core/iomgr/iomgr.h"
+#include "src/core/iomgr/pollset.h"
 #include "src/core/iomgr/wakeup_fd_posix.h"
 
 typedef struct grpc_pollset_vtable grpc_pollset_vtable;
@@ -53,15 +55,15 @@ typedef struct grpc_cached_wakeup_fd {
   struct grpc_cached_wakeup_fd *next;
 } grpc_cached_wakeup_fd;
 
-typedef struct grpc_pollset_worker {
+struct grpc_pollset_worker {
   grpc_cached_wakeup_fd *wakeup_fd;
   int reevaluate_polling_on_wakeup;
   int kicked_specifically;
   struct grpc_pollset_worker *next;
   struct grpc_pollset_worker *prev;
-} grpc_pollset_worker;
+};
 
-typedef struct grpc_pollset {
+struct grpc_pollset {
   /* pollsets under posix can mutate representation as fds are added and
      removed.
      For example, we may choose a poll() based implementation on linux for
@@ -81,7 +83,7 @@ typedef struct grpc_pollset {
   } data;
   /* Local cache of eventfds for workers */
   grpc_cached_wakeup_fd *local_wakeup_cache;
-} grpc_pollset;
+};
 
 struct grpc_pollset_vtable {
   void (*add_fd)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
@@ -93,8 +95,6 @@ struct grpc_pollset_vtable {
   void (*destroy)(grpc_pollset *pollset);
 };
 
-#define GRPC_POLLSET_MU(pollset) (&(pollset)->mu)
-
 /* Add an fd to a pollset */
 void grpc_pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
                          struct grpc_fd *fd);
@@ -142,6 +142,10 @@ int grpc_pollset_has_workers(grpc_pollset *pollset);
 void grpc_remove_fd_from_all_epoll_sets(int fd);
 
 /* override to allow tests to hook poll() usage */
+/* NOTE: Any changes to grpc_poll_function must take place when the gRPC
+   is certainly not doing any polling anywhere.
+   Otherwise, there might be a race between changing the variable and actually
+   doing a polling operation */
 typedef int (*grpc_poll_function_type)(struct pollfd *, nfds_t, int);
 extern grpc_poll_function_type grpc_poll_function;
 extern grpc_wakeup_fd grpc_global_wakeup_fd;

+ 3 - 9
src/core/iomgr/pollset_set.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,15 +41,9 @@
    fd's (etc) that have been registered with the set_set to that pollset.
    Registering fd's automatically adds them to all current pollsets. */
 
-#ifdef GPR_POSIX_SOCKET
-#include "src/core/iomgr/pollset_set_posix.h"
-#endif
+typedef struct grpc_pollset_set grpc_pollset_set;
 
-#ifdef GPR_WIN32
-#include "src/core/iomgr/pollset_set_windows.h"
-#endif
-
-void grpc_pollset_set_init(grpc_pollset_set *pollset_set);
+grpc_pollset_set *grpc_pollset_set_create(void);
 void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set);
 void grpc_pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
                                   grpc_pollset_set *pollset_set,

+ 23 - 3
src/core/iomgr/pollset_set_posix.c

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,11 +41,30 @@
 #include <grpc/support/alloc.h>
 #include <grpc/support/useful.h>
 
-#include "src/core/iomgr/pollset_set.h"
+#include "src/core/iomgr/pollset_posix.h"
+#include "src/core/iomgr/pollset_set_posix.h"
 
-void grpc_pollset_set_init(grpc_pollset_set *pollset_set) {
+struct grpc_pollset_set {
+  gpr_mu mu;
+
+  size_t pollset_count;
+  size_t pollset_capacity;
+  grpc_pollset **pollsets;
+
+  size_t pollset_set_count;
+  size_t pollset_set_capacity;
+  struct grpc_pollset_set **pollset_sets;
+
+  size_t fd_count;
+  size_t fd_capacity;
+  grpc_fd **fds;
+};
+
+grpc_pollset_set *grpc_pollset_set_create(void) {
+  grpc_pollset_set *pollset_set = gpr_malloc(sizeof(*pollset_set));
   memset(pollset_set, 0, sizeof(*pollset_set));
   gpr_mu_init(&pollset_set->mu);
+  return pollset_set;
 }
 
 void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set) {
@@ -57,6 +76,7 @@ void grpc_pollset_set_destroy(grpc_pollset_set *pollset_set) {
   gpr_free(pollset_set->pollsets);
   gpr_free(pollset_set->pollset_sets);
   gpr_free(pollset_set->fds);
+  gpr_free(pollset_set);
 }
 
 void grpc_pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,

+ 2 - 18
src/core/iomgr/pollset_set_posix.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,23 +35,7 @@
 #define GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_POSIX_H
 
 #include "src/core/iomgr/fd_posix.h"
-#include "src/core/iomgr/pollset_posix.h"
-
-typedef struct grpc_pollset_set {
-  gpr_mu mu;
-
-  size_t pollset_count;
-  size_t pollset_capacity;
-  grpc_pollset **pollsets;
-
-  size_t pollset_set_count;
-  size_t pollset_set_capacity;
-  struct grpc_pollset_set **pollset_sets;
-
-  size_t fd_count;
-  size_t fd_capacity;
-  grpc_fd **fds;
-} grpc_pollset_set;
+#include "src/core/iomgr/pollset_set.h"
 
 void grpc_pollset_set_add_fd(grpc_exec_ctx *exec_ctx,
                              grpc_pollset_set *pollset_set, grpc_fd *fd);

+ 3 - 3
src/core/iomgr/pollset_set_windows.c

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -35,9 +35,9 @@
 
 #ifdef GPR_WINSOCK_SOCKET
 
-#include "src/core/iomgr/pollset_set.h"
+#include "src/core/iomgr/pollset_set_windows.h"
 
-void grpc_pollset_set_init(grpc_pollset_set* pollset_set) {}
+grpc_pollset_set* grpc_pollset_set_create(pollset_set) { return NULL; }
 
 void grpc_pollset_set_destroy(grpc_pollset_set* pollset_set) {}
 

+ 2 - 2
src/core/iomgr/pollset_set_windows.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,6 @@
 #ifndef GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_WINDOWS_H
 #define GRPC_INTERNAL_CORE_IOMGR_POLLSET_SET_WINDOWS_H
 
-typedef struct grpc_pollset_set { void *unused; } grpc_pollset_set;
+#include "src/core/iomgr/pollset_set.h"
 
 #endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H */

+ 24 - 21
src/core/iomgr/pollset_windows.c

@@ -38,7 +38,6 @@
 #include <grpc/support/log.h>
 #include <grpc/support/thd.h>
 
-#include "src/core/iomgr/timer_internal.h"
 #include "src/core/iomgr/iomgr_internal.h"
 #include "src/core/iomgr/iocp_windows.h"
 #include "src/core/iomgr/pollset.h"
@@ -90,12 +89,15 @@ static void push_front_worker(grpc_pollset_worker *root,
       worker->links[type].next->links[type].prev = worker;
 }
 
+size_t grpc_pollset_size(void) { return sizeof(grpc_pollset); }
+
 /* There isn't really any such thing as a pollset under Windows, due to the
    nature of the IO completion ports. We're still going to provide a minimal
    set of features for the sake of the rest of grpc. But grpc_pollset_work
    won't actually do any polling, and return as quickly as possible. */
 
-void grpc_pollset_init(grpc_pollset *pollset) {
+void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
+  *mu = &grpc_polling_mu;
   memset(pollset, 0, sizeof(*pollset));
   pollset->root_worker.links[GRPC_POLLSET_WORKER_LINK_POLLSET].next =
       pollset->root_worker.links[GRPC_POLLSET_WORKER_LINK_POLLSET].prev =
@@ -126,25 +128,25 @@ void grpc_pollset_reset(grpc_pollset *pollset) {
 }
 
 void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
-                       grpc_pollset_worker *worker, gpr_timespec now,
+                       grpc_pollset_worker **worker_hdl, gpr_timespec now,
                        gpr_timespec deadline) {
+  grpc_pollset_worker worker;
+  *worker_hdl = &worker;
+
   int added_worker = 0;
-  worker->links[GRPC_POLLSET_WORKER_LINK_POLLSET].next =
-      worker->links[GRPC_POLLSET_WORKER_LINK_POLLSET].prev =
-          worker->links[GRPC_POLLSET_WORKER_LINK_GLOBAL].next =
-              worker->links[GRPC_POLLSET_WORKER_LINK_GLOBAL].prev = NULL;
-  worker->kicked = 0;
-  worker->pollset = pollset;
-  gpr_cv_init(&worker->cv);
-  if (grpc_timer_check(exec_ctx, now, &deadline)) {
-    goto done;
-  }
+  worker.links[GRPC_POLLSET_WORKER_LINK_POLLSET].next =
+      worker.links[GRPC_POLLSET_WORKER_LINK_POLLSET].prev =
+          worker.links[GRPC_POLLSET_WORKER_LINK_GLOBAL].next =
+              worker.links[GRPC_POLLSET_WORKER_LINK_GLOBAL].prev = NULL;
+  worker.kicked = 0;
+  worker.pollset = pollset;
+  gpr_cv_init(&worker.cv);
   if (!pollset->kicked_without_pollers && !pollset->shutting_down) {
     if (g_active_poller == NULL) {
       grpc_pollset_worker *next_worker;
       /* become poller */
       pollset->is_iocp_worker = 1;
-      g_active_poller = worker;
+      g_active_poller = &worker;
       gpr_mu_unlock(&grpc_polling_mu);
       grpc_iocp_work(exec_ctx, deadline);
       grpc_exec_ctx_flush(exec_ctx);
@@ -171,12 +173,12 @@ void grpc_pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
       goto done;
     }
     push_front_worker(&g_global_root_worker, GRPC_POLLSET_WORKER_LINK_GLOBAL,
-                      worker);
+                      &worker);
     push_front_worker(&pollset->root_worker, GRPC_POLLSET_WORKER_LINK_POLLSET,
-                      worker);
+                      &worker);
     added_worker = 1;
-    while (!worker->kicked) {
-      if (gpr_cv_wait(&worker->cv, &grpc_polling_mu, deadline)) {
+    while (!worker.kicked) {
+      if (gpr_cv_wait(&worker.cv, &grpc_polling_mu, deadline)) {
         break;
       }
     }
@@ -190,10 +192,11 @@ done:
     gpr_mu_lock(&grpc_polling_mu);
   }
   if (added_worker) {
-    remove_worker(worker, GRPC_POLLSET_WORKER_LINK_GLOBAL);
-    remove_worker(worker, GRPC_POLLSET_WORKER_LINK_POLLSET);
+    remove_worker(&worker, GRPC_POLLSET_WORKER_LINK_GLOBAL);
+    remove_worker(&worker, GRPC_POLLSET_WORKER_LINK_POLLSET);
   }
-  gpr_cv_destroy(&worker->cv);
+  gpr_cv_destroy(&worker.cv);
+  *worker_hdl = NULL;
 }
 
 void grpc_pollset_kick(grpc_pollset *p, grpc_pollset_worker *specific_worker) {

+ 1 - 5
src/core/iomgr/pollset_windows.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -72,8 +72,4 @@ struct grpc_pollset {
   grpc_closure *on_shutdown;
 };
 
-extern gpr_mu grpc_polling_mu;
-
-#define GRPC_POLLSET_MU(pollset) (&grpc_polling_mu)
-
 #endif /* GRPC_INTERNAL_CORE_IOMGR_POLLSET_WINDOWS_H */

+ 7 - 5
src/core/iomgr/tcp_client_posix.c

@@ -42,17 +42,19 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "src/core/iomgr/timer.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/time.h>
+
 #include "src/core/iomgr/iomgr_posix.h"
 #include "src/core/iomgr/pollset_posix.h"
+#include "src/core/iomgr/pollset_set_posix.h"
 #include "src/core/iomgr/sockaddr_utils.h"
 #include "src/core/iomgr/socket_utils_posix.h"
 #include "src/core/iomgr/tcp_posix.h"
+#include "src/core/iomgr/timer.h"
 #include "src/core/support/string.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
 
 extern int grpc_tcp_trace;
 

+ 4 - 2
src/core/iomgr/tcp_posix.c

@@ -40,8 +40,8 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/types.h>
 #include <unistd.h>
 
 #include <grpc/support/alloc.h>
@@ -51,9 +51,11 @@
 #include <grpc/support/sync.h>
 #include <grpc/support/time.h>
 
-#include "src/core/support/string.h"
 #include "src/core/debug/trace.h"
+#include "src/core/iomgr/pollset_posix.h"
+#include "src/core/iomgr/pollset_set_posix.h"
 #include "src/core/profiling/timers.h"
+#include "src/core/support/string.h"
 
 #ifdef GPR_HAVE_MSG_NOSIGNAL
 #define SENDMSG_FLAGS MSG_NOSIGNAL

+ 2 - 3
src/core/iomgr/timer.c

@@ -34,7 +34,6 @@
 #include "src/core/iomgr/timer.h"
 
 #include "src/core/iomgr/timer_heap.h"
-#include "src/core/iomgr/timer_internal.h"
 #include "src/core/iomgr/time_averaged_stats.h"
 #include <grpc/support/log.h>
 #include <grpc/support/sync.h>
@@ -336,8 +335,8 @@ static int run_some_expired_timers(grpc_exec_ctx *exec_ctx, gpr_timespec now,
   return (int)n;
 }
 
-int grpc_timer_check(grpc_exec_ctx *exec_ctx, gpr_timespec now,
-                     gpr_timespec *next) {
+bool grpc_timer_check(grpc_exec_ctx *exec_ctx, gpr_timespec now,
+                      gpr_timespec *next) {
   GPR_ASSERT(now.clock_type == g_clock_type);
   return run_some_expired_timers(
       exec_ctx, now, next,

+ 21 - 1
src/core/iomgr/timer.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -86,4 +86,24 @@ void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer,
    Requires:  cancel() must happen after add() on a given timer */
 void grpc_timer_cancel(grpc_exec_ctx *exec_ctx, grpc_timer *timer);
 
+/* iomgr internal api for dealing with timers */
+
+/* Check for timers to be run, and run them.
+   Return true if timer callbacks were executed.
+   Drops drop_mu if it is non-null before executing callbacks.
+   If next is non-null, TRY to update *next with the next running timer
+   IF that timer occurs before *next current value.
+   *next is never guaranteed to be updated on any given execution; however,
+   with high probability at least one thread in the system will see an update
+   at any time slice. */
+
+bool grpc_timer_check(grpc_exec_ctx *exec_ctx, gpr_timespec now,
+                      gpr_timespec *next);
+void grpc_timer_list_init(gpr_timespec now);
+void grpc_timer_list_shutdown(grpc_exec_ctx *exec_ctx);
+
+/* the following must be implemented by each iomgr implementation */
+
+void grpc_kick_poller(void);
+
 #endif /* GRPC_INTERNAL_CORE_IOMGR_TIMER_H */

+ 0 - 61
src/core/iomgr/timer_internal.h

@@ -1,61 +0,0 @@
-/*
- *
- * Copyright 2015, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef GRPC_INTERNAL_CORE_IOMGR_TIMER_INTERNAL_H
-#define GRPC_INTERNAL_CORE_IOMGR_TIMER_INTERNAL_H
-
-#include "src/core/iomgr/exec_ctx.h"
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-
-/* iomgr internal api for dealing with timers */
-
-/* Check for timers to be run, and run them.
-   Return non zero if timer callbacks were executed.
-   Drops drop_mu if it is non-null before executing callbacks.
-   If next is non-null, TRY to update *next with the next running timer
-   IF that timer occurs before *next current value.
-   *next is never guaranteed to be updated on any given execution; however,
-   with high probability at least one thread in the system will see an update
-   at any time slice. */
-
-int grpc_timer_check(grpc_exec_ctx* exec_ctx, gpr_timespec now,
-                     gpr_timespec* next);
-void grpc_timer_list_init(gpr_timespec now);
-void grpc_timer_list_shutdown(grpc_exec_ctx* exec_ctx);
-
-/* the following must be implemented by each iomgr implementation */
-
-void grpc_kick_poller(void);
-
-#endif /* GRPC_INTERNAL_CORE_IOMGR_TIMER_INTERNAL_H */

+ 1 - 0
src/core/iomgr/udp_server.h

@@ -35,6 +35,7 @@
 #define GRPC_INTERNAL_CORE_IOMGR_UDP_SERVER_H
 
 #include "src/core/iomgr/endpoint.h"
+#include "src/core/iomgr/fd_posix.h"
 
 /* Forward decl of grpc_server */
 typedef struct grpc_server grpc_server;

+ 1 - 0
src/core/iomgr/workqueue_posix.c

@@ -44,6 +44,7 @@
 #include <grpc/support/useful.h>
 
 #include "src/core/iomgr/fd_posix.h"
+#include "src/core/iomgr/pollset_posix.h"
 
 static void on_readable(grpc_exec_ctx *exec_ctx, void *arg, bool success);
 

+ 3 - 1
src/core/iomgr/workqueue_posix.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,8 @@
 #ifndef GRPC_INTERNAL_CORE_IOMGR_WORKQUEUE_POSIX_H
 #define GRPC_INTERNAL_CORE_IOMGR_WORKQUEUE_POSIX_H
 
+#include "src/core/iomgr/wakeup_fd_posix.h"
+
 struct grpc_fd;
 
 struct grpc_workqueue {

+ 119 - 0
src/core/proto/grpc/lb/v0/load_balancer.pb.c

@@ -0,0 +1,119 @@
+/*
+ *
+ * Copyright 2016, 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.
+ *
+ */
+/* Automatically generated nanopb constant definitions */
+/* Generated by nanopb-0.3.5-dev */
+
+#include "src/core/proto/grpc/lb/v0/load_balancer.pb.h"
+
+#if PB_PROTO_HEADER_VERSION != 30
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+
+
+const pb_field_t grpc_lb_v0_Duration_fields[3] = {
+    PB_FIELD(  1, INT64   , OPTIONAL, STATIC  , FIRST, grpc_lb_v0_Duration, seconds, seconds, 0),
+    PB_FIELD(  2, INT32   , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_Duration, nanos, seconds, 0),
+    PB_LAST_FIELD
+};
+
+const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3] = {
+    PB_FIELD(  1, MESSAGE , OPTIONAL, STATIC  , FIRST, grpc_lb_v0_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v0_InitialLoadBalanceRequest_fields),
+    PB_FIELD(  2, MESSAGE , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v0_ClientStats_fields),
+    PB_LAST_FIELD
+};
+
+const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2] = {
+    PB_FIELD(  1, STRING  , OPTIONAL, STATIC  , FIRST, grpc_lb_v0_InitialLoadBalanceRequest, name, name, 0),
+    PB_LAST_FIELD
+};
+
+const pb_field_t grpc_lb_v0_ClientStats_fields[4] = {
+    PB_FIELD(  1, INT64   , OPTIONAL, STATIC  , FIRST, grpc_lb_v0_ClientStats, total_requests, total_requests, 0),
+    PB_FIELD(  2, INT64   , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_ClientStats, client_rpc_errors, total_requests, 0),
+    PB_FIELD(  3, INT64   , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_ClientStats, dropped_requests, client_rpc_errors, 0),
+    PB_LAST_FIELD
+};
+
+const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3] = {
+    PB_FIELD(  1, MESSAGE , OPTIONAL, STATIC  , FIRST, grpc_lb_v0_LoadBalanceResponse, initial_response, initial_response, &grpc_lb_v0_InitialLoadBalanceResponse_fields),
+    PB_FIELD(  2, MESSAGE , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_LoadBalanceResponse, server_list, initial_response, &grpc_lb_v0_ServerList_fields),
+    PB_LAST_FIELD
+};
+
+const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4] = {
+    PB_FIELD(  1, STRING  , OPTIONAL, STATIC  , FIRST, grpc_lb_v0_InitialLoadBalanceResponse, client_config, client_config, 0),
+    PB_FIELD(  2, STRING  , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, load_balancer_delegate, client_config, 0),
+    PB_FIELD(  3, MESSAGE , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval, load_balancer_delegate, &grpc_lb_v0_Duration_fields),
+    PB_LAST_FIELD
+};
+
+const pb_field_t grpc_lb_v0_ServerList_fields[3] = {
+    PB_FIELD(  1, MESSAGE , REPEATED, CALLBACK, FIRST, grpc_lb_v0_ServerList, servers, servers, &grpc_lb_v0_Server_fields),
+    PB_FIELD(  3, MESSAGE , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_ServerList, expiration_interval, servers, &grpc_lb_v0_Duration_fields),
+    PB_LAST_FIELD
+};
+
+const pb_field_t grpc_lb_v0_Server_fields[5] = {
+    PB_FIELD(  1, STRING  , OPTIONAL, STATIC  , FIRST, grpc_lb_v0_Server, ip_address, ip_address, 0),
+    PB_FIELD(  2, INT32   , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_Server, port, ip_address, 0),
+    PB_FIELD(  3, BYTES   , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_Server, load_balance_token, port, 0),
+    PB_FIELD(  4, BOOL    , OPTIONAL, STATIC  , OTHER, grpc_lb_v0_Server, drop_request, load_balance_token, 0),
+    PB_LAST_FIELD
+};
+
+
+/* Check that field information fits in pb_field_t */
+#if !defined(PB_FIELD_32BIT)
+/* If you get an error here, it means that you need to define PB_FIELD_32BIT
+ * compile-time option. You can do that in pb.h or on compiler command line.
+ * 
+ * The reason you need to do this is that some of your messages contain tag
+ * numbers or field sizes that are larger than what can fit in 8 or 16 bit
+ * field descriptors.
+ */
+PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v0_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server)
+#endif
+
+#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
+/* If you get an error here, it means that you need to define PB_FIELD_16BIT
+ * compile-time option. You can do that in pb.h or on compiler command line.
+ * 
+ * The reason you need to do this is that some of your messages contain tag
+ * numbers or field sizes that are larger than what can fit in the default
+ * 8 bit descriptors.
+ */
+PB_STATIC_ASSERT((pb_membersize(grpc_lb_v0_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v0_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v0_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v0_ServerList, servers) < 256 && pb_membersize(grpc_lb_v0_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v0_Duration_grpc_lb_v0_LoadBalanceRequest_grpc_lb_v0_InitialLoadBalanceRequest_grpc_lb_v0_ClientStats_grpc_lb_v0_LoadBalanceResponse_grpc_lb_v0_InitialLoadBalanceResponse_grpc_lb_v0_ServerList_grpc_lb_v0_Server)
+#endif
+
+

+ 182 - 0
src/core/proto/grpc/lb/v0/load_balancer.pb.h

@@ -0,0 +1,182 @@
+/*
+ *
+ * Copyright 2016, 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.
+ *
+ */
+/* Automatically generated nanopb header */
+/* Generated by nanopb-0.3.5-dev */
+
+#ifndef PB_LOAD_BALANCER_PB_H_INCLUDED
+#define PB_LOAD_BALANCER_PB_H_INCLUDED
+#include "third_party/nanopb/pb.h"
+#if PB_PROTO_HEADER_VERSION != 30
+#error Regenerate this file with the current version of nanopb generator.
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Struct definitions */
+typedef struct _grpc_lb_v0_ClientStats {
+    bool has_total_requests;
+    int64_t total_requests;
+    bool has_client_rpc_errors;
+    int64_t client_rpc_errors;
+    bool has_dropped_requests;
+    int64_t dropped_requests;
+} grpc_lb_v0_ClientStats;
+
+typedef struct _grpc_lb_v0_Duration {
+    bool has_seconds;
+    int64_t seconds;
+    bool has_nanos;
+    int32_t nanos;
+} grpc_lb_v0_Duration;
+
+typedef struct _grpc_lb_v0_InitialLoadBalanceRequest {
+    bool has_name;
+    char name[128];
+} grpc_lb_v0_InitialLoadBalanceRequest;
+
+typedef PB_BYTES_ARRAY_T(64) grpc_lb_v0_Server_load_balance_token_t;
+typedef struct _grpc_lb_v0_Server {
+    bool has_ip_address;
+    char ip_address[46];
+    bool has_port;
+    int32_t port;
+    bool has_load_balance_token;
+    grpc_lb_v0_Server_load_balance_token_t load_balance_token;
+    bool has_drop_request;
+    bool drop_request;
+} grpc_lb_v0_Server;
+
+typedef struct _grpc_lb_v0_InitialLoadBalanceResponse {
+    bool has_client_config;
+    char client_config[64];
+    bool has_load_balancer_delegate;
+    char load_balancer_delegate[64];
+    bool has_client_stats_report_interval;
+    grpc_lb_v0_Duration client_stats_report_interval;
+} grpc_lb_v0_InitialLoadBalanceResponse;
+
+typedef struct _grpc_lb_v0_LoadBalanceRequest {
+    bool has_initial_request;
+    grpc_lb_v0_InitialLoadBalanceRequest initial_request;
+    bool has_client_stats;
+    grpc_lb_v0_ClientStats client_stats;
+} grpc_lb_v0_LoadBalanceRequest;
+
+typedef struct _grpc_lb_v0_ServerList {
+    pb_callback_t servers;
+    bool has_expiration_interval;
+    grpc_lb_v0_Duration expiration_interval;
+} grpc_lb_v0_ServerList;
+
+typedef struct _grpc_lb_v0_LoadBalanceResponse {
+    bool has_initial_response;
+    grpc_lb_v0_InitialLoadBalanceResponse initial_response;
+    bool has_server_list;
+    grpc_lb_v0_ServerList server_list;
+} grpc_lb_v0_LoadBalanceResponse;
+
+/* Default values for struct fields */
+
+/* Initializer values for message structs */
+#define grpc_lb_v0_Duration_init_default         {false, 0, false, 0}
+#define grpc_lb_v0_LoadBalanceRequest_init_default {false, grpc_lb_v0_InitialLoadBalanceRequest_init_default, false, grpc_lb_v0_ClientStats_init_default}
+#define grpc_lb_v0_InitialLoadBalanceRequest_init_default {false, ""}
+#define grpc_lb_v0_ClientStats_init_default      {false, 0, false, 0, false, 0}
+#define grpc_lb_v0_LoadBalanceResponse_init_default {false, grpc_lb_v0_InitialLoadBalanceResponse_init_default, false, grpc_lb_v0_ServerList_init_default}
+#define grpc_lb_v0_InitialLoadBalanceResponse_init_default {false, "", false, "", false, grpc_lb_v0_Duration_init_default}
+#define grpc_lb_v0_ServerList_init_default       {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_default}
+#define grpc_lb_v0_Server_init_default           {false, "", false, 0, false, {0, {0}}, false, 0}
+#define grpc_lb_v0_Duration_init_zero            {false, 0, false, 0}
+#define grpc_lb_v0_LoadBalanceRequest_init_zero  {false, grpc_lb_v0_InitialLoadBalanceRequest_init_zero, false, grpc_lb_v0_ClientStats_init_zero}
+#define grpc_lb_v0_InitialLoadBalanceRequest_init_zero {false, ""}
+#define grpc_lb_v0_ClientStats_init_zero         {false, 0, false, 0, false, 0}
+#define grpc_lb_v0_LoadBalanceResponse_init_zero {false, grpc_lb_v0_InitialLoadBalanceResponse_init_zero, false, grpc_lb_v0_ServerList_init_zero}
+#define grpc_lb_v0_InitialLoadBalanceResponse_init_zero {false, "", false, "", false, grpc_lb_v0_Duration_init_zero}
+#define grpc_lb_v0_ServerList_init_zero          {{{NULL}, NULL}, false, grpc_lb_v0_Duration_init_zero}
+#define grpc_lb_v0_Server_init_zero              {false, "", false, 0, false, {0, {0}}, false, 0}
+
+/* Field tags (for use in manual encoding/decoding) */
+#define grpc_lb_v0_ClientStats_total_requests_tag 1
+#define grpc_lb_v0_ClientStats_client_rpc_errors_tag 2
+#define grpc_lb_v0_ClientStats_dropped_requests_tag 3
+#define grpc_lb_v0_Duration_seconds_tag          1
+#define grpc_lb_v0_Duration_nanos_tag            2
+#define grpc_lb_v0_InitialLoadBalanceRequest_name_tag 1
+#define grpc_lb_v0_Server_ip_address_tag         1
+#define grpc_lb_v0_Server_port_tag               2
+#define grpc_lb_v0_Server_load_balance_token_tag 3
+#define grpc_lb_v0_Server_drop_request_tag       4
+#define grpc_lb_v0_InitialLoadBalanceResponse_client_config_tag 1
+#define grpc_lb_v0_InitialLoadBalanceResponse_load_balancer_delegate_tag 2
+#define grpc_lb_v0_InitialLoadBalanceResponse_client_stats_report_interval_tag 3
+#define grpc_lb_v0_LoadBalanceRequest_initial_request_tag 1
+#define grpc_lb_v0_LoadBalanceRequest_client_stats_tag 2
+#define grpc_lb_v0_ServerList_servers_tag        1
+#define grpc_lb_v0_ServerList_expiration_interval_tag 3
+#define grpc_lb_v0_LoadBalanceResponse_initial_response_tag 1
+#define grpc_lb_v0_LoadBalanceResponse_server_list_tag 2
+
+/* Struct field encoding specification for nanopb */
+extern const pb_field_t grpc_lb_v0_Duration_fields[3];
+extern const pb_field_t grpc_lb_v0_LoadBalanceRequest_fields[3];
+extern const pb_field_t grpc_lb_v0_InitialLoadBalanceRequest_fields[2];
+extern const pb_field_t grpc_lb_v0_ClientStats_fields[4];
+extern const pb_field_t grpc_lb_v0_LoadBalanceResponse_fields[3];
+extern const pb_field_t grpc_lb_v0_InitialLoadBalanceResponse_fields[4];
+extern const pb_field_t grpc_lb_v0_ServerList_fields[3];
+extern const pb_field_t grpc_lb_v0_Server_fields[5];
+
+/* Maximum encoded size of messages (where known) */
+#define grpc_lb_v0_Duration_size                 22
+#define grpc_lb_v0_LoadBalanceRequest_size       169
+#define grpc_lb_v0_InitialLoadBalanceRequest_size 131
+#define grpc_lb_v0_ClientStats_size              33
+#define grpc_lb_v0_LoadBalanceResponse_size      (165 + grpc_lb_v0_ServerList_size)
+#define grpc_lb_v0_InitialLoadBalanceResponse_size 156
+#define grpc_lb_v0_Server_size                   127
+
+/* Message IDs (where set with "msgid" option) */
+#ifdef PB_MSGID
+
+#define LOAD_BALANCER_MESSAGES \
+
+
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif

+ 1 - 1
src/core/security/base64.c → src/core/security/b64.c

@@ -31,7 +31,7 @@
  *
  */
 
-#include "src/core/security/base64.h"
+#include "src/core/security/b64.h"
 
 #include <stdint.h>
 #include <string.h>

+ 1 - 1
src/core/security/base64.h → src/core/security/b64.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

+ 0 - 1
src/core/security/client_auth_filter.c

@@ -310,7 +310,6 @@ static void init_channel_elem(grpc_exec_ctx *exec_ctx,
   GPR_ASSERT(auth_context != NULL);
 
   /* initialize members */
-  GPR_ASSERT(sc->is_client_side);
   chand->security_connector =
       (grpc_channel_security_connector *)GRPC_SECURITY_CONNECTOR_REF(
           sc, "client_auth_filter");

+ 3 - 3
src/core/security/credentials.c

@@ -166,7 +166,7 @@ void grpc_server_credentials_release(grpc_server_credentials *creds) {
 }
 
 grpc_security_status grpc_server_credentials_create_security_connector(
-    grpc_server_credentials *creds, grpc_security_connector **sc) {
+    grpc_server_credentials *creds, grpc_server_security_connector **sc) {
   if (creds == NULL || creds->vtable->create_security_connector == NULL) {
     gpr_log(GPR_ERROR, "Server credentials cannot create security context.");
     return GRPC_SECURITY_ERROR;
@@ -298,7 +298,7 @@ static grpc_security_status ssl_create_security_connector(
 }
 
 static grpc_security_status ssl_server_create_security_connector(
-    grpc_server_credentials *creds, grpc_security_connector **sc) {
+    grpc_server_credentials *creds, grpc_server_security_connector **sc) {
   grpc_ssl_server_credentials *c = (grpc_ssl_server_credentials *)creds;
   return grpc_ssl_server_security_connector_create(&c->config, sc);
 }
@@ -894,7 +894,7 @@ static grpc_security_status fake_transport_security_create_security_connector(
 
 static grpc_security_status
 fake_transport_security_server_create_security_connector(
-    grpc_server_credentials *c, grpc_security_connector **sc) {
+    grpc_server_credentials *c, grpc_server_security_connector **sc) {
   *sc = grpc_fake_server_security_connector_create();
   return GRPC_SECURITY_OK;
 }

+ 3 - 3
src/core/security/credentials.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -234,7 +234,7 @@ grpc_refresh_token_credentials_create_from_auth_refresh_token(
 typedef struct {
   void (*destruct)(grpc_server_credentials *c);
   grpc_security_status (*create_security_connector)(
-      grpc_server_credentials *c, grpc_security_connector **sc);
+      grpc_server_credentials *c, grpc_server_security_connector **sc);
 } grpc_server_credentials_vtable;
 
 struct grpc_server_credentials {
@@ -245,7 +245,7 @@ struct grpc_server_credentials {
 };
 
 grpc_security_status grpc_server_credentials_create_security_connector(
-    grpc_server_credentials *creds, grpc_security_connector **sc);
+    grpc_server_credentials *creds, grpc_server_security_connector **sc);
 
 grpc_server_credentials *grpc_server_credentials_ref(
     grpc_server_credentials *creds);

+ 24 - 19
src/core/security/google_default_credentials.c

@@ -41,7 +41,7 @@
 
 #include "src/core/httpcli/httpcli.h"
 #include "src/core/support/env.h"
-#include "src/core/support/file.h"
+#include "src/core/support/load_file.h"
 #include "src/core/surface/api_trace.h"
 
 /* -- Constants. -- */
@@ -52,13 +52,14 @@
 
 static grpc_channel_credentials *default_credentials = NULL;
 static int compute_engine_detection_done = 0;
-static gpr_mu g_mu;
+static gpr_mu g_state_mu;
+static gpr_mu *g_polling_mu;
 static gpr_once g_once = GPR_ONCE_INIT;
 
-static void init_default_credentials(void) { gpr_mu_init(&g_mu); }
+static void init_default_credentials(void) { gpr_mu_init(&g_state_mu); }
 
 typedef struct {
-  grpc_pollset pollset;
+  grpc_pollset *pollset;
   int is_done;
   int success;
 } compute_engine_detector;
@@ -80,10 +81,10 @@ static void on_compute_engine_detection_http_response(
       }
     }
   }
-  gpr_mu_lock(GRPC_POLLSET_MU(&detector->pollset));
+  gpr_mu_lock(g_polling_mu);
   detector->is_done = 1;
-  grpc_pollset_kick(&detector->pollset, NULL);
-  gpr_mu_unlock(GRPC_POLLSET_MU(&detector->pollset));
+  grpc_pollset_kick(detector->pollset, NULL);
+  gpr_mu_unlock(g_polling_mu);
 }
 
 static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool s) {
@@ -101,7 +102,8 @@ static int is_stack_running_on_compute_engine(void) {
      on compute engine. */
   gpr_timespec max_detection_delay = gpr_time_from_seconds(1, GPR_TIMESPAN);
 
-  grpc_pollset_init(&detector.pollset);
+  detector.pollset = gpr_malloc(grpc_pollset_size());
+  grpc_pollset_init(detector.pollset, &g_polling_mu);
   detector.is_done = 0;
   detector.success = 0;
 
@@ -112,7 +114,7 @@ static int is_stack_running_on_compute_engine(void) {
   grpc_httpcli_context_init(&context);
 
   grpc_httpcli_get(
-      &exec_ctx, &context, &detector.pollset, &request,
+      &exec_ctx, &context, detector.pollset, &request,
       gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), max_detection_delay),
       on_compute_engine_detection_http_response, &detector);
 
@@ -120,19 +122,22 @@ static int is_stack_running_on_compute_engine(void) {
 
   /* Block until we get the response. This is not ideal but this should only be
      called once for the lifetime of the process by the default credentials. */
-  gpr_mu_lock(GRPC_POLLSET_MU(&detector.pollset));
+  gpr_mu_lock(g_polling_mu);
   while (!detector.is_done) {
-    grpc_pollset_worker worker;
-    grpc_pollset_work(&exec_ctx, &detector.pollset, &worker,
+    grpc_pollset_worker *worker = NULL;
+    grpc_pollset_work(&exec_ctx, detector.pollset, &worker,
                       gpr_now(GPR_CLOCK_MONOTONIC),
                       gpr_inf_future(GPR_CLOCK_MONOTONIC));
   }
-  gpr_mu_unlock(GRPC_POLLSET_MU(&detector.pollset));
+  gpr_mu_unlock(g_polling_mu);
 
   grpc_httpcli_context_destroy(&context);
-  grpc_closure_init(&destroy_closure, destroy_pollset, &detector.pollset);
-  grpc_pollset_shutdown(&exec_ctx, &detector.pollset, &destroy_closure);
+  grpc_closure_init(&destroy_closure, destroy_pollset, detector.pollset);
+  grpc_pollset_shutdown(&exec_ctx, detector.pollset, &destroy_closure);
   grpc_exec_ctx_finish(&exec_ctx);
+  g_polling_mu = NULL;
+
+  gpr_free(detector.pollset);
 
   return detector.success;
 }
@@ -184,7 +189,7 @@ grpc_channel_credentials *grpc_google_default_credentials_create(void) {
 
   gpr_once_init(&g_once, init_default_credentials);
 
-  gpr_mu_lock(&g_mu);
+  gpr_mu_lock(&g_state_mu);
 
   if (default_credentials != NULL) {
     result = grpc_channel_credentials_ref(default_credentials);
@@ -230,19 +235,19 @@ end:
       gpr_log(GPR_ERROR, "Could not create google default credentials.");
     }
   }
-  gpr_mu_unlock(&g_mu);
+  gpr_mu_unlock(&g_state_mu);
   return result;
 }
 
 void grpc_flush_cached_google_default_credentials(void) {
   gpr_once_init(&g_once, init_default_credentials);
-  gpr_mu_lock(&g_mu);
+  gpr_mu_lock(&g_state_mu);
   if (default_credentials != NULL) {
     grpc_channel_credentials_unref(default_credentials);
     default_credentials = NULL;
   }
   compute_engine_detection_done = 0;
-  gpr_mu_unlock(&g_mu);
+  gpr_mu_unlock(&g_state_mu);
 }
 
 /* -- Well known credentials path. -- */

+ 15 - 7
src/core/security/handshake.c

@@ -33,6 +33,7 @@
 
 #include "src/core/security/handshake.h"
 
+#include <stdbool.h>
 #include <string.h>
 
 #include "src/core/security/security_context.h"
@@ -46,6 +47,7 @@
 typedef struct {
   grpc_security_connector *connector;
   tsi_handshaker *handshaker;
+  bool is_client_side;
   unsigned char *handshake_buffer;
   size_t handshake_buffer_size;
   grpc_endpoint *wrapped_endpoint;
@@ -67,9 +69,11 @@ static void on_handshake_data_sent_to_peer(grpc_exec_ctx *exec_ctx, void *setup,
                                            bool success);
 
 static void security_connector_remove_handshake(grpc_security_handshake *h) {
+  GPR_ASSERT(!h->is_client_side);
   grpc_security_connector_handshake_list *node;
   grpc_security_connector_handshake_list *tmp;
-  grpc_security_connector *sc = h->connector;
+  grpc_server_security_connector *sc =
+      (grpc_server_security_connector *)h->connector;
   gpr_mu_lock(&sc->mu);
   node = sc->handshaking_handshakes;
   if (node && node->handshake == h) {
@@ -94,7 +98,7 @@ static void security_connector_remove_handshake(grpc_security_handshake *h) {
 static void security_handshake_done(grpc_exec_ctx *exec_ctx,
                                     grpc_security_handshake *h,
                                     int is_success) {
-  if (!h->connector->is_client_side) {
+  if (!h->is_client_side) {
     security_connector_remove_handshake(h);
   }
   if (is_success) {
@@ -290,6 +294,7 @@ static void on_handshake_data_sent_to_peer(grpc_exec_ctx *exec_ctx,
 void grpc_do_security_handshake(grpc_exec_ctx *exec_ctx,
                                 tsi_handshaker *handshaker,
                                 grpc_security_connector *connector,
+                                bool is_client_side,
                                 grpc_endpoint *nonsecure_endpoint,
                                 grpc_security_handshake_done_cb cb,
                                 void *user_data) {
@@ -298,6 +303,7 @@ void grpc_do_security_handshake(grpc_exec_ctx *exec_ctx,
   memset(h, 0, sizeof(grpc_security_handshake));
   h->handshaker = handshaker;
   h->connector = GRPC_SECURITY_CONNECTOR_REF(connector, "handshake");
+  h->is_client_side = is_client_side;
   h->handshake_buffer_size = GRPC_INITIAL_HANDSHAKE_BUFFER_SIZE;
   h->handshake_buffer = gpr_malloc(h->handshake_buffer_size);
   h->wrapped_endpoint = nonsecure_endpoint;
@@ -310,13 +316,15 @@ void grpc_do_security_handshake(grpc_exec_ctx *exec_ctx,
   gpr_slice_buffer_init(&h->left_overs);
   gpr_slice_buffer_init(&h->outgoing);
   gpr_slice_buffer_init(&h->incoming);
-  if (!connector->is_client_side) {
+  if (!is_client_side) {
+    grpc_server_security_connector *server_connector =
+        (grpc_server_security_connector *)connector;
     handshake_node = gpr_malloc(sizeof(grpc_security_connector_handshake_list));
     handshake_node->handshake = h;
-    gpr_mu_lock(&connector->mu);
-    handshake_node->next = connector->handshaking_handshakes;
-    connector->handshaking_handshakes = handshake_node;
-    gpr_mu_unlock(&connector->mu);
+    gpr_mu_lock(&server_connector->mu);
+    handshake_node->next = server_connector->handshaking_handshakes;
+    server_connector->handshaking_handshakes = handshake_node;
+    gpr_mu_unlock(&server_connector->mu);
   }
   send_handshake_bytes_to_peer(exec_ctx, h);
 }

+ 2 - 1
src/core/security/handshake.h

@@ -1,6 +1,6 @@
 /*
  *
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,7 @@
 void grpc_do_security_handshake(grpc_exec_ctx *exec_ctx,
                                 tsi_handshaker *handshaker,
                                 grpc_security_connector *connector,
+                                bool is_client_side,
                                 grpc_endpoint *nonsecure_endpoint,
                                 grpc_security_handshake_done_cb cb,
                                 void *user_data);

+ 1 - 1
src/core/security/json_token.c

@@ -39,7 +39,7 @@
 #include <grpc/support/log.h>
 #include <grpc/support/string_util.h>
 
-#include "src/core/security/base64.h"
+#include "src/core/security/b64.h"
 #include "src/core/support/string.h"
 
 #include <openssl/bio.h>

+ 1 - 1
src/core/security/jwt_verifier.c

@@ -37,7 +37,7 @@
 #include <string.h>
 
 #include "src/core/httpcli/httpcli.h"
-#include "src/core/security/base64.h"
+#include "src/core/security/b64.h"
 #include "src/core/tsi/ssl_types.h"
 
 #include <grpc/support/alloc.h>

+ 77 - 62
src/core/security/security_connector.c

@@ -33,22 +33,23 @@
 
 #include "src/core/security/security_connector.h"
 
+#include <stdbool.h>
 #include <string.h>
 
+#include <grpc/support/alloc.h>
+#include <grpc/support/host_port.h>
+#include <grpc/support/log.h>
+#include <grpc/support/slice_buffer.h>
+#include <grpc/support/string_util.h>
+
 #include "src/core/security/credentials.h"
 #include "src/core/security/handshake.h"
 #include "src/core/security/secure_endpoint.h"
 #include "src/core/security/security_context.h"
 #include "src/core/support/env.h"
-#include "src/core/support/file.h"
+#include "src/core/support/load_file.h"
 #include "src/core/support/string.h"
 #include "src/core/transport/chttp2/alpn.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/host_port.h>
-#include <grpc/support/log.h>
-#include <grpc/support/slice_buffer.h>
-#include <grpc/support/string_util.h>
 #include "src/core/tsi/fake_transport_security.h"
 #include "src/core/tsi/ssl_transport_security.h"
 
@@ -110,31 +111,39 @@ const tsi_peer_property *tsi_peer_get_property_by_name(const tsi_peer *peer,
   return NULL;
 }
 
-void grpc_security_connector_shutdown(grpc_exec_ctx *exec_ctx,
-                                      grpc_security_connector *connector) {
+void grpc_server_security_connector_shutdown(
+    grpc_exec_ctx *exec_ctx, grpc_server_security_connector *connector) {
   grpc_security_connector_handshake_list *tmp;
-  if (!connector->is_client_side) {
-    gpr_mu_lock(&connector->mu);
-    while (connector->handshaking_handshakes) {
-      tmp = connector->handshaking_handshakes;
-      grpc_security_handshake_shutdown(
-          exec_ctx, connector->handshaking_handshakes->handshake);
-      connector->handshaking_handshakes = tmp->next;
-      gpr_free(tmp);
-    }
-    gpr_mu_unlock(&connector->mu);
+  gpr_mu_lock(&connector->mu);
+  while (connector->handshaking_handshakes) {
+    tmp = connector->handshaking_handshakes;
+    grpc_security_handshake_shutdown(
+        exec_ctx, connector->handshaking_handshakes->handshake);
+    connector->handshaking_handshakes = tmp->next;
+    gpr_free(tmp);
   }
+  gpr_mu_unlock(&connector->mu);
 }
 
-void grpc_security_connector_do_handshake(grpc_exec_ctx *exec_ctx,
-                                          grpc_security_connector *sc,
-                                          grpc_endpoint *nonsecure_endpoint,
-                                          grpc_security_handshake_done_cb cb,
-                                          void *user_data) {
+void grpc_channel_security_connector_do_handshake(
+    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *sc,
+    grpc_endpoint *nonsecure_endpoint, grpc_security_handshake_done_cb cb,
+    void *user_data) {
+  if (sc == NULL || nonsecure_endpoint == NULL) {
+    cb(exec_ctx, user_data, GRPC_SECURITY_ERROR, NULL, NULL);
+  } else {
+    sc->do_handshake(exec_ctx, sc, nonsecure_endpoint, cb, user_data);
+  }
+}
+
+void grpc_server_security_connector_do_handshake(
+    grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc,
+    grpc_tcp_server_acceptor *acceptor, grpc_endpoint *nonsecure_endpoint,
+    grpc_security_handshake_done_cb cb, void *user_data) {
   if (sc == NULL || nonsecure_endpoint == NULL) {
     cb(exec_ctx, user_data, GRPC_SECURITY_ERROR, NULL, NULL);
   } else {
-    sc->vtable->do_handshake(exec_ctx, sc, nonsecure_endpoint, cb, user_data);
+    sc->do_handshake(exec_ctx, sc, acceptor, nonsecure_endpoint, cb, user_data);
   }
 }
 
@@ -248,7 +257,8 @@ static void fake_channel_destroy(grpc_security_connector *sc) {
 }
 
 static void fake_server_destroy(grpc_security_connector *sc) {
-  gpr_mu_destroy(&sc->mu);
+  grpc_server_security_connector *c = (grpc_server_security_connector *)sc;
+  gpr_mu_destroy(&c->mu);
   gpr_free(sc);
 }
 
@@ -298,49 +308,52 @@ static void fake_channel_check_call_host(grpc_exec_ctx *exec_ctx,
 }
 
 static void fake_channel_do_handshake(grpc_exec_ctx *exec_ctx,
-                                      grpc_security_connector *sc,
+                                      grpc_channel_security_connector *sc,
                                       grpc_endpoint *nonsecure_endpoint,
                                       grpc_security_handshake_done_cb cb,
                                       void *user_data) {
-  grpc_do_security_handshake(exec_ctx, tsi_create_fake_handshaker(1), sc,
-                             nonsecure_endpoint, cb, user_data);
+  grpc_do_security_handshake(exec_ctx, tsi_create_fake_handshaker(1), &sc->base,
+                             true, nonsecure_endpoint, cb, user_data);
 }
 
 static void fake_server_do_handshake(grpc_exec_ctx *exec_ctx,
-                                     grpc_security_connector *sc,
+                                     grpc_server_security_connector *sc,
+                                     grpc_tcp_server_acceptor *acceptor,
                                      grpc_endpoint *nonsecure_endpoint,
                                      grpc_security_handshake_done_cb cb,
                                      void *user_data) {
-  grpc_do_security_handshake(exec_ctx, tsi_create_fake_handshaker(0), sc,
-                             nonsecure_endpoint, cb, user_data);
+  grpc_do_security_handshake(exec_ctx, tsi_create_fake_handshaker(0), &sc->base,
+                             false, nonsecure_endpoint, cb, user_data);
 }
 
 static grpc_security_connector_vtable fake_channel_vtable = {
-    fake_channel_destroy, fake_channel_do_handshake, fake_check_peer};
+    fake_channel_destroy, fake_check_peer};
 
-static grpc_security_connector_vtable fake_server_vtable = {
-    fake_server_destroy, fake_server_do_handshake, fake_check_peer};
+static grpc_security_connector_vtable fake_server_vtable = {fake_server_destroy,
+                                                            fake_check_peer};
 
 grpc_channel_security_connector *grpc_fake_channel_security_connector_create(
     grpc_call_credentials *request_metadata_creds) {
   grpc_channel_security_connector *c = gpr_malloc(sizeof(*c));
   memset(c, 0, sizeof(*c));
   gpr_ref_init(&c->base.refcount, 1);
-  c->base.is_client_side = 1;
   c->base.url_scheme = GRPC_FAKE_SECURITY_URL_SCHEME;
   c->base.vtable = &fake_channel_vtable;
   c->request_metadata_creds = grpc_call_credentials_ref(request_metadata_creds);
   c->check_call_host = fake_channel_check_call_host;
+  c->do_handshake = fake_channel_do_handshake;
   return c;
 }
 
-grpc_security_connector *grpc_fake_server_security_connector_create(void) {
-  grpc_security_connector *c = gpr_malloc(sizeof(grpc_security_connector));
-  memset(c, 0, sizeof(grpc_security_connector));
-  gpr_ref_init(&c->refcount, 1);
-  c->is_client_side = 0;
-  c->vtable = &fake_server_vtable;
-  c->url_scheme = GRPC_FAKE_SECURITY_URL_SCHEME;
+grpc_server_security_connector *grpc_fake_server_security_connector_create(
+    void) {
+  grpc_server_security_connector *c =
+      gpr_malloc(sizeof(grpc_server_security_connector));
+  memset(c, 0, sizeof(*c));
+  gpr_ref_init(&c->base.refcount, 1);
+  c->base.vtable = &fake_server_vtable;
+  c->base.url_scheme = GRPC_FAKE_SECURITY_URL_SCHEME;
+  c->do_handshake = fake_server_do_handshake;
   gpr_mu_init(&c->mu);
   return c;
 }
@@ -355,7 +368,7 @@ typedef struct {
 } grpc_ssl_channel_security_connector;
 
 typedef struct {
-  grpc_security_connector base;
+  grpc_server_security_connector base;
   tsi_ssl_handshaker_factory *handshaker_factory;
 } grpc_ssl_server_security_connector;
 
@@ -378,12 +391,12 @@ static void ssl_server_destroy(grpc_security_connector *sc) {
   if (c->handshaker_factory != NULL) {
     tsi_ssl_handshaker_factory_destroy(c->handshaker_factory);
   }
-  gpr_mu_destroy(&sc->mu);
+  gpr_mu_destroy(&c->base.mu);
   gpr_free(sc);
 }
 
 static grpc_security_status ssl_create_handshaker(
-    tsi_ssl_handshaker_factory *handshaker_factory, int is_client,
+    tsi_ssl_handshaker_factory *handshaker_factory, bool is_client,
     const char *peer_name, tsi_handshaker **handshaker) {
   tsi_result result = TSI_OK;
   if (handshaker_factory == NULL) return GRPC_SECURITY_ERROR;
@@ -398,7 +411,7 @@ static grpc_security_status ssl_create_handshaker(
 }
 
 static void ssl_channel_do_handshake(grpc_exec_ctx *exec_ctx,
-                                     grpc_security_connector *sc,
+                                     grpc_channel_security_connector *sc,
                                      grpc_endpoint *nonsecure_endpoint,
                                      grpc_security_handshake_done_cb cb,
                                      void *user_data) {
@@ -406,20 +419,21 @@ static void ssl_channel_do_handshake(grpc_exec_ctx *exec_ctx,
       (grpc_ssl_channel_security_connector *)sc;
   tsi_handshaker *handshaker;
   grpc_security_status status = ssl_create_handshaker(
-      c->handshaker_factory, 1,
+      c->handshaker_factory, true,
       c->overridden_target_name != NULL ? c->overridden_target_name
                                         : c->target_name,
       &handshaker);
   if (status != GRPC_SECURITY_OK) {
     cb(exec_ctx, user_data, status, NULL, NULL);
   } else {
-    grpc_do_security_handshake(exec_ctx, handshaker, sc, nonsecure_endpoint, cb,
-                               user_data);
+    grpc_do_security_handshake(exec_ctx, handshaker, &sc->base, true,
+                               nonsecure_endpoint, cb, user_data);
   }
 }
 
 static void ssl_server_do_handshake(grpc_exec_ctx *exec_ctx,
-                                    grpc_security_connector *sc,
+                                    grpc_server_security_connector *sc,
+                                    grpc_tcp_server_acceptor *acceptor,
                                     grpc_endpoint *nonsecure_endpoint,
                                     grpc_security_handshake_done_cb cb,
                                     void *user_data) {
@@ -427,12 +441,12 @@ static void ssl_server_do_handshake(grpc_exec_ctx *exec_ctx,
       (grpc_ssl_server_security_connector *)sc;
   tsi_handshaker *handshaker;
   grpc_security_status status =
-      ssl_create_handshaker(c->handshaker_factory, 0, NULL, &handshaker);
+      ssl_create_handshaker(c->handshaker_factory, false, NULL, &handshaker);
   if (status != GRPC_SECURITY_OK) {
     cb(exec_ctx, user_data, status, NULL, NULL);
   } else {
-    grpc_do_security_handshake(exec_ctx, handshaker, sc, nonsecure_endpoint, cb,
-                               user_data);
+    grpc_do_security_handshake(exec_ctx, handshaker, &sc->base, false,
+                               nonsecure_endpoint, cb, user_data);
   }
 }
 
@@ -603,10 +617,10 @@ static void ssl_channel_check_call_host(grpc_exec_ctx *exec_ctx,
 }
 
 static grpc_security_connector_vtable ssl_channel_vtable = {
-    ssl_channel_destroy, ssl_channel_do_handshake, ssl_channel_check_peer};
+    ssl_channel_destroy, ssl_channel_check_peer};
 
 static grpc_security_connector_vtable ssl_server_vtable = {
-    ssl_server_destroy, ssl_server_do_handshake, ssl_server_check_peer};
+    ssl_server_destroy, ssl_server_check_peer};
 
 static gpr_slice compute_default_pem_root_certs_once(void) {
   gpr_slice result = gpr_empty_slice();
@@ -700,11 +714,11 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
 
   gpr_ref_init(&c->base.base.refcount, 1);
   c->base.base.vtable = &ssl_channel_vtable;
-  c->base.base.is_client_side = 1;
   c->base.base.url_scheme = GRPC_SSL_URL_SCHEME;
   c->base.request_metadata_creds =
       grpc_call_credentials_ref(request_metadata_creds);
   c->base.check_call_host = ssl_channel_check_call_host;
+  c->base.do_handshake = ssl_channel_do_handshake;
   gpr_split_host_port(target_name, &c->target_name, &port);
   gpr_free(port);
   if (overridden_target_name != NULL) {
@@ -735,7 +749,7 @@ error:
 }
 
 grpc_security_status grpc_ssl_server_security_connector_create(
-    const grpc_ssl_server_config *config, grpc_security_connector **sc) {
+    const grpc_ssl_server_config *config, grpc_server_security_connector **sc) {
   size_t num_alpn_protocols = grpc_chttp2_num_alpn_versions();
   const unsigned char **alpn_protocol_strings =
       gpr_malloc(sizeof(const char *) * num_alpn_protocols);
@@ -759,9 +773,9 @@ grpc_security_status grpc_ssl_server_security_connector_create(
   c = gpr_malloc(sizeof(grpc_ssl_server_security_connector));
   memset(c, 0, sizeof(grpc_ssl_server_security_connector));
 
-  gpr_ref_init(&c->base.refcount, 1);
-  c->base.url_scheme = GRPC_SSL_URL_SCHEME;
-  c->base.vtable = &ssl_server_vtable;
+  gpr_ref_init(&c->base.base.refcount, 1);
+  c->base.base.url_scheme = GRPC_SSL_URL_SCHEME;
+  c->base.base.vtable = &ssl_server_vtable;
   result = tsi_create_ssl_server_handshaker_factory(
       (const unsigned char **)config->pem_private_keys,
       config->pem_private_keys_sizes,
@@ -774,11 +788,12 @@ grpc_security_status grpc_ssl_server_security_connector_create(
   if (result != TSI_OK) {
     gpr_log(GPR_ERROR, "Handshaker factory creation failed with %s.",
             tsi_result_to_string(result));
-    ssl_server_destroy(&c->base);
+    ssl_server_destroy(&c->base.base);
     *sc = NULL;
     goto error;
   }
   gpr_mu_init(&c->base.mu);
+  c->base.do_handshake = ssl_server_do_handshake;
   *sc = &c->base;
   gpr_free((void *)alpn_protocol_strings);
   gpr_free(alpn_protocol_string_lengths);

+ 42 - 22
src/core/security/security_connector.h

@@ -36,6 +36,7 @@
 
 #include <grpc/grpc_security.h>
 #include "src/core/iomgr/endpoint.h"
+#include "src/core/iomgr/tcp_server.h"
 #include "src/core/tsi/transport_security_interface.h"
 
 /* --- status enum. --- */
@@ -68,9 +69,6 @@ typedef void (*grpc_security_handshake_done_cb)(
 
 typedef struct {
   void (*destroy)(grpc_security_connector *sc);
-  void (*do_handshake)(grpc_exec_ctx *exec_ctx, grpc_security_connector *sc,
-                       grpc_endpoint *nonsecure_endpoint,
-                       grpc_security_handshake_done_cb cb, void *user_data);
   void (*check_peer)(grpc_exec_ctx *exec_ctx, grpc_security_connector *sc,
                      tsi_peer peer, grpc_security_peer_check_cb cb,
                      void *user_data);
@@ -84,13 +82,7 @@ typedef struct grpc_security_connector_handshake_list {
 struct grpc_security_connector {
   const grpc_security_connector_vtable *vtable;
   gpr_refcount refcount;
-  int is_client_side;
   const char *url_scheme;
-  /* Used on server side only. */
-  /* TODO(yangg): Create a grpc_server_security_connector with these. */
-  gpr_mu mu;
-  grpc_security_connector_handshake_list *handshaking_handshakes;
-  const grpc_channel_args *channel_args;
 };
 
 /* Refcounting. */
@@ -113,13 +105,6 @@ grpc_security_connector *grpc_security_connector_ref(
 void grpc_security_connector_unref(grpc_security_connector *policy);
 #endif
 
-/* Handshake. */
-void grpc_security_connector_do_handshake(grpc_exec_ctx *exec_ctx,
-                                          grpc_security_connector *connector,
-                                          grpc_endpoint *nonsecure_endpoint,
-                                          grpc_security_handshake_done_cb cb,
-                                          void *user_data);
-
 /* Check the peer. Callee takes ownership of the peer object.
    The callback will include the resulting auth_context. */
 void grpc_security_connector_check_peer(grpc_exec_ctx *exec_ctx,
@@ -128,9 +113,6 @@ void grpc_security_connector_check_peer(grpc_exec_ctx *exec_ctx,
                                         grpc_security_peer_check_cb cb,
                                         void *user_data);
 
-void grpc_security_connector_shutdown(grpc_exec_ctx *exec_ctx,
-                                      grpc_security_connector *connector);
-
 /* Util to encapsulate the connector in a channel arg. */
 grpc_arg grpc_security_connector_to_arg(grpc_security_connector *sc);
 
@@ -153,12 +135,16 @@ typedef void (*grpc_security_call_host_check_cb)(grpc_exec_ctx *exec_ctx,
                                                  grpc_security_status status);
 
 struct grpc_channel_security_connector {
-  grpc_security_connector base; /* requires is_client_side to be non 0. */
+  grpc_security_connector base;
   grpc_call_credentials *request_metadata_creds;
   void (*check_call_host)(grpc_exec_ctx *exec_ctx,
                           grpc_channel_security_connector *sc, const char *host,
                           grpc_auth_context *auth_context,
                           grpc_security_call_host_check_cb cb, void *user_data);
+  void (*do_handshake)(grpc_exec_ctx *exec_ctx,
+                       grpc_channel_security_connector *sc,
+                       grpc_endpoint *nonsecure_endpoint,
+                       grpc_security_handshake_done_cb cb, void *user_data);
 };
 
 /* Checks that the host that will be set for a call is acceptable. */
@@ -167,6 +153,39 @@ void grpc_channel_security_connector_check_call_host(
     const char *host, grpc_auth_context *auth_context,
     grpc_security_call_host_check_cb cb, void *user_data);
 
+/* Handshake. */
+void grpc_channel_security_connector_do_handshake(
+    grpc_exec_ctx *exec_ctx, grpc_channel_security_connector *connector,
+    grpc_endpoint *nonsecure_endpoint, grpc_security_handshake_done_cb cb,
+    void *user_data);
+
+/* --- server_security_connector object. ---
+
+    A server security connector object represents away to configure the
+    underlying transport security mechanism on the server side.  */
+
+typedef struct grpc_server_security_connector grpc_server_security_connector;
+
+struct grpc_server_security_connector {
+  grpc_security_connector base;
+  gpr_mu mu;
+  grpc_security_connector_handshake_list *handshaking_handshakes;
+  const grpc_channel_args *channel_args;
+  void (*do_handshake)(grpc_exec_ctx *exec_ctx,
+                       grpc_server_security_connector *sc,
+                       grpc_tcp_server_acceptor *acceptor,
+                       grpc_endpoint *nonsecure_endpoint,
+                       grpc_security_handshake_done_cb cb, void *user_data);
+};
+
+void grpc_server_security_connector_do_handshake(
+    grpc_exec_ctx *exec_ctx, grpc_server_security_connector *sc,
+    grpc_tcp_server_acceptor *acceptor, grpc_endpoint *nonsecure_endpoint,
+    grpc_security_handshake_done_cb cb, void *user_data);
+
+void grpc_server_security_connector_shutdown(
+    grpc_exec_ctx *exec_ctx, grpc_server_security_connector *connector);
+
 /* --- Creation security connectors. --- */
 
 /* For TESTING ONLY!
@@ -176,7 +195,8 @@ grpc_channel_security_connector *grpc_fake_channel_security_connector_create(
 
 /* For TESTING ONLY!
    Creates a fake connector that emulates real server security.  */
-grpc_security_connector *grpc_fake_server_security_connector_create(void);
+grpc_server_security_connector *grpc_fake_server_security_connector_create(
+    void);
 
 /* Config for ssl clients. */
 typedef struct {
@@ -231,7 +251,7 @@ typedef struct {
   specific error code otherwise.
 */
 grpc_security_status grpc_ssl_server_security_connector_create(
-    const grpc_ssl_server_config *config, grpc_security_connector **sc);
+    const grpc_ssl_server_config *config, grpc_server_security_connector **sc);
 
 /* Util. */
 const tsi_peer_property *tsi_peer_get_property_by_name(const tsi_peer *peer,

部分文件因文件數量過多而無法顯示