Merge remote-tracking branch 'upstream/master' into deadline_filter

pull/7970/head
Mark D. Roth 8 years ago
commit 3c09810ac9
  1. 6
      BUILD
  2. 2
      CMakeLists.txt
  3. 38
      Makefile
  4. 1
      binding.gyp
  5. 12
      build.yaml
  6. 1
      config.m4
  7. 5
      examples/php/route_guide/run_route_guide_client.sh
  8. 5
      gRPC-Core.podspec
  9. 2
      grpc.gemspec
  10. 2
      package.xml
  11. 86
      src/core/ext/census/trace_context.c
  12. 68
      src/core/ext/census/trace_context.h
  13. 16
      src/core/ext/census/tracing.c
  14. 32
      src/core/ext/client_config/client_channel.c
  15. 13
      src/core/ext/client_config/client_channel.h
  16. 20
      src/core/ext/client_config/lb_policy_factory.c
  17. 11
      src/core/ext/client_config/lb_policy_factory.h
  18. 5
      src/core/ext/client_config/resolver_factory.h
  19. 4
      src/core/ext/client_config/resolver_registry.c
  20. 3
      src/core/ext/client_config/resolver_registry.h
  21. 58
      src/core/ext/client_config/resolver_result.c
  22. 32
      src/core/ext/client_config/resolver_result.h
  23. 25
      src/core/ext/resolver/dns/native/dns_resolver.c
  24. 19
      src/core/ext/resolver/sockaddr/sockaddr_resolver.c
  25. 17
      src/core/ext/transport/chttp2/client/insecure/channel_create.c
  26. 15
      src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
  27. 1
      src/php/lib/Grpc/BaseStub.php
  28. 102
      src/php/tests/interop/interop_client.php
  29. 3
      src/php/tests/unit_tests/CallCredentials2Test.php
  30. 12
      src/python/grpcio/grpc/__init__.py
  31. 17
      src/python/grpcio/grpc/_channel.py
  32. 10
      src/python/grpcio/grpc/_common.py
  33. 5
      src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
  34. 4
      src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
  35. 5
      src/python/grpcio/grpc/_server.py
  36. 1
      src/python/grpcio/grpc_core_dependencies.py
  37. 1
      src/python/grpcio_tests/tests/tests.json
  38. 53
      src/python/grpcio_tests/tests/unit/_channel_args_test.py
  39. 10
      src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py
  40. 2
      src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py
  41. 5
      src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py
  42. 5
      src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py
  43. 9
      src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
  44. 0
      test/core/census/data/context_empty.pb
  45. 0
      test/core/census/data/context_empty.txt
  46. BIN
      test/core/census/data/context_full.pb
  47. 3
      test/core/census/data/context_full.txt
  48. BIN
      test/core/census/data/context_no_sample.pb
  49. 2
      test/core/census/data/context_no_sample.txt
  50. BIN
      test/core/census/data/context_span_only.pb
  51. 2
      test/core/census/data/context_span_only.txt
  52. BIN
      test/core/census/data/context_trace_only.pb
  53. 2
      test/core/census/data/context_trace_only.txt
  54. 231
      test/core/census/trace_context_test.c
  55. 24
      test/core/client_config/resolvers/dns_resolver_connectivity_test.c
  56. 24
      test/core/client_config/resolvers/dns_resolver_test.c
  57. 24
      test/core/client_config/resolvers/sockaddr_resolver_test.c
  58. 2
      tools/doxygen/Doxyfile.core.internal
  59. 2
      tools/run_tests/run_build_statistics.py
  60. 12
      tools/run_tests/run_tests.py
  61. 21
      tools/run_tests/sources_and_headers.json
  62. 21
      tools/run_tests/tests.json
  63. 27
      vsprojects/buildtests_c.sln
  64. 3
      vsprojects/vcxproj/grpc/grpc.vcxproj
  65. 6
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  66. 3
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
  67. 6
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
  68. 199
      vsprojects/vcxproj/test/census_trace_context_test/census_trace_context_test.vcxproj
  69. 21
      vsprojects/vcxproj/test/census_trace_context_test/census_trace_context_test.vcxproj.filters

@ -320,6 +320,7 @@ cc_library(
"src/core/ext/census/mlog.h", "src/core/ext/census/mlog.h",
"src/core/ext/census/resource.h", "src/core/ext/census/resource.h",
"src/core/ext/census/rpc_metric_id.h", "src/core/ext/census/rpc_metric_id.h",
"src/core/ext/census/trace_context.h",
"src/core/lib/surface/init.c", "src/core/lib/surface/init.c",
"src/core/lib/channel/channel_args.c", "src/core/lib/channel/channel_args.c",
"src/core/lib/channel/channel_stack.c", "src/core/lib/channel/channel_stack.c",
@ -508,6 +509,7 @@ cc_library(
"src/core/ext/census/operation.c", "src/core/ext/census/operation.c",
"src/core/ext/census/placeholders.c", "src/core/ext/census/placeholders.c",
"src/core/ext/census/resource.c", "src/core/ext/census/resource.c",
"src/core/ext/census/trace_context.c",
"src/core/ext/census/tracing.c", "src/core/ext/census/tracing.c",
"src/core/plugin_registry/grpc_plugin_registry.c", "src/core/plugin_registry/grpc_plugin_registry.c",
], ],
@ -1047,6 +1049,7 @@ cc_library(
"src/core/ext/census/mlog.h", "src/core/ext/census/mlog.h",
"src/core/ext/census/resource.h", "src/core/ext/census/resource.h",
"src/core/ext/census/rpc_metric_id.h", "src/core/ext/census/rpc_metric_id.h",
"src/core/ext/census/trace_context.h",
"src/core/lib/surface/init.c", "src/core/lib/surface/init.c",
"src/core/lib/surface/init_unsecure.c", "src/core/lib/surface/init_unsecure.c",
"src/core/lib/channel/channel_args.c", "src/core/lib/channel/channel_args.c",
@ -1206,6 +1209,7 @@ cc_library(
"src/core/ext/census/operation.c", "src/core/ext/census/operation.c",
"src/core/ext/census/placeholders.c", "src/core/ext/census/placeholders.c",
"src/core/ext/census/resource.c", "src/core/ext/census/resource.c",
"src/core/ext/census/trace_context.c",
"src/core/ext/census/tracing.c", "src/core/ext/census/tracing.c",
"src/core/plugin_registry/grpc_unsecure_plugin_registry.c", "src/core/plugin_registry/grpc_unsecure_plugin_registry.c",
], ],
@ -2359,6 +2363,7 @@ objc_library(
"src/core/ext/census/operation.c", "src/core/ext/census/operation.c",
"src/core/ext/census/placeholders.c", "src/core/ext/census/placeholders.c",
"src/core/ext/census/resource.c", "src/core/ext/census/resource.c",
"src/core/ext/census/trace_context.c",
"src/core/ext/census/tracing.c", "src/core/ext/census/tracing.c",
"src/core/plugin_registry/grpc_plugin_registry.c", "src/core/plugin_registry/grpc_plugin_registry.c",
], ],
@ -2547,6 +2552,7 @@ objc_library(
"src/core/ext/census/mlog.h", "src/core/ext/census/mlog.h",
"src/core/ext/census/resource.h", "src/core/ext/census/resource.h",
"src/core/ext/census/rpc_metric_id.h", "src/core/ext/census/rpc_metric_id.h",
"src/core/ext/census/trace_context.h",
], ],
includes = [ includes = [
"include", "include",

@ -480,6 +480,7 @@ add_library(grpc
src/core/ext/census/operation.c src/core/ext/census/operation.c
src/core/ext/census/placeholders.c src/core/ext/census/placeholders.c
src/core/ext/census/resource.c src/core/ext/census/resource.c
src/core/ext/census/trace_context.c
src/core/ext/census/tracing.c src/core/ext/census/tracing.c
src/core/plugin_registry/grpc_plugin_registry.c src/core/plugin_registry/grpc_plugin_registry.c
) )
@ -937,6 +938,7 @@ add_library(grpc_unsecure
src/core/ext/census/operation.c src/core/ext/census/operation.c
src/core/ext/census/placeholders.c src/core/ext/census/placeholders.c
src/core/ext/census/resource.c src/core/ext/census/resource.c
src/core/ext/census/trace_context.c
src/core/ext/census/tracing.c src/core/ext/census/tracing.c
src/core/plugin_registry/grpc_unsecure_plugin_registry.c src/core/plugin_registry/grpc_unsecure_plugin_registry.c
) )

@ -909,6 +909,7 @@ bin_decoder_test: $(BINDIR)/$(CONFIG)/bin_decoder_test
bin_encoder_test: $(BINDIR)/$(CONFIG)/bin_encoder_test bin_encoder_test: $(BINDIR)/$(CONFIG)/bin_encoder_test
census_context_test: $(BINDIR)/$(CONFIG)/census_context_test census_context_test: $(BINDIR)/$(CONFIG)/census_context_test
census_resource_test: $(BINDIR)/$(CONFIG)/census_resource_test census_resource_test: $(BINDIR)/$(CONFIG)/census_resource_test
census_trace_context_test: $(BINDIR)/$(CONFIG)/census_trace_context_test
channel_create_test: $(BINDIR)/$(CONFIG)/channel_create_test channel_create_test: $(BINDIR)/$(CONFIG)/channel_create_test
chttp2_hpack_encoder_test: $(BINDIR)/$(CONFIG)/chttp2_hpack_encoder_test chttp2_hpack_encoder_test: $(BINDIR)/$(CONFIG)/chttp2_hpack_encoder_test
chttp2_status_conversion_test: $(BINDIR)/$(CONFIG)/chttp2_status_conversion_test chttp2_status_conversion_test: $(BINDIR)/$(CONFIG)/chttp2_status_conversion_test
@ -1237,6 +1238,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/bin_encoder_test \ $(BINDIR)/$(CONFIG)/bin_encoder_test \
$(BINDIR)/$(CONFIG)/census_context_test \ $(BINDIR)/$(CONFIG)/census_context_test \
$(BINDIR)/$(CONFIG)/census_resource_test \ $(BINDIR)/$(CONFIG)/census_resource_test \
$(BINDIR)/$(CONFIG)/census_trace_context_test \
$(BINDIR)/$(CONFIG)/channel_create_test \ $(BINDIR)/$(CONFIG)/channel_create_test \
$(BINDIR)/$(CONFIG)/chttp2_hpack_encoder_test \ $(BINDIR)/$(CONFIG)/chttp2_hpack_encoder_test \
$(BINDIR)/$(CONFIG)/chttp2_status_conversion_test \ $(BINDIR)/$(CONFIG)/chttp2_status_conversion_test \
@ -1551,6 +1553,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/census_context_test || ( echo test census_context_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/census_context_test || ( echo test census_context_test failed ; exit 1 )
$(E) "[RUN] Testing census_resource_test" $(E) "[RUN] Testing census_resource_test"
$(Q) $(BINDIR)/$(CONFIG)/census_resource_test || ( echo test census_resource_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/census_resource_test || ( echo test census_resource_test failed ; exit 1 )
$(E) "[RUN] Testing census_trace_context_test"
$(Q) $(BINDIR)/$(CONFIG)/census_trace_context_test || ( echo test census_trace_context_test failed ; exit 1 )
$(E) "[RUN] Testing channel_create_test" $(E) "[RUN] Testing channel_create_test"
$(Q) $(BINDIR)/$(CONFIG)/channel_create_test || ( echo test channel_create_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/channel_create_test || ( echo test channel_create_test failed ; exit 1 )
$(E) "[RUN] Testing chttp2_hpack_encoder_test" $(E) "[RUN] Testing chttp2_hpack_encoder_test"
@ -2709,6 +2713,7 @@ LIBGRPC_SRC = \
src/core/ext/census/operation.c \ src/core/ext/census/operation.c \
src/core/ext/census/placeholders.c \ src/core/ext/census/placeholders.c \
src/core/ext/census/resource.c \ src/core/ext/census/resource.c \
src/core/ext/census/trace_context.c \
src/core/ext/census/tracing.c \ src/core/ext/census/tracing.c \
src/core/plugin_registry/grpc_plugin_registry.c \ src/core/plugin_registry/grpc_plugin_registry.c \
@ -3410,6 +3415,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/census/operation.c \ src/core/ext/census/operation.c \
src/core/ext/census/placeholders.c \ src/core/ext/census/placeholders.c \
src/core/ext/census/resource.c \ src/core/ext/census/resource.c \
src/core/ext/census/trace_context.c \
src/core/ext/census/tracing.c \ src/core/ext/census/tracing.c \
src/core/plugin_registry/grpc_unsecure_plugin_registry.c \ src/core/plugin_registry/grpc_unsecure_plugin_registry.c \
@ -7217,6 +7223,38 @@ endif
endif endif
CENSUS_TRACE_CONTEXT_TEST_SRC = \
test/core/census/trace_context_test.c \
CENSUS_TRACE_CONTEXT_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(CENSUS_TRACE_CONTEXT_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/census_trace_context_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/census_trace_context_test: $(CENSUS_TRACE_CONTEXT_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(CENSUS_TRACE_CONTEXT_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/census_trace_context_test
endif
$(OBJDIR)/$(CONFIG)/test/core/census/trace_context_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_census_trace_context_test: $(CENSUS_TRACE_CONTEXT_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(CENSUS_TRACE_CONTEXT_TEST_OBJS:.o=.dep)
endif
endif
CHANNEL_CREATE_TEST_SRC = \ CHANNEL_CREATE_TEST_SRC = \
test/core/surface/channel_create_test.c \ test/core/surface/channel_create_test.c \

@ -755,6 +755,7 @@
'src/core/ext/census/operation.c', 'src/core/ext/census/operation.c',
'src/core/ext/census/placeholders.c', 'src/core/ext/census/placeholders.c',
'src/core/ext/census/resource.c', 'src/core/ext/census/resource.c',
'src/core/ext/census/trace_context.c',
'src/core/ext/census/tracing.c', 'src/core/ext/census/tracing.c',
'src/core/plugin_registry/grpc_plugin_registry.c', 'src/core/plugin_registry/grpc_plugin_registry.c',
], ],

@ -29,6 +29,7 @@ filegroups:
- src/core/ext/census/mlog.h - src/core/ext/census/mlog.h
- src/core/ext/census/resource.h - src/core/ext/census/resource.h
- src/core/ext/census/rpc_metric_id.h - src/core/ext/census/rpc_metric_id.h
- src/core/ext/census/trace_context.h
src: src:
- src/core/ext/census/base_resources.c - src/core/ext/census/base_resources.c
- src/core/ext/census/context.c - src/core/ext/census/context.c
@ -42,6 +43,7 @@ filegroups:
- src/core/ext/census/operation.c - src/core/ext/census/operation.c
- src/core/ext/census/placeholders.c - src/core/ext/census/placeholders.c
- src/core/ext/census/resource.c - src/core/ext/census/resource.c
- src/core/ext/census/trace_context.c
- src/core/ext/census/tracing.c - src/core/ext/census/tracing.c
plugin: census_grpc_plugin plugin: census_grpc_plugin
uses: uses:
@ -1349,6 +1351,16 @@ targets:
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: census_trace_context_test
build: test
language: c
src:
- test/core/census/trace_context_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: channel_create_test - name: channel_create_test
build: test build: test
language: c language: c

@ -274,6 +274,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/census/operation.c \ src/core/ext/census/operation.c \
src/core/ext/census/placeholders.c \ src/core/ext/census/placeholders.c \
src/core/ext/census/resource.c \ src/core/ext/census/resource.c \
src/core/ext/census/trace_context.c \
src/core/ext/census/tracing.c \ src/core/ext/census/tracing.c \
src/core/plugin_registry/grpc_plugin_registry.c \ src/core/plugin_registry/grpc_plugin_registry.c \
src/boringssl/err_data.c \ src/boringssl/err_data.c \

@ -30,5 +30,6 @@
set -e set -e
cd $(dirname $0) cd $(dirname $0)
php $extension_dir -d extension=grpc.so -d max_execution_time=300 \ php -d extension=grpc.so -d max_execution_time=300 \
route_guide_client.php ../../node/route_guide/route_guide_db.json route_guide_client.php \
../../node/static_codegen/route_guide/route_guide_db.json

@ -411,6 +411,7 @@ Pod::Spec.new do |s|
'src/core/ext/census/mlog.h', 'src/core/ext/census/mlog.h',
'src/core/ext/census/resource.h', 'src/core/ext/census/resource.h',
'src/core/ext/census/rpc_metric_id.h', 'src/core/ext/census/rpc_metric_id.h',
'src/core/ext/census/trace_context.h',
'src/core/lib/surface/init.c', 'src/core/lib/surface/init.c',
'src/core/lib/channel/channel_args.c', 'src/core/lib/channel/channel_args.c',
'src/core/lib/channel/channel_stack.c', 'src/core/lib/channel/channel_stack.c',
@ -602,6 +603,7 @@ Pod::Spec.new do |s|
'src/core/ext/census/operation.c', 'src/core/ext/census/operation.c',
'src/core/ext/census/placeholders.c', 'src/core/ext/census/placeholders.c',
'src/core/ext/census/resource.c', 'src/core/ext/census/resource.c',
'src/core/ext/census/trace_context.c',
'src/core/ext/census/tracing.c', 'src/core/ext/census/tracing.c',
'src/core/plugin_registry/grpc_plugin_registry.c' 'src/core/plugin_registry/grpc_plugin_registry.c'
@ -779,7 +781,8 @@ Pod::Spec.new do |s|
'src/core/ext/census/grpc_filter.h', 'src/core/ext/census/grpc_filter.h',
'src/core/ext/census/mlog.h', 'src/core/ext/census/mlog.h',
'src/core/ext/census/resource.h', 'src/core/ext/census/resource.h',
'src/core/ext/census/rpc_metric_id.h' 'src/core/ext/census/rpc_metric_id.h',
'src/core/ext/census/trace_context.h'
end end
s.subspec 'Cronet-Interface' do |ss| s.subspec 'Cronet-Interface' do |ss|

@ -331,6 +331,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/census/mlog.h ) s.files += %w( src/core/ext/census/mlog.h )
s.files += %w( src/core/ext/census/resource.h ) s.files += %w( src/core/ext/census/resource.h )
s.files += %w( src/core/ext/census/rpc_metric_id.h ) s.files += %w( src/core/ext/census/rpc_metric_id.h )
s.files += %w( src/core/ext/census/trace_context.h )
s.files += %w( src/core/lib/surface/init.c ) s.files += %w( src/core/lib/surface/init.c )
s.files += %w( src/core/lib/channel/channel_args.c ) s.files += %w( src/core/lib/channel/channel_args.c )
s.files += %w( src/core/lib/channel/channel_stack.c ) s.files += %w( src/core/lib/channel/channel_stack.c )
@ -522,6 +523,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/census/operation.c ) s.files += %w( src/core/ext/census/operation.c )
s.files += %w( src/core/ext/census/placeholders.c ) s.files += %w( src/core/ext/census/placeholders.c )
s.files += %w( src/core/ext/census/resource.c ) s.files += %w( src/core/ext/census/resource.c )
s.files += %w( src/core/ext/census/trace_context.c )
s.files += %w( src/core/ext/census/tracing.c ) s.files += %w( src/core/ext/census/tracing.c )
s.files += %w( src/core/plugin_registry/grpc_plugin_registry.c ) s.files += %w( src/core/plugin_registry/grpc_plugin_registry.c )
s.files += %w( third_party/boringssl/crypto/aes/internal.h ) s.files += %w( third_party/boringssl/crypto/aes/internal.h )

@ -338,6 +338,7 @@
<file baseinstalldir="/" name="src/core/ext/census/mlog.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/mlog.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/resource.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/resource.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/rpc_metric_id.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/rpc_metric_id.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/trace_context.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/init.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/surface/init.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_args.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_args.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/channel/channel_stack.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/channel/channel_stack.c" role="src" />
@ -529,6 +530,7 @@
<file baseinstalldir="/" name="src/core/ext/census/operation.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/operation.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/placeholders.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/placeholders.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/resource.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/resource.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/trace_context.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/census/tracing.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/census/tracing.c" role="src" />
<file baseinstalldir="/" name="src/core/plugin_registry/grpc_plugin_registry.c" role="src" /> <file baseinstalldir="/" name="src/core/plugin_registry/grpc_plugin_registry.c" role="src" />
<file baseinstalldir="/" name="third_party/boringssl/crypto/aes/internal.h" role="src" /> <file baseinstalldir="/" name="third_party/boringssl/crypto/aes/internal.h" role="src" />

@ -0,0 +1,86 @@
/*
*
* 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/ext/census/trace_context.h"
#include <grpc/census.h>
#include <grpc/support/log.h>
#include <stdbool.h>
#include "third_party/nanopb/pb_decode.h"
#include "third_party/nanopb/pb_encode.h"
// This function assumes the TraceContext is valid.
size_t encode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
const size_t buf_size) {
// Create a stream that will write to our buffer.
pb_ostream_t stream = pb_ostream_from_buffer(buffer, buf_size);
// encode message
bool status = pb_encode(&stream, google_trace_TraceContext_fields, ctxt);
if (!status) {
gpr_log(GPR_DEBUG, "TraceContext encoding failed: %s",
PB_GET_ERROR(&stream));
return 0;
}
return stream.bytes_written;
}
bool decode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
const size_t nbytes) {
// Create a stream that reads nbytes from the buffer.
pb_istream_t stream = pb_istream_from_buffer(buffer, nbytes);
// decode message
bool status = pb_decode(&stream, google_trace_TraceContext_fields, ctxt);
if (!status) {
gpr_log(GPR_DEBUG, "TraceContext decoding failed: %s",
PB_GET_ERROR(&stream));
return false;
}
// check fields
if (!ctxt->has_trace_id) {
gpr_log(GPR_DEBUG, "Invalid TraceContext: missing trace_id");
return false;
}
if (!ctxt->has_span_id) {
gpr_log(GPR_DEBUG, "Invalid TraceContext: missing span_id");
return false;
}
return true;
}

@ -0,0 +1,68 @@
/*
*
* 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.
*
*/
/* Functions for manipulating trace contexts as defined in
src/proto/census/trace.proto */
#ifndef GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H
#define GRPC_CORE_EXT_CENSUS_TRACE_CONTEXT_H
#include "src/core/ext/census/gen/trace_context.pb.h"
/* Maximum number of bytes required to encode a TraceContext (31)
1 byte for trace_id field
1 byte for trace_id length
1 byte for trace_id.hi field
8 bytes for trace_id.hi (uint64_t)
1 byte for trace_id.lo field
8 bytes for trace_id.lo (uint64_t)
1 byte for span_id field
8 bytes for span_id (uint64_t)
1 byte for is_sampled field
1 byte for is_sampled (bool) */
#define TRACE_MAX_CONTEXT_SIZE 31
/* Encode a trace context (ctxt) into proto format to the buffer provided. The
size of buffer must be at least TRACE_MAX_CONTEXT_SIZE. On success, returns the
number of bytes successfully encoded into buffer. On failure, returns 0. */
size_t encode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
const size_t buf_size);
/* Decode a proto-encoded TraceContext from the provided buffer into the
TraceContext structure (ctxt). The function expects to be supplied the number
of bytes to be read from buffer (nbytes). This function will also validate that
the TraceContext has a span_id and a trace_id, and will return false if either
of these do not exist. On success, returns true and false otherwise. */
bool decode_trace_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
const size_t nbytes);
#endif

@ -31,15 +31,19 @@
* *
*/ */
//#include "src/core/ext/census/tracing.h"
#include <grpc/census.h> #include <grpc/census.h>
/* TODO(aveitch): These are all placeholder implementations. */ /* TODO(aveitch): These are all placeholder implementations. */
int census_trace_mask(const census_context *context) { // int census_trace_mask(const census_context *context) {
return CENSUS_TRACE_MASK_NONE; // return CENSUS_TRACE_MASK_NONE;
} // }
// void census_set_trace_mask(int trace_mask) {}
void census_set_trace_mask(int trace_mask) {} // void census_trace_print(census_context *context, uint32_t type,
// const char *buffer, size_t n) {}
void census_trace_print(census_context *context, uint32_t type, // void SetTracerParams(const Params& params);
const char *buffer, size_t n) {}

@ -42,6 +42,7 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/client_config/lb_policy_registry.h"
#include "src/core/ext/client_config/subchannel.h" #include "src/core/ext/client_config/subchannel.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
@ -64,6 +65,8 @@ typedef struct client_channel_channel_data {
grpc_resolver *resolver; grpc_resolver *resolver;
/** have we started resolving this channel */ /** have we started resolving this channel */
bool started_resolving; bool started_resolving;
/** client channel factory */
grpc_client_channel_factory *client_channel_factory;
/** mutex protecting client configuration, including all /** mutex protecting client configuration, including all
variables below in this data structure */ variables below in this data structure */
@ -174,20 +177,26 @@ static void on_resolver_result_changed(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *state_error = GRPC_ERROR_CREATE("No load balancing policy"); grpc_error *state_error = GRPC_ERROR_CREATE("No load balancing policy");
if (chand->resolver_result != NULL) { if (chand->resolver_result != NULL) {
lb_policy = grpc_resolver_result_get_lb_policy(chand->resolver_result); grpc_lb_policy_args lb_policy_args;
lb_policy_args.addresses =
grpc_resolver_result_get_addresses(chand->resolver_result);
lb_policy_args.additional_args =
grpc_resolver_result_get_lb_policy_args(chand->resolver_result);
lb_policy_args.client_channel_factory = chand->client_channel_factory;
lb_policy = grpc_lb_policy_create(
exec_ctx,
grpc_resolver_result_get_lb_policy_name(chand->resolver_result),
&lb_policy_args);
if (lb_policy != NULL) { if (lb_policy != NULL) {
GRPC_LB_POLICY_REF(lb_policy, "channel");
GRPC_LB_POLICY_REF(lb_policy, "config_change"); GRPC_LB_POLICY_REF(lb_policy, "config_change");
GRPC_ERROR_UNREF(state_error); GRPC_ERROR_UNREF(state_error);
state = state =
grpc_lb_policy_check_connectivity(exec_ctx, lb_policy, &state_error); grpc_lb_policy_check_connectivity(exec_ctx, lb_policy, &state_error);
} }
grpc_resolver_result_unref(exec_ctx, chand->resolver_result); grpc_resolver_result_unref(exec_ctx, chand->resolver_result);
chand->resolver_result = NULL;
} }
chand->resolver_result = NULL;
if (lb_policy != NULL) { if (lb_policy != NULL) {
grpc_pollset_set_add_pollset_set(exec_ctx, lb_policy->interested_parties, grpc_pollset_set_add_pollset_set(exec_ctx, lb_policy->interested_parties,
chand->interested_parties); chand->interested_parties);
@ -347,6 +356,9 @@ static void cc_destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_resolver_shutdown(exec_ctx, chand->resolver); grpc_resolver_shutdown(exec_ctx, chand->resolver);
GRPC_RESOLVER_UNREF(exec_ctx, chand->resolver, "channel"); GRPC_RESOLVER_UNREF(exec_ctx, chand->resolver, "channel");
} }
if (chand->client_channel_factory != NULL) {
grpc_client_channel_factory_unref(exec_ctx, chand->client_channel_factory);
}
if (chand->lb_policy != NULL) { if (chand->lb_policy != NULL) {
grpc_pollset_set_del_pollset_set(exec_ctx, grpc_pollset_set_del_pollset_set(exec_ctx,
chand->lb_policy->interested_parties, chand->lb_policy->interested_parties,
@ -796,10 +808,12 @@ const grpc_channel_filter grpc_client_channel_filter = {
"client-channel", "client-channel",
}; };
void grpc_client_channel_set_resolver(grpc_exec_ctx *exec_ctx, void grpc_client_channel_finish_initialization(
grpc_channel_stack *channel_stack, grpc_exec_ctx *exec_ctx, grpc_channel_stack *channel_stack,
grpc_resolver *resolver) { grpc_resolver *resolver,
grpc_client_channel_factory *client_channel_factory) {
/* post construction initialization: set the transport setup pointer */ /* post construction initialization: set the transport setup pointer */
GPR_ASSERT(client_channel_factory != NULL);
grpc_channel_element *elem = grpc_channel_stack_last_element(channel_stack); grpc_channel_element *elem = grpc_channel_stack_last_element(channel_stack);
channel_data *chand = elem->channel_data; channel_data *chand = elem->channel_data;
gpr_mu_lock(&chand->mu); gpr_mu_lock(&chand->mu);
@ -813,6 +827,8 @@ void grpc_client_channel_set_resolver(grpc_exec_ctx *exec_ctx,
grpc_resolver_next(exec_ctx, resolver, &chand->resolver_result, grpc_resolver_next(exec_ctx, resolver, &chand->resolver_result,
&chand->on_resolver_result_changed); &chand->on_resolver_result_changed);
} }
chand->client_channel_factory = client_channel_factory;
grpc_client_channel_factory_ref(client_channel_factory);
gpr_mu_unlock(&chand->mu); gpr_mu_unlock(&chand->mu);
} }

@ -34,6 +34,7 @@
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_H #ifndef GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_H #define GRPC_CORE_EXT_CLIENT_CONFIG_CLIENT_CHANNEL_H
#include "src/core/ext/client_config/client_channel_factory.h"
#include "src/core/ext/client_config/resolver.h" #include "src/core/ext/client_config/resolver.h"
#include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/channel_stack.h"
@ -46,12 +47,12 @@
extern const grpc_channel_filter grpc_client_channel_filter; extern const grpc_channel_filter grpc_client_channel_filter;
/* post-construction initializer to let the client channel know which /* Post-construction initializer to give the client channel its resolver
transport setup it should cancel upon destruction, or initiate when it needs and factory. */
a connection */ void grpc_client_channel_finish_initialization(
void grpc_client_channel_set_resolver(grpc_exec_ctx *exec_ctx, grpc_exec_ctx *exec_ctx, grpc_channel_stack *channel_stack,
grpc_channel_stack *channel_stack, grpc_resolver *resolver,
grpc_resolver *resolver); grpc_client_channel_factory *client_channel_factory);
grpc_connectivity_state grpc_client_channel_check_connectivity_state( grpc_connectivity_state grpc_client_channel_check_connectivity_state(
grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, int try_to_connect); grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, int try_to_connect);

@ -34,6 +34,7 @@
#include <string.h> #include <string.h>
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/client_config/lb_policy_factory.h" #include "src/core/ext/client_config/lb_policy_factory.h"
@ -46,6 +47,25 @@ grpc_lb_addresses* grpc_lb_addresses_create(size_t num_addresses) {
return addresses; return addresses;
} }
grpc_lb_addresses* grpc_lb_addresses_copy(grpc_lb_addresses* addresses,
void* (*user_data_copy)(void*)) {
grpc_lb_addresses* new_addresses =
grpc_lb_addresses_create(addresses->num_addresses);
memcpy(new_addresses->addresses, addresses->addresses,
sizeof(grpc_lb_address) * addresses->num_addresses);
for (size_t i = 0; i < addresses->num_addresses; ++i) {
if (new_addresses->addresses[i].balancer_name != NULL) {
new_addresses->addresses[i].balancer_name =
gpr_strdup(new_addresses->addresses[i].balancer_name);
}
if (user_data_copy != NULL) {
new_addresses->addresses[i].user_data =
user_data_copy(new_addresses->addresses[i].user_data);
}
}
return new_addresses;
}
void grpc_lb_addresses_set_address(grpc_lb_addresses* addresses, size_t index, void grpc_lb_addresses_set_address(grpc_lb_addresses* addresses, size_t index,
void* address, size_t address_len, void* address, size_t address_len,
bool is_balancer, char* balancer_name, bool is_balancer, char* balancer_name,

@ -36,9 +36,9 @@
#include "src/core/ext/client_config/client_channel_factory.h" #include "src/core/ext/client_config/client_channel_factory.h"
#include "src/core/ext/client_config/lb_policy.h" #include "src/core/ext/client_config/lb_policy.h"
#include "src/core/ext/client_config/resolver_result.h"
#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/resolve_address.h"
typedef struct grpc_lb_policy_factory grpc_lb_policy_factory; typedef struct grpc_lb_policy_factory grpc_lb_policy_factory;
typedef struct grpc_lb_policy_factory_vtable grpc_lb_policy_factory_vtable; typedef struct grpc_lb_policy_factory_vtable grpc_lb_policy_factory_vtable;
@ -68,6 +68,11 @@ typedef struct grpc_lb_addresses {
* \a num_addresses addresses. */ * \a num_addresses addresses. */
grpc_lb_addresses *grpc_lb_addresses_create(size_t num_addresses); grpc_lb_addresses *grpc_lb_addresses_create(size_t num_addresses);
/** Creates a copy of \a addresses. If \a user_data_copy is not NULL,
* it will be invoked to copy the \a user_data field of each address. */
grpc_lb_addresses *grpc_lb_addresses_copy(grpc_lb_addresses *addresses,
void *(*user_data_copy)(void *));
/** Sets the value of the address at index \a index of \a addresses. /** Sets the value of the address at index \a index of \a addresses.
* \a address is a socket address of length \a address_len. * \a address is a socket address of length \a address_len.
* Takes ownership of \a balancer_name. */ * Takes ownership of \a balancer_name. */
@ -82,9 +87,13 @@ void grpc_lb_addresses_destroy(grpc_lb_addresses *addresses,
void (*user_data_destroy)(void *)); void (*user_data_destroy)(void *));
/** Arguments passed to LB policies. */ /** Arguments passed to LB policies. */
/* TODO(roth, ctiller): Consider replacing this struct with
grpc_channel_args. See comment in resolver_result.h for details. */
typedef struct grpc_lb_policy_args { typedef struct grpc_lb_policy_args {
grpc_lb_addresses *addresses; grpc_lb_addresses *addresses;
grpc_client_channel_factory *client_channel_factory; grpc_client_channel_factory *client_channel_factory;
/* Can be used to pass implementation-specific parameters to the LB policy. */
grpc_channel_args *additional_args;
} grpc_lb_policy_args; } grpc_lb_policy_args;
struct grpc_lb_policy_factory_vtable { struct grpc_lb_policy_factory_vtable {

@ -47,10 +47,7 @@ struct grpc_resolver_factory {
const grpc_resolver_factory_vtable *vtable; const grpc_resolver_factory_vtable *vtable;
}; };
typedef struct grpc_resolver_args { typedef struct grpc_resolver_args { grpc_uri *uri; } grpc_resolver_args;
grpc_uri *uri;
grpc_client_channel_factory *client_channel_factory;
} grpc_resolver_args;
struct grpc_resolver_factory_vtable { struct grpc_resolver_factory_vtable {
void (*ref)(grpc_resolver_factory *factory); void (*ref)(grpc_resolver_factory *factory);

@ -128,15 +128,13 @@ static grpc_resolver_factory *resolve_factory(const char *target,
return factory; return factory;
} }
grpc_resolver *grpc_resolver_create( grpc_resolver *grpc_resolver_create(const char *target) {
const char *target, grpc_client_channel_factory *client_channel_factory) {
grpc_uri *uri = NULL; grpc_uri *uri = NULL;
grpc_resolver_factory *factory = resolve_factory(target, &uri); grpc_resolver_factory *factory = resolve_factory(target, &uri);
grpc_resolver *resolver; grpc_resolver *resolver;
grpc_resolver_args args; grpc_resolver_args args;
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
args.uri = uri; args.uri = uri;
args.client_channel_factory = client_channel_factory;
resolver = grpc_resolver_factory_create_resolver(factory, &args); resolver = grpc_resolver_factory_create_resolver(factory, &args);
grpc_uri_destroy(uri); grpc_uri_destroy(uri);
return resolver; return resolver;

@ -55,8 +55,7 @@ void grpc_register_resolver_type(grpc_resolver_factory *factory);
If a resolver factory was found, use it to instantiate a resolver and If a resolver factory was found, use it to instantiate a resolver and
return it. return it.
If a resolver factory was not found, return NULL. */ If a resolver factory was not found, return NULL. */
grpc_resolver *grpc_resolver_create( grpc_resolver *grpc_resolver_create(const char *target);
const char *target, grpc_client_channel_factory *client_channel_factory);
/** Find a resolver factory given a name and return an (owned-by-the-caller) /** Find a resolver factory given a name and return an (owned-by-the-caller)
* reference to it */ * reference to it */

@ -34,40 +34,54 @@
#include <string.h> #include <string.h>
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
struct grpc_resolver_result { struct grpc_resolver_result {
gpr_refcount refs; gpr_refcount refs;
grpc_lb_policy* lb_policy; grpc_lb_addresses* addresses;
char* lb_policy_name;
grpc_channel_args* lb_policy_args;
}; };
grpc_resolver_result* grpc_resolver_result_create() { grpc_resolver_result* grpc_resolver_result_create(
grpc_resolver_result* c = gpr_malloc(sizeof(*c)); grpc_lb_addresses* addresses, const char* lb_policy_name,
memset(c, 0, sizeof(*c)); grpc_channel_args* lb_policy_args) {
gpr_ref_init(&c->refs, 1); grpc_resolver_result* result = gpr_malloc(sizeof(*result));
return c; memset(result, 0, sizeof(*result));
gpr_ref_init(&result->refs, 1);
result->addresses = addresses;
result->lb_policy_name = gpr_strdup(lb_policy_name);
result->lb_policy_args = lb_policy_args;
return result;
} }
void grpc_resolver_result_ref(grpc_resolver_result* c) { gpr_ref(&c->refs); } void grpc_resolver_result_ref(grpc_resolver_result* result) {
gpr_ref(&result->refs);
}
void grpc_resolver_result_unref(grpc_exec_ctx* exec_ctx, void grpc_resolver_result_unref(grpc_exec_ctx* exec_ctx,
grpc_resolver_result* c) { grpc_resolver_result* result) {
if (gpr_unref(&c->refs)) { if (gpr_unref(&result->refs)) {
if (c->lb_policy != NULL) { grpc_lb_addresses_destroy(result->addresses, NULL /* user_data_destroy */);
GRPC_LB_POLICY_UNREF(exec_ctx, c->lb_policy, "resolver_result"); gpr_free(result->lb_policy_name);
} grpc_channel_args_destroy(result->lb_policy_args);
gpr_free(c); gpr_free(result);
} }
} }
void grpc_resolver_result_set_lb_policy(grpc_resolver_result* c, grpc_lb_addresses* grpc_resolver_result_get_addresses(
grpc_lb_policy* lb_policy) { grpc_resolver_result* result) {
GPR_ASSERT(c->lb_policy == NULL); return result->addresses;
if (lb_policy) { }
GRPC_LB_POLICY_REF(lb_policy, "resolver_result");
} const char* grpc_resolver_result_get_lb_policy_name(
c->lb_policy = lb_policy; grpc_resolver_result* result) {
return result->lb_policy_name;
} }
grpc_lb_policy* grpc_resolver_result_get_lb_policy(grpc_resolver_result* c) { grpc_channel_args* grpc_resolver_result_get_lb_policy_args(
return c->lb_policy; grpc_resolver_result* result) {
return result->lb_policy_args;
} }

@ -32,22 +32,40 @@
#ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H #ifndef GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H
#define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H #define GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H
#include <stdbool.h> #include "src/core/ext/client_config/lb_policy_factory.h"
#include "src/core/ext/client_config/lb_policy.h"
#include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/resolve_address.h"
// TODO(roth, ctiller): In the long term, we are considering replacing
// the resolver_result data structure with grpc_channel_args. The idea is
// that the resolver will return a set of channel args that contains the
// information that is currently in the resolver_result struct. For
// example, there will be specific args indicating the set of addresses
// and the name of the LB policy to instantiate. Note that if we did
// this, we would probably want to change the data structure of
// grpc_channel_args such to a hash table or AVL or some other data
// structure that does not require linear search to find keys.
/// Results reported from a grpc_resolver. /// Results reported from a grpc_resolver.
typedef struct grpc_resolver_result grpc_resolver_result; typedef struct grpc_resolver_result grpc_resolver_result;
grpc_resolver_result* grpc_resolver_result_create(); /// Takes ownership of \a addresses and \a lb_policy_args.
grpc_resolver_result* grpc_resolver_result_create(
grpc_lb_addresses* addresses, const char* lb_policy_name,
grpc_channel_args* lb_policy_args);
void grpc_resolver_result_ref(grpc_resolver_result* result); void grpc_resolver_result_ref(grpc_resolver_result* result);
void grpc_resolver_result_unref(grpc_exec_ctx* exec_ctx, void grpc_resolver_result_unref(grpc_exec_ctx* exec_ctx,
grpc_resolver_result* result); grpc_resolver_result* result);
void grpc_resolver_result_set_lb_policy(grpc_resolver_result* result, /// Caller does NOT take ownership of result.
grpc_lb_policy* lb_policy); grpc_lb_addresses* grpc_resolver_result_get_addresses(
grpc_lb_policy* grpc_resolver_result_get_lb_policy( grpc_resolver_result* result);
/// Caller does NOT take ownership of result.
const char* grpc_resolver_result_get_lb_policy_name(
grpc_resolver_result* result);
/// Caller does NOT take ownership of result.
grpc_channel_args* grpc_resolver_result_get_lb_policy_args(
grpc_resolver_result* result); grpc_resolver_result* result);
#endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H */ #endif /* GRPC_CORE_EXT_CLIENT_CONFIG_RESOLVER_RESULT_H */

@ -37,7 +37,6 @@
#include <grpc/support/host_port.h> #include <grpc/support/host_port.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/ext/client_config/lb_policy_registry.h"
#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/client_config/resolver_registry.h"
#include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer.h"
@ -58,8 +57,6 @@ typedef struct {
char *name; char *name;
/** default port to use */ /** default port to use */
char *default_port; char *default_port;
/** subchannel factory */
grpc_client_channel_factory *client_channel_factory;
/** load balancing policy name */ /** load balancing policy name */
char *lb_policy_name; char *lb_policy_name;
@ -166,31 +163,20 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) { grpc_error *error) {
dns_resolver *r = arg; dns_resolver *r = arg;
grpc_resolver_result *result = NULL; grpc_resolver_result *result = NULL;
grpc_lb_policy *lb_policy;
gpr_mu_lock(&r->mu); gpr_mu_lock(&r->mu);
GPR_ASSERT(r->resolving); GPR_ASSERT(r->resolving);
r->resolving = 0; r->resolving = 0;
if (r->addresses != NULL) { if (r->addresses != NULL) {
grpc_lb_policy_args lb_policy_args; grpc_lb_addresses *addresses =
memset(&lb_policy_args, 0, sizeof(lb_policy_args)); grpc_lb_addresses_create(r->addresses->naddrs);
lb_policy_args.addresses = grpc_lb_addresses_create(r->addresses->naddrs);
for (size_t i = 0; i < r->addresses->naddrs; ++i) { for (size_t i = 0; i < r->addresses->naddrs; ++i) {
grpc_lb_addresses_set_address( grpc_lb_addresses_set_address(
lb_policy_args.addresses, i, &r->addresses->addrs[i].addr, addresses, i, &r->addresses->addrs[i].addr,
r->addresses->addrs[i].len, false /* is_balancer */, r->addresses->addrs[i].len, false /* is_balancer */,
NULL /* balancer_name */, NULL /* user_data */); NULL /* balancer_name */, NULL /* user_data */);
} }
grpc_resolved_addresses_destroy(r->addresses); grpc_resolved_addresses_destroy(r->addresses);
lb_policy_args.client_channel_factory = r->client_channel_factory; result = grpc_resolver_result_create(addresses, r->lb_policy_name, NULL);
lb_policy =
grpc_lb_policy_create(exec_ctx, r->lb_policy_name, &lb_policy_args);
grpc_lb_addresses_destroy(lb_policy_args.addresses,
NULL /* user_data_destroy */);
result = grpc_resolver_result_create();
if (lb_policy != NULL) {
grpc_resolver_result_set_lb_policy(result, lb_policy);
GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "construction");
}
} else { } else {
gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
gpr_timespec next_try = gpr_backoff_step(&r->backoff_state, now); gpr_timespec next_try = gpr_backoff_step(&r->backoff_state, now);
@ -251,7 +237,6 @@ static void dns_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) {
if (r->resolved_result) { if (r->resolved_result) {
grpc_resolver_result_unref(exec_ctx, r->resolved_result); grpc_resolver_result_unref(exec_ctx, r->resolved_result);
} }
grpc_client_channel_factory_unref(exec_ctx, r->client_channel_factory);
gpr_free(r->name); gpr_free(r->name);
gpr_free(r->default_port); gpr_free(r->default_port);
gpr_free(r->lb_policy_name); gpr_free(r->lb_policy_name);
@ -278,10 +263,8 @@ static grpc_resolver *dns_create(grpc_resolver_args *args,
grpc_resolver_init(&r->base, &dns_resolver_vtable); grpc_resolver_init(&r->base, &dns_resolver_vtable);
r->name = gpr_strdup(path); r->name = gpr_strdup(path);
r->default_port = gpr_strdup(default_port); r->default_port = gpr_strdup(default_port);
r->client_channel_factory = args->client_channel_factory;
gpr_backoff_init(&r->backoff_state, BACKOFF_MULTIPLIER, BACKOFF_JITTER, gpr_backoff_init(&r->backoff_state, BACKOFF_MULTIPLIER, BACKOFF_JITTER,
BACKOFF_MIN_SECONDS * 1000, BACKOFF_MAX_SECONDS * 1000); BACKOFF_MIN_SECONDS * 1000, BACKOFF_MAX_SECONDS * 1000);
grpc_client_channel_factory_ref(r->client_channel_factory);
r->lb_policy_name = gpr_strdup(lb_policy_name); r->lb_policy_name = gpr_strdup(lb_policy_name);
return &r->base; return &r->base;
} }

@ -40,7 +40,6 @@
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/ext/client_config/lb_policy_registry.h"
#include "src/core/ext/client_config/parse_address.h" #include "src/core/ext/client_config/parse_address.h"
#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/client_config/resolver_registry.h"
#include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/resolve_address.h"
@ -52,8 +51,6 @@ typedef struct {
grpc_resolver base; grpc_resolver base;
/** refcount */ /** refcount */
gpr_refcount refs; gpr_refcount refs;
/** subchannel factory */
grpc_client_channel_factory *client_channel_factory;
/** load balancing policy name */ /** load balancing policy name */
char *lb_policy_name; char *lb_policy_name;
@ -122,17 +119,10 @@ static void sockaddr_next(grpc_exec_ctx *exec_ctx, grpc_resolver *resolver,
static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx, static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
sockaddr_resolver *r) { sockaddr_resolver *r) {
if (r->next_completion != NULL && !r->published) { if (r->next_completion != NULL && !r->published) {
grpc_resolver_result *result = grpc_resolver_result_create();
grpc_lb_policy_args lb_policy_args;
memset(&lb_policy_args, 0, sizeof(lb_policy_args));
lb_policy_args.addresses = r->addresses;
lb_policy_args.client_channel_factory = r->client_channel_factory;
grpc_lb_policy *lb_policy =
grpc_lb_policy_create(exec_ctx, r->lb_policy_name, &lb_policy_args);
grpc_resolver_result_set_lb_policy(result, lb_policy);
GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "sockaddr");
r->published = true; r->published = true;
*r->target_result = result; *r->target_result = grpc_resolver_result_create(
grpc_lb_addresses_copy(r->addresses, NULL /* user_data_copy */),
r->lb_policy_name, NULL);
grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL); grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL);
r->next_completion = NULL; r->next_completion = NULL;
} }
@ -141,7 +131,6 @@ static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) { static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) {
sockaddr_resolver *r = (sockaddr_resolver *)gr; sockaddr_resolver *r = (sockaddr_resolver *)gr;
gpr_mu_destroy(&r->mu); gpr_mu_destroy(&r->mu);
grpc_client_channel_factory_unref(exec_ctx, r->client_channel_factory);
grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */); grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */);
gpr_free(r->lb_policy_name); gpr_free(r->lb_policy_name);
gpr_free(r); gpr_free(r);
@ -243,8 +232,6 @@ static grpc_resolver *sockaddr_create(
gpr_ref_init(&r->refs, 1); gpr_ref_init(&r->refs, 1);
gpr_mu_init(&r->mu); gpr_mu_init(&r->mu);
grpc_resolver_init(&r->base, &sockaddr_resolver_vtable); grpc_resolver_init(&r->base, &sockaddr_resolver_vtable);
r->client_channel_factory = args->client_channel_factory;
grpc_client_channel_factory_ref(r->client_channel_factory);
return &r->base; return &r->base;
} }

@ -160,7 +160,6 @@ typedef struct {
grpc_client_channel_factory base; grpc_client_channel_factory base;
gpr_refcount refs; gpr_refcount refs;
grpc_channel_args *merge_args; grpc_channel_args *merge_args;
grpc_channel *master;
} client_channel_factory; } client_channel_factory;
static void client_channel_factory_ref( static void client_channel_factory_ref(
@ -173,10 +172,6 @@ static void client_channel_factory_unref(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory) { grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory) {
client_channel_factory *f = (client_channel_factory *)cc_factory; client_channel_factory *f = (client_channel_factory *)cc_factory;
if (gpr_unref(&f->refs)) { if (gpr_unref(&f->refs)) {
if (f->master != NULL) {
GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, f->master,
"client_channel_factory");
}
grpc_channel_args_destroy(f->merge_args); grpc_channel_args_destroy(f->merge_args);
gpr_free(f); gpr_free(f);
} }
@ -210,15 +205,15 @@ static grpc_channel *client_channel_factory_create_channel(
grpc_channel *channel = grpc_channel_create(exec_ctx, target, final_args, grpc_channel *channel = grpc_channel_create(exec_ctx, target, final_args,
GRPC_CLIENT_CHANNEL, NULL); GRPC_CLIENT_CHANNEL, NULL);
grpc_channel_args_destroy(final_args); grpc_channel_args_destroy(final_args);
grpc_resolver *resolver = grpc_resolver_create(target, &f->base); grpc_resolver *resolver = grpc_resolver_create(target);
if (!resolver) { if (!resolver) {
GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel, GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel,
"client_channel_factory_create_channel"); "client_channel_factory_create_channel");
return NULL; return NULL;
} }
grpc_client_channel_set_resolver( grpc_client_channel_finish_initialization(
exec_ctx, grpc_channel_get_channel_stack(channel), resolver); exec_ctx, grpc_channel_get_channel_stack(channel), resolver, &f->base);
GRPC_RESOLVER_UNREF(exec_ctx, resolver, "create_channel"); GRPC_RESOLVER_UNREF(exec_ctx, resolver, "create_channel");
return channel; return channel;
@ -250,12 +245,8 @@ grpc_channel *grpc_insecure_channel_create(const char *target,
grpc_channel *channel = client_channel_factory_create_channel( grpc_channel *channel = client_channel_factory_create_channel(
&exec_ctx, &f->base, target, GRPC_CLIENT_CHANNEL_TYPE_REGULAR, NULL); &exec_ctx, &f->base, target, GRPC_CLIENT_CHANNEL_TYPE_REGULAR, NULL);
if (channel != NULL) {
f->master = channel;
GRPC_CHANNEL_INTERNAL_REF(f->master, "grpc_insecure_channel_create");
}
grpc_client_channel_factory_unref(&exec_ctx, &f->base);
grpc_client_channel_factory_unref(&exec_ctx, &f->base);
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);
return channel != NULL ? channel : grpc_lame_client_channel_create( return channel != NULL ? channel : grpc_lame_client_channel_create(

@ -220,7 +220,6 @@ typedef struct {
gpr_refcount refs; gpr_refcount refs;
grpc_channel_args *merge_args; grpc_channel_args *merge_args;
grpc_channel_security_connector *security_connector; grpc_channel_security_connector *security_connector;
grpc_channel *master;
} client_channel_factory; } client_channel_factory;
static void client_channel_factory_ref( static void client_channel_factory_ref(
@ -235,10 +234,6 @@ static void client_channel_factory_unref(
if (gpr_unref(&f->refs)) { if (gpr_unref(&f->refs)) {
GRPC_SECURITY_CONNECTOR_UNREF(&f->security_connector->base, GRPC_SECURITY_CONNECTOR_UNREF(&f->security_connector->base,
"client_channel_factory"); "client_channel_factory");
if (f->master != NULL) {
GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, f->master,
"client_channel_factory");
}
grpc_channel_args_destroy(f->merge_args); grpc_channel_args_destroy(f->merge_args);
gpr_free(f); gpr_free(f);
} }
@ -276,10 +271,10 @@ static grpc_channel *client_channel_factory_create_channel(
GRPC_CLIENT_CHANNEL, NULL); GRPC_CLIENT_CHANNEL, NULL);
grpc_channel_args_destroy(final_args); grpc_channel_args_destroy(final_args);
grpc_resolver *resolver = grpc_resolver_create(target, &f->base); grpc_resolver *resolver = grpc_resolver_create(target);
if (resolver != NULL) { if (resolver != NULL) {
grpc_client_channel_set_resolver( grpc_client_channel_finish_initialization(
exec_ctx, grpc_channel_get_channel_stack(channel), resolver); exec_ctx, grpc_channel_get_channel_stack(channel), resolver, &f->base);
GRPC_RESOLVER_UNREF(exec_ctx, resolver, "create"); GRPC_RESOLVER_UNREF(exec_ctx, resolver, "create");
} else { } else {
GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel, GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel,
@ -356,10 +351,6 @@ grpc_channel *grpc_secure_channel_create(grpc_channel_credentials *creds,
grpc_channel *channel = client_channel_factory_create_channel( grpc_channel *channel = client_channel_factory_create_channel(
&exec_ctx, &f->base, target, GRPC_CLIENT_CHANNEL_TYPE_REGULAR, NULL); &exec_ctx, &f->base, target, GRPC_CLIENT_CHANNEL_TYPE_REGULAR, NULL);
if (channel != NULL) {
f->master = channel;
GRPC_CHANNEL_INTERNAL_REF(f->master, "grpc_secure_channel_create");
}
grpc_client_channel_factory_unref(&exec_ctx, &f->base); grpc_client_channel_factory_unref(&exec_ctx, &f->base);
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);

@ -182,6 +182,7 @@ class BaseStub
} else { } else {
$hostname = $this->hostname; $hostname = $this->hostname;
} }
return 'https://'.$hostname.$service_name; return 'https://'.$hostname.$service_name;
} }

@ -70,7 +70,8 @@ function hardAssertIfStatusOk($status)
*/ */
function emptyUnary($stub) function emptyUnary($stub)
{ {
list($result, $status) = $stub->EmptyCall(new grpc\testing\EmptyMessage())->wait(); list($result, $status) =
$stub->EmptyCall(new grpc\testing\EmptyMessage())->wait();
hardAssertIfStatusOk($status); hardAssertIfStatusOk($status);
hardAssert($result !== null, 'Call completed with a null response'); hardAssert($result !== null, 'Call completed with a null response');
} }
@ -92,8 +93,8 @@ function largeUnary($stub)
* @param $fillUsername boolean whether to fill result with username * @param $fillUsername boolean whether to fill result with username
* @param $fillOauthScope boolean whether to fill result with oauth scope * @param $fillOauthScope boolean whether to fill result with oauth scope
*/ */
function performLargeUnary($stub, $fillUsername = false, $fillOauthScope = false, function performLargeUnary($stub, $fillUsername = false,
$callback = false) $fillOauthScope = false, $callback = false)
{ {
$request_len = 271828; $request_len = 271828;
$response_len = 314159; $response_len = 314159;
@ -118,11 +119,11 @@ function performLargeUnary($stub, $fillUsername = false, $fillOauthScope = false
hardAssert($result !== null, 'Call returned a null response'); hardAssert($result !== null, 'Call returned a null response');
$payload = $result->getPayload(); $payload = $result->getPayload();
hardAssert($payload->getType() === grpc\testing\PayloadType::COMPRESSABLE, hardAssert($payload->getType() === grpc\testing\PayloadType::COMPRESSABLE,
'Payload had the wrong type'); 'Payload had the wrong type');
hardAssert(strlen($payload->getBody()) === $response_len, hardAssert(strlen($payload->getBody()) === $response_len,
'Payload had the wrong length'); 'Payload had the wrong length');
hardAssert($payload->getBody() === str_repeat("\0", $response_len), hardAssert($payload->getBody() === str_repeat("\0", $response_len),
'Payload had the wrong content'); 'Payload had the wrong content');
return $result; return $result;
} }
@ -141,11 +142,12 @@ function serviceAccountCreds($stub, $args)
$jsonKey = json_decode( $jsonKey = json_decode(
file_get_contents(getenv(CredentialsLoader::ENV_VAR)), file_get_contents(getenv(CredentialsLoader::ENV_VAR)),
true); true);
$result = performLargeUnary($stub, $fillUsername = true, $fillOauthScope = true); $result = performLargeUnary($stub, $fillUsername = true,
hardAssert($result->getUsername() == $jsonKey['client_email'], $fillOauthScope = true);
'invalid email returned'); hardAssert($result->getUsername() === $jsonKey['client_email'],
'invalid email returned');
hardAssert(strpos($args['oauth_scope'], $result->getOauthScope()) !== false, hardAssert(strpos($args['oauth_scope'], $result->getOauthScope()) !== false,
'invalid oauth scope returned'); 'invalid oauth scope returned');
} }
/** /**
@ -163,9 +165,10 @@ function computeEngineCreds($stub, $args)
if (!array_key_exists('default_service_account', $args)) { if (!array_key_exists('default_service_account', $args)) {
throw new Exception('Missing default_service_account'); throw new Exception('Missing default_service_account');
} }
$result = performLargeUnary($stub, $fillUsername = true, $fillOauthScope = true); $result = performLargeUnary($stub, $fillUsername = true,
hardAssert($args['default_service_account'] == $result->getUsername(), $fillOauthScope = true);
'invalid email returned'); hardAssert($args['default_service_account'] === $result->getUsername(),
'invalid email returned');
} }
/** /**
@ -179,9 +182,10 @@ function jwtTokenCreds($stub, $args)
$jsonKey = json_decode( $jsonKey = json_decode(
file_get_contents(getenv(CredentialsLoader::ENV_VAR)), file_get_contents(getenv(CredentialsLoader::ENV_VAR)),
true); true);
$result = performLargeUnary($stub, $fillUsername = true, $fillOauthScope = true); $result = performLargeUnary($stub, $fillUsername = true,
hardAssert($result->getUsername() == $jsonKey['client_email'], $fillOauthScope = true);
'invalid email returned'); hardAssert($result->getUsername() === $jsonKey['client_email'],
'invalid email returned');
} }
/** /**
@ -195,9 +199,10 @@ function oauth2AuthToken($stub, $args)
$jsonKey = json_decode( $jsonKey = json_decode(
file_get_contents(getenv(CredentialsLoader::ENV_VAR)), file_get_contents(getenv(CredentialsLoader::ENV_VAR)),
true); true);
$result = performLargeUnary($stub, $fillUsername = true, $fillOauthScope = true); $result = performLargeUnary($stub, $fillUsername = true,
hardAssert($result->getUsername() == $jsonKey['client_email'], $fillOauthScope = true);
'invalid email returned'); hardAssert($result->getUsername() === $jsonKey['client_email'],
'invalid email returned');
} }
function updateAuthMetadataCallback($context) function updateAuthMetadataCallback($context)
@ -209,8 +214,9 @@ function updateAuthMetadataCallback($context)
$metadata = []; $metadata = [];
$result = $auth_credentials->updateMetadata([], $authUri); $result = $auth_credentials->updateMetadata([], $authUri);
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$metadata[strtolower($key)] = $value; $metadata[strtolower($key)] = $value;
} }
return $metadata; return $metadata;
} }
@ -226,10 +232,11 @@ function perRpcCreds($stub, $args)
file_get_contents(getenv(CredentialsLoader::ENV_VAR)), file_get_contents(getenv(CredentialsLoader::ENV_VAR)),
true); true);
$result = performLargeUnary($stub, $fillUsername = true, $fillOauthScope = true, $result = performLargeUnary($stub, $fillUsername = true,
$fillOauthScope = true,
'updateAuthMetadataCallback'); 'updateAuthMetadataCallback');
hardAssert($result->getUsername() == $jsonKey['client_email'], hardAssert($result->getUsername() === $jsonKey['client_email'],
'invalid email returned'); 'invalid email returned');
} }
/** /**
@ -258,7 +265,7 @@ function clientStreaming($stub)
list($result, $status) = $call->wait(); list($result, $status) = $call->wait();
hardAssertIfStatusOk($status); hardAssertIfStatusOk($status);
hardAssert($result->getAggregatedPayloadSize() === 74922, hardAssert($result->getAggregatedPayloadSize() === 74922,
'aggregated_payload_size was incorrect'); 'aggregated_payload_size was incorrect');
} }
/** /**
@ -283,10 +290,11 @@ function serverStreaming($stub)
foreach ($call->responses() as $value) { foreach ($call->responses() as $value) {
hardAssert($i < 4, 'Too many responses'); hardAssert($i < 4, 'Too many responses');
$payload = $value->getPayload(); $payload = $value->getPayload();
hardAssert($payload->getType() === grpc\testing\PayloadType::COMPRESSABLE, hardAssert(
'Payload '.$i.' had the wrong type'); $payload->getType() === grpc\testing\PayloadType::COMPRESSABLE,
'Payload '.$i.' had the wrong type');
hardAssert(strlen($payload->getBody()) === $sizes[$i], hardAssert(strlen($payload->getBody()) === $sizes[$i],
'Response '.$i.' had the wrong length'); 'Response '.$i.' had the wrong length');
$i += 1; $i += 1;
} }
hardAssertIfStatusOk($call->getStatus()); hardAssertIfStatusOk($call->getStatus());
@ -318,10 +326,11 @@ function pingPong($stub)
hardAssert($response !== null, 'Server returned too few responses'); hardAssert($response !== null, 'Server returned too few responses');
$payload = $response->getPayload(); $payload = $response->getPayload();
hardAssert($payload->getType() === grpc\testing\PayloadType::COMPRESSABLE, hardAssert(
'Payload '.$i.' had the wrong type'); $payload->getType() === grpc\testing\PayloadType::COMPRESSABLE,
'Payload '.$i.' had the wrong type');
hardAssert(strlen($payload->getBody()) === $response_lengths[$i], hardAssert(strlen($payload->getBody()) === $response_lengths[$i],
'Payload '.$i.' had the wrong length'); 'Payload '.$i.' had the wrong length');
} }
$call->writesDone(); $call->writesDone();
hardAssert($call->read() === null, 'Server returned too many responses'); hardAssert($call->read() === null, 'Server returned too many responses');
@ -352,7 +361,7 @@ function cancelAfterBegin($stub)
$call->cancel(); $call->cancel();
list($result, $status) = $call->wait(); list($result, $status) = $call->wait();
hardAssert($status->code === Grpc\STATUS_CANCELLED, hardAssert($status->code === Grpc\STATUS_CANCELLED,
'Call status was not CANCELLED'); 'Call status was not CANCELLED');
} }
/** /**
@ -377,7 +386,7 @@ function cancelAfterFirstResponse($stub)
$call->cancel(); $call->cancel();
hardAssert($call->getStatus()->code === Grpc\STATUS_CANCELLED, hardAssert($call->getStatus()->code === Grpc\STATUS_CANCELLED,
'Call status was not CANCELLED'); 'Call status was not CANCELLED');
} }
function timeoutOnSleepingServer($stub) function timeoutOnSleepingServer($stub)
@ -396,7 +405,7 @@ function timeoutOnSleepingServer($stub)
$response = $call->read(); $response = $call->read();
hardAssert($call->getStatus()->code === Grpc\STATUS_DEADLINE_EXCEEDED, hardAssert($call->getStatus()->code === Grpc\STATUS_DEADLINE_EXCEEDED,
'Call status was not DEADLINE_EXCEEDED'); 'Call status was not DEADLINE_EXCEEDED');
} }
function customMetadata($stub) function customMetadata($stub)
@ -425,9 +434,9 @@ function customMetadata($stub)
$initial_metadata = $call->getMetadata(); $initial_metadata = $call->getMetadata();
hardAssert(array_key_exists($ECHO_INITIAL_KEY, $initial_metadata), hardAssert(array_key_exists($ECHO_INITIAL_KEY, $initial_metadata),
'Initial metadata does not contain expected key'); 'Initial metadata does not contain expected key');
hardAssert($initial_metadata[$ECHO_INITIAL_KEY][0] == hardAssert(
$ECHO_INITIAL_VALUE, $initial_metadata[$ECHO_INITIAL_KEY][0] === $ECHO_INITIAL_VALUE,
'Incorrect initial metadata value'); 'Incorrect initial metadata value');
list($result, $status) = $call->wait(); list($result, $status) = $call->wait();
hardAssertIfStatusOk($status); hardAssertIfStatusOk($status);
@ -435,8 +444,9 @@ function customMetadata($stub)
$trailing_metadata = $call->getTrailingMetadata(); $trailing_metadata = $call->getTrailingMetadata();
hardAssert(array_key_exists($ECHO_TRAILING_KEY, $trailing_metadata), hardAssert(array_key_exists($ECHO_TRAILING_KEY, $trailing_metadata),
'Trailing metadata does not contain expected key'); 'Trailing metadata does not contain expected key');
hardAssert($trailing_metadata[$ECHO_TRAILING_KEY][0] == hardAssert(
$ECHO_TRAILING_VALUE, 'Incorrect trailing metadata value'); $trailing_metadata[$ECHO_TRAILING_KEY][0] === $ECHO_TRAILING_VALUE,
'Incorrect trailing metadata value');
$streaming_call = $stub->FullDuplexCall($metadata); $streaming_call = $stub->FullDuplexCall($metadata);
@ -451,7 +461,7 @@ function customMetadata($stub)
hardAssert(array_key_exists($ECHO_TRAILING_KEY, hardAssert(array_key_exists($ECHO_TRAILING_KEY,
$streaming_trailing_metadata), $streaming_trailing_metadata),
'Trailing metadata does not contain expected key'); 'Trailing metadata does not contain expected key');
hardAssert($streaming_trailing_metadata[$ECHO_TRAILING_KEY][0] == hardAssert($streaming_trailing_metadata[$ECHO_TRAILING_KEY][0] ===
$ECHO_TRAILING_VALUE, 'Incorrect trailing metadata value'); $ECHO_TRAILING_VALUE, 'Incorrect trailing metadata value');
} }
@ -506,7 +516,7 @@ function _makeStub($args)
throw new Exception('Missing argument: --test_case is required'); throw new Exception('Missing argument: --test_case is required');
} }
if ($args['server_port'] == 443) { if ($args['server_port'] === 443) {
$server_address = $args['server_host']; $server_address = $args['server_host'];
} else { } else {
$server_address = $args['server_host'].':'.$args['server_port']; $server_address = $args['server_host'].':'.$args['server_port'];
@ -548,7 +558,7 @@ function _makeStub($args)
if (in_array($test_case, ['service_account_creds', if (in_array($test_case, ['service_account_creds',
'compute_engine_creds', 'jwt_token_creds', ])) { 'compute_engine_creds', 'jwt_token_creds', ])) {
if ($test_case == 'jwt_token_creds') { if ($test_case === 'jwt_token_creds') {
$auth_credentials = ApplicationDefaultCredentials::getCredentials(); $auth_credentials = ApplicationDefaultCredentials::getCredentials();
} else { } else {
$auth_credentials = ApplicationDefaultCredentials::getCredentials( $auth_credentials = ApplicationDefaultCredentials::getCredentials(
@ -558,7 +568,7 @@ function _makeStub($args)
$opts['update_metadata'] = $auth_credentials->getUpdateMetadataFunc(); $opts['update_metadata'] = $auth_credentials->getUpdateMetadataFunc();
} }
if ($test_case == 'oauth2_auth_token') { if ($test_case === 'oauth2_auth_token') {
$auth_credentials = ApplicationDefaultCredentials::getCredentials( $auth_credentials = ApplicationDefaultCredentials::getCredentials(
$args['oauth_scope'] $args['oauth_scope']
); );
@ -578,8 +588,9 @@ function _makeStub($args)
$opts['update_metadata'] = $update_metadata; $opts['update_metadata'] = $update_metadata;
} }
if ($test_case == 'unimplemented_method') { if ($test_case === 'unimplemented_method') {
$stub = new grpc\testing\UnimplementedServiceClient($server_address, $opts); $stub = new grpc\testing\UnimplementedServiceClient($server_address,
$opts);
} else { } else {
$stub = new grpc\testing\TestServiceClient($server_address, $opts); $stub = new grpc\testing\TestServiceClient($server_address, $opts);
} }
@ -656,7 +667,8 @@ function interop_main($args, $stub = false)
return $stub; return $stub;
} }
if (isset($_SERVER['PHP_SELF']) && preg_match('/interop_client/', $_SERVER['PHP_SELF'])) { if (isset($_SERVER['PHP_SELF']) &&
preg_match('/interop_client/', $_SERVER['PHP_SELF'])) {
$args = getopt('', ['server_host:', 'server_port:', 'test_case:', $args = getopt('', ['server_host:', 'server_port:', 'test_case:',
'use_tls::', 'use_test_ca::', 'use_tls::', 'use_test_ca::',
'server_host_override:', 'oauth_scope:', 'server_host_override:', 'oauth_scope:',

@ -170,7 +170,7 @@ class CallCredentials2Test extends PHPUnit_Framework_TestCase
$this->assertTrue(is_string($context->service_url)); $this->assertTrue(is_string($context->service_url));
$this->assertTrue(is_string($context->method_name)); $this->assertTrue(is_string($context->method_name));
return "a string"; return 'a string';
} }
public function testCallbackWithInvalidReturnValue() public function testCallbackWithInvalidReturnValue()
@ -196,5 +196,4 @@ class CallCredentials2Test extends PHPUnit_Framework_TestCase
$this->assertTrue($event->send_close); $this->assertTrue($event->send_close);
$this->assertTrue($event->status->code == Grpc\STATUS_UNAUTHENTICATED); $this->assertTrue($event->status->code == Grpc\STATUS_UNAUTHENTICATED);
} }
} }

@ -1189,7 +1189,7 @@ def insecure_channel(target, options=None):
A Channel to the target through which RPCs may be conducted. A Channel to the target through which RPCs may be conducted.
""" """
from grpc import _channel from grpc import _channel
return _channel.Channel(target, options, None) return _channel.Channel(target, () if options is None else options, None)
def secure_channel(target, credentials, options=None): def secure_channel(target, credentials, options=None):
@ -1205,10 +1205,11 @@ def secure_channel(target, credentials, options=None):
A Channel to the target through which RPCs may be conducted. A Channel to the target through which RPCs may be conducted.
""" """
from grpc import _channel from grpc import _channel
return _channel.Channel(target, options, credentials._credentials) return _channel.Channel(target, () if options is None else options,
credentials._credentials)
def server(thread_pool, handlers=None): def server(thread_pool, handlers=None, options=None):
"""Creates a Server with which RPCs can be serviced. """Creates a Server with which RPCs can be serviced.
Args: Args:
@ -1219,12 +1220,15 @@ def server(thread_pool, handlers=None):
only handlers the server will use to service RPCs; other handlers may only handlers the server will use to service RPCs; other handlers may
later be added by calling add_generic_rpc_handlers any time before the later be added by calling add_generic_rpc_handlers any time before the
returned Server is started. returned Server is started.
options: A sequence of string-value pairs according to which to configure
the created server.
Returns: Returns:
A Server with which RPCs can be serviced. A Server with which RPCs can be serviced.
""" """
from grpc import _server from grpc import _server
return _server.Server(thread_pool, () if handlers is None else handlers) return _server.Server(thread_pool, () if handlers is None else handlers,
() if options is None else options)
################################### __all__ ################################# ################################### __all__ #################################

@ -842,18 +842,8 @@ def _unsubscribe(state, callback):
def _options(options): def _options(options):
if options is None: return list(options) + [
pairs = ((cygrpc.ChannelArgKey.primary_user_agent_string, _USER_AGENT),) (cygrpc.ChannelArgKey.primary_user_agent_string, _USER_AGENT)]
else:
pairs = list(options) + [
(cygrpc.ChannelArgKey.primary_user_agent_string, _USER_AGENT)]
encoded_pairs = [
(_common.encode(arg_name), arg_value) if isinstance(arg_value, int)
else (_common.encode(arg_name), _common.encode(arg_value))
for arg_name, arg_value in pairs]
return cygrpc.ChannelArgs([
cygrpc.ChannelArg(arg_name, arg_value)
for arg_name, arg_value in encoded_pairs])
class Channel(grpc.Channel): class Channel(grpc.Channel):
@ -867,7 +857,8 @@ class Channel(grpc.Channel):
credentials: A cygrpc.ChannelCredentials or None. credentials: A cygrpc.ChannelCredentials or None.
""" """
self._channel = cygrpc.Channel( self._channel = cygrpc.Channel(
_common.encode(target), _options(options), credentials) _common.encode(target), _common.channel_args(_options(options)),
credentials)
self._call_state = _ChannelCallState(self._channel) self._call_state = _ChannelCallState(self._channel)
self._connectivity_state = _ChannelConnectivityState(self._channel) self._connectivity_state = _ChannelConnectivityState(self._channel)

@ -94,6 +94,16 @@ def decode(b):
return b.decode('latin1') return b.decode('latin1')
def channel_args(options):
channel_args = []
for key, value in options:
if isinstance(value, six.string_types):
channel_args.append(cygrpc.ChannelArg(encode(key), encode(value)))
else:
channel_args.append(cygrpc.ChannelArg(encode(key), value))
return cygrpc.ChannelArgs(channel_args)
def cygrpc_metadata(application_metadata): def cygrpc_metadata(application_metadata):
return _EMPTY_METADATA if application_metadata is None else cygrpc.Metadata( return _EMPTY_METADATA if application_metadata is None else cygrpc.Metadata(
cygrpc.Metadatum(encode(key), encode(value)) cygrpc.Metadatum(encode(key), encode(value))

@ -32,15 +32,16 @@ cimport cpython
cdef class Channel: cdef class Channel:
def __cinit__(self, bytes target, ChannelArgs arguments=None, def __cinit__(self, bytes target, ChannelArgs arguments,
ChannelCredentials channel_credentials=None): ChannelCredentials channel_credentials=None):
grpc_init() grpc_init()
cdef grpc_channel_args *c_arguments = NULL cdef grpc_channel_args *c_arguments = NULL
cdef char *c_target = NULL cdef char *c_target = NULL
self.c_channel = NULL self.c_channel = NULL
self.references = [] self.references = []
if arguments is not None: if len(arguments) > 0:
c_arguments = &arguments.c_args c_arguments = &arguments.c_args
self.references.append(arguments)
c_target = target c_target = target
if channel_credentials is None: if channel_credentials is None:
with nogil: with nogil:

@ -34,12 +34,12 @@ import time
cdef class Server: cdef class Server:
def __cinit__(self, ChannelArgs arguments=None): def __cinit__(self, ChannelArgs arguments):
grpc_init() grpc_init()
cdef grpc_channel_args *c_arguments = NULL cdef grpc_channel_args *c_arguments = NULL
self.references = [] self.references = []
self.registered_completion_queues = [] self.registered_completion_queues = []
if arguments is not None: if len(arguments) > 0:
c_arguments = &arguments.c_args c_arguments = &arguments.c_args
self.references.append(arguments) self.references.append(arguments)
with nogil: with nogil:

@ -728,12 +728,11 @@ def _start(state):
cleanup_server, target=_serve, args=(state,)) cleanup_server, target=_serve, args=(state,))
thread.start() thread.start()
class Server(grpc.Server): class Server(grpc.Server):
def __init__(self, thread_pool, generic_handlers): def __init__(self, thread_pool, generic_handlers, options):
completion_queue = cygrpc.CompletionQueue() completion_queue = cygrpc.CompletionQueue()
server = cygrpc.Server() server = cygrpc.Server(_common.channel_args(options))
server.register_completion_queue(completion_queue) server.register_completion_queue(completion_queue)
self._state = _ServerState( self._state = _ServerState(
completion_queue, server, generic_handlers, thread_pool) completion_queue, server, generic_handlers, thread_pool)

@ -268,6 +268,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/census/operation.c', 'src/core/ext/census/operation.c',
'src/core/ext/census/placeholders.c', 'src/core/ext/census/placeholders.c',
'src/core/ext/census/resource.c', 'src/core/ext/census/resource.c',
'src/core/ext/census/trace_context.c',
'src/core/ext/census/tracing.c', 'src/core/ext/census/tracing.c',
'src/core/plugin_registry/grpc_plugin_registry.c', 'src/core/plugin_registry/grpc_plugin_registry.c',
'src/boringssl/err_data.c', 'src/boringssl/err_data.c',

@ -7,6 +7,7 @@
"_beta_features_test.BetaFeaturesTest", "_beta_features_test.BetaFeaturesTest",
"_beta_features_test.ContextManagementAndLifecycleTest", "_beta_features_test.ContextManagementAndLifecycleTest",
"_cancel_many_calls_test.CancelManyCallsTest", "_cancel_many_calls_test.CancelManyCallsTest",
"_channel_args_test.ChannelArgsTest",
"_channel_connectivity_test.ChannelConnectivityTest", "_channel_connectivity_test.ChannelConnectivityTest",
"_channel_ready_future_test.ChannelReadyFutureTest", "_channel_ready_future_test.ChannelReadyFutureTest",
"_channel_test.ChannelTest", "_channel_test.ChannelTest",

@ -0,0 +1,53 @@
# 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.
"""Tests of Channel Args on client/server side."""
import unittest
import grpc
TEST_CHANNEL_ARGS = (
('arg1', b'bytes_val'),
('arg2', 'str_val'),
('arg3', 1),
(b'arg4', 'str_val'),
)
class ChannelArgsTest(unittest.TestCase):
def test_client(self):
grpc.insecure_channel('localhost:8080', options=TEST_CHANNEL_ARGS)
def test_server(self):
grpc.server(None, options=TEST_CHANNEL_ARGS)
if __name__ == '__main__':
unittest.main(verbosity=2)

@ -78,7 +78,7 @@ class ChannelConnectivityTest(unittest.TestCase):
def test_lonely_channel_connectivity(self): def test_lonely_channel_connectivity(self):
callback = _Callback() callback = _Callback()
channel = _channel.Channel('localhost:12345', None, None) channel = _channel.Channel('localhost:12345', (), None)
channel.subscribe(callback.update, try_to_connect=False) channel.subscribe(callback.update, try_to_connect=False)
first_connectivities = callback.block_until_connectivities_satisfy(bool) first_connectivities = callback.block_until_connectivities_satisfy(bool)
channel.subscribe(callback.update, try_to_connect=True) channel.subscribe(callback.update, try_to_connect=True)
@ -105,13 +105,13 @@ class ChannelConnectivityTest(unittest.TestCase):
def test_immediately_connectable_channel_connectivity(self): def test_immediately_connectable_channel_connectivity(self):
thread_pool = _thread_pool.RecordingThreadPool(max_workers=None) thread_pool = _thread_pool.RecordingThreadPool(max_workers=None)
server = _server.Server(thread_pool, ()) server = _server.Server(thread_pool, (), ())
port = server.add_insecure_port('[::]:0') port = server.add_insecure_port('[::]:0')
server.start() server.start()
first_callback = _Callback() first_callback = _Callback()
second_callback = _Callback() second_callback = _Callback()
channel = _channel.Channel('localhost:{}'.format(port), None, None) channel = _channel.Channel('localhost:{}'.format(port), (), None)
channel.subscribe(first_callback.update, try_to_connect=False) channel.subscribe(first_callback.update, try_to_connect=False)
first_connectivities = first_callback.block_until_connectivities_satisfy( first_connectivities = first_callback.block_until_connectivities_satisfy(
bool) bool)
@ -146,12 +146,12 @@ class ChannelConnectivityTest(unittest.TestCase):
def test_reachable_then_unreachable_channel_connectivity(self): def test_reachable_then_unreachable_channel_connectivity(self):
thread_pool = _thread_pool.RecordingThreadPool(max_workers=None) thread_pool = _thread_pool.RecordingThreadPool(max_workers=None)
server = _server.Server(thread_pool, ()) server = _server.Server(thread_pool, (), ())
port = server.add_insecure_port('[::]:0') port = server.add_insecure_port('[::]:0')
server.start() server.start()
callback = _Callback() callback = _Callback()
channel = _channel.Channel('localhost:{}'.format(port), None, None) channel = _channel.Channel('localhost:{}'.format(port), (), None)
channel.subscribe(callback.update, try_to_connect=True) channel.subscribe(callback.update, try_to_connect=True)
callback.block_until_connectivities_satisfy(_ready_in_connectivities) callback.block_until_connectivities_satisfy(_ready_in_connectivities)
# Now take down the server and confirm that channel readiness is repudiated. # Now take down the server and confirm that channel readiness is repudiated.

@ -79,7 +79,7 @@ class ChannelReadyFutureTest(unittest.TestCase):
def test_immediately_connectable_channel_connectivity(self): def test_immediately_connectable_channel_connectivity(self):
thread_pool = _thread_pool.RecordingThreadPool(max_workers=None) thread_pool = _thread_pool.RecordingThreadPool(max_workers=None)
server = _server.Server(thread_pool, ()) server = _server.Server(thread_pool, (), ())
port = server.add_insecure_port('[::]:0') port = server.add_insecure_port('[::]:0')
server.start() server.start()
channel = grpc.insecure_channel('localhost:{}'.format(port)) channel = grpc.insecure_channel('localhost:{}'.format(port))

@ -157,11 +157,12 @@ class CancelManyCallsTest(unittest.TestCase):
server_thread_pool = logging_pool.pool(test_constants.THREAD_CONCURRENCY) server_thread_pool = logging_pool.pool(test_constants.THREAD_CONCURRENCY)
server_completion_queue = cygrpc.CompletionQueue() server_completion_queue = cygrpc.CompletionQueue()
server = cygrpc.Server() server = cygrpc.Server(cygrpc.ChannelArgs([]))
server.register_completion_queue(server_completion_queue) server.register_completion_queue(server_completion_queue)
port = server.add_http2_port(b'[::]:0') port = server.add_http2_port(b'[::]:0')
server.start() server.start()
channel = cygrpc.Channel('localhost:{}'.format(port).encode()) channel = cygrpc.Channel('localhost:{}'.format(port).encode(),
cygrpc.ChannelArgs([]))
state = _State() state = _State()

@ -124,11 +124,12 @@ class ReadSomeButNotAllResponsesTest(unittest.TestCase):
def testReadSomeButNotAllResponses(self): def testReadSomeButNotAllResponses(self):
server_completion_queue = cygrpc.CompletionQueue() server_completion_queue = cygrpc.CompletionQueue()
server = cygrpc.Server() server = cygrpc.Server(cygrpc.ChannelArgs([]))
server.register_completion_queue(server_completion_queue) server.register_completion_queue(server_completion_queue)
port = server.add_http2_port(b'[::]:0') port = server.add_http2_port(b'[::]:0')
server.start() server.start()
channel = cygrpc.Channel('localhost:{}'.format(port).encode()) channel = cygrpc.Channel('localhost:{}'.format(port).encode(),
cygrpc.ChannelArgs([]))
server_shutdown_tag = 'server_shutdown_tag' server_shutdown_tag = 'server_shutdown_tag'
server_driver = _ServerDriver(server_completion_queue, server_shutdown_tag) server_driver = _ServerDriver(server_completion_queue, server_shutdown_tag)

@ -121,7 +121,7 @@ class TypeSmokeTest(unittest.TestCase):
del call_credentials del call_credentials
def testServerStartNoExplicitShutdown(self): def testServerStartNoExplicitShutdown(self):
server = cygrpc.Server() server = cygrpc.Server(cygrpc.ChannelArgs([]))
completion_queue = cygrpc.CompletionQueue() completion_queue = cygrpc.CompletionQueue()
server.register_completion_queue(completion_queue) server.register_completion_queue(completion_queue)
port = server.add_http2_port(b'[::]:0') port = server.add_http2_port(b'[::]:0')
@ -131,7 +131,7 @@ class TypeSmokeTest(unittest.TestCase):
def testServerStartShutdown(self): def testServerStartShutdown(self):
completion_queue = cygrpc.CompletionQueue() completion_queue = cygrpc.CompletionQueue()
server = cygrpc.Server() server = cygrpc.Server(cygrpc.ChannelArgs([]))
server.add_http2_port(b'[::]:0') server.add_http2_port(b'[::]:0')
server.register_completion_queue(completion_queue) server.register_completion_queue(completion_queue)
server.start() server.start()
@ -148,7 +148,7 @@ class ServerClientMixin(object):
def setUpMixin(self, server_credentials, client_credentials, host_override): def setUpMixin(self, server_credentials, client_credentials, host_override):
self.server_completion_queue = cygrpc.CompletionQueue() self.server_completion_queue = cygrpc.CompletionQueue()
self.server = cygrpc.Server() self.server = cygrpc.Server(cygrpc.ChannelArgs([]))
self.server.register_completion_queue(self.server_completion_queue) self.server.register_completion_queue(self.server_completion_queue)
if server_credentials: if server_credentials:
self.port = self.server.add_http2_port(b'[::]:0', server_credentials) self.port = self.server.add_http2_port(b'[::]:0', server_credentials)
@ -164,7 +164,8 @@ class ServerClientMixin(object):
'localhost:{}'.format(self.port).encode(), client_channel_arguments, 'localhost:{}'.format(self.port).encode(), client_channel_arguments,
client_credentials) client_credentials)
else: else:
self.client_channel = cygrpc.Channel('localhost:{}'.format(self.port).encode()) self.client_channel = cygrpc.Channel(
'localhost:{}'.format(self.port).encode(), cygrpc.ChannelArgs([]))
if host_override: if host_override:
self.host_argument = None # default host self.host_argument = None # default host
self.expected_host = host_override self.expected_host = host_override

@ -0,0 +1,3 @@
trace_id { hi : 5; lo : 1 }
span_id : 7
is_sampled : true

@ -0,0 +1,2 @@
trace_id { hi : 5; lo : 1 }
span_id : 7

@ -0,0 +1,2 @@
span_id : 7
is_sampled : true

@ -0,0 +1,2 @@
trace_id { hi : 5; lo : 1 }
is_sampled : true

@ -0,0 +1,231 @@
/*
*
* 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 <grpc/census.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/useful.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include "src/core/ext/census/base_resources.h"
#include "src/core/ext/census/resource.h"
#include "test/core/util/test_config.h"
#include "src/core/ext/census/gen/trace_context.pb.h"
#include "src/core/ext/census/trace_context.h"
#include "third_party/nanopb/pb_decode.h"
#include "third_party/nanopb/pb_encode.h"
#define BUF_SIZE 256
/* Encodes a TraceContext structure (ctxt1) to a buffer, and then decodes it
to a second TraceContext (ctxt2). Validates that the resulting TraceContext
has a span_id, trace_id, and that the values are equal to those in initial
TraceContext. On success, returns true. If encode_trace_context returns 0,
decode_trace_context fails, or the resulting TraceContext is missing a trace_id
or span_id, it will return false. */
bool validate_encode_decode_context(google_trace_TraceContext *ctxt1,
uint8_t *buffer, size_t buf_size) {
google_trace_TraceContext ctxt2 = google_trace_TraceContext_init_zero;
size_t msg_length;
GPR_ASSERT(ctxt1->has_trace_id && ctxt1->has_span_id);
msg_length = encode_trace_context(ctxt1, buffer, buf_size);
if (msg_length == 0) {
return false;
}
if (!decode_trace_context(&ctxt2, buffer, msg_length)) {
return false;
}
if (!ctxt2.has_trace_id || !ctxt2.has_span_id) {
return false;
}
GPR_ASSERT(
ctxt1->trace_id.hi == ctxt2.trace_id.hi &&
ctxt1->trace_id.lo == ctxt2.trace_id.lo &&
ctxt1->span_id == ctxt2.span_id &&
ctxt1->has_is_sampled == ctxt2.has_is_sampled &&
(ctxt1->has_is_sampled ? ctxt1->is_sampled == ctxt2.is_sampled : true));
return true;
}
/* Decodes a proto-encoded TraceContext from a buffer. If decode_trace_context
fails or the resulting TraceContext is missing a trace_id or span_id it will
return false, otherwise returns true. */
bool validate_decode_context(google_trace_TraceContext *ctxt, uint8_t *buffer,
size_t msg_length) {
// Validate the decoding of a context written to buffer.
if (!decode_trace_context(ctxt, buffer, msg_length)) {
return false;
}
if (!ctxt->has_trace_id || !ctxt->has_span_id) {
return false;
}
return true;
}
/* Read an encoded trace context from a file. Validates that the decoding
gives the expected result (succeed). */
static void read_and_validate_context_from_file(google_trace_TraceContext *ctxt,
const char *file,
const bool succeed) {
uint8_t buffer[BUF_SIZE];
FILE *input = fopen(file, "rb");
GPR_ASSERT(input != NULL);
size_t nbytes = fread(buffer, 1, BUF_SIZE, input);
GPR_ASSERT(nbytes <= BUF_SIZE && feof(input) && !ferror(input));
bool res = validate_decode_context(ctxt, buffer, nbytes);
GPR_ASSERT(res == succeed);
GPR_ASSERT(fclose(input) == 0);
}
// Test full proto-buffer.
static void test_full() {
google_trace_TraceContext ctxt = google_trace_TraceContext_init_zero;
read_and_validate_context_from_file(
&ctxt, "test/core/census/data/context_full.pb", true);
}
// Test empty proto-buffer.
static void test_empty() {
google_trace_TraceContext ctxt = google_trace_TraceContext_init_zero;
read_and_validate_context_from_file(
&ctxt, "test/core/census/data/context_empty.pb", false);
}
// Test proto-buffer with only trace_id.
static void test_trace_only() {
google_trace_TraceContext ctxt = google_trace_TraceContext_init_zero;
read_and_validate_context_from_file(
&ctxt, "test/core/census/data/context_trace_only.pb", false);
}
// Test proto-buffer with only span_id.
static void test_span_only() {
google_trace_TraceContext ctxt = google_trace_TraceContext_init_zero;
read_and_validate_context_from_file(
&ctxt, "test/core/census/data/context_span_only.pb", false);
}
// Test proto-buffer without is_sampled value.
static void test_no_sample() {
google_trace_TraceContext ctxt = google_trace_TraceContext_init_zero;
read_and_validate_context_from_file(
&ctxt, "test/core/census/data/context_no_sample.pb", true);
GPR_ASSERT(ctxt.has_is_sampled == false && ctxt.is_sampled == false);
}
static void test_encode_decode() {
uint8_t buffer[BUF_SIZE] = {0};
google_trace_TraceContext ctxt1 = google_trace_TraceContext_init_zero;
ctxt1.has_trace_id = true;
ctxt1.trace_id.has_hi = true;
ctxt1.trace_id.has_lo = true;
ctxt1.trace_id.lo = 1;
ctxt1.trace_id.hi = 2;
ctxt1.has_span_id = true;
ctxt1.span_id = 3;
validate_encode_decode_context(&ctxt1, buffer, sizeof(buffer));
google_trace_TraceContext ctxt2 = google_trace_TraceContext_init_zero;
ctxt2.has_trace_id = true;
ctxt2.trace_id.has_hi = false;
ctxt2.trace_id.has_lo = false;
ctxt2.has_span_id = true;
validate_encode_decode_context(&ctxt2, buffer, sizeof(buffer));
}
// Test a corrupted proto-buffer.
static void test_corrupt() {
uint8_t buffer[BUF_SIZE] = {0};
google_trace_TraceContext ctxt1 = google_trace_TraceContext_init_zero;
size_t msg_length;
ctxt1.has_trace_id = true;
ctxt1.trace_id.has_hi = true;
ctxt1.trace_id.has_lo = true;
ctxt1.trace_id.lo = 1;
ctxt1.trace_id.hi = 2;
ctxt1.has_span_id = true;
ctxt1.span_id = 3;
ctxt1.is_sampled = true;
msg_length = encode_trace_context(&ctxt1, buffer, sizeof(buffer));
/* Corrupt some bytes. 255 (0xFF) should be illegal for the first byte of the
proto encoded object. */
buffer[0] = 255;
bool res = validate_decode_context(&ctxt1, buffer, msg_length);
GPR_ASSERT(res == false);
}
static void test_buffer_size() {
// This buffer is too small, so the encode should fail.
uint8_t buffer[16] = {0};
google_trace_TraceContext ctxt1 = google_trace_TraceContext_init_zero;
size_t msg_length;
ctxt1.has_trace_id = true;
ctxt1.trace_id.has_hi = true;
ctxt1.trace_id.has_lo = true;
ctxt1.trace_id.lo = 1;
ctxt1.trace_id.hi = 2;
ctxt1.has_span_id = true;
ctxt1.span_id = 3;
ctxt1.is_sampled = true;
msg_length = encode_trace_context(&ctxt1, buffer, sizeof(buffer));
GPR_ASSERT(msg_length == 0);
}
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
test_full();
test_empty();
test_trace_only();
test_span_only();
test_encode_decode();
test_corrupt();
test_no_sample();
test_buffer_size();
return 0;
}

@ -41,29 +41,6 @@
#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer.h"
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
static void client_channel_factory_ref(grpc_client_channel_factory *scv) {}
static void client_channel_factory_unref(grpc_exec_ctx *exec_ctx,
grpc_client_channel_factory *scv) {}
static grpc_subchannel *client_channel_factory_create_subchannel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory,
grpc_subchannel_args *args) {
return NULL;
}
static grpc_channel *client_channel_factory_create_channel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
const char *target, grpc_client_channel_type type,
grpc_channel_args *args) {
GPR_UNREACHABLE_CODE(return NULL);
}
static const grpc_client_channel_factory_vtable sc_vtable = {
client_channel_factory_ref, client_channel_factory_unref,
client_channel_factory_create_subchannel,
client_channel_factory_create_channel};
static grpc_client_channel_factory cc_factory = {&sc_vtable};
static gpr_mu g_mu; static gpr_mu g_mu;
static bool g_fail_resolution = true; static bool g_fail_resolution = true;
@ -92,7 +69,6 @@ static grpc_resolver *create_resolver(const char *name) {
grpc_resolver_args args; grpc_resolver_args args;
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
args.uri = uri; args.uri = uri;
args.client_channel_factory = &cc_factory;
grpc_resolver *resolver = grpc_resolver *resolver =
grpc_resolver_factory_create_resolver(factory, &args); grpc_resolver_factory_create_resolver(factory, &args);
grpc_resolver_factory_unref(factory); grpc_resolver_factory_unref(factory);

@ -38,29 +38,6 @@
#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/client_config/resolver_registry.h"
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
static void client_channel_factory_ref(grpc_client_channel_factory *scv) {}
static void client_channel_factory_unref(grpc_exec_ctx *exec_ctx,
grpc_client_channel_factory *scv) {}
static grpc_subchannel *client_channel_factory_create_subchannel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory,
grpc_subchannel_args *args) {
GPR_UNREACHABLE_CODE(return NULL);
}
static grpc_channel *client_channel_factory_create_channel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
const char *target, grpc_client_channel_type type,
grpc_channel_args *args) {
GPR_UNREACHABLE_CODE(return NULL);
}
static const grpc_client_channel_factory_vtable sc_vtable = {
client_channel_factory_ref, client_channel_factory_unref,
client_channel_factory_create_subchannel,
client_channel_factory_create_channel};
static grpc_client_channel_factory cc_factory = {&sc_vtable};
static void test_succeeds(grpc_resolver_factory *factory, const char *string) { static void test_succeeds(grpc_resolver_factory *factory, const char *string) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_uri *uri = grpc_uri_parse(string, 0); grpc_uri *uri = grpc_uri_parse(string, 0);
@ -71,7 +48,6 @@ static void test_succeeds(grpc_resolver_factory *factory, const char *string) {
GPR_ASSERT(uri); GPR_ASSERT(uri);
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
args.uri = uri; args.uri = uri;
args.client_channel_factory = &cc_factory;
resolver = grpc_resolver_factory_create_resolver(factory, &args); resolver = grpc_resolver_factory_create_resolver(factory, &args);
GPR_ASSERT(resolver != NULL); GPR_ASSERT(resolver != NULL);
GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds"); GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds");

@ -38,29 +38,6 @@
#include "src/core/ext/client_config/resolver_registry.h" #include "src/core/ext/client_config/resolver_registry.h"
#include "test/core/util/test_config.h" #include "test/core/util/test_config.h"
static void client_channel_factory_ref(grpc_client_channel_factory *scv) {}
static void client_channel_factory_unref(grpc_exec_ctx *exec_ctx,
grpc_client_channel_factory *scv) {}
static grpc_subchannel *client_channel_factory_create_subchannel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *factory,
grpc_subchannel_args *args) {
GPR_UNREACHABLE_CODE(return NULL);
}
static grpc_channel *client_channel_factory_create_channel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
const char *target, grpc_client_channel_type type,
grpc_channel_args *args) {
GPR_UNREACHABLE_CODE(return NULL);
}
static const grpc_client_channel_factory_vtable sc_vtable = {
client_channel_factory_ref, client_channel_factory_unref,
client_channel_factory_create_subchannel,
client_channel_factory_create_channel};
static grpc_client_channel_factory cc_factory = {&sc_vtable};
static void test_succeeds(grpc_resolver_factory *factory, const char *string) { static void test_succeeds(grpc_resolver_factory *factory, const char *string) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_uri *uri = grpc_uri_parse(string, 0); grpc_uri *uri = grpc_uri_parse(string, 0);
@ -71,7 +48,6 @@ static void test_succeeds(grpc_resolver_factory *factory, const char *string) {
GPR_ASSERT(uri); GPR_ASSERT(uri);
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
args.uri = uri; args.uri = uri;
args.client_channel_factory = &cc_factory;
resolver = grpc_resolver_factory_create_resolver(factory, &args); resolver = grpc_resolver_factory_create_resolver(factory, &args);
GPR_ASSERT(resolver != NULL); GPR_ASSERT(resolver != NULL);
GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds"); GRPC_RESOLVER_UNREF(&exec_ctx, resolver, "test_succeeds");

@ -948,6 +948,7 @@ src/core/ext/census/grpc_filter.h \
src/core/ext/census/mlog.h \ src/core/ext/census/mlog.h \
src/core/ext/census/resource.h \ src/core/ext/census/resource.h \
src/core/ext/census/rpc_metric_id.h \ src/core/ext/census/rpc_metric_id.h \
src/core/ext/census/trace_context.h \
src/core/lib/surface/init.c \ src/core/lib/surface/init.c \
src/core/lib/channel/channel_args.c \ src/core/lib/channel/channel_args.c \
src/core/lib/channel/channel_stack.c \ src/core/lib/channel/channel_stack.c \
@ -1139,6 +1140,7 @@ src/core/ext/census/mlog.c \
src/core/ext/census/operation.c \ src/core/ext/census/operation.c \
src/core/ext/census/placeholders.c \ src/core/ext/census/placeholders.c \
src/core/ext/census/resource.c \ src/core/ext/census/resource.c \
src/core/ext/census/trace_context.c \
src/core/ext/census/tracing.c \ src/core/ext/census/tracing.c \
src/core/plugin_registry/grpc_plugin_registry.c \ src/core/plugin_registry/grpc_plugin_registry.c \
include/grpc/support/alloc.h \ include/grpc/support/alloc.h \

@ -63,6 +63,8 @@ _URL_BASE = 'https://grpc-testing.appspot.com/job'
_KNOWN_ERRORS = [ _KNOWN_ERRORS = [
'Failed to build workspace Tests with scheme AllTests', 'Failed to build workspace Tests with scheme AllTests',
'Build timed out', 'Build timed out',
'TIMEOUT: tools/run_tests/pre_build_node.sh',
'TIMEOUT: tools/run_tests/pre_build_ruby.sh',
'FATAL: Unable to produce a script file', 'FATAL: Unable to produce a script file',
'FAILED: build_docker_c\+\+', 'FAILED: build_docker_c\+\+',
'cannot find package \"cloud.google.com/go/compute/metadata\"', 'cannot find package \"cloud.google.com/go/compute/metadata\"',

@ -1198,18 +1198,6 @@ def _shut_down_legacy_server(legacy_server_port):
'http://localhost:%d/quitquitquit' % legacy_server_port).read() 'http://localhost:%d/quitquitquit' % legacy_server_port).read()
def _shut_down_legacy_server(legacy_server_port):
try:
version = int(urllib2.urlopen(
'http://localhost:%d/version_number' % legacy_server_port,
timeout=10).read())
except:
pass
else:
urllib2.urlopen(
'http://localhost:%d/quitquitquit' % legacy_server_port).read()
def _start_port_server(port_server_port): def _start_port_server(port_server_port):
# check if a compatible port server is running # check if a compatible port server is running
# if incompatible (version mismatch) ==> start a new one # if incompatible (version mismatch) ==> start a new one

@ -156,6 +156,22 @@
"third_party": false, "third_party": false,
"type": "target" "type": "target"
}, },
{
"deps": [
"gpr",
"gpr_test_util",
"grpc",
"grpc_test_util"
],
"headers": [],
"language": "c",
"name": "census_trace_context_test",
"src": [
"test/core/census/trace_context_test.c"
],
"third_party": false,
"type": "target"
},
{ {
"deps": [ "deps": [
"gpr", "gpr",
@ -5695,7 +5711,8 @@
"src/core/ext/census/grpc_filter.h", "src/core/ext/census/grpc_filter.h",
"src/core/ext/census/mlog.h", "src/core/ext/census/mlog.h",
"src/core/ext/census/resource.h", "src/core/ext/census/resource.h",
"src/core/ext/census/rpc_metric_id.h" "src/core/ext/census/rpc_metric_id.h",
"src/core/ext/census/trace_context.h"
], ],
"language": "c", "language": "c",
"name": "census", "name": "census",
@ -5723,6 +5740,8 @@
"src/core/ext/census/resource.c", "src/core/ext/census/resource.c",
"src/core/ext/census/resource.h", "src/core/ext/census/resource.h",
"src/core/ext/census/rpc_metric_id.h", "src/core/ext/census/rpc_metric_id.h",
"src/core/ext/census/trace_context.c",
"src/core/ext/census/trace_context.h",
"src/core/ext/census/tracing.c" "src/core/ext/census/tracing.c"
], ],
"third_party": false, "third_party": false,

@ -190,6 +190,27 @@
"windows" "windows"
] ]
}, },
{
"args": [],
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"flaky": false,
"gtest": false,
"language": "c",
"name": "census_trace_context_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
]
},
{ {
"args": [], "args": [],
"ci_platforms": [ "ci_platforms": [

@ -120,6 +120,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "census_resource_test", "vcx
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "census_trace_context_test", "vcxproj\test\census_trace_context_test\census_trace_context_test.vcxproj", "{14511310-FAE4-C287-31DC-D6F456D10AF3}"
ProjectSection(myProperties) = preProject
lib = "False"
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} = {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}
{29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9}
{EAB0A629-17A9-44DB-B5FF-E91A721FE037} = {EAB0A629-17A9-44DB-B5FF-E91A721FE037}
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "channel_create_test", "vcxproj\test\channel_create_test\channel_create_test.vcxproj", "{AFC88484-3A2E-32BC-25B2-23DF741D4F3D}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "channel_create_test", "vcxproj\test\channel_create_test\channel_create_test.vcxproj", "{AFC88484-3A2E-32BC-25B2-23DF741D4F3D}"
ProjectSection(myProperties) = preProject ProjectSection(myProperties) = preProject
lib = "False" lib = "False"
@ -1660,6 +1671,22 @@ Global
{18CF99B5-3C61-EC3D-9509-3C95334C3B88}.Release-DLL|Win32.Build.0 = Release|Win32 {18CF99B5-3C61-EC3D-9509-3C95334C3B88}.Release-DLL|Win32.Build.0 = Release|Win32
{18CF99B5-3C61-EC3D-9509-3C95334C3B88}.Release-DLL|x64.ActiveCfg = Release|x64 {18CF99B5-3C61-EC3D-9509-3C95334C3B88}.Release-DLL|x64.ActiveCfg = Release|x64
{18CF99B5-3C61-EC3D-9509-3C95334C3B88}.Release-DLL|x64.Build.0 = Release|x64 {18CF99B5-3C61-EC3D-9509-3C95334C3B88}.Release-DLL|x64.Build.0 = Release|x64
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Debug|Win32.ActiveCfg = Debug|Win32
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Debug|x64.ActiveCfg = Debug|x64
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Release|Win32.ActiveCfg = Release|Win32
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Release|x64.ActiveCfg = Release|x64
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Debug|Win32.Build.0 = Debug|Win32
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Debug|x64.Build.0 = Debug|x64
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Release|Win32.Build.0 = Release|Win32
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Release|x64.Build.0 = Release|x64
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Debug-DLL|Win32.ActiveCfg = Debug|Win32
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Debug-DLL|Win32.Build.0 = Debug|Win32
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Debug-DLL|x64.ActiveCfg = Debug|x64
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Debug-DLL|x64.Build.0 = Debug|x64
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Release-DLL|Win32.ActiveCfg = Release|Win32
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Release-DLL|Win32.Build.0 = Release|Win32
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Release-DLL|x64.ActiveCfg = Release|x64
{14511310-FAE4-C287-31DC-D6F456D10AF3}.Release-DLL|x64.Build.0 = Release|x64
{AFC88484-3A2E-32BC-25B2-23DF741D4F3D}.Debug|Win32.ActiveCfg = Debug|Win32 {AFC88484-3A2E-32BC-25B2-23DF741D4F3D}.Debug|Win32.ActiveCfg = Debug|Win32
{AFC88484-3A2E-32BC-25B2-23DF741D4F3D}.Debug|x64.ActiveCfg = Debug|x64 {AFC88484-3A2E-32BC-25B2-23DF741D4F3D}.Debug|x64.ActiveCfg = Debug|x64
{AFC88484-3A2E-32BC-25B2-23DF741D4F3D}.Release|Win32.ActiveCfg = Release|Win32 {AFC88484-3A2E-32BC-25B2-23DF741D4F3D}.Release|Win32.ActiveCfg = Release|Win32

@ -457,6 +457,7 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\mlog.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\census\mlog.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\resource.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\census\resource.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\rpc_metric_id.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\census\rpc_metric_id.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\trace_context.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="$(SolutionDir)\..\src\core\lib\surface\init.c"> <ClCompile Include="$(SolutionDir)\..\src\core\lib\surface\init.c">
@ -841,6 +842,8 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\resource.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\census\resource.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\trace_context.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\tracing.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\census\tracing.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\plugin_registry\grpc_plugin_registry.c"> <ClCompile Include="$(SolutionDir)\..\src\core\plugin_registry\grpc_plugin_registry.c">

@ -574,6 +574,9 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\resource.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\census\resource.c">
<Filter>src\core\ext\census</Filter> <Filter>src\core\ext\census</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\trace_context.c">
<Filter>src\core\ext\census</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\tracing.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\census\tracing.c">
<Filter>src\core\ext\census</Filter> <Filter>src\core\ext\census</Filter>
</ClCompile> </ClCompile>
@ -1148,6 +1151,9 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\rpc_metric_id.h"> <ClInclude Include="$(SolutionDir)\..\src\core\ext\census\rpc_metric_id.h">
<Filter>src\core\ext\census</Filter> <Filter>src\core\ext\census</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\trace_context.h">
<Filter>src\core\ext\census</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -423,6 +423,7 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\mlog.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\census\mlog.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\resource.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\census\resource.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\rpc_metric_id.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\census\rpc_metric_id.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\trace_context.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="$(SolutionDir)\..\src\core\lib\surface\init.c"> <ClCompile Include="$(SolutionDir)\..\src\core\lib\surface\init.c">
@ -749,6 +750,8 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\resource.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\census\resource.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\trace_context.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\tracing.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\census\tracing.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\plugin_registry\grpc_unsecure_plugin_registry.c"> <ClCompile Include="$(SolutionDir)\..\src\core\plugin_registry\grpc_unsecure_plugin_registry.c">

@ -487,6 +487,9 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\resource.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\census\resource.c">
<Filter>src\core\ext\census</Filter> <Filter>src\core\ext\census</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\trace_context.c">
<Filter>src\core\ext\census</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\census\tracing.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\census\tracing.c">
<Filter>src\core\ext\census</Filter> <Filter>src\core\ext\census</Filter>
</ClCompile> </ClCompile>
@ -986,6 +989,9 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\rpc_metric_id.h"> <ClInclude Include="$(SolutionDir)\..\src\core\ext\census\rpc_metric_id.h">
<Filter>src\core\ext\census</Filter> <Filter>src\core\ext\census</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\census\trace_context.h">
<Filter>src\core\ext\census</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -0,0 +1,199 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\1.0.204.1.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{14511310-FAE4-C287-31DC-D6F456D10AF3}</ProjectGuid>
<IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected>
<IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration">
<PlatformToolset>v100</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration">
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'" Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)\..\vsprojects\global.props" />
<Import Project="$(SolutionDir)\..\vsprojects\openssl.props" />
<Import Project="$(SolutionDir)\..\vsprojects\winsock.props" />
<Import Project="$(SolutionDir)\..\vsprojects\zlib.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>census_trace_context_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>census_trace_context_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
<Configuration-grpc_dependencies_openssl>Release</Configuration-grpc_dependencies_openssl>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="$(SolutionDir)\..\test\core\census\trace_context_test.c">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc_test_util\grpc_test_util.vcxproj">
<Project>{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj">
<Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\gpr_test_util\gpr_test_util.vcxproj">
<Project>{EAB0A629-17A9-44DB-B5FF-E91A721FE037}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\gpr\gpr.vcxproj">
<Project>{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" />
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" />
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" />
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" />
</ImportGroup>
<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('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" />
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" />
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" />
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" />
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" />
</Target>
</Project>

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="$(SolutionDir)\..\test\core\census\trace_context_test.c">
<Filter>test\core\census</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="test">
<UniqueIdentifier>{ceb3b75d-b5bc-0966-6724-06fb51237d08}</UniqueIdentifier>
</Filter>
<Filter Include="test\core">
<UniqueIdentifier>{8d294ce5-d65c-2fef-28ab-43b4d23722c3}</UniqueIdentifier>
</Filter>
<Filter Include="test\core\census">
<UniqueIdentifier>{3981af30-20c0-647e-755f-fa184674d50a}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
Loading…
Cancel
Save