Merge github.com:grpc/grpc into poll-wakeup

pull/9984/head
Craig Tiller 8 years ago
commit a2d11d7bb4
  1. 2
      .gitignore
  2. 14
      .pylintrc
  3. 149
      CMakeLists.txt
  4. 183
      Makefile
  5. 26
      bazel/cc_grpc_library.bzl
  6. 17
      bazel/generate_cc.bzl
  7. 5
      bazel/grpc_build_system.bzl
  8. 20
      binding.gyp
  9. 57
      build.yaml
  10. 2
      doc/PROTOCOL-WEB.md
  11. 5
      examples/csharp/helloworld-from-cli/global.json
  12. 2
      gRPC-Core.podspec
  13. 2
      gRPC-ProtoRPC.podspec
  14. 2
      gRPC-RxLibrary.podspec
  15. 2
      gRPC.podspec
  16. 1
      grpc.def
  17. 52
      include/grpc++/impl/channel_argument_option.h
  18. 8
      include/grpc++/server_builder.h
  19. 4
      include/grpc/support/sync.h
  20. 2
      package.json
  21. 4
      package.xml
  22. 2
      requirements.txt
  23. 2
      setup.py
  24. 4
      src/compiler/cpp_generator.cc
  25. 2
      src/core/ext/client_channel/client_channel_plugin.c
  26. 10
      src/core/ext/client_channel/http_proxy.c
  27. 28
      src/core/ext/client_channel/parse_address.c
  28. 22
      src/core/ext/client_channel/resolver_registry.c
  29. 5
      src/core/ext/client_channel/resolver_registry.h
  30. 11
      src/core/ext/client_channel/subchannel.c
  31. 3
      src/core/ext/client_channel/subchannel.h
  32. 37
      src/core/ext/client_channel/uri_parser.c
  33. 4
      src/core/ext/client_channel/uri_parser.h
  34. 2
      src/core/ext/lb_policy/grpclb/grpclb.c
  35. 2
      src/core/ext/transport/chttp2/client/chttp2_connector.c
  36. 3
      src/core/ext/transport/chttp2/client/insecure/channel_create.c
  37. 7
      src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
  38. 42
      src/core/ext/transport/chttp2/transport/parsing.c
  39. 422
      src/core/lib/iomgr/error.c
  40. 11
      src/core/lib/iomgr/error.h
  41. 24
      src/core/lib/iomgr/error_internal.h
  42. 12
      src/core/lib/iomgr/sockaddr_utils.c
  43. 19
      src/core/lib/iomgr/tcp_server_posix.c
  44. 6
      src/core/lib/iomgr/udp_server.c
  45. 2
      src/core/lib/iomgr/wakeup_fd_posix.h
  46. 12
      src/core/lib/support/sync.c
  47. 4
      src/core/lib/surface/call.c
  48. 22
      src/core/lib/transport/error_utils.c
  49. 35
      src/core/lib/transport/transport.c
  50. 6
      src/core/lib/transport/transport.h
  51. 2
      src/cpp/common/version_cc.cc
  52. 78
      src/cpp/server/channel_argument_option.cc
  53. 8
      src/cpp/server/server_builder.cc
  54. 2
      src/cpp/server/server_cc.cc
  55. 26
      src/csharp/Grpc.Auth/Grpc.Auth.csproj
  56. 10
      src/csharp/Grpc.Auth/packages.config
  57. 6
      src/csharp/Grpc.Auth/project.json
  58. 4
      src/csharp/Grpc.Core.Testing/project.json
  59. 86
      src/csharp/Grpc.Core.Tests/AuthContextTest.cs
  60. 82
      src/csharp/Grpc.Core.Tests/AuthPropertyTest.cs
  61. 12
      src/csharp/Grpc.Core.Tests/ClientServerTest.cs
  62. 19
      src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj
  63. 41
      src/csharp/Grpc.Core.Tests/TestResult.xml
  64. 7
      src/csharp/Grpc.Core.Tests/packages.config
  65. 8
      src/csharp/Grpc.Core.Tests/project.json
  66. 128
      src/csharp/Grpc.Core/AuthContext.cs
  67. 126
      src/csharp/Grpc.Core/AuthProperty.cs
  68. 4
      src/csharp/Grpc.Core/Grpc.Core.csproj
  69. 119
      src/csharp/Grpc.Core/Internal/AuthContextSafeHandle.cs
  70. 10
      src/csharp/Grpc.Core/Internal/BatchContextSafeHandle.cs
  71. 8
      src/csharp/Grpc.Core/Internal/CallSafeHandle.cs
  72. 67
      src/csharp/Grpc.Core/Internal/MarshalUtils.cs
  73. 18
      src/csharp/Grpc.Core/Internal/NativeMethods.cs
  74. 13
      src/csharp/Grpc.Core/Metadata.cs
  75. 23
      src/csharp/Grpc.Core/ServerCallContext.cs
  76. 4
      src/csharp/Grpc.Core/VersionInfo.cs
  77. 2
      src/csharp/Grpc.Core/project.json
  78. 12
      src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
  79. 6
      src/csharp/Grpc.Examples.Tests/packages.config
  80. 4
      src/csharp/Grpc.Examples.Tests/project.json
  81. 14
      src/csharp/Grpc.Examples/Grpc.Examples.csproj
  82. 4
      src/csharp/Grpc.Examples/packages.config
  83. 9
      src/csharp/Grpc.Examples/project.json
  84. 10
      src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
  85. 6
      src/csharp/Grpc.HealthCheck.Tests/packages.config
  86. 4
      src/csharp/Grpc.HealthCheck.Tests/project.json
  87. 6
      src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
  88. 2
      src/csharp/Grpc.HealthCheck/packages.config
  89. 13
      src/csharp/Grpc.HealthCheck/project.json
  90. 28
      src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
  91. 10
      src/csharp/Grpc.IntegrationTesting.Client/packages.config
  92. 3
      src/csharp/Grpc.IntegrationTesting.QpsWorker/packages.config
  93. 28
      src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
  94. 10
      src/csharp/Grpc.IntegrationTesting.Server/packages.config
  95. 3
      src/csharp/Grpc.IntegrationTesting.StressClient/packages.config
  96. 497
      src/csharp/Grpc.IntegrationTesting/Control.cs
  97. 12
      src/csharp/Grpc.IntegrationTesting/Empty.cs
  98. 52
      src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
  99. 128
      src/csharp/Grpc.IntegrationTesting/Messages.cs
  100. 4
      src/csharp/Grpc.IntegrationTesting/Metrics.cs
  101. Some files were not shown because too many files have changed in this diff Show More

2
.gitignore vendored

@ -8,7 +8,7 @@ objs
# Python items
cython_debug/
python_build/
python_format_venv/
yapf_virtual_environment/
python_pylint_venv/
.coverage*
.eggs

@ -3,6 +3,12 @@
# not include "unused_" and "ignored_" by default?
dummy-variables-rgx=^ignored_|^unused_
[DESIGN]
# NOTE(nathaniel): Not particularly attached to this value; it just seems to
# be what works for us at the moment (excepting the dead-code-walking Beta
# API).
max-args=6
[MISCELLANEOUS]
# NOTE(nathaniel): We are big fans of "TODO(<issue link>): " and
# "NOTE(<username or issue link>): ". We do not allow "TODO:",
@ -13,28 +19,22 @@ notes=FIXME,XXX
#TODO: Enable missing-docstring
#TODO: Enable too-few-public-methods
#TODO: Enable too-many-arguments
#TODO: Enable no-init
#TODO: Enable duplicate-code
#TODO: Enable invalid-name
#TODO: Enable suppressed-message
#TODO: Enable locally-disabled
#TODO: Enable protected-access
#TODO: Enable no-name-in-module
#TODO: Enable unused-argument
#TODO: Enable wrong-import-order
# TODO(https://github.com/PyCQA/pylint/issues/59#issuecomment-283774279):
# enable cyclic-import after a 1.7-or-later pylint release that recognizes our
# disable=cyclic-import suppressions.
#TODO: Enable too-many-instance-attributes
#TODO: Enable too-many-locals
#TODO: Enable too-many-lines
#TODO: Enable redefined-variable-type
#TODO: Enable next-method-called
#TODO: Enable import-error
#TODO: Enable useless-else-on-loop
#TODO: Enable too-many-return-statements
#TODO: Enable too-many-nested-blocks
#TODO: Enable super-init-not-called
disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,suppressed-message,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks,super-init-not-called
disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-nested-blocks

@ -42,7 +42,7 @@
cmake_minimum_required(VERSION 2.8)
set(PACKAGE_NAME "grpc")
set(PACKAGE_VERSION "1.2.0-dev")
set(PACKAGE_VERSION "1.3.0-dev")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/")
@ -353,6 +353,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c dualstack_socket_test)
endif()
add_dependencies(buildtests_c endpoint_pair_test)
add_dependencies(buildtests_c error_test)
if(_gRPC_PLATFORM_LINUX)
add_dependencies(buildtests_c ev_epoll_linux_test)
endif()
@ -440,6 +441,7 @@ add_dependencies(buildtests_c mlog_test)
add_dependencies(buildtests_c multiple_server_queues_test)
add_dependencies(buildtests_c murmur_hash_test)
add_dependencies(buildtests_c no_server_test)
add_dependencies(buildtests_c parse_address_test)
add_dependencies(buildtests_c percent_encoding_test)
if(_gRPC_PLATFORM_LINUX)
add_dependencies(buildtests_c pollset_set_test)
@ -464,6 +466,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c socket_utils_test)
endif()
add_dependencies(buildtests_c status_conversion_test)
add_dependencies(buildtests_c stream_owned_slice_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_c tcp_client_posix_test)
endif()
@ -663,6 +666,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx secure_sync_unary_ping_pong_test)
endif()
add_dependencies(buildtests_cxx server_builder_plugin_test)
add_dependencies(buildtests_cxx server_builder_test)
add_dependencies(buildtests_cxx server_context_test_spouse_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx server_crash_test)
@ -1450,7 +1454,7 @@ add_library(grpc_test_util
test/core/security/oauth2_utils.c
test/core/end2end/cq_verifier.c
test/core/end2end/fake_resolver.c
test/core/end2end/fixtures/http_proxy.c
test/core/end2end/fixtures/http_proxy_fixture.c
test/core/end2end/fixtures/proxy.c
test/core/iomgr/endpoint_tests.c
test/core/util/debugger_macros.c
@ -1657,7 +1661,7 @@ if (gRPC_BUILD_TESTS)
add_library(grpc_test_util_unsecure
test/core/end2end/cq_verifier.c
test/core/end2end/fake_resolver.c
test/core/end2end/fixtures/http_proxy.c
test/core/end2end/fixtures/http_proxy_fixture.c
test/core/end2end/fixtures/proxy.c
test/core/iomgr/endpoint_tests.c
test/core/util/debugger_macros.c
@ -2086,6 +2090,7 @@ add_library(grpc++
src/cpp/common/rpc_method.cc
src/cpp/common/version_cc.cc
src/cpp/server/async_generic_service.cc
src/cpp/server/channel_argument_option.cc
src/cpp/server/create_default_thread_pool.cc
src/cpp/server/dynamic_thread_pool.cc
src/cpp/server/health/default_health_check_service.cc
@ -2151,6 +2156,7 @@ foreach(_hdr
include/grpc++/grpc++.h
include/grpc++/health_check_service_interface.h
include/grpc++/impl/call.h
include/grpc++/impl/channel_argument_option.h
include/grpc++/impl/client_unary_call.h
include/grpc++/impl/codegen/core_codegen.h
include/grpc++/impl/grpc_library.h
@ -2272,6 +2278,7 @@ add_library(grpc++_cronet
src/cpp/common/rpc_method.cc
src/cpp/common/version_cc.cc
src/cpp/server/async_generic_service.cc
src/cpp/server/channel_argument_option.cc
src/cpp/server/create_default_thread_pool.cc
src/cpp/server/dynamic_thread_pool.cc
src/cpp/server/health/default_health_check_service.cc
@ -2521,6 +2528,7 @@ foreach(_hdr
include/grpc++/grpc++.h
include/grpc++/health_check_service_interface.h
include/grpc++/impl/call.h
include/grpc++/impl/channel_argument_option.h
include/grpc++/impl/client_unary_call.h
include/grpc++/impl/codegen/core_codegen.h
include/grpc++/impl/grpc_library.h
@ -2943,6 +2951,7 @@ add_library(grpc++_unsecure
src/cpp/common/rpc_method.cc
src/cpp/common/version_cc.cc
src/cpp/server/async_generic_service.cc
src/cpp/server/channel_argument_option.cc
src/cpp/server/create_default_thread_pool.cc
src/cpp/server/dynamic_thread_pool.cc
src/cpp/server/health/default_health_check_service.cc
@ -3008,6 +3017,7 @@ foreach(_hdr
include/grpc++/grpc++.h
include/grpc++/health_check_service_interface.h
include/grpc++/impl/call.h
include/grpc++/impl/channel_argument_option.h
include/grpc++/impl/client_unary_call.h
include/grpc++/impl/codegen/core_codegen.h
include/grpc++/impl/grpc_library.h
@ -3143,6 +3153,7 @@ target_link_libraries(grpc_benchmark
${_gRPC_ALLTARGETS_LIBRARIES}
benchmark
grpc++
grpc_test_util
grpc
${_gRPC_GFLAGS_LIBRARIES}
)
@ -4613,6 +4624,33 @@ target_link_libraries(endpoint_pair_test
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(error_test
test/core/iomgr/error_test.c
)
target_include_directories(error_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${BENCHMARK_ROOT_DIR}/include
PRIVATE ${ZLIB_ROOT_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
)
target_link_libraries(error_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr_test_util
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX)
@ -6494,6 +6532,33 @@ target_link_libraries(no_server_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(parse_address_test
test/core/client_channel/parse_address_test.c
)
target_include_directories(parse_address_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${BENCHMARK_ROOT_DIR}/include
PRIVATE ${ZLIB_ROOT_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
)
target_link_libraries(parse_address_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr_test_util
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(percent_encoding_test
test/core/slice/percent_encoding_test.c
)
@ -6984,6 +7049,33 @@ target_link_libraries(status_conversion_test
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(stream_owned_slice_test
test/core/transport/stream_owned_slice_test.c
)
target_include_directories(stream_owned_slice_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${BENCHMARK_ROOT_DIR}/include
PRIVATE ${ZLIB_ROOT_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
)
target_link_libraries(stream_owned_slice_test
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_test_util
grpc
gpr_test_util
gpr
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@ -7913,7 +8005,9 @@ target_link_libraries(bm_metadata
${_gRPC_ALLTARGETS_LIBRARIES}
grpc_benchmark
benchmark
grpc++_test_util
grpc_test_util
grpc++
grpc
gpr_test_util
gpr
@ -9822,6 +9916,55 @@ target_link_libraries(server_builder_plugin_test
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(server_builder_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo_messages.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/echo.grpc.pb.h
test/cpp/server/server_builder_test.cc
third_party/googletest/src/gtest-all.cc
)
protobuf_generate_grpc_cpp(
src/proto/grpc/testing/echo_messages.proto
)
protobuf_generate_grpc_cpp(
src/proto/grpc/testing/echo.proto
)
target_include_directories(server_builder_test
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${BENCHMARK_ROOT_DIR}/include
PRIVATE ${ZLIB_ROOT_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
PRIVATE third_party/googletest/include
PRIVATE third_party/googletest
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(server_builder_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc++_test_util
grpc_test_util
gpr_test_util
grpc++
grpc
gpr
${_gRPC_GFLAGS_LIBRARIES}
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(server_context_test_spouse_test
test/cpp/test/server_context_test_spouse_test.cc
third_party/googletest/src/gtest-all.cc

@ -412,8 +412,8 @@ Q = @
endif
CORE_VERSION = 3.0.0-dev
CPP_VERSION = 1.2.0-dev
CSHARP_VERSION = 1.2.0-dev
CPP_VERSION = 1.3.0-dev
CSHARP_VERSION = 1.3.0-dev
CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
@ -926,6 +926,7 @@ dns_resolver_connectivity_test: $(BINDIR)/$(CONFIG)/dns_resolver_connectivity_te
dns_resolver_test: $(BINDIR)/$(CONFIG)/dns_resolver_test
dualstack_socket_test: $(BINDIR)/$(CONFIG)/dualstack_socket_test
endpoint_pair_test: $(BINDIR)/$(CONFIG)/endpoint_pair_test
error_test: $(BINDIR)/$(CONFIG)/error_test
ev_epoll_linux_test: $(BINDIR)/$(CONFIG)/ev_epoll_linux_test
fd_conservation_posix_test: $(BINDIR)/$(CONFIG)/fd_conservation_posix_test
fd_posix_test: $(BINDIR)/$(CONFIG)/fd_posix_test
@ -1002,6 +1003,7 @@ murmur_hash_test: $(BINDIR)/$(CONFIG)/murmur_hash_test
nanopb_fuzzer_response_test: $(BINDIR)/$(CONFIG)/nanopb_fuzzer_response_test
nanopb_fuzzer_serverlist_test: $(BINDIR)/$(CONFIG)/nanopb_fuzzer_serverlist_test
no_server_test: $(BINDIR)/$(CONFIG)/no_server_test
parse_address_test: $(BINDIR)/$(CONFIG)/parse_address_test
percent_decode_fuzzer: $(BINDIR)/$(CONFIG)/percent_decode_fuzzer
percent_encode_fuzzer: $(BINDIR)/$(CONFIG)/percent_encode_fuzzer
percent_encoding_test: $(BINDIR)/$(CONFIG)/percent_encoding_test
@ -1024,6 +1026,7 @@ sockaddr_utils_test: $(BINDIR)/$(CONFIG)/sockaddr_utils_test
socket_utils_test: $(BINDIR)/$(CONFIG)/socket_utils_test
ssl_server_fuzzer: $(BINDIR)/$(CONFIG)/ssl_server_fuzzer
status_conversion_test: $(BINDIR)/$(CONFIG)/status_conversion_test
stream_owned_slice_test: $(BINDIR)/$(CONFIG)/stream_owned_slice_test
tcp_client_posix_test: $(BINDIR)/$(CONFIG)/tcp_client_posix_test
tcp_client_uv_test: $(BINDIR)/$(CONFIG)/tcp_client_uv_test
tcp_posix_test: $(BINDIR)/$(CONFIG)/tcp_posix_test
@ -1104,6 +1107,7 @@ round_robin_end2end_test: $(BINDIR)/$(CONFIG)/round_robin_end2end_test
secure_auth_context_test: $(BINDIR)/$(CONFIG)/secure_auth_context_test
secure_sync_unary_ping_pong_test: $(BINDIR)/$(CONFIG)/secure_sync_unary_ping_pong_test
server_builder_plugin_test: $(BINDIR)/$(CONFIG)/server_builder_plugin_test
server_builder_test: $(BINDIR)/$(CONFIG)/server_builder_test
server_context_test_spouse_test: $(BINDIR)/$(CONFIG)/server_context_test_spouse_test
server_crash_test: $(BINDIR)/$(CONFIG)/server_crash_test
server_crash_test_client: $(BINDIR)/$(CONFIG)/server_crash_test_client
@ -1301,6 +1305,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/dns_resolver_test \
$(BINDIR)/$(CONFIG)/dualstack_socket_test \
$(BINDIR)/$(CONFIG)/endpoint_pair_test \
$(BINDIR)/$(CONFIG)/error_test \
$(BINDIR)/$(CONFIG)/ev_epoll_linux_test \
$(BINDIR)/$(CONFIG)/fd_conservation_posix_test \
$(BINDIR)/$(CONFIG)/fd_posix_test \
@ -1364,6 +1369,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/multiple_server_queues_test \
$(BINDIR)/$(CONFIG)/murmur_hash_test \
$(BINDIR)/$(CONFIG)/no_server_test \
$(BINDIR)/$(CONFIG)/parse_address_test \
$(BINDIR)/$(CONFIG)/percent_encoding_test \
$(BINDIR)/$(CONFIG)/pollset_set_test \
$(BINDIR)/$(CONFIG)/resolve_address_posix_test \
@ -1382,6 +1388,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/sockaddr_utils_test \
$(BINDIR)/$(CONFIG)/socket_utils_test \
$(BINDIR)/$(CONFIG)/status_conversion_test \
$(BINDIR)/$(CONFIG)/stream_owned_slice_test \
$(BINDIR)/$(CONFIG)/tcp_client_posix_test \
$(BINDIR)/$(CONFIG)/tcp_client_uv_test \
$(BINDIR)/$(CONFIG)/tcp_posix_test \
@ -1515,6 +1522,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/secure_auth_context_test \
$(BINDIR)/$(CONFIG)/secure_sync_unary_ping_pong_test \
$(BINDIR)/$(CONFIG)/server_builder_plugin_test \
$(BINDIR)/$(CONFIG)/server_builder_test \
$(BINDIR)/$(CONFIG)/server_context_test_spouse_test \
$(BINDIR)/$(CONFIG)/server_crash_test \
$(BINDIR)/$(CONFIG)/server_crash_test_client \
@ -1630,6 +1638,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/secure_auth_context_test \
$(BINDIR)/$(CONFIG)/secure_sync_unary_ping_pong_test \
$(BINDIR)/$(CONFIG)/server_builder_plugin_test \
$(BINDIR)/$(CONFIG)/server_builder_test \
$(BINDIR)/$(CONFIG)/server_context_test_spouse_test \
$(BINDIR)/$(CONFIG)/server_crash_test \
$(BINDIR)/$(CONFIG)/server_crash_test_client \
@ -1695,6 +1704,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/dualstack_socket_test || ( echo test dualstack_socket_test failed ; exit 1 )
$(E) "[RUN] Testing endpoint_pair_test"
$(Q) $(BINDIR)/$(CONFIG)/endpoint_pair_test || ( echo test endpoint_pair_test failed ; exit 1 )
$(E) "[RUN] Testing error_test"
$(Q) $(BINDIR)/$(CONFIG)/error_test || ( echo test error_test failed ; exit 1 )
$(E) "[RUN] Testing ev_epoll_linux_test"
$(Q) $(BINDIR)/$(CONFIG)/ev_epoll_linux_test || ( echo test ev_epoll_linux_test failed ; exit 1 )
$(E) "[RUN] Testing fd_conservation_posix_test"
@ -1805,6 +1816,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/murmur_hash_test || ( echo test murmur_hash_test failed ; exit 1 )
$(E) "[RUN] Testing no_server_test"
$(Q) $(BINDIR)/$(CONFIG)/no_server_test || ( echo test no_server_test failed ; exit 1 )
$(E) "[RUN] Testing parse_address_test"
$(Q) $(BINDIR)/$(CONFIG)/parse_address_test || ( echo test parse_address_test failed ; exit 1 )
$(E) "[RUN] Testing percent_encoding_test"
$(Q) $(BINDIR)/$(CONFIG)/percent_encoding_test || ( echo test percent_encoding_test failed ; exit 1 )
$(E) "[RUN] Testing pollset_set_test"
@ -1841,6 +1854,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/socket_utils_test || ( echo test socket_utils_test failed ; exit 1 )
$(E) "[RUN] Testing status_conversion_test"
$(Q) $(BINDIR)/$(CONFIG)/status_conversion_test || ( echo test status_conversion_test failed ; exit 1 )
$(E) "[RUN] Testing stream_owned_slice_test"
$(Q) $(BINDIR)/$(CONFIG)/stream_owned_slice_test || ( echo test stream_owned_slice_test failed ; exit 1 )
$(E) "[RUN] Testing tcp_client_posix_test"
$(Q) $(BINDIR)/$(CONFIG)/tcp_client_posix_test || ( echo test tcp_client_posix_test failed ; exit 1 )
$(E) "[RUN] Testing tcp_client_uv_test"
@ -1991,6 +2006,8 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/secure_sync_unary_ping_pong_test || ( echo test secure_sync_unary_ping_pong_test failed ; exit 1 )
$(E) "[RUN] Testing server_builder_plugin_test"
$(Q) $(BINDIR)/$(CONFIG)/server_builder_plugin_test || ( echo test server_builder_plugin_test failed ; exit 1 )
$(E) "[RUN] Testing server_builder_test"
$(Q) $(BINDIR)/$(CONFIG)/server_builder_test || ( echo test server_builder_test failed ; exit 1 )
$(E) "[RUN] Testing server_context_test_spouse_test"
$(Q) $(BINDIR)/$(CONFIG)/server_context_test_spouse_test || ( echo test server_context_test_spouse_test failed ; exit 1 )
$(E) "[RUN] Testing server_crash_test"
@ -3330,7 +3347,7 @@ LIBGRPC_TEST_UTIL_SRC = \
test/core/security/oauth2_utils.c \
test/core/end2end/cq_verifier.c \
test/core/end2end/fake_resolver.c \
test/core/end2end/fixtures/http_proxy.c \
test/core/end2end/fixtures/http_proxy_fixture.c \
test/core/end2end/fixtures/proxy.c \
test/core/iomgr/endpoint_tests.c \
test/core/util/debugger_macros.c \
@ -3530,7 +3547,7 @@ endif
LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
test/core/end2end/cq_verifier.c \
test/core/end2end/fake_resolver.c \
test/core/end2end/fixtures/http_proxy.c \
test/core/end2end/fixtures/http_proxy_fixture.c \
test/core/end2end/fixtures/proxy.c \
test/core/iomgr/endpoint_tests.c \
test/core/util/debugger_macros.c \
@ -3935,6 +3952,7 @@ LIBGRPC++_SRC = \
src/cpp/common/rpc_method.cc \
src/cpp/common/version_cc.cc \
src/cpp/server/async_generic_service.cc \
src/cpp/server/channel_argument_option.cc \
src/cpp/server/create_default_thread_pool.cc \
src/cpp/server/dynamic_thread_pool.cc \
src/cpp/server/health/default_health_check_service.cc \
@ -3967,6 +3985,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/grpc++.h \
include/grpc++/health_check_service_interface.h \
include/grpc++/impl/call.h \
include/grpc++/impl/channel_argument_option.h \
include/grpc++/impl/client_unary_call.h \
include/grpc++/impl/codegen/core_codegen.h \
include/grpc++/impl/grpc_library.h \
@ -4134,6 +4153,7 @@ LIBGRPC++_CRONET_SRC = \
src/cpp/common/rpc_method.cc \
src/cpp/common/version_cc.cc \
src/cpp/server/async_generic_service.cc \
src/cpp/server/channel_argument_option.cc \
src/cpp/server/create_default_thread_pool.cc \
src/cpp/server/dynamic_thread_pool.cc \
src/cpp/server/health/default_health_check_service.cc \
@ -4349,6 +4369,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/grpc++.h \
include/grpc++/health_check_service_interface.h \
include/grpc++/impl/call.h \
include/grpc++/impl/channel_argument_option.h \
include/grpc++/impl/client_unary_call.h \
include/grpc++/impl/codegen/core_codegen.h \
include/grpc++/impl/grpc_library.h \
@ -4817,6 +4838,7 @@ LIBGRPC++_UNSECURE_SRC = \
src/cpp/common/rpc_method.cc \
src/cpp/common/version_cc.cc \
src/cpp/server/async_generic_service.cc \
src/cpp/server/channel_argument_option.cc \
src/cpp/server/create_default_thread_pool.cc \
src/cpp/server/dynamic_thread_pool.cc \
src/cpp/server/health/default_health_check_service.cc \
@ -4849,6 +4871,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/grpc++.h \
include/grpc++/health_check_service_interface.h \
include/grpc++/impl/call.h \
include/grpc++/impl/channel_argument_option.h \
include/grpc++/impl/client_unary_call.h \
include/grpc++/impl/codegen/core_codegen.h \
include/grpc++/impl/grpc_library.h \
@ -8716,6 +8739,38 @@ endif
endif
ERROR_TEST_SRC = \
test/core/iomgr/error_test.c \
ERROR_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ERROR_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/error_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/error_test: $(ERROR_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) $(ERROR_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)/error_test
endif
$(OBJDIR)/$(CONFIG)/test/core/iomgr/error_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_error_test: $(ERROR_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(ERROR_TEST_OBJS:.o=.dep)
endif
endif
EV_EPOLL_LINUX_TEST_SRC = \
test/core/iomgr/ev_epoll_linux_test.c \
@ -11148,6 +11203,38 @@ endif
endif
PARSE_ADDRESS_TEST_SRC = \
test/core/client_channel/parse_address_test.c \
PARSE_ADDRESS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(PARSE_ADDRESS_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/parse_address_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/parse_address_test: $(PARSE_ADDRESS_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) $(PARSE_ADDRESS_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)/parse_address_test
endif
$(OBJDIR)/$(CONFIG)/test/core/client_channel/parse_address_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_parse_address_test: $(PARSE_ADDRESS_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(PARSE_ADDRESS_TEST_OBJS:.o=.dep)
endif
endif
PERCENT_DECODE_FUZZER_SRC = \
test/core/slice/percent_decode_fuzzer.c \
@ -11852,6 +11939,38 @@ endif
endif
STREAM_OWNED_SLICE_TEST_SRC = \
test/core/transport/stream_owned_slice_test.c \
STREAM_OWNED_SLICE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(STREAM_OWNED_SLICE_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/stream_owned_slice_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/stream_owned_slice_test: $(STREAM_OWNED_SLICE_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) $(STREAM_OWNED_SLICE_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)/stream_owned_slice_test
endif
$(OBJDIR)/$(CONFIG)/test/core/transport/stream_owned_slice_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_stream_owned_slice_test: $(STREAM_OWNED_SLICE_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(STREAM_OWNED_SLICE_TEST_OBJS:.o=.dep)
endif
endif
TCP_CLIENT_POSIX_TEST_SRC = \
test/core/iomgr/tcp_client_posix_test.c \
@ -12935,16 +13054,16 @@ $(BINDIR)/$(CONFIG)/bm_metadata: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/bm_metadata: $(PROTOBUF_DEP) $(BM_METADATA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(BINDIR)/$(CONFIG)/bm_metadata: $(PROTOBUF_DEP) $(BM_METADATA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(BM_METADATA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_metadata
$(Q) $(LDXX) $(LDFLAGS) $(BM_METADATA_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_metadata
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_metadata.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_metadata.o: $(LIBDIR)/$(CONFIG)/libgrpc_benchmark.a $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_bm_metadata: $(BM_METADATA_OBJS:.o=.dep)
@ -15064,6 +15183,56 @@ endif
endif
SERVER_BUILDER_TEST_SRC = \
$(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc \
$(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc \
test/cpp/server/server_builder_test.cc \
SERVER_BUILDER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SERVER_BUILDER_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/server_builder_test: openssl_dep_error
else
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/server_builder_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/server_builder_test: $(PROTOBUF_DEP) $(SERVER_BUILDER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(SERVER_BUILDER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/server_builder_test
endif
endif
$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/echo_messages.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/echo.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/server/server_builder_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_server_builder_test: $(SERVER_BUILDER_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(SERVER_BUILDER_TEST_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/server/server_builder_test.o: $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.pb.cc $(GENDIR)/src/proto/grpc/testing/echo.grpc.pb.cc
SERVER_CONTEXT_TEST_SPOUSE_TEST_SRC = \
test/cpp/test/server_context_test_spouse_test.cc \

@ -2,7 +2,7 @@
load("//:bazel/generate_cc.bzl", "generate_cc")
def cc_grpc_library(name, srcs, deps, proto_only, **kwargs):
def cc_grpc_library(name, srcs, deps, proto_only, well_known_protos, use_external = False, **kwargs):
"""Generates C++ grpc classes from a .proto file.
Assumes the generated classes will be used in cc_api_version = 2.
@ -12,6 +12,11 @@ def cc_grpc_library(name, srcs, deps, proto_only, **kwargs):
srcs: a single proto_library, which wraps the .proto files with services.
deps: a list of C++ proto_library (or cc_proto_library) which provides
the compiled code of any message that the services depend on.
well_known_protos: The target from protobuf library that exports well
known protos. Currently it will only work if the value is
"@submodule_protobuf//:well_known_protos"
use_external: When True the grpc deps are prefixed with //external. This
allows grpc to be used as a dependency in other bazel projects.
**kwargs: rest of arguments, e.g., compatible_with and visibility.
"""
if len(srcs) > 1:
@ -33,22 +38,37 @@ def cc_grpc_library(name, srcs, deps, proto_only, **kwargs):
generate_cc(
name = codegen_target,
srcs = [proto_target],
well_known_protos = well_known_protos,
**kwargs
)
if not proto_only:
if use_external:
# when this file is used by non-grpc projects
plugin = "//external:grpc_cpp_plugin"
else:
plugin = "//:grpc_cpp_plugin"
generate_cc(
name = codegen_grpc_target,
srcs = [proto_target],
plugin = "//:grpc_cpp_plugin",
plugin = plugin,
well_known_protos = well_known_protos,
**kwargs
)
if use_external:
# when this file is used by non-grpc projects
grpc_deps = ["//external:grpc++", "//external:grpc++_codegen_proto",
"//external:protobuf"]
else:
grpc_deps = ["//:grpc++", "//:grpc++_codegen_proto", "//external:protobuf"]
native.cc_library(
name = name,
srcs = [":" + codegen_grpc_target, ":" + codegen_target],
hdrs = [":" + codegen_grpc_target, ":" + codegen_target],
deps = deps + ["//:grpc++", "//:grpc++_codegen_proto", "//external:protobuf"],
deps = deps + grpc_deps,
**kwargs
)
else:

@ -31,8 +31,20 @@ def generate_cc_impl(ctx):
arguments += ["-I{0}={0}".format(include.path) for include in includes]
arguments += [proto.path for proto in protos]
# create a list of well known proto files if the argument is non-None
well_known_proto_files = []
if ctx.attr.well_known_protos:
f = ctx.attr.well_known_protos.files.to_list()[0].dirname
if f != "external/submodule_protobuf/src/google/protobuf":
print("Error: Only @submodule_protobuf//:well_known_protos is supported")
else:
# f points to "external/submodule_protobuf/src/google/protobuf"
# add -I argument to protoc so it knows where to look for the proto files.
arguments += ["-I{0}".format(f + "/../..")]
well_known_proto_files = [f for f in ctx.attr.well_known_protos.files]
ctx.action(
inputs = protos + includes + additional_input,
inputs = protos + includes + additional_input + well_known_proto_files,
outputs = out_files,
executable = ctx.executable._protoc,
arguments = arguments,
@ -56,6 +68,9 @@ generate_cc = rule(
mandatory = False,
allow_empty = True,
),
"well_known_protos" : attr.label(
mandatory = False,
),
"_protoc": attr.label(
default = Label("//external:protocol_compiler"),
executable = True,

@ -58,11 +58,14 @@ def grpc_proto_plugin(name, srcs = [], deps = []):
load("//:bazel/cc_grpc_library.bzl", "cc_grpc_library")
def grpc_proto_library(name, srcs = [], deps = [], well_known_deps = [], has_services = True):
def grpc_proto_library(name, srcs = [], deps = [], well_known_protos = None,
has_services = True, use_external = False):
cc_grpc_library(
name = name,
srcs = srcs,
deps = deps,
well_known_protos = well_known_protos,
proto_only = not has_services,
use_external = use_external,
)

@ -43,7 +43,11 @@
# out. It can be re-enabled for one build by setting the npm config
# variable grpc_uv to true, and it can be re-enabled permanently by
# setting it to true here.
'grpc_uv%': 'false'
'grpc_uv%': 'false',
# Some Node installations use the system installation of OpenSSL, and on
# some systems, the system OpenSSL still does not have ALPN support. This
# will let users recompile gRPC to work without ALPN.
'grpc_alpn%': 'true'
},
'target_defaults': {
'include_dirs': [
@ -73,10 +77,16 @@
'OPENSSL_NO_ASM'
]
}, {
# As of the beginning of 2017, we only support versions of Node with
# embedded versions of OpenSSL that support ALPN
'defines': [
'TSI_OPENSSL_ALPN_SUPPORT=1'
'conditions': [
['grpc_alpn=="true"', {
'defines': [
'TSI_OPENSSL_ALPN_SUPPORT=1'
],
}, {
'defines': [
'TSI_OPENSSL_ALPN_SUPPORT=0'
],
}]
],
'include_dirs': [
'<(node_root_dir)/deps/openssl/openssl/include',

@ -14,7 +14,7 @@ settings:
'#10': See the expand_version.py for all the quirks here
core_version: 3.0.0-dev
g_stands_for: green
version: 1.2.0-dev
version: 1.3.0-dev
filegroups:
- name: census
public_headers:
@ -586,7 +586,7 @@ filegroups:
headers:
- test/core/end2end/cq_verifier.h
- test/core/end2end/fake_resolver.h
- test/core/end2end/fixtures/http_proxy.h
- test/core/end2end/fixtures/http_proxy_fixture.h
- test/core/end2end/fixtures/proxy.h
- test/core/iomgr/endpoint_tests.h
- test/core/util/debugger_macros.h
@ -602,7 +602,7 @@ filegroups:
src:
- test/core/end2end/cq_verifier.c
- test/core/end2end/fake_resolver.c
- test/core/end2end/fixtures/http_proxy.c
- test/core/end2end/fixtures/http_proxy_fixture.c
- test/core/end2end/fixtures/proxy.c
- test/core/iomgr/endpoint_tests.c
- test/core/util/debugger_macros.c
@ -774,6 +774,7 @@ filegroups:
- include/grpc++/grpc++.h
- include/grpc++/health_check_service_interface.h
- include/grpc++/impl/call.h
- include/grpc++/impl/channel_argument_option.h
- include/grpc++/impl/client_unary_call.h
- include/grpc++/impl/codegen/core_codegen.h
- include/grpc++/impl/grpc_library.h
@ -830,6 +831,7 @@ filegroups:
- src/cpp/common/rpc_method.cc
- src/cpp/common/version_cc.cc
- src/cpp/server/async_generic_service.cc
- src/cpp/server/channel_argument_option.cc
- src/cpp/server/create_default_thread_pool.cc
- src/cpp/server/dynamic_thread_pool.cc
- src/cpp/server/health/default_health_check_service.cc
@ -1226,6 +1228,7 @@ libs:
deps:
- benchmark
- grpc++
- grpc_test_util
- grpc
- name: grpc_cli_libs
build: private
@ -1699,6 +1702,17 @@ targets:
- gpr
exclude_iomgrs:
- uv
- name: error_test
cpu_cost: 30
build: test
language: c
src:
- test/core/iomgr/error_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: ev_epoll_linux_test
build: test
language: c
@ -2505,6 +2519,16 @@ targets:
- grpc
- gpr_test_util
- gpr
- name: parse_address_test
build: test
language: c
src:
- test/core/client_channel/parse_address_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: percent_decode_fuzzer
build: fuzzer
language: c
@ -2761,6 +2785,16 @@ targets:
- grpc
- gpr_test_util
- gpr
- name: stream_owned_slice_test
build: test
language: c
src:
- test/core/transport/stream_owned_slice_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: tcp_client_posix_test
cpu_cost: 0.5
build: test
@ -3222,7 +3256,9 @@ targets:
deps:
- grpc_benchmark
- benchmark
- grpc++_test_util
- grpc_test_util
- grpc++
- grpc
- gpr_test_util
- gpr
@ -3918,6 +3954,21 @@ targets:
- grpc
- gpr_test_util
- gpr
- name: server_builder_test
gtest: true
build: test
language: c++
src:
- src/proto/grpc/testing/echo_messages.proto
- src/proto/grpc/testing/echo.proto
- test/cpp/server/server_builder_test.cc
deps:
- grpc++_test_util
- grpc_test_util
- gpr_test_util
- grpc++
- grpc
- gpr
- name: server_context_test_spouse_test
gtest: true
build: test

@ -94,8 +94,6 @@ the response stream needs to be text encoded e.g. when XHR is used or due
to security policies with XHR
* Accept: application/grpc-web-text
2. The default text encoding is base64
* Text encoding may be specified with Content-Type or Accept headers as
* application/grpc-web-text-base64
* Note that “Content-Transfer-Encoding: base64” should not be used.
Due to in-stream base64 padding when delimiting messages, the entire
response body is not necessarily a valid base64-encoded entity

@ -0,0 +1,5 @@
{
"sdk": {
"version": "1.0.0-preview2-003121"
}
}

@ -37,7 +37,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-Core'
version = '1.2.0-dev'
version = '1.3.0-dev'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'http://www.grpc.io'

@ -36,7 +36,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-ProtoRPC'
version = '1.2.0-dev'
version = '1.3.0-dev'
s.version = version
s.summary = 'RPC library for Protocol Buffers, based on gRPC'
s.homepage = 'http://www.grpc.io'

@ -36,7 +36,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC-RxLibrary'
version = '1.2.0-dev'
version = '1.3.0-dev'
s.version = version
s.summary = 'Reactive Extensions library for iOS/OSX.'
s.homepage = 'http://www.grpc.io'

@ -35,7 +35,7 @@
Pod::Spec.new do |s|
s.name = 'gRPC'
version = '1.2.0-dev'
version = '1.3.0-dev'
s.version = version
s.summary = 'gRPC client library for iOS/OSX'
s.homepage = 'http://www.grpc.io'

@ -258,6 +258,7 @@ EXPORTS
gpr_ref_non_zero
gpr_refn
gpr_unref
gpr_ref_is_unique
gpr_stats_init
gpr_stats_inc
gpr_stats_read

@ -0,0 +1,52 @@
/*
*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GRPCXX_IMPL_CHANNEL_ARGUMENT_OPTION_H
#define GRPCXX_IMPL_CHANNEL_ARGUMENT_OPTION_H
#include <map>
#include <memory>
#include <grpc++/impl/server_builder_option.h>
#include <grpc++/support/channel_arguments.h>
namespace grpc {
std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
const grpc::string &name, const grpc::string &value);
std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
const grpc::string &name, int value);
} // namespace grpc
#endif // GRPCXX_IMPL_CHANNEL_ARGUMENT_OPTION_H

@ -39,6 +39,7 @@
#include <memory>
#include <vector>
#include <grpc++/impl/channel_argument_option.h>
#include <grpc++/impl/server_builder_option.h>
#include <grpc++/impl/server_builder_plugin.h>
#include <grpc++/support/config.h>
@ -130,6 +131,13 @@ class ServerBuilder {
/// Only useful if this is a Synchronous server.
ServerBuilder& SetSyncServerOption(SyncServerOption option, int value);
/// Add a channel argument (an escape hatch to tuning core library parameters
/// directly)
template <class T>
ServerBuilder& AddChannelArgument(const grpc::string& arg, const T& value) {
return SetOption(MakeChannelArgumentOption(arg, value));
}
/// Tries to bind \a server to the given \a addr.
///
/// It can be invoked multiple times.

@ -164,6 +164,10 @@ GPRAPI void gpr_refn(gpr_refcount *r, int n);
zero. . Requires *r initialized. */
GPRAPI int gpr_unref(gpr_refcount *r);
/* Return non-zero iff the reference count of *r is one, and thus is owned
by exactly one object. */
GPRAPI int gpr_ref_is_unique(gpr_refcount *r);
/* --- Stats counters ---
These calls act on the integral type gpr_stats_counter. It requires no

@ -1,6 +1,6 @@
{
"name": "grpc",
"version": "1.2.0-dev",
"version": "1.3.0-dev",
"author": "Google Inc.",
"description": "gRPC Library for Node",
"homepage": "http://www.grpc.io/",

@ -13,8 +13,8 @@
<date>2017-03-01</date>
<time>16:06:07</time>
<version>
<release>1.2.0dev</release>
<api>1.2.0dev</api>
<release>1.3.0dev</release>
<api>1.3.0dev</api>
</version>
<stability>
<release>beta</release>

@ -3,6 +3,6 @@ coverage>=4.0
cython>=0.23
enum34>=1.0.4
futures>=2.2.0
protobuf>=3.0.0
protobuf>=3.2.0
six>=1.10
wheel>=0.29

@ -209,7 +209,7 @@ INSTALL_REQUIRES = (
'enum34>=1.0.4',
# TODO(atash): eventually split the grpcio package into a metapackage
# depending on protobuf and the runtime component (independent of protobuf)
'protobuf>=3.0.0',
'protobuf>=3.2.0',
)
if not PY3:

@ -102,7 +102,7 @@ grpc::string GetHeaderPrologue(File *file, const Parameters & /*params*/) {
vars["filename_base"] = file->filename_without_ext();
vars["message_header_ext"] = file->message_header_ext();
printer->Print(vars, "// Generated by the gRPC protobuf plugin.\n");
printer->Print(vars, "// Generated by the gRPC C++ plugin.\n");
printer->Print(vars,
"// If you make any local change, they will be lost.\n");
printer->Print(vars, "// source: $filename$\n");
@ -1010,7 +1010,7 @@ grpc::string GetSourcePrologue(File *file, const Parameters & /*params*/) {
vars["message_header_ext"] = file->message_header_ext();
vars["service_header_ext"] = file->service_header_ext();
printer->Print(vars, "// Generated by the gRPC protobuf plugin.\n");
printer->Print(vars, "// Generated by the gRPC C++ plugin.\n");
printer->Print(vars,
"// If you make any local change, they will be lost.\n");
printer->Print(vars, "// source: $filename$\n\n");

@ -64,7 +64,7 @@ static bool set_default_host_if_unset(grpc_exec_ctx *exec_ctx,
}
}
char *default_authority = grpc_get_default_authority(
grpc_channel_stack_builder_get_target(builder));
exec_ctx, grpc_channel_stack_builder_get_target(builder));
if (default_authority != NULL) {
grpc_arg arg;
arg.type = GRPC_ARG_STRING;

@ -46,10 +46,11 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/support/env.h"
static char* grpc_get_http_proxy_server() {
static char* grpc_get_http_proxy_server(grpc_exec_ctx* exec_ctx) {
char* uri_str = gpr_getenv("http_proxy");
if (uri_str == NULL) return NULL;
grpc_uri* uri = grpc_uri_parse(uri_str, false /* suppress_errors */);
grpc_uri* uri =
grpc_uri_parse(exec_ctx, uri_str, false /* suppress_errors */);
char* proxy_name = NULL;
if (uri == NULL || uri->authority == NULL) {
gpr_log(GPR_ERROR, "cannot parse value of 'http_proxy' env var");
@ -76,9 +77,10 @@ static bool proxy_mapper_map_name(grpc_exec_ctx* exec_ctx,
const grpc_channel_args* args,
char** name_to_resolve,
grpc_channel_args** new_args) {
*name_to_resolve = grpc_get_http_proxy_server();
*name_to_resolve = grpc_get_http_proxy_server(exec_ctx);
if (*name_to_resolve == NULL) return false;
grpc_uri* uri = grpc_uri_parse(server_uri, false /* suppress_errors */);
grpc_uri* uri =
grpc_uri_parse(exec_ctx, server_uri, false /* suppress_errors */);
if (uri == NULL || uri->path[0] == '\0') {
gpr_log(GPR_ERROR,
"'http_proxy' environment variable set, but cannot "

@ -44,6 +44,7 @@
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/support/string.h"
#ifdef GRPC_HAVE_UNIX_SOCKET
@ -120,9 +121,30 @@ int parse_ipv6(grpc_uri *uri, grpc_resolved_address *resolved_addr) {
memset(in6, 0, sizeof(*in6));
resolved_addr->len = sizeof(*in6);
in6->sin6_family = AF_INET6;
if (inet_pton(AF_INET6, host, &in6->sin6_addr) == 0) {
gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host);
goto done;
/* Handle the RFC6874 syntax for IPv6 zone identifiers. */
char *host_end = (char *)gpr_memrchr(host, '%', strlen(host));
if (host_end != NULL) {
GPR_ASSERT(host_end >= host);
char host_without_scope[INET6_ADDRSTRLEN];
size_t host_without_scope_len = (size_t)(host_end - host);
strncpy(host_without_scope, host, host_without_scope_len);
host_without_scope[host_without_scope_len] = '\0';
if (inet_pton(AF_INET6, host_without_scope, &in6->sin6_addr) == 0) {
gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host_without_scope);
goto done;
}
if (gpr_parse_bytes_to_uint32(host_end + 1,
strlen(host) - host_without_scope_len - 1,
&in6->sin6_scope_id) == 0) {
gpr_log(GPR_ERROR, "invalid ipv6 scope id: '%s'", host_end + 1);
goto done;
}
} else {
if (inet_pton(AF_INET6, host, &in6->sin6_addr) == 0) {
gpr_log(GPR_ERROR, "invalid ipv6 address: '%s'", host);
goto done;
}
}
if (port != NULL) {

@ -108,22 +108,23 @@ static grpc_resolver_factory *lookup_factory_by_uri(grpc_uri *uri) {
return lookup_factory(uri->scheme);
}
static grpc_resolver_factory *resolve_factory(const char *target,
static grpc_resolver_factory *resolve_factory(grpc_exec_ctx *exec_ctx,
const char *target,
grpc_uri **uri,
char **canonical_target) {
grpc_resolver_factory *factory = NULL;
GPR_ASSERT(uri != NULL);
*uri = grpc_uri_parse(target, 1);
*uri = grpc_uri_parse(exec_ctx, target, 1);
factory = lookup_factory_by_uri(*uri);
if (factory == NULL) {
grpc_uri_destroy(*uri);
gpr_asprintf(canonical_target, "%s%s", g_default_resolver_prefix, target);
*uri = grpc_uri_parse(*canonical_target, 1);
*uri = grpc_uri_parse(exec_ctx, *canonical_target, 1);
factory = lookup_factory_by_uri(*uri);
if (factory == NULL) {
grpc_uri_destroy(grpc_uri_parse(target, 0));
grpc_uri_destroy(grpc_uri_parse(*canonical_target, 0));
grpc_uri_destroy(grpc_uri_parse(exec_ctx, target, 0));
grpc_uri_destroy(grpc_uri_parse(exec_ctx, *canonical_target, 0));
gpr_log(GPR_ERROR, "don't know how to resolve '%s' or '%s'", target,
*canonical_target);
}
@ -138,7 +139,7 @@ grpc_resolver *grpc_resolver_create(grpc_exec_ctx *exec_ctx, const char *target,
grpc_uri *uri = NULL;
char *canonical_target = NULL;
grpc_resolver_factory *factory =
resolve_factory(target, &uri, &canonical_target);
resolve_factory(exec_ctx, target, &uri, &canonical_target);
grpc_resolver *resolver;
grpc_resolver_args resolver_args;
memset(&resolver_args, 0, sizeof(resolver_args));
@ -153,21 +154,22 @@ grpc_resolver *grpc_resolver_create(grpc_exec_ctx *exec_ctx, const char *target,
return resolver;
}
char *grpc_get_default_authority(const char *target) {
char *grpc_get_default_authority(grpc_exec_ctx *exec_ctx, const char *target) {
grpc_uri *uri = NULL;
char *canonical_target = NULL;
grpc_resolver_factory *factory =
resolve_factory(target, &uri, &canonical_target);
resolve_factory(exec_ctx, target, &uri, &canonical_target);
char *authority = grpc_resolver_factory_get_default_authority(factory, uri);
grpc_uri_destroy(uri);
gpr_free(canonical_target);
return authority;
}
char *grpc_resolver_factory_add_default_prefix_if_needed(const char *target) {
char *grpc_resolver_factory_add_default_prefix_if_needed(
grpc_exec_ctx *exec_ctx, const char *target) {
grpc_uri *uri = NULL;
char *canonical_target = NULL;
resolve_factory(target, &uri, &canonical_target);
resolve_factory(exec_ctx, target, &uri, &canonical_target);
grpc_uri_destroy(uri);
return canonical_target == NULL ? gpr_strdup(target) : canonical_target;
}

@ -74,10 +74,11 @@ grpc_resolver_factory *grpc_resolver_factory_lookup(const char *name);
/** Given a target, return a (freshly allocated with gpr_malloc) string
representing the default authority to pass from a client. */
char *grpc_get_default_authority(const char *target);
char *grpc_get_default_authority(grpc_exec_ctx *exec_ctx, const char *target);
/** Returns a newly allocated string containing \a target, adding the
default prefix if needed. */
char *grpc_resolver_factory_add_default_prefix_if_needed(const char *target);
char *grpc_resolver_factory_add_default_prefix_if_needed(
grpc_exec_ctx *exec_ctx, const char *target);
#endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_RESOLVER_REGISTRY_H */

@ -331,7 +331,7 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
}
c->pollset_set = grpc_pollset_set_create();
grpc_resolved_address *addr = gpr_malloc(sizeof(*addr));
grpc_get_subchannel_address_arg(args->args, addr);
grpc_get_subchannel_address_arg(exec_ctx, args->args, addr);
grpc_set_initial_connect_string(&addr, &c->initial_connect_string);
grpc_resolved_address *new_address = NULL;
grpc_channel_args *new_args = NULL;
@ -787,9 +787,9 @@ grpc_call_stack *grpc_subchannel_call_get_call_stack(
return SUBCHANNEL_CALL_TO_CALL_STACK(subchannel_call);
}
static void grpc_uri_to_sockaddr(const char *uri_str,
static void grpc_uri_to_sockaddr(grpc_exec_ctx *exec_ctx, const char *uri_str,
grpc_resolved_address *addr) {
grpc_uri *uri = grpc_uri_parse(uri_str, 0 /* suppress_errors */);
grpc_uri *uri = grpc_uri_parse(exec_ctx, uri_str, 0 /* suppress_errors */);
GPR_ASSERT(uri != NULL);
if (strcmp(uri->scheme, "ipv4") == 0) {
GPR_ASSERT(parse_ipv4(uri, addr));
@ -801,12 +801,13 @@ static void grpc_uri_to_sockaddr(const char *uri_str,
grpc_uri_destroy(uri);
}
void grpc_get_subchannel_address_arg(const grpc_channel_args *args,
void grpc_get_subchannel_address_arg(grpc_exec_ctx *exec_ctx,
const grpc_channel_args *args,
grpc_resolved_address *addr) {
const char *addr_uri_str = grpc_get_subchannel_address_uri_arg(args);
memset(addr, 0, sizeof(*addr));
if (*addr_uri_str != '\0') {
grpc_uri_to_sockaddr(addr_uri_str, addr);
grpc_uri_to_sockaddr(exec_ctx, addr_uri_str, addr);
}
}

@ -175,7 +175,8 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
const grpc_subchannel_args *args);
/// Sets \a addr from \a args.
void grpc_get_subchannel_address_arg(const grpc_channel_args *args,
void grpc_get_subchannel_address_arg(grpc_exec_ctx *exec_ctx,
const grpc_channel_args *args,
grpc_resolved_address *addr);
/// Returns the URI string for the address to connect to.

@ -35,13 +35,15 @@
#include <string.h>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
#include "src/core/lib/slice/percent_encoding.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/support/string.h"
/** a size_t default value... maps to all 1's */
@ -68,11 +70,16 @@ static grpc_uri *bad_uri(const char *uri_text, size_t pos, const char *section,
return NULL;
}
/** Returns a copy of \a src[begin, end) */
static char *copy_component(const char *src, size_t begin, size_t end) {
char *out = gpr_malloc(end - begin + 1);
memcpy(out, src + begin, end - begin);
out[end - begin] = 0;
/** Returns a copy of percent decoded \a src[begin, end) */
static char *decode_and_copy_component(grpc_exec_ctx *exec_ctx, const char *src,
size_t begin, size_t end) {
grpc_slice component =
grpc_slice_from_copied_buffer(src + begin, end - begin);
grpc_slice decoded_component =
grpc_permissive_percent_decode_slice(component);
char *out = grpc_dump_slice(decoded_component, GPR_DUMP_ASCII);
grpc_slice_unref_internal(exec_ctx, component);
grpc_slice_unref_internal(exec_ctx, decoded_component);
return out;
}
@ -175,7 +182,8 @@ static void parse_query_parts(grpc_uri *uri) {
}
}
grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors) {
grpc_uri *grpc_uri_parse(grpc_exec_ctx *exec_ctx, const char *uri_text,
int suppress_errors) {
grpc_uri *uri;
size_t scheme_begin = 0;
size_t scheme_end = NOT_SET;
@ -263,11 +271,16 @@ grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors) {
}
uri = gpr_zalloc(sizeof(*uri));
uri->scheme = copy_component(uri_text, scheme_begin, scheme_end);
uri->authority = copy_component(uri_text, authority_begin, authority_end);
uri->path = copy_component(uri_text, path_begin, path_end);
uri->query = copy_component(uri_text, query_begin, query_end);
uri->fragment = copy_component(uri_text, fragment_begin, fragment_end);
uri->scheme =
decode_and_copy_component(exec_ctx, uri_text, scheme_begin, scheme_end);
uri->authority = decode_and_copy_component(exec_ctx, uri_text,
authority_begin, authority_end);
uri->path =
decode_and_copy_component(exec_ctx, uri_text, path_begin, path_end);
uri->query =
decode_and_copy_component(exec_ctx, uri_text, query_begin, query_end);
uri->fragment = decode_and_copy_component(exec_ctx, uri_text, fragment_begin,
fragment_end);
parse_query_parts(uri);
return uri;

@ -35,6 +35,7 @@
#define GRPC_CORE_EXT_CLIENT_CHANNEL_URI_PARSER_H
#include <stddef.h>
#include "src/core/lib/iomgr/exec_ctx.h"
typedef struct {
char *scheme;
@ -51,7 +52,8 @@ typedef struct {
} grpc_uri;
/** parse a uri, return NULL on failure */
grpc_uri *grpc_uri_parse(const char *uri_text, int suppress_errors);
grpc_uri *grpc_uri_parse(grpc_exec_ctx *exec_ctx, const char *uri_text,
int suppress_errors);
/** return the part of a query string after the '=' in "?key=xxx&...", or NULL
* if key is not present */

@ -861,7 +861,7 @@ static grpc_lb_policy *glb_create(grpc_exec_ctx *exec_ctx,
arg = grpc_channel_args_find(args->args, GRPC_ARG_SERVER_URI);
GPR_ASSERT(arg != NULL);
GPR_ASSERT(arg->type == GRPC_ARG_STRING);
grpc_uri *uri = grpc_uri_parse(arg->value.string, true);
grpc_uri *uri = grpc_uri_parse(exec_ctx, arg->value.string, true);
GPR_ASSERT(uri->path[0] != '\0');
glb_policy->server_name =
gpr_strdup(uri->path[0] == '/' ? uri->path + 1 : uri->path);

@ -226,7 +226,7 @@ static void chttp2_connector_connect(grpc_exec_ctx *exec_ctx,
grpc_closure *notify) {
chttp2_connector *c = (chttp2_connector *)con;
grpc_resolved_address addr;
grpc_get_subchannel_address_arg(args->channel_args, &addr);
grpc_get_subchannel_address_arg(exec_ctx, args->channel_args, &addr);
gpr_mu_lock(&c->mu);
GPR_ASSERT(c->notify == NULL);
c->notify = notify;

@ -72,7 +72,8 @@ static grpc_channel *client_channel_factory_create_channel(
grpc_arg arg;
arg.type = GRPC_ARG_STRING;
arg.key = GRPC_ARG_SERVER_URI;
arg.value.string = grpc_resolver_factory_add_default_prefix_if_needed(target);
arg.value.string =
grpc_resolver_factory_add_default_prefix_if_needed(exec_ctx, target);
const char *to_remove[] = {GRPC_ARG_SERVER_URI};
grpc_channel_args *new_args =
grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);

@ -83,7 +83,7 @@ static grpc_subchannel_args *get_secure_naming_subchannel_args(
const char *server_uri_str = server_uri_arg->value.string;
GPR_ASSERT(server_uri_str != NULL);
grpc_uri *server_uri =
grpc_uri_parse(server_uri_str, true /* supress errors */);
grpc_uri_parse(exec_ctx, server_uri_str, true /* supress errors */);
GPR_ASSERT(server_uri != NULL);
const char *server_uri_path;
server_uri_path =
@ -96,7 +96,7 @@ static grpc_subchannel_args *get_secure_naming_subchannel_args(
const char *target_uri_str =
grpc_get_subchannel_address_uri_arg(args->args);
grpc_uri *target_uri =
grpc_uri_parse(target_uri_str, false /* suppress errors */);
grpc_uri_parse(exec_ctx, target_uri_str, false /* suppress errors */);
GPR_ASSERT(target_uri != NULL);
if (target_uri->path[0] != '\0') { // "path" may be empty
const grpc_slice key = grpc_slice_from_static_string(
@ -181,7 +181,8 @@ static grpc_channel *client_channel_factory_create_channel(
grpc_arg arg;
arg.type = GRPC_ARG_STRING;
arg.key = GRPC_ARG_SERVER_URI;
arg.value.string = grpc_resolver_factory_add_default_prefix_if_needed(target);
arg.value.string =
grpc_resolver_factory_add_default_prefix_if_needed(exec_ctx, target);
const char *to_remove[] = {GRPC_ARG_SERVER_URI};
grpc_channel_args *new_args =
grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);

@ -381,16 +381,38 @@ static grpc_error *update_incoming_window(grpc_exec_ctx *exec_ctx,
s->incoming_window_delta +
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]) {
char *msg;
gpr_asprintf(&msg,
"frame of size %d overflows incoming window of %" PRId64,
t->incoming_frame_size,
s->incoming_window_delta +
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]);
grpc_error *err = GRPC_ERROR_CREATE(msg);
gpr_free(msg);
return err;
if (incoming_frame_size <=
s->incoming_window_delta +
t->settings[GRPC_SENT_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]) {
gpr_log(
GPR_ERROR,
"Incoming frame of size %d exceeds incoming window size of %" PRId64
".\n"
"The (un-acked, future) window size would be %" PRId64
" which is not exceeded.\n"
"This would usually cause a disconnection, but allowing it due to "
"broken HTTP2 implementations in the wild.\n"
"See (for example) https://github.com/netty/netty/issues/6520.",
t->incoming_frame_size,
s->incoming_window_delta +
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE],
s->incoming_window_delta +
t->settings[GRPC_SENT_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]);
} else {
char *msg;
gpr_asprintf(&msg,
"frame of size %d overflows incoming window of %" PRId64,
t->incoming_frame_size,
s->incoming_window_delta +
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]);
grpc_error *err = GRPC_ERROR_CREATE(msg);
gpr_free(msg);
return err;
}
}
GRPC_CHTTP2_FLOW_DEBIT_STREAM_INCOMING_WINDOW_DELTA("parse", t, s,

@ -35,6 +35,7 @@
#include <string.h>
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@ -47,46 +48,7 @@
#include "src/core/lib/iomgr/error_internal.h"
#include "src/core/lib/profiling/timers.h"
static void destroy_integer(void *key) {}
static void *copy_integer(void *key) { return key; }
static long compare_integers(void *key1, void *key2) {
return GPR_ICMP((uintptr_t)key1, (uintptr_t)key2);
}
static void destroy_string(void *str) { gpr_free(str); }
static void *copy_string(void *str) { return gpr_strdup(str); }
static void destroy_err(void *err) { GRPC_ERROR_UNREF(err); }
static void *copy_err(void *err) { return GRPC_ERROR_REF(err); }
static void destroy_time(void *tm) { gpr_free(tm); }
static gpr_timespec *box_time(gpr_timespec tm) {
gpr_timespec *out = gpr_malloc(sizeof(*out));
*out = tm;
return out;
}
static void *copy_time(void *tm) { return box_time(*(gpr_timespec *)tm); }
static const gpr_avl_vtable avl_vtable_ints = {destroy_integer, copy_integer,
compare_integers,
destroy_integer, copy_integer};
static const gpr_avl_vtable avl_vtable_strs = {destroy_integer, copy_integer,
compare_integers, destroy_string,
copy_string};
static const gpr_avl_vtable avl_vtable_times = {
destroy_integer, copy_integer, compare_integers, destroy_time, copy_time};
static const gpr_avl_vtable avl_vtable_errs = {
destroy_integer, copy_integer, compare_integers, destroy_err, copy_err};
#include "src/core/lib/slice/slice_internal.h"
static const char *error_int_name(grpc_error_ints key) {
switch (key) {
@ -120,6 +82,8 @@ static const char *error_int_name(grpc_error_ints key) {
return "limit";
case GRPC_ERROR_INT_OCCURRED_DURING_WRITE:
return "occurred_during_write";
case GRPC_ERROR_INT_MAX:
GPR_UNREACHABLE_CODE(return "unknown");
}
GPR_UNREACHABLE_CODE(return "unknown");
}
@ -150,6 +114,8 @@ static const char *error_str_name(grpc_error_strs key) {
return "filename";
case GRPC_ERROR_STR_QUEUED_BUFFERS:
return "queued_buffers";
case GRPC_ERROR_STR_MAX:
GPR_UNREACHABLE_CODE(return "unknown");
}
GPR_UNREACHABLE_CODE(return "unknown");
}
@ -158,6 +124,8 @@ static const char *error_time_name(grpc_error_times key) {
switch (key) {
case GRPC_ERROR_TIME_CREATED:
return "created";
case GRPC_ERROR_TIME_MAX:
GPR_UNREACHABLE_CODE(return "unknown");
}
GPR_UNREACHABLE_CODE(return "unknown");
}
@ -184,12 +152,36 @@ grpc_error *grpc_error_ref(grpc_error *err) {
}
#endif
static void unref_errs(grpc_error *err) {
uint8_t slot = err->first_err;
while (slot != UINT8_MAX) {
grpc_linked_error *lerr = (grpc_linked_error *)(err->arena + slot);
GRPC_ERROR_UNREF(lerr->err);
GPR_ASSERT(err->last_err == slot ? lerr->next == UINT8_MAX
: lerr->next != UINT8_MAX);
slot = lerr->next;
}
}
static void unref_slice(grpc_slice slice) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_slice_unref_internal(&exec_ctx, slice);
grpc_exec_ctx_finish(&exec_ctx);
}
static void unref_strs(grpc_error *err) {
for (size_t which = 0; which < GRPC_ERROR_STR_MAX; ++which) {
uint8_t slot = err->strs[which];
if (slot != UINT8_MAX) {
unref_slice(*(grpc_slice *)(err->arena + slot));
}
}
}
static void error_destroy(grpc_error *err) {
GPR_ASSERT(!grpc_error_is_special(err));
gpr_avl_unref(err->ints);
gpr_avl_unref(err->strs);
gpr_avl_unref(err->errs);
gpr_avl_unref(err->times);
unref_errs(err);
unref_strs(err);
gpr_free((void *)gpr_atm_acq_load(&err->error_string));
gpr_free(err);
}
@ -213,67 +205,189 @@ void grpc_error_unref(grpc_error *err) {
}
#endif
static uint8_t get_placement(grpc_error **err, size_t size) {
GPR_ASSERT(*err);
uint8_t slots = (uint8_t)(size / sizeof(intptr_t));
if ((*err)->arena_size + slots > (*err)->arena_capacity) {
(*err)->arena_capacity = (uint8_t)(3 * (*err)->arena_capacity / 2);
*err = gpr_realloc(
*err, sizeof(grpc_error) + (*err)->arena_capacity * sizeof(intptr_t));
}
uint8_t placement = (*err)->arena_size;
(*err)->arena_size = (uint8_t)((*err)->arena_size + slots);
return placement;
}
static void internal_set_int(grpc_error **err, grpc_error_ints which,
intptr_t value) {
// GPR_ASSERT((*err)->ints[which] == UINT8_MAX); // TODO, enforce this
uint8_t slot = (*err)->ints[which];
if (slot == UINT8_MAX) {
slot = get_placement(err, sizeof(value));
}
(*err)->ints[which] = slot;
(*err)->arena[slot] = value;
}
static void internal_set_str(grpc_error **err, grpc_error_strs which,
grpc_slice value) {
// GPR_ASSERT((*err)->strs[which] == UINT8_MAX); // TODO, enforce this
uint8_t slot = (*err)->strs[which];
if (slot == UINT8_MAX) {
slot = get_placement(err, sizeof(value));
} else {
unref_slice(*(grpc_slice *)((*err)->arena + slot));
}
(*err)->strs[which] = slot;
memcpy((*err)->arena + slot, &value, sizeof(value));
}
static void internal_set_time(grpc_error **err, grpc_error_times which,
gpr_timespec value) {
// GPR_ASSERT((*err)->times[which] == UINT8_MAX); // TODO, enforce this
uint8_t slot = (*err)->times[which];
if (slot == UINT8_MAX) {
slot = get_placement(err, sizeof(value));
}
(*err)->times[which] = slot;
memcpy((*err)->arena + slot, &value, sizeof(value));
}
static void internal_add_error(grpc_error **err, grpc_error *new) {
grpc_linked_error new_last = {new, UINT8_MAX};
uint8_t slot = get_placement(err, sizeof(grpc_linked_error));
if ((*err)->first_err == UINT8_MAX) {
GPR_ASSERT((*err)->last_err == UINT8_MAX);
(*err)->last_err = slot;
(*err)->first_err = slot;
} else {
GPR_ASSERT((*err)->last_err != UINT8_MAX);
grpc_linked_error *old_last =
(grpc_linked_error *)((*err)->arena + (*err)->last_err);
old_last->next = slot;
(*err)->last_err = slot;
}
memcpy((*err)->arena + slot, &new_last, sizeof(grpc_linked_error));
}
#define SLOTS_PER_INT (sizeof(intptr_t) / sizeof(intptr_t))
#define SLOTS_PER_STR (sizeof(grpc_slice) / sizeof(intptr_t))
#define SLOTS_PER_TIME (sizeof(gpr_timespec) / sizeof(intptr_t))
#define SLOTS_PER_LINKED_ERROR (sizeof(grpc_linked_error) / sizeof(intptr_t))
// size of storing one int and two slices and a timespec. For line, desc, file,
// and time created
#define DEFAULT_ERROR_CAPACITY \
(SLOTS_PER_INT + (SLOTS_PER_STR * 2) + SLOTS_PER_TIME)
// It is very common to include and extra int and string in an error
#define SURPLUS_CAPACITY (2 * SLOTS_PER_INT + SLOTS_PER_TIME)
grpc_error *grpc_error_create(const char *file, int line, const char *desc,
grpc_error **referencing,
size_t num_referencing) {
GPR_TIMER_BEGIN("grpc_error_create", 0);
grpc_error *err = gpr_malloc(sizeof(*err));
uint8_t initial_arena_capacity = (uint8_t)(
DEFAULT_ERROR_CAPACITY +
(uint8_t)(num_referencing * SLOTS_PER_LINKED_ERROR) + SURPLUS_CAPACITY);
grpc_error *err =
gpr_malloc(sizeof(*err) + initial_arena_capacity * sizeof(intptr_t));
if (err == NULL) { // TODO(ctiller): make gpr_malloc return NULL
return GRPC_ERROR_OOM;
}
#ifdef GRPC_ERROR_REFCOUNT_DEBUG
gpr_log(GPR_DEBUG, "%p create [%s:%d]", err, file, line);
#endif
err->ints = gpr_avl_add(gpr_avl_create(&avl_vtable_ints),
(void *)(uintptr_t)GRPC_ERROR_INT_FILE_LINE,
(void *)(uintptr_t)line);
err->strs = gpr_avl_add(
gpr_avl_add(gpr_avl_create(&avl_vtable_strs),
(void *)(uintptr_t)GRPC_ERROR_STR_FILE, gpr_strdup(file)),
(void *)(uintptr_t)GRPC_ERROR_STR_DESCRIPTION, gpr_strdup(desc));
err->errs = gpr_avl_create(&avl_vtable_errs);
err->next_err = 0;
for (size_t i = 0; i < num_referencing; i++) {
err->arena_size = 0;
err->arena_capacity = initial_arena_capacity;
err->first_err = UINT8_MAX;
err->last_err = UINT8_MAX;
memset(err->ints, UINT8_MAX, GRPC_ERROR_INT_MAX);
memset(err->strs, UINT8_MAX, GRPC_ERROR_STR_MAX);
memset(err->times, UINT8_MAX, GRPC_ERROR_TIME_MAX);
internal_set_int(&err, GRPC_ERROR_INT_FILE_LINE, line);
internal_set_str(&err, GRPC_ERROR_STR_FILE,
grpc_slice_from_static_string(file));
internal_set_str(
&err, GRPC_ERROR_STR_DESCRIPTION,
grpc_slice_from_copied_buffer(
desc,
strlen(desc) +
1)); // TODO, pull this up. // TODO(ncteisen), pull this up.
for (size_t i = 0; i < num_referencing; ++i) {
if (referencing[i] == GRPC_ERROR_NONE) continue;
err->errs = gpr_avl_add(err->errs, (void *)(err->next_err++),
GRPC_ERROR_REF(referencing[i]));
internal_add_error(
&err,
GRPC_ERROR_REF(
referencing[i])); // TODO(ncteisen), change ownership semantics
}
err->times = gpr_avl_add(gpr_avl_create(&avl_vtable_times),
(void *)(uintptr_t)GRPC_ERROR_TIME_CREATED,
box_time(gpr_now(GPR_CLOCK_REALTIME)));
internal_set_time(&err, GRPC_ERROR_TIME_CREATED, gpr_now(GPR_CLOCK_REALTIME));
gpr_atm_no_barrier_store(&err->error_string, 0);
gpr_ref_init(&err->refs, 1);
GPR_TIMER_END("grpc_error_create", 0);
return err;
}
static void ref_strs(grpc_error *err) {
for (size_t i = 0; i < GRPC_ERROR_STR_MAX; ++i) {
uint8_t slot = err->strs[i];
if (slot != UINT8_MAX) {
grpc_slice_ref_internal(*(grpc_slice *)(err->arena + slot));
}
}
}
static void ref_errs(grpc_error *err) {
uint8_t slot = err->first_err;
while (slot != UINT8_MAX) {
grpc_linked_error *lerr = (grpc_linked_error *)(err->arena + slot);
GRPC_ERROR_REF(lerr->err);
slot = lerr->next;
}
}
static grpc_error *copy_error_and_unref(grpc_error *in) {
GPR_TIMER_BEGIN("copy_error_and_unref", 0);
grpc_error *out;
if (grpc_error_is_special(in)) {
if (in == GRPC_ERROR_NONE)
out = grpc_error_set_int(GRPC_ERROR_CREATE("no error"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_OK);
else if (in == GRPC_ERROR_OOM)
out = GRPC_ERROR_CREATE("oom");
else if (in == GRPC_ERROR_CANCELLED)
out =
grpc_error_set_int(GRPC_ERROR_CREATE("cancelled"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_CANCELLED);
else
out = GRPC_ERROR_CREATE("unknown");
out = GRPC_ERROR_CREATE("unknown");
if (in == GRPC_ERROR_NONE) {
internal_set_str(&out, GRPC_ERROR_STR_DESCRIPTION,
grpc_slice_from_static_string("no error"));
internal_set_int(&out, GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_OK);
} else if (in == GRPC_ERROR_OOM) {
internal_set_str(&out, GRPC_ERROR_STR_DESCRIPTION,
grpc_slice_from_static_string("oom"));
} else if (in == GRPC_ERROR_CANCELLED) {
internal_set_str(&out, GRPC_ERROR_STR_DESCRIPTION,
grpc_slice_from_static_string("cancelled"));
internal_set_int(&out, GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_CANCELLED);
}
} else if (gpr_ref_is_unique(&in->refs)) {
out = in;
} else {
out = gpr_malloc(sizeof(*out));
uint8_t new_arena_capacity = in->arena_capacity;
// the returned err will be added to, so we ensure this is room to avoid
// unneeded allocations.
if (in->arena_capacity - in->arena_size < (uint8_t)SLOTS_PER_STR) {
new_arena_capacity = (uint8_t)(3 * new_arena_capacity / 2);
}
out = gpr_malloc(sizeof(*in) + new_arena_capacity * sizeof(intptr_t));
#ifdef GRPC_ERROR_REFCOUNT_DEBUG
gpr_log(GPR_DEBUG, "%p create copying %p", out, in);
#endif
out->ints = gpr_avl_ref(in->ints);
out->strs = gpr_avl_ref(in->strs);
out->errs = gpr_avl_ref(in->errs);
out->times = gpr_avl_ref(in->times);
memcpy(out, in, sizeof(*in) + in->arena_size * sizeof(intptr_t));
out->arena_capacity = new_arena_capacity;
gpr_atm_no_barrier_store(&out->error_string, 0);
out->next_err = in->next_err;
gpr_ref_init(&out->refs, 1);
ref_strs(out);
ref_errs(out);
GRPC_ERROR_UNREF(in);
}
GPR_TIMER_END("copy_error_and_unref", 0);
@ -284,7 +398,7 @@ grpc_error *grpc_error_set_int(grpc_error *src, grpc_error_ints which,
intptr_t value) {
GPR_TIMER_BEGIN("grpc_error_set_int", 0);
grpc_error *new = copy_error_and_unref(src);
new->ints = gpr_avl_add(new->ints, (void *)(uintptr_t)which, (void *)value);
internal_set_int(&new, which, value);
GPR_TIMER_END("grpc_error_set_int", 0);
return new;
}
@ -302,7 +416,6 @@ static special_error_status_map error_status_map[] = {
bool grpc_error_get_int(grpc_error *err, grpc_error_ints which, intptr_t *p) {
GPR_TIMER_BEGIN("grpc_error_get_int", 0);
void *pp;
if (grpc_error_is_special(err)) {
if (which == GRPC_ERROR_INT_GRPC_STATUS) {
for (size_t i = 0; i < GPR_ARRAY_SIZE(error_status_map); i++) {
@ -316,8 +429,9 @@ bool grpc_error_get_int(grpc_error *err, grpc_error_ints which, intptr_t *p) {
GPR_TIMER_END("grpc_error_get_int", 0);
return false;
}
if (gpr_avl_maybe_get(err->ints, (void *)(uintptr_t)which, &pp)) {
if (p != NULL) *p = (intptr_t)pp;
uint8_t slot = err->ints[which];
if (slot != UINT8_MAX) {
if (p != NULL) *p = err->arena[slot];
GPR_TIMER_END("grpc_error_get_int", 0);
return true;
}
@ -329,8 +443,9 @@ grpc_error *grpc_error_set_str(grpc_error *src, grpc_error_strs which,
const char *value) {
GPR_TIMER_BEGIN("grpc_error_set_str", 0);
grpc_error *new = copy_error_and_unref(src);
new->strs =
gpr_avl_add(new->strs, (void *)(uintptr_t)which, gpr_strdup(value));
internal_set_str(&new, which,
grpc_slice_from_copied_buffer(
value, strlen(value) + 1)); // TODO, pull this up.
GPR_TIMER_END("grpc_error_set_str", 0);
return new;
}
@ -346,13 +461,19 @@ const char *grpc_error_get_str(grpc_error *err, grpc_error_strs which) {
}
return NULL;
}
return gpr_avl_get(err->strs, (void *)(uintptr_t)which);
uint8_t slot = err->strs[which];
if (slot != UINT8_MAX) {
return (const char *)GRPC_SLICE_START_PTR(
*(grpc_slice *)(err->arena + slot));
} else {
return NULL;
}
}
grpc_error *grpc_error_add_child(grpc_error *src, grpc_error *child) {
GPR_TIMER_BEGIN("grpc_error_add_child", 0);
grpc_error *new = copy_error_and_unref(src);
new->errs = gpr_avl_add(new->errs, (void *)(new->next_err++), child);
internal_add_error(&new, child);
GPR_TIMER_END("grpc_error_add_child", 0);
return new;
}
@ -372,42 +493,6 @@ typedef struct {
size_t cap_kvs;
} kv_pairs;
static void append_kv(kv_pairs *kvs, char *key, char *value) {
if (kvs->num_kvs == kvs->cap_kvs) {
kvs->cap_kvs = GPR_MAX(3 * kvs->cap_kvs / 2, 4);
kvs->kvs = gpr_realloc(kvs->kvs, sizeof(*kvs->kvs) * kvs->cap_kvs);
}
kvs->kvs[kvs->num_kvs].key = key;
kvs->kvs[kvs->num_kvs].value = value;
kvs->num_kvs++;
}
static void collect_kvs(gpr_avl_node *node, char *key(void *k),
char *fmt(void *v), kv_pairs *kvs) {
if (node == NULL) return;
append_kv(kvs, key(node->key), fmt(node->value));
collect_kvs(node->left, key, fmt, kvs);
collect_kvs(node->right, key, fmt, kvs);
}
static char *key_int(void *p) {
return gpr_strdup(error_int_name((grpc_error_ints)(uintptr_t)p));
}
static char *key_str(void *p) {
return gpr_strdup(error_str_name((grpc_error_strs)(uintptr_t)p));
}
static char *key_time(void *p) {
return gpr_strdup(error_time_name((grpc_error_times)(uintptr_t)p));
}
static char *fmt_int(void *p) {
char *s;
gpr_asprintf(&s, "%" PRIdPTR, (intptr_t)p);
return s;
}
static void append_chr(char c, char **s, size_t *sz, size_t *cap) {
if (*sz == *cap) {
*cap = GPR_MAX(8, 3 * *cap / 2);
@ -459,6 +544,40 @@ static void append_esc_str(const char *str, char **s, size_t *sz, size_t *cap) {
append_chr('"', s, sz, cap);
}
static void append_kv(kv_pairs *kvs, char *key, char *value) {
if (kvs->num_kvs == kvs->cap_kvs) {
kvs->cap_kvs = GPR_MAX(3 * kvs->cap_kvs / 2, 4);
kvs->kvs = gpr_realloc(kvs->kvs, sizeof(*kvs->kvs) * kvs->cap_kvs);
}
kvs->kvs[kvs->num_kvs].key = key;
kvs->kvs[kvs->num_kvs].value = value;
kvs->num_kvs++;
}
static char *key_int(grpc_error_ints which) {
return gpr_strdup(error_int_name(which));
}
static char *fmt_int(intptr_t p) {
char *s;
gpr_asprintf(&s, "%" PRIdPTR, p);
return s;
}
static void collect_ints_kvs(grpc_error *err, kv_pairs *kvs) {
for (size_t which = 0; which < GRPC_ERROR_INT_MAX; ++which) {
uint8_t slot = err->ints[which];
if (slot != UINT8_MAX) {
append_kv(kvs, key_int((grpc_error_ints)which),
fmt_int(err->arena[slot]));
}
}
}
static char *key_str(grpc_error_strs which) {
return gpr_strdup(error_str_name(which));
}
static char *fmt_str(void *p) {
char *s = NULL;
size_t sz = 0;
@ -468,8 +587,22 @@ static char *fmt_str(void *p) {
return s;
}
static char *fmt_time(void *p) {
gpr_timespec tm = *(gpr_timespec *)p;
static void collect_strs_kvs(grpc_error *err, kv_pairs *kvs) {
for (size_t which = 0; which < GRPC_ERROR_STR_MAX; ++which) {
uint8_t slot = err->strs[which];
if (slot != UINT8_MAX) {
append_kv(
kvs, key_str((grpc_error_strs)which),
fmt_str(GRPC_SLICE_START_PTR(*(grpc_slice *)(err->arena + slot))));
}
}
}
static char *key_time(grpc_error_times which) {
return gpr_strdup(error_time_name(which));
}
static char *fmt_time(gpr_timespec tm) {
char *out;
char *pfx = "!!";
switch (tm.clock_type) {
@ -490,24 +623,37 @@ static char *fmt_time(void *p) {
return out;
}
static void add_errs(gpr_avl_node *n, char **s, size_t *sz, size_t *cap,
bool *first) {
if (n == NULL) return;
add_errs(n->left, s, sz, cap, first);
if (!*first) append_chr(',', s, sz, cap);
*first = false;
const char *e = grpc_error_string(n->value);
append_str(e, s, sz, cap);
add_errs(n->right, s, sz, cap, first);
static void collect_times_kvs(grpc_error *err, kv_pairs *kvs) {
for (size_t which = 0; which < GRPC_ERROR_TIME_MAX; ++which) {
uint8_t slot = err->times[which];
if (slot != UINT8_MAX) {
append_kv(kvs, key_time((grpc_error_times)which),
fmt_time(*(gpr_timespec *)(err->arena + slot)));
}
}
}
static void add_errs(grpc_error *err, char **s, size_t *sz, size_t *cap) {
uint8_t slot = err->first_err;
bool first = true;
while (slot != UINT8_MAX) {
grpc_linked_error *lerr = (grpc_linked_error *)(err->arena + slot);
if (!first) append_chr(',', s, sz, cap);
first = false;
const char *e = grpc_error_string(lerr->err);
append_str(e, s, sz, cap);
GPR_ASSERT(err->last_err == slot ? lerr->next == UINT8_MAX
: lerr->next != UINT8_MAX);
slot = lerr->next;
}
}
static char *errs_string(grpc_error *err) {
char *s = NULL;
size_t sz = 0;
size_t cap = 0;
bool first = true;
append_chr('[', &s, &sz, &cap);
add_errs(err->errs.root, &s, &sz, &cap, &first);
add_errs(err, &s, &sz, &cap);
append_chr(']', &s, &sz, &cap);
append_chr(0, &s, &sz, &cap);
return s;
@ -555,10 +701,10 @@ const char *grpc_error_string(grpc_error *err) {
kv_pairs kvs;
memset(&kvs, 0, sizeof(kvs));
collect_kvs(err->ints.root, key_int, fmt_int, &kvs);
collect_kvs(err->strs.root, key_str, fmt_str, &kvs);
collect_kvs(err->times.root, key_time, fmt_time, &kvs);
if (!gpr_avl_is_empty(err->errs)) {
collect_ints_kvs(err, &kvs);
collect_strs_kvs(err, &kvs);
collect_times_kvs(err, &kvs);
if (err->first_err != UINT8_MAX) {
append_kv(&kvs, gpr_strdup("referenced_errors"), errs_string(err));
}

@ -102,6 +102,9 @@ typedef enum {
GRPC_ERROR_INT_LIMIT,
/// chttp2: did the error occur while a write was in progress
GRPC_ERROR_INT_OCCURRED_DURING_WRITE,
/// Must always be last
GRPC_ERROR_INT_MAX,
} grpc_error_ints;
typedef enum {
@ -129,11 +132,17 @@ typedef enum {
GRPC_ERROR_STR_KEY,
/// value associated with the error
GRPC_ERROR_STR_VALUE,
/// Must always be last
GRPC_ERROR_STR_MAX,
} grpc_error_strs;
typedef enum {
/// timestamp of error creation
GRPC_ERROR_TIME_CREATED,
/// Must always be last
GRPC_ERROR_TIME_MAX,
} grpc_error_times;
/// The following "special" errors can be propagated without allocating memory.
@ -184,8 +193,6 @@ void grpc_error_unref(grpc_error *err);
grpc_error *grpc_error_set_int(grpc_error *src, grpc_error_ints which,
intptr_t value) GRPC_MUST_USE_RESULT;
bool grpc_error_get_int(grpc_error *error, grpc_error_ints which, intptr_t *p);
grpc_error *grpc_error_set_time(grpc_error *src, grpc_error_times which,
gpr_timespec value) GRPC_MUST_USE_RESULT;
grpc_error *grpc_error_set_str(grpc_error *src, grpc_error_strs which,
const char *value) GRPC_MUST_USE_RESULT;
/// Returns NULL if the specified string is not set.

@ -35,18 +35,28 @@
#define GRPC_CORE_LIB_IOMGR_ERROR_INTERNAL_H
#include <inttypes.h>
#include <stdbool.h>
#include <stdbool.h> // TODO, do we need this?
#include <grpc/support/avl.h>
#include <grpc/support/sync.h>
typedef struct grpc_linked_error grpc_linked_error;
struct grpc_linked_error {
grpc_error *err;
uint8_t next;
};
struct grpc_error {
gpr_refcount refs;
gpr_avl ints;
gpr_avl strs;
gpr_avl times;
gpr_avl errs;
uintptr_t next_err;
uint8_t ints[GRPC_ERROR_INT_MAX];
uint8_t strs[GRPC_ERROR_STR_MAX];
uint8_t times[GRPC_ERROR_TIME_MAX];
uint8_t first_err;
uint8_t last_err;
gpr_atm error_string;
uint8_t arena_size;
uint8_t arena_capacity;
intptr_t arena[0];
};
bool grpc_error_is_special(grpc_error *err);

@ -162,6 +162,7 @@ int grpc_sockaddr_to_string(char **out,
char ntop_buf[INET6_ADDRSTRLEN];
const void *ip = NULL;
int port;
uint32_t sin6_scope_id = 0;
int ret;
*out = NULL;
@ -177,10 +178,19 @@ int grpc_sockaddr_to_string(char **out,
const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr;
ip = &addr6->sin6_addr;
port = ntohs(addr6->sin6_port);
sin6_scope_id = addr6->sin6_scope_id;
}
if (ip != NULL &&
grpc_inet_ntop(addr->sa_family, ip, ntop_buf, sizeof(ntop_buf)) != NULL) {
ret = gpr_join_host_port(out, ntop_buf, port);
if (sin6_scope_id != 0) {
char *host_with_scope;
/* Enclose sin6_scope_id with the format defined in RFC 6784 section 2. */
gpr_asprintf(&host_with_scope, "%s%%25%" PRIu32, ntop_buf, sin6_scope_id);
ret = gpr_join_host_port(out, host_with_scope, port);
gpr_free(host_with_scope);
} else {
ret = gpr_join_host_port(out, ntop_buf, port);
}
} else {
ret = gpr_asprintf(out, "(sockaddr family=%d)", addr->sa_family);
}

@ -114,6 +114,8 @@ struct grpc_tcp_server {
/* is this server shutting down? */
bool shutdown;
/* have listeners been shutdown? */
bool shutdown_listeners;
/* use SO_REUSEPORT */
bool so_reuseport;
/* expand wildcard addresses to a list of all local addresses */
@ -161,7 +163,7 @@ grpc_error *grpc_tcp_server_create(grpc_exec_ctx *exec_ctx,
grpc_tcp_server **server) {
gpr_once_init(&check_init, init);
grpc_tcp_server *s = gpr_malloc(sizeof(grpc_tcp_server));
grpc_tcp_server *s = gpr_zalloc(sizeof(grpc_tcp_server));
s->so_reuseport = has_so_reuseport;
s->resource_quota = grpc_resource_quota_create(NULL);
s->expand_wildcard_addrs = false;
@ -422,7 +424,14 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *err) {
grpc_fd_notify_on_read(exec_ctx, sp->emfd, &sp->read_closure);
return;
default:
gpr_log(GPR_ERROR, "Failed accept4: %s", strerror(errno));
gpr_mu_lock(&sp->server->mu);
if (!sp->server->shutdown_listeners) {
gpr_log(GPR_ERROR, "Failed accept4: %s", strerror(errno));
} else {
/* if we have shutdown listeners, accept4 could fail, and we
needn't notify users */
}
gpr_mu_unlock(&sp->server->mu);
goto error;
}
}
@ -438,11 +447,6 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *err) {
grpc_fd *fdobj = grpc_fd_create(fd, name);
if (read_notifier_pollset == NULL) {
gpr_log(GPR_ERROR, "Read notifier pollset is not set on the fd");
goto error;
}
grpc_pollset_add_fd(exec_ctx, read_notifier_pollset, fdobj);
// Create acceptor.
@ -941,6 +945,7 @@ void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) {
void grpc_tcp_server_shutdown_listeners(grpc_exec_ctx *exec_ctx,
grpc_tcp_server *s) {
gpr_mu_lock(&s->mu);
s->shutdown_listeners = true;
/* shutdown all fd's */
if (s->active_ports) {
grpc_tcp_listener *sp;

@ -485,7 +485,11 @@ void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *s,
grpc_schedule_on_exec_ctx);
grpc_fd_notify_on_write(exec_ctx, sp->emfd, &sp->write_closure);
s->active_ports++;
/* Registered for both read and write callbacks: increment active_ports
* twice to account for this, and delay free-ing of memory until both
* on_read and on_write have fired. */
s->active_ports += 2;
sp = sp->next;
}

@ -46,7 +46,7 @@
*
* Setup:
* 1. Before calling anything, call global_init() at least once.
* 1. Call grpc_wakeup_fd_create() to get a wakeup_fd.
* 1. Call grpc_wakeup_fd_init() to set up a wakeup_fd.
* 2. Add the result of GRPC_WAKEUP_FD_FD to the set of monitored file
* descriptors for the poll() style API you are using. Monitor the file
* descriptor for readability.

@ -37,6 +37,8 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <assert.h>
/* Number of mutexes to allocate for events, to avoid lock contention.
Should be a prime. */
enum { event_sync_partitions = 31 };
@ -99,8 +101,12 @@ void gpr_ref_init(gpr_refcount *r, int n) { gpr_atm_rel_store(&r->count, n); }
void gpr_ref(gpr_refcount *r) { gpr_atm_no_barrier_fetch_add(&r->count, 1); }
void gpr_ref_non_zero(gpr_refcount *r) {
#ifndef NDEBUG
gpr_atm prior = gpr_atm_no_barrier_fetch_add(&r->count, 1);
GPR_ASSERT(prior > 0);
assert(prior > 0);
#else
gpr_ref(r);
#endif
}
void gpr_refn(gpr_refcount *r, int n) {
@ -113,6 +119,10 @@ int gpr_unref(gpr_refcount *r) {
return prior == 1;
}
int gpr_ref_is_unique(gpr_refcount *r) {
return gpr_atm_acq_load(&r->count) == 1;
}
void gpr_stats_init(gpr_stats_counter *c, intptr_t n) {
gpr_atm_rel_store(&c->value, n);
}

@ -161,6 +161,7 @@ struct grpc_call {
bool receiving_message;
bool requested_final_op;
bool received_final_op;
bool sent_any_op;
/* have we received initial metadata */
bool has_initial_md_been_received;
@ -488,7 +489,7 @@ void grpc_call_destroy(grpc_call *c) {
gpr_mu_lock(&c->mu);
GPR_ASSERT(!c->destroy_called);
c->destroy_called = 1;
cancel = !c->received_final_op;
cancel = c->sent_any_op && !c->received_final_op;
gpr_mu_unlock(&c->mu);
if (cancel) {
cancel_with_error(&exec_ctx, c, STATUS_FROM_API_OVERRIDE,
@ -1678,6 +1679,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
grpc_closure_init(&bctl->finish_batch, finish_batch, bctl,
grpc_schedule_on_exec_ctx);
stream_op->on_complete = &bctl->finish_batch;
call->sent_any_op = true;
gpr_mu_unlock(&call->mu);
execute_op(exec_ctx, call, stream_op);

@ -44,12 +44,12 @@ static grpc_error *recursively_find_error_with_field(grpc_error *error,
}
if (grpc_error_is_special(error)) return NULL;
// Otherwise, search through its children.
intptr_t key = 0;
while (true) {
grpc_error *child_error = gpr_avl_get(error->errs, (void *)key++);
if (child_error == NULL) break;
grpc_error *result = recursively_find_error_with_field(child_error, which);
if (result != NULL) return result;
uint8_t slot = error->first_err;
while (slot != UINT8_MAX) {
grpc_linked_error *lerr = (grpc_linked_error *)(error->arena + slot);
grpc_error *result = recursively_find_error_with_field(lerr->err, which);
if (result) return result;
slot = lerr->next;
}
return NULL;
}
@ -112,13 +112,13 @@ bool grpc_error_has_clear_grpc_status(grpc_error *error) {
if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, NULL)) {
return true;
}
intptr_t key = 0;
while (true) {
grpc_error *child_error = gpr_avl_get(error->errs, (void *)key++);
if (child_error == NULL) break;
if (grpc_error_has_clear_grpc_status(child_error)) {
uint8_t slot = error->first_err;
while (slot != UINT8_MAX) {
grpc_linked_error *lerr = (grpc_linked_error *)(error->arena + slot);
if (grpc_error_has_clear_grpc_status(lerr->err)) {
return true;
}
slot = lerr->next;
}
return false;
}

@ -84,6 +84,39 @@ void grpc_stream_unref(grpc_exec_ctx *exec_ctx,
}
}
#define STREAM_REF_FROM_SLICE_REF(p) \
((grpc_stream_refcount *)(((uint8_t *)p) - \
offsetof(grpc_stream_refcount, slice_refcount)))
static void slice_stream_ref(void *p) {
#ifdef GRPC_STREAM_REFCOUNT_DEBUG
grpc_stream_ref(STREAM_REF_FROM_SLICE_REF(p), "slice");
#else
grpc_stream_ref(STREAM_REF_FROM_SLICE_REF(p));
#endif
}
static void slice_stream_unref(grpc_exec_ctx *exec_ctx, void *p) {
#ifdef GRPC_STREAM_REFCOUNT_DEBUG
grpc_stream_unref(exec_ctx, STREAM_REF_FROM_SLICE_REF(p), "slice");
#else
grpc_stream_unref(exec_ctx, STREAM_REF_FROM_SLICE_REF(p));
#endif
}
grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount *refcount,
void *buffer, size_t length) {
slice_stream_ref(&refcount->slice_refcount);
return (grpc_slice){.refcount = &refcount->slice_refcount,
.data.refcounted = {.bytes = buffer, .length = length}};
}
static const grpc_slice_refcount_vtable stream_ref_slice_vtable = {
.ref = slice_stream_ref,
.unref = slice_stream_unref,
.eq = grpc_slice_default_eq_impl,
.hash = grpc_slice_default_hash_impl};
#ifdef GRPC_STREAM_REFCOUNT_DEBUG
void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs,
grpc_iomgr_cb_func cb, void *cb_arg,
@ -95,6 +128,8 @@ void grpc_stream_ref_init(grpc_stream_refcount *refcount, int initial_refs,
#endif
gpr_ref_init(&refcount->refs, initial_refs);
grpc_closure_init(&refcount->destroy, cb, cb_arg, grpc_schedule_on_exec_ctx);
refcount->slice_refcount.vtable = &stream_ref_slice_vtable;
refcount->slice_refcount.sub_refcount = &refcount->slice_refcount;
}
static void move64(uint64_t *from, uint64_t *to) {

@ -64,6 +64,7 @@ typedef struct grpc_stream_refcount {
#ifdef GRPC_STREAM_REFCOUNT_DEBUG
const char *object_type;
#endif
grpc_slice_refcount slice_refcount;
} grpc_stream_refcount;
#ifdef GRPC_STREAM_REFCOUNT_DEBUG
@ -84,6 +85,11 @@ void grpc_stream_unref(grpc_exec_ctx *exec_ctx, grpc_stream_refcount *refcount);
grpc_stream_ref_init(rc, ir, cb, cb_arg)
#endif
/* Wrap a buffer that is owned by some stream object into a slice that shares
the same refcount */
grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount *refcount,
void *buffer, size_t length);
typedef struct {
uint64_t framing_bytes;
uint64_t data_bytes;

@ -37,5 +37,5 @@
#include <grpc++/grpc++.h>
namespace grpc {
grpc::string Version() { return "1.2.0-dev"; }
grpc::string Version() { return "1.3.0-dev"; }
}

@ -0,0 +1,78 @@
/*
*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <grpc++/impl/channel_argument_option.h>
namespace grpc {
std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
const grpc::string &name, const grpc::string &value) {
class StringOption final : public ServerBuilderOption {
public:
StringOption(const grpc::string &name, const grpc::string &value)
: name_(name), value_(value) {}
virtual void UpdateArguments(ChannelArguments *args) override {
args->SetString(name_, value_);
}
virtual void UpdatePlugins(
std::vector<std::unique_ptr<ServerBuilderPlugin>> *plugins) override {}
private:
const grpc::string name_;
const grpc::string value_;
};
return std::unique_ptr<ServerBuilderOption>(new StringOption(name, value));
}
std::unique_ptr<ServerBuilderOption> MakeChannelArgumentOption(
const grpc::string &name, int value) {
class IntOption final : public ServerBuilderOption {
public:
IntOption(const grpc::string &name, int value)
: name_(name), value_(value) {}
virtual void UpdateArguments(ChannelArguments *args) override {
args->SetInt(name_, value_);
}
virtual void UpdatePlugins(
std::vector<std::unique_ptr<ServerBuilderPlugin>> *plugins) override {}
private:
const grpc::string name_;
const int value_;
};
return std::unique_ptr<ServerBuilderOption>(new IntOption(name, value));
}
} // namespace grpc

@ -323,9 +323,14 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() {
}
}
bool added_port = false;
for (auto port = ports_.begin(); port != ports_.end(); port++) {
int r = server->AddListeningPort(port->addr, port->creds.get());
if (!r) return nullptr;
if (!r) {
if (added_port) server->Shutdown();
return nullptr;
}
added_port = true;
if (port->selected_port != nullptr) {
*port->selected_port = r;
}
@ -333,6 +338,7 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() {
auto cqs_data = cqs_.empty() ? nullptr : &cqs_[0];
if (!server->Start(cqs_data, cqs_.size())) {
if (added_port) server->Shutdown();
return nullptr;
}

@ -534,7 +534,7 @@ bool Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) {
void Server::ShutdownInternal(gpr_timespec deadline) {
std::unique_lock<std::mutex> lock(mu_);
if (started_ && !shutdown_) {
if (!shutdown_) {
shutdown_ = true;
/// The completion queue to use for server shutdown completion notification

@ -34,32 +34,26 @@
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core">
<HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core">
<HintPath>..\packages\Google.Apis.Core.1.21.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Google.Apis">
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
<HintPath>..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.PlatformServices">
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
<HintPath>..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth">
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
<HintPath>..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices">
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
<HintPath>..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

@ -1,10 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
<package id="Google.Apis" version="1.16.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
<package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="Google.Apis" version="1.21.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.21.0" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.21.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages>

@ -1,5 +1,5 @@
{
"version": "1.2.0-dev",
"version": "1.3.0-dev",
"title": "gRPC C# Auth",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",
@ -21,8 +21,8 @@
}
},
"dependencies": {
"Grpc.Core": "1.2.0-dev",
"Google.Apis.Auth": "1.16.0"
"Grpc.Core": "1.3.0-dev",
"Google.Apis.Auth": "1.21.0"
},
"frameworks": {
"net45": { },

@ -1,5 +1,5 @@
{
"version": "1.2.0-dev",
"version": "1.3.0-dev",
"title": "gRPC C# Core Testing",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2017, Google Inc.",
@ -21,7 +21,7 @@
}
},
"dependencies": {
"Grpc.Core": "1.2.0-dev"
"Grpc.Core": "1.3.0-dev"
},
"frameworks": {
"net45": {

@ -0,0 +1,86 @@
#region Copyright notice and license
// Copyright 2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Grpc.Core;
using System.Linq;
namespace Grpc.Core.Tests
{
public class AuthContextTest
{
[Test]
public void EmptyContext()
{
var context = new AuthContext(null, new Dictionary<string, List<AuthProperty>>());
Assert.IsFalse(context.IsPeerAuthenticated);
Assert.IsNull(context.PeerIdentityPropertyName);
Assert.AreEqual(0, context.PeerIdentity.Count());
Assert.AreEqual(0, context.Properties.Count());
Assert.AreEqual(0, context.FindPropertiesByName("nonexistent").Count());
}
[Test]
public void AuthenticatedContext()
{
var property1 = AuthProperty.Create("abc", new byte[] { 68, 69, 70 });
var context = new AuthContext("some_identity", new Dictionary<string, List<AuthProperty>>
{
{"some_identity", new List<AuthProperty> {property1}}
});
Assert.IsTrue(context.IsPeerAuthenticated);
Assert.AreEqual("some_identity", context.PeerIdentityPropertyName);
Assert.AreEqual(1, context.PeerIdentity.Count());
}
[Test]
public void FindPropertiesByName()
{
var property1 = AuthProperty.Create("abc", new byte[] {68, 69, 70});
var property2 = AuthProperty.Create("abc", new byte[] {71, 72, 73 });
var property3 = AuthProperty.Create("abc", new byte[] {});
var context = new AuthContext(null, new Dictionary<string, List<AuthProperty>>
{
{"existent", new List<AuthProperty> {property1, property2}},
{"foobar", new List<AuthProperty> {property3}},
});
Assert.AreEqual(3, context.Properties.Count());
Assert.AreEqual(0, context.FindPropertiesByName("nonexistent").Count());
var existentProperties = new List<AuthProperty>(context.FindPropertiesByName("existent"));
Assert.AreEqual(2, existentProperties.Count);
}
}
}

@ -0,0 +1,82 @@
#region Copyright notice and license
// Copyright 2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using NUnit.Framework;
namespace Grpc.Core.Tests
{
public class AuthPropertyTest
{
[Test]
public void Create_NameIsNotNull()
{
Assert.Throws(typeof(ArgumentNullException), () => AuthProperty.Create(null, new byte[0]));
Assert.Throws(typeof(ArgumentNullException), () => AuthProperty.CreateUnsafe(null, new byte[0]));
}
[Test]
public void Create_ValueIsNotNull()
{
Assert.Throws(typeof(ArgumentNullException), () => AuthProperty.Create("abc", null));
Assert.Throws(typeof(ArgumentNullException), () => AuthProperty.CreateUnsafe("abc", null));
}
[Test]
public void Create()
{
var valueBytes = new byte[] { 68, 69, 70 };
var authProperty = AuthProperty.Create("abc", valueBytes);
Assert.AreEqual("abc", authProperty.Name);
Assert.AreNotSame(valueBytes, authProperty.ValueBytesUnsafe);
CollectionAssert.AreEqual(valueBytes, authProperty.ValueBytes);
CollectionAssert.AreEqual(valueBytes, authProperty.ValueBytesUnsafe);
Assert.AreEqual("DEF", authProperty.Value);
}
[Test]
public void CreateUnsafe()
{
var valueBytes = new byte[] { 68, 69, 70 };
var authProperty = AuthProperty.CreateUnsafe("abc", valueBytes);
Assert.AreEqual("abc", authProperty.Name);
Assert.AreSame(valueBytes, authProperty.ValueBytesUnsafe);
Assert.AreNotSame(valueBytes, authProperty.ValueBytes);
CollectionAssert.AreEqual(valueBytes, authProperty.ValueBytes);
CollectionAssert.AreEqual(valueBytes, authProperty.ValueBytesUnsafe);
Assert.AreEqual("DEF", authProperty.Value);
}
}
}

@ -375,6 +375,18 @@ namespace Grpc.Core.Tests
Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc"));
}
[Test]
public void ServerCallContext_AuthContextNotPopulated()
{
helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) =>
{
Assert.IsFalse(context.AuthContext.IsPeerAuthenticated);
Assert.AreEqual(0, context.AuthContext.Properties.Count());
return "PASS";
});
Assert.AreEqual("PASS", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc"));
}
[Test]
public async Task Channel_WaitForStateChangedAsync()
{

@ -27,17 +27,17 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll</HintPath>
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.6.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@ -64,7 +64,6 @@
<Compile Include="ChannelOptionsTest.cs" />
<Compile Include="Internal\TimespecTest.cs" />
<Compile Include="TimeoutsTest.cs" />
<Compile Include="NUnitVersionTest.cs" />
<Compile Include="ChannelTest.cs" />
<Compile Include="MockServiceHelper.cs" />
<Compile Include="ResponseHeadersTest.cs" />
@ -81,6 +80,8 @@
<Compile Include="ShutdownHookPendingCallTest.cs" />
<Compile Include="ShutdownHookClientTest.cs" />
<Compile Include="AppDomainUnloadTest.cs" />
<Compile Include="AuthContextTest.cs" />
<Compile Include="AuthPropertyTest.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--This file represents the results of running a test suite-->
<test-results name="/usr/local/google/home/jtattermusch/github/grpc/src/csharp/GrpcCoreTests/bin/Debug/GrpcCoreTests.dll" total="3" errors="0" failures="0" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2015-01-29" time="19:40:47">
<environment nunit-version="2.6.0.0" clr-version="4.0.30319.17020" os-version="Unix 3.13.0.43" platform="Unix" cwd="/usr/local/google/home/jtattermusch/github/grpc/src/csharp/GrpcCoreTests" machine-name="jtattermusch.mtv.corp.google.com" user="jtattermusch" user-domain="jtattermusch.mtv.corp.google.com" />
<culture-info current-culture="en-US" current-uiculture="en-US" />
<test-suite type="Assembly" name="/usr/local/google/home/jtattermusch/github/grpc/src/csharp/GrpcCoreTests/bin/Debug/GrpcCoreTests.dll" executed="True" result="Success" success="True" time="0.172" asserts="0">
<results>
<test-suite type="Namespace" name="Google" executed="True" result="Success" success="True" time="0.166" asserts="0">
<results>
<test-suite type="Namespace" name="GRPC" executed="True" result="Success" success="True" time="0.166" asserts="0">
<results>
<test-suite type="Namespace" name="Core" executed="True" result="Success" success="True" time="0.166" asserts="0">
<results>
<test-suite type="Namespace" name="Tests" executed="True" result="Success" success="True" time="0.166" asserts="0">
<results>
<test-suite type="TestFixture" name="CallsTest" executed="True" result="Success" success="True" time="0.009" asserts="0">
<results>
<test-case name="Grpc.Core.Tests.CallsTest.Test1" executed="True" result="Success" success="True" time="0.004" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="ClientServerTest" executed="True" result="Success" success="True" time="0.149" asserts="0">
<results>
<test-case name="Grpc.Core.Tests.ClientServerTest.EmptyCall" executed="True" result="Success" success="True" time="0.111" asserts="0" />
</results>
</test-suite>
<test-suite type="TestFixture" name="ServerTest" executed="True" result="Success" success="True" time="0.001" asserts="0">
<results>
<test-case name="Grpc.Core.Tests.ServerTest.StartAndShutdownServer" executed="True" result="Success" success="True" time="0.001" asserts="0" />
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</results>
</test-suite>
</test-results>

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnit.ConsoleRunner" version="3.2.0" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="NUnit" version="3.6.0" targetFramework="net45" />
<package id="NUnitLite" version="3.6.0" targetFramework="net45" />
<package id="OpenCover" version="4.6.519" />
<package id="ReportGenerator" version="2.4.4.0" />
<package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />

@ -45,10 +45,10 @@
"Grpc.Core": {
"target": "project"
},
"Newtonsoft.Json": "8.0.3",
"NUnit": "3.2.0",
"NUnitLite": "3.2.0-*",
"NUnit.ConsoleRunner": "3.2.0",
"Newtonsoft.Json": "9.0.1",
"NUnit": "3.6.0",
"NUnitLite": "3.6.0",
"NUnit.ConsoleRunner": "3.6.0",
"OpenCover": "4.6.519",
"ReportGenerator": "2.4.4.0"
},

@ -0,0 +1,128 @@
#region Copyright notice and license
// Copyright 2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
namespace Grpc.Core
{
/// <summary>
/// Authentication context for a call.
/// AuthContext is the only reliable source of truth when it comes to authenticating calls.
/// Using any other call/context properties for authentication purposes is wrong and inherently unsafe.
/// Note: experimental API that can change or be removed without any prior notice.
/// </summary>
public class AuthContext
{
string peerIdentityPropertyName;
Dictionary<string, List<AuthProperty>> properties;
/// <summary>
/// Initializes a new instance of the <see cref="T:Grpc.Core.AuthContext"/> class.
/// </summary>
/// <param name="peerIdentityPropertyName">Peer identity property name.</param>
/// <param name="properties">Multimap of auth properties by name.</param>
internal AuthContext(string peerIdentityPropertyName, Dictionary<string, List<AuthProperty>> properties)
{
this.peerIdentityPropertyName = peerIdentityPropertyName;
this.properties = GrpcPreconditions.CheckNotNull(properties);
}
/// <summary>
/// Returns <c>true</c> if the peer is authenticated.
/// </summary>
public bool IsPeerAuthenticated
{
get
{
return peerIdentityPropertyName != null;
}
}
/// <summary>
/// Gets the name of the property that indicates the peer identity. Returns <c>null</c>
/// if the peer is not authenticated.
/// </summary>
public string PeerIdentityPropertyName
{
get
{
return peerIdentityPropertyName;
}
}
/// <summary>
/// Gets properties that represent the peer identity (there can be more than one). Returns an empty collection
/// if the peer is not authenticated.
/// </summary>
public IEnumerable<AuthProperty> PeerIdentity
{
get
{
if (peerIdentityPropertyName == null)
{
return Enumerable.Empty<AuthProperty>();
}
return properties[peerIdentityPropertyName];
}
}
/// <summary>
/// Gets the auth properties of this context.
/// </summary>
public IEnumerable<AuthProperty> Properties
{
get
{
return properties.Values.SelectMany(v => v);
}
}
/// <summary>
/// Returns the auth properties with given name (there can be more than one).
/// If no properties of given name exist, an empty collection will be returned.
/// </summary>
public IEnumerable<AuthProperty> FindPropertiesByName(string propertyName)
{
List<AuthProperty> result;
if (!properties.TryGetValue(propertyName, out result))
{
return Enumerable.Empty<AuthProperty>();
}
return result;
}
}
}

@ -0,0 +1,126 @@
#region Copyright notice and license
// Copyright 2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
namespace Grpc.Core
{
/// <summary>
/// A property of an <see cref="AuthContext"/>.
/// Note: experimental API that can change or be removed without any prior notice.
/// </summary>
public class AuthProperty
{
string name;
byte[] valueBytes;
Lazy<string> value;
private AuthProperty(string name, byte[] valueBytes)
{
this.name = GrpcPreconditions.CheckNotNull(name);
this.valueBytes = GrpcPreconditions.CheckNotNull(valueBytes);
this.value = new Lazy<string>(() => MarshalUtils.GetStringUTF8(this.valueBytes));
}
/// <summary>
/// Gets the name of the property.
/// </summary>
public string Name
{
get
{
return name;
}
}
/// <summary>
/// Gets the string value of the property.
/// </summary>
public string Value
{
get
{
return value.Value;
}
}
/// <summary>
/// Gets the binary value of the property.
/// </summary>
public byte[] ValueBytes
{
get
{
var valueCopy = new byte[valueBytes.Length];
Buffer.BlockCopy(valueBytes, 0, valueCopy, 0, valueBytes.Length);
return valueCopy;
}
}
/// <summary>
/// Creates an instance of <c>AuthProperty</c>.
/// </summary>
/// <param name="name">the name</param>
/// <param name="valueBytes">the binary value of the property</param>
public static AuthProperty Create(string name, byte[] valueBytes)
{
GrpcPreconditions.CheckNotNull(valueBytes);
var valueCopy = new byte[valueBytes.Length];
Buffer.BlockCopy(valueBytes, 0, valueCopy, 0, valueBytes.Length);
return new AuthProperty(name, valueCopy);
}
/// <summary>
/// Gets the binary value of the property (without making a defensive copy).
/// </summary>
internal byte[] ValueBytesUnsafe
{
get
{
return valueBytes;
}
}
/// <summary>
/// Creates and instance of <c>AuthProperty</c> without making a defensive copy of <c>valueBytes</c>.
/// </summary>
internal static AuthProperty CreateUnsafe(string name, byte[] valueBytes)
{
return new AuthProperty(name, valueBytes);
}
}
}

@ -131,6 +131,10 @@
<Compile Include="Internal\RequestCallContextSafeHandle.cs" />
<Compile Include="Utils\TaskUtils.cs" />
<Compile Include="Internal\CallFlags.cs" />
<Compile Include="AuthContext.cs" />
<Compile Include="Internal\AuthContextSafeHandle.cs" />
<Compile Include="Internal\MarshalUtils.cs" />
<Compile Include="AuthProperty.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Grpc.Core.project.json" />

@ -0,0 +1,119 @@
#region Copyright notice and license
// Copyright 2017, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using Grpc.Core;
using Grpc.Core.Utils;
namespace Grpc.Core.Internal
{
/// <summary>
/// grpc_auth_context
/// </summary>
internal class AuthContextSafeHandle : SafeHandleZeroIsInvalid
{
static readonly NativeMethods Native = NativeMethods.Get();
private AuthContextSafeHandle()
{
}
/// <summary>
/// Copies contents of the native auth context into a new <c>AuthContext</c> instance.
/// </summary>
public AuthContext ToAuthContext()
{
if (IsInvalid)
{
return new AuthContext(null, new Dictionary<string, List<AuthProperty>>());
}
var peerIdentityPropertyName = Marshal.PtrToStringAnsi(Native.grpcsharp_auth_context_peer_identity_property_name(this));
var propertiesDict = new Dictionary<string, List<AuthProperty>>();
var it = Native.grpcsharp_auth_context_property_iterator(this);
IntPtr authPropertyPtr = IntPtr.Zero;
while ((authPropertyPtr = Native.grpcsharp_auth_property_iterator_next(ref it)) != IntPtr.Zero)
{
var authProperty = PtrToAuthProperty(authPropertyPtr);
if (!propertiesDict.ContainsKey(authProperty.Name))
{
propertiesDict[authProperty.Name] = new List<AuthProperty>();
}
propertiesDict[authProperty.Name].Add(authProperty);
}
return new AuthContext(peerIdentityPropertyName, propertiesDict);
}
protected override bool ReleaseHandle()
{
Native.grpcsharp_auth_context_release(handle);
return true;
}
private AuthProperty PtrToAuthProperty(IntPtr authPropertyPtr)
{
var nativeAuthProperty = (NativeAuthProperty) Marshal.PtrToStructure(authPropertyPtr, typeof(NativeAuthProperty));
var name = Marshal.PtrToStringAnsi(nativeAuthProperty.Name);
var valueBytes = new byte[(int) nativeAuthProperty.ValueLength];
Marshal.Copy(nativeAuthProperty.Value, valueBytes, 0, (int)nativeAuthProperty.ValueLength);
return AuthProperty.CreateUnsafe(name, valueBytes);
}
/// <summary>
/// grpc_auth_property
/// </summary>
internal struct NativeAuthProperty
{
public IntPtr Name;
public IntPtr Value;
public UIntPtr ValueLength;
}
/// <summary>
/// grpc_auth_property_iterator
/// </summary>
internal struct NativeAuthPropertyIterator
{
public IntPtr AuthContext;
public UIntPtr Index;
public IntPtr Name;
}
}
}

@ -43,7 +43,6 @@ namespace Grpc.Core.Internal
/// </summary>
internal class BatchContextSafeHandle : SafeHandleZeroIsInvalid
{
static readonly Encoding EncodingUTF8 = System.Text.Encoding.UTF8;
static readonly NativeMethods Native = NativeMethods.Get();
private BatchContextSafeHandle()
@ -75,7 +74,7 @@ namespace Grpc.Core.Internal
{
UIntPtr detailsLength;
IntPtr detailsPtr = Native.grpcsharp_batch_context_recv_status_on_client_details(this, out detailsLength);
string details = PtrToStringUtf8(detailsPtr, (int) detailsLength.ToUInt32());
string details = MarshalUtils.PtrToStringUTF8(detailsPtr, (int) detailsLength.ToUInt32());
var status = new Status(Native.grpcsharp_batch_context_recv_status_on_client_status(this), details);
IntPtr metadataArrayPtr = Native.grpcsharp_batch_context_recv_status_on_client_trailing_metadata(this);
@ -108,12 +107,5 @@ namespace Grpc.Core.Internal
Native.grpcsharp_batch_context_destroy(handle);
return true;
}
string PtrToStringUtf8(IntPtr ptr, int len)
{
var bytes = new byte[len];
Marshal.Copy(ptr, bytes, 0, len);
return EncodingUTF8.GetString(bytes);
}
}
}

@ -45,7 +45,6 @@ namespace Grpc.Core.Internal
internal class CallSafeHandle : SafeHandleZeroIsInvalid, INativeCall
{
public static readonly CallSafeHandle NullInstance = new CallSafeHandle();
static readonly Encoding EncodingUTF8 = System.Text.Encoding.UTF8;
static readonly NativeMethods Native = NativeMethods.Get();
const uint GRPC_WRITE_BUFFER_HINT = 1;
@ -140,7 +139,7 @@ namespace Grpc.Core.Internal
var ctx = BatchContextSafeHandle.Create();
var optionalPayloadLength = optionalPayload != null ? new UIntPtr((ulong)optionalPayload.Length) : UIntPtr.Zero;
completionQueue.CompletionRegistry.RegisterBatchCompletion(ctx, (success, context) => callback(success));
var statusDetailBytes = EncodingUTF8.GetBytes(status.Detail);
var statusDetailBytes = MarshalUtils.GetBytesUTF8(status.Detail);
Native.grpcsharp_call_send_status_from_server(this, ctx, status.StatusCode, statusDetailBytes, new UIntPtr((ulong)statusDetailBytes.Length), metadataArray, sendEmptyInitialMetadata,
optionalPayload, optionalPayloadLength, writeFlags).CheckOk();
}
@ -204,6 +203,11 @@ namespace Grpc.Core.Internal
}
}
public AuthContextSafeHandle GetAuthContext()
{
return Native.grpcsharp_call_auth_context(this);
}
protected override bool ReleaseHandle()
{
Native.grpcsharp_call_destroy(handle);

@ -32,46 +32,59 @@
#endregion
using System;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
using NUnit.Framework;
using System.Runtime.InteropServices;
using System.Text;
namespace Grpc.Core.Tests
namespace Grpc.Core.Internal
{
/// <summary>
/// Tests if the version of nunit-console used is sufficient to run async tests.
/// Useful methods for native/managed marshalling.
/// </summary>
public class NUnitVersionTest
internal static class MarshalUtils
{
private int testRunCount = 0;
static readonly Encoding EncodingUTF8 = System.Text.Encoding.UTF8;
static readonly Encoding EncodingASCII = System.Text.Encoding.ASCII;
[TestFixtureTearDown]
public void Cleanup()
/// <summary>
/// Converts <c>IntPtr</c> pointing to a UTF-8 encoded byte array to <c>string</c>.
/// </summary>
public static string PtrToStringUTF8(IntPtr ptr, int len)
{
if (testRunCount != 2)
{
Console.Error.WriteLine("You are using and old version of NUnit that doesn't support async tests and skips them instead. " +
"This test has failed to indicate that.");
Console.Error.Flush();
throw new Exception("NUnitVersionTest has failed.");
}
var bytes = new byte[len];
Marshal.Copy(ptr, bytes, 0, len);
return EncodingUTF8.GetString(bytes);
}
[Test]
public void NUnitVersionTest1()
/// <summary>
/// Returns byte array containing UTF-8 encoding of given string.
/// </summary>
public static byte[] GetBytesUTF8(string str)
{
testRunCount++;
return EncodingUTF8.GetBytes(str);
}
// Old version of NUnit will skip this test
[Test]
public async Task NUnitVersionTest2()
/// <summary>
/// Get string from a UTF8 encoded byte array.
/// </summary>
public static string GetStringUTF8(byte[] bytes)
{
testRunCount++;
await Task.Delay(10);
return EncodingUTF8.GetString(bytes);
}
/// <summary>
/// Returns byte array containing ASCII encoding of given string.
/// </summary>
public static byte[] GetBytesASCII(string str)
{
return EncodingASCII.GetBytes(str);
}
/// <summary>
/// Get string from an ASCII encoded byte array.
/// </summary>
public static string GetStringASCII(byte[] bytes)
{
return EncodingASCII.GetString(bytes);
}
}
}

@ -148,6 +148,12 @@ namespace Grpc.Core.Internal
public readonly Delegates.grpcsharp_server_shutdown_and_notify_callback_delegate grpcsharp_server_shutdown_and_notify_callback;
public readonly Delegates.grpcsharp_server_destroy_delegate grpcsharp_server_destroy;
public readonly Delegates.grpcsharp_call_auth_context_delegate grpcsharp_call_auth_context;
public readonly Delegates.grpcsharp_auth_context_peer_identity_property_name_delegate grpcsharp_auth_context_peer_identity_property_name;
public readonly Delegates.grpcsharp_auth_context_property_iterator_delegate grpcsharp_auth_context_property_iterator;
public readonly Delegates.grpcsharp_auth_property_iterator_next_delegate grpcsharp_auth_property_iterator_next;
public readonly Delegates.grpcsharp_auth_context_release_delegate grpcsharp_auth_context_release;
public readonly Delegates.gprsharp_now_delegate gprsharp_now;
public readonly Delegates.gprsharp_inf_future_delegate gprsharp_inf_future;
public readonly Delegates.gprsharp_inf_past_delegate gprsharp_inf_past;
@ -256,6 +262,12 @@ namespace Grpc.Core.Internal
this.grpcsharp_server_shutdown_and_notify_callback = GetMethodDelegate<Delegates.grpcsharp_server_shutdown_and_notify_callback_delegate>(library);
this.grpcsharp_server_destroy = GetMethodDelegate<Delegates.grpcsharp_server_destroy_delegate>(library);
this.grpcsharp_call_auth_context = GetMethodDelegate<Delegates.grpcsharp_call_auth_context_delegate>(library);
this.grpcsharp_auth_context_peer_identity_property_name = GetMethodDelegate<Delegates.grpcsharp_auth_context_peer_identity_property_name_delegate>(library);
this.grpcsharp_auth_context_property_iterator = GetMethodDelegate<Delegates.grpcsharp_auth_context_property_iterator_delegate>(library);
this.grpcsharp_auth_property_iterator_next = GetMethodDelegate<Delegates.grpcsharp_auth_property_iterator_next_delegate>(library);
this.grpcsharp_auth_context_release = GetMethodDelegate<Delegates.grpcsharp_auth_context_release_delegate>(library);
this.gprsharp_now = GetMethodDelegate<Delegates.gprsharp_now_delegate>(library);
this.gprsharp_inf_future = GetMethodDelegate<Delegates.gprsharp_inf_future_delegate>(library);
this.gprsharp_inf_past = GetMethodDelegate<Delegates.gprsharp_inf_past_delegate>(library);
@ -404,6 +416,12 @@ namespace Grpc.Core.Internal
public delegate void grpcsharp_server_shutdown_and_notify_callback_delegate(ServerSafeHandle server, CompletionQueueSafeHandle cq, BatchContextSafeHandle ctx);
public delegate void grpcsharp_server_destroy_delegate(IntPtr server);
public delegate AuthContextSafeHandle grpcsharp_call_auth_context_delegate(CallSafeHandle call);
public delegate IntPtr grpcsharp_auth_context_peer_identity_property_name_delegate(AuthContextSafeHandle authContext); // returns const char*
public delegate AuthContextSafeHandle.NativeAuthPropertyIterator grpcsharp_auth_context_property_iterator_delegate(AuthContextSafeHandle authContext);
public delegate IntPtr grpcsharp_auth_property_iterator_next_delegate(ref AuthContextSafeHandle.NativeAuthPropertyIterator iterator); // returns const auth_property*
public delegate void grpcsharp_auth_context_release_delegate(IntPtr authContext);
public delegate Timespec gprsharp_now_delegate(ClockType clockType);
public delegate Timespec gprsharp_inf_future_delegate(ClockType clockType);
public delegate Timespec gprsharp_inf_past_delegate(ClockType clockType);

@ -32,12 +32,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
namespace Grpc.Core
@ -242,7 +240,6 @@ namespace Grpc.Core
/// </summary>
public class Entry
{
private static readonly Encoding Encoding = Encoding.ASCII;
private static readonly Regex ValidKeyRegex = new Regex("^[a-z0-9_-]+$");
readonly string key;
@ -306,7 +303,7 @@ namespace Grpc.Core
{
if (valueBytes == null)
{
return Encoding.GetBytes(value);
return MarshalUtils.GetBytesASCII(value);
}
// defensive copy to guarantee immutability
@ -324,7 +321,7 @@ namespace Grpc.Core
get
{
GrpcPreconditions.CheckState(!IsBinary, "Cannot access string value of a binary metadata entry");
return value ?? Encoding.GetString(valueBytes);
return value ?? MarshalUtils.GetStringASCII(valueBytes);
}
}
@ -358,7 +355,7 @@ namespace Grpc.Core
/// </summary>
internal byte[] GetSerializedValueUnsafe()
{
return valueBytes ?? Encoding.GetBytes(value);
return valueBytes ?? MarshalUtils.GetBytesASCII(value);
}
/// <summary>
@ -371,7 +368,7 @@ namespace Grpc.Core
{
return new Entry(key, null, valueBytes);
}
return new Entry(key, Encoding.GetString(valueBytes), null);
return new Entry(key, MarshalUtils.GetStringASCII(valueBytes), null);
}
private static string NormalizeKey(string key)

@ -32,7 +32,6 @@
#endregion
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
@ -56,6 +55,7 @@ namespace Grpc.Core
private Status status = Status.DefaultSuccess;
private Func<Metadata, Task> writeHeadersFunc;
private IHasWriteOptions writeOptionsHolder;
private Lazy<AuthContext> authContext;
internal ServerCallContext(CallSafeHandle callHandle, string method, string host, DateTime deadline, Metadata requestHeaders, CancellationToken cancellationToken,
Func<Metadata, Task> writeHeadersFunc, IHasWriteOptions writeOptionsHolder)
@ -68,6 +68,7 @@ namespace Grpc.Core
this.cancellationToken = cancellationToken;
this.writeHeadersFunc = writeHeadersFunc;
this.writeOptionsHolder = writeOptionsHolder;
this.authContext = new Lazy<AuthContext>(GetAuthContextEager);
}
/// <summary>
@ -187,6 +188,26 @@ namespace Grpc.Core
writeOptionsHolder.WriteOptions = value;
}
}
/// <summary>
/// Gets the <c>AuthContext</c> associated with this call.
/// Note: Access to AuthContext is an experimental API that can change without any prior notice.
/// </summary>
public AuthContext AuthContext
{
get
{
return authContext.Value;
}
}
private AuthContext GetAuthContextEager()
{
using (var authContextNative = callHandle.GetAuthContext())
{
return authContextNative.ToAuthContext();
}
}
}
/// <summary>

@ -48,11 +48,11 @@ namespace Grpc.Core
/// <summary>
/// Current <c>AssemblyFileVersion</c> of gRPC C# assemblies
/// </summary>
public const string CurrentAssemblyFileVersion = "1.2.0.0";
public const string CurrentAssemblyFileVersion = "1.3.0.0";
/// <summary>
/// Current version of gRPC C#
/// </summary>
public const string CurrentVersion = "1.2.0-dev";
public const string CurrentVersion = "1.3.0-dev";
}
}

@ -1,5 +1,5 @@
{
"version": "1.2.0-dev",
"version": "1.3.0-dev",
"title": "gRPC C# Core",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",

@ -27,17 +27,17 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
<HintPath>..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll</HintPath>
<HintPath>..\packages\NUnitLite.3.6.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
<HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" />
<package id="Google.Protobuf" version="3.2.0" targetFramework="net45" />
<package id="NUnit" version="3.6.0" targetFramework="net45" />
<package id="NUnitLite" version="3.6.0" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />
</packages>

@ -45,8 +45,8 @@
"Grpc.Examples": {
"target": "project"
},
"NUnit": "3.2.0",
"NUnitLite": "3.2.0-*"
"NUnit": "3.6.0",
"NUnitLite": "3.6.0"
},
"frameworks": {
"net45": { },

@ -3,8 +3,6 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7DC1433E-3225-42C7-B7EA-546D56E27A4B}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Grpc.Examples</RootNamespace>
@ -28,17 +26,17 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data.Linq" />
<Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="Google.Protobuf" version="3.2.0" targetFramework="net45" />
<package id="NUnit" version="3.6.0" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />
</packages>

@ -6,15 +6,10 @@
"Grpc.Core": {
"target": "project"
},
"Google.Protobuf": "3.0.0"
"Google.Protobuf": "3.2.0"
},
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": ""
}
},
"net45": {},
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {

@ -35,14 +35,14 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
<HintPath>..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
<HintPath>..\packages\NUnitLite.3.6.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" />
<package id="Google.Protobuf" version="3.2.0" targetFramework="net45" />
<package id="NUnit" version="3.6.0" targetFramework="net45" />
<package id="NUnitLite" version="3.6.0" targetFramework="net45" />
</packages>

@ -45,8 +45,8 @@
"Grpc.HealthCheck": {
"target": "project"
},
"NUnit": "3.2.0",
"NUnitLite": "3.2.0-*"
"NUnit": "3.6.0",
"NUnitLite": "3.6.0"
},
"frameworks": {
"net45": { },

@ -36,12 +36,12 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="Google.Protobuf" version="3.2.0" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.1.1" targetFramework="net45" />
</packages>

@ -1,5 +1,5 @@
{
"version": "1.2.0-dev",
"version": "1.3.0-dev",
"title": "gRPC C# Healthchecking",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",
@ -21,16 +21,11 @@
}
},
"dependencies": {
"Grpc.Core": "1.2.0-dev",
"Google.Protobuf": "3.0.0"
"Grpc.Core": "1.3.0-dev",
"Google.Protobuf": "3.2.0"
},
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": ""
}
},
"net45": {},
"netstandard1.5": {
"dependencies": {
"NETStandard.Library": "1.6.0"

@ -34,33 +34,6 @@
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core">
<HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
</Reference>
<Reference Include="Google.Apis">
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.PlatformServices">
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth">
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices">
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
@ -82,6 +55,5 @@
</ItemGroup>
<ItemGroup>
<None Include="Grpc.IntegrationTesting.Client.project.json" />
<None Include="packages.config" />
</ItemGroup>
</Project>

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
<package id="Google.Apis" version="1.16.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
<package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages>

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
</packages>

@ -34,33 +34,6 @@
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core">
<HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
</Reference>
<Reference Include="Google.Apis">
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.PlatformServices">
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth">
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices">
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
@ -82,6 +55,5 @@
</ItemGroup>
<ItemGroup>
<None Include="Grpc.IntegrationTesting.Server.project.json" />
<None Include="packages.config" />
</ItemGroup>
</Project>

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
<package id="Google.Apis" version="1.16.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
<package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages>

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
</packages>

@ -30,63 +30,66 @@ namespace Grpc.Testing {
"cnBjLnRlc3RpbmcuQ2xvc2VkTG9vcFBhcmFtc0gAEi4KB3BvaXNzb24YAiAB",
"KAsyGy5ncnBjLnRlc3RpbmcuUG9pc3NvblBhcmFtc0gAQgYKBGxvYWQiQwoO",
"U2VjdXJpdHlQYXJhbXMSEwoLdXNlX3Rlc3RfY2EYASABKAgSHAoUc2VydmVy",
"X2hvc3Rfb3ZlcnJpZGUYAiABKAki8AMKDENsaWVudENvbmZpZxIWCg5zZXJ2",
"ZXJfdGFyZ2V0cxgBIAMoCRItCgtjbGllbnRfdHlwZRgCIAEoDjIYLmdycGMu",
"dGVzdGluZy5DbGllbnRUeXBlEjUKD3NlY3VyaXR5X3BhcmFtcxgDIAEoCzIc",
"LmdycGMudGVzdGluZy5TZWN1cml0eVBhcmFtcxIkChxvdXRzdGFuZGluZ19y",
"cGNzX3Blcl9jaGFubmVsGAQgASgFEhcKD2NsaWVudF9jaGFubmVscxgFIAEo",
"BRIcChRhc3luY19jbGllbnRfdGhyZWFkcxgHIAEoBRInCghycGNfdHlwZRgI",
"IAEoDjIVLmdycGMudGVzdGluZy5ScGNUeXBlEi0KC2xvYWRfcGFyYW1zGAog",
"ASgLMhguZ3JwYy50ZXN0aW5nLkxvYWRQYXJhbXMSMwoOcGF5bG9hZF9jb25m",
"aWcYCyABKAsyGy5ncnBjLnRlc3RpbmcuUGF5bG9hZENvbmZpZxI3ChBoaXN0",
"b2dyYW1fcGFyYW1zGAwgASgLMh0uZ3JwYy50ZXN0aW5nLkhpc3RvZ3JhbVBh",
"cmFtcxIRCgljb3JlX2xpc3QYDSADKAUSEgoKY29yZV9saW1pdBgOIAEoBRIY",
"ChBvdGhlcl9jbGllbnRfYXBpGA8gASgJIjgKDENsaWVudFN0YXR1cxIoCgVz",
"dGF0cxgBIAEoCzIZLmdycGMudGVzdGluZy5DbGllbnRTdGF0cyIVCgRNYXJr",
"Eg0KBXJlc2V0GAEgASgIImgKCkNsaWVudEFyZ3MSKwoFc2V0dXAYASABKAsy",
"Gi5ncnBjLnRlc3RpbmcuQ2xpZW50Q29uZmlnSAASIgoEbWFyaxgCIAEoCzIS",
"LmdycGMudGVzdGluZy5NYXJrSABCCQoHYXJndHlwZSK0AgoMU2VydmVyQ29u",
"ZmlnEi0KC3NlcnZlcl90eXBlGAEgASgOMhguZ3JwYy50ZXN0aW5nLlNlcnZl",
"clR5cGUSNQoPc2VjdXJpdHlfcGFyYW1zGAIgASgLMhwuZ3JwYy50ZXN0aW5n",
"LlNlY3VyaXR5UGFyYW1zEgwKBHBvcnQYBCABKAUSHAoUYXN5bmNfc2VydmVy",
"X3RocmVhZHMYByABKAUSEgoKY29yZV9saW1pdBgIIAEoBRIzCg5wYXlsb2Fk",
"X2NvbmZpZxgJIAEoCzIbLmdycGMudGVzdGluZy5QYXlsb2FkQ29uZmlnEhEK",
"CWNvcmVfbGlzdBgKIAMoBRIYChBvdGhlcl9zZXJ2ZXJfYXBpGAsgASgJEhwK",
"E3Jlc291cmNlX3F1b3RhX3NpemUY6QcgASgFImgKClNlcnZlckFyZ3MSKwoF",
"c2V0dXAYASABKAsyGi5ncnBjLnRlc3RpbmcuU2VydmVyQ29uZmlnSAASIgoE",
"bWFyaxgCIAEoCzISLmdycGMudGVzdGluZy5NYXJrSABCCQoHYXJndHlwZSJV",
"CgxTZXJ2ZXJTdGF0dXMSKAoFc3RhdHMYASABKAsyGS5ncnBjLnRlc3Rpbmcu",
"U2VydmVyU3RhdHMSDAoEcG9ydBgCIAEoBRINCgVjb3JlcxgDIAEoBSINCgtD",
"b3JlUmVxdWVzdCIdCgxDb3JlUmVzcG9uc2USDQoFY29yZXMYASABKAUiBgoE",
"Vm9pZCL9AQoIU2NlbmFyaW8SDAoEbmFtZRgBIAEoCRIxCg1jbGllbnRfY29u",
"ZmlnGAIgASgLMhouZ3JwYy50ZXN0aW5nLkNsaWVudENvbmZpZxITCgtudW1f",
"Y2xpZW50cxgDIAEoBRIxCg1zZXJ2ZXJfY29uZmlnGAQgASgLMhouZ3JwYy50",
"ZXN0aW5nLlNlcnZlckNvbmZpZxITCgtudW1fc2VydmVycxgFIAEoBRIWCg53",
"YXJtdXBfc2Vjb25kcxgGIAEoBRIZChFiZW5jaG1hcmtfc2Vjb25kcxgHIAEo",
"BRIgChhzcGF3bl9sb2NhbF93b3JrZXJfY291bnQYCCABKAUiNgoJU2NlbmFy",
"aW9zEikKCXNjZW5hcmlvcxgBIAMoCzIWLmdycGMudGVzdGluZy5TY2VuYXJp",
"byL4AgoVU2NlbmFyaW9SZXN1bHRTdW1tYXJ5EgsKA3FwcxgBIAEoARIbChNx",
"cHNfcGVyX3NlcnZlcl9jb3JlGAIgASgBEhoKEnNlcnZlcl9zeXN0ZW1fdGlt",
"ZRgDIAEoARIYChBzZXJ2ZXJfdXNlcl90aW1lGAQgASgBEhoKEmNsaWVudF9z",
"eXN0ZW1fdGltZRgFIAEoARIYChBjbGllbnRfdXNlcl90aW1lGAYgASgBEhIK",
"CmxhdGVuY3lfNTAYByABKAESEgoKbGF0ZW5jeV85MBgIIAEoARISCgpsYXRl",
"bmN5Xzk1GAkgASgBEhIKCmxhdGVuY3lfOTkYCiABKAESEwoLbGF0ZW5jeV85",
"OTkYCyABKAESGAoQc2VydmVyX2NwdV91c2FnZRgMIAEoARImCh5zdWNjZXNz",
"ZnVsX3JlcXVlc3RzX3Blcl9zZWNvbmQYDSABKAESIgoaZmFpbGVkX3JlcXVl",
"c3RzX3Blcl9zZWNvbmQYDiABKAEigwMKDlNjZW5hcmlvUmVzdWx0EigKCHNj",
"ZW5hcmlvGAEgASgLMhYuZ3JwYy50ZXN0aW5nLlNjZW5hcmlvEi4KCWxhdGVu",
"Y2llcxgCIAEoCzIbLmdycGMudGVzdGluZy5IaXN0b2dyYW1EYXRhEi8KDGNs",
"aWVudF9zdGF0cxgDIAMoCzIZLmdycGMudGVzdGluZy5DbGllbnRTdGF0cxIv",
"CgxzZXJ2ZXJfc3RhdHMYBCADKAsyGS5ncnBjLnRlc3RpbmcuU2VydmVyU3Rh",
"dHMSFAoMc2VydmVyX2NvcmVzGAUgAygFEjQKB3N1bW1hcnkYBiABKAsyIy5n",
"cnBjLnRlc3RpbmcuU2NlbmFyaW9SZXN1bHRTdW1tYXJ5EhYKDmNsaWVudF9z",
"dWNjZXNzGAcgAygIEhYKDnNlcnZlcl9zdWNjZXNzGAggAygIEjkKD3JlcXVl",
"c3RfcmVzdWx0cxgJIAMoCzIgLmdycGMudGVzdGluZy5SZXF1ZXN0UmVzdWx0",
"Q291bnQqQQoKQ2xpZW50VHlwZRIPCgtTWU5DX0NMSUVOVBAAEhAKDEFTWU5D",
"X0NMSUVOVBABEhAKDE9USEVSX0NMSUVOVBACKlsKClNlcnZlclR5cGUSDwoL",
"U1lOQ19TRVJWRVIQABIQCgxBU1lOQ19TRVJWRVIQARIYChRBU1lOQ19HRU5F",
"UklDX1NFUlZFUhACEhAKDE9USEVSX1NFUlZFUhADKiMKB1JwY1R5cGUSCQoF",
"VU5BUlkQABINCglTVFJFQU1JTkcQAWIGcHJvdG8z"));
"X2hvc3Rfb3ZlcnJpZGUYAiABKAkiTQoKQ2hhbm5lbEFyZxIMCgRuYW1lGAEg",
"ASgJEhMKCXN0cl92YWx1ZRgCIAEoCUgAEhMKCWludF92YWx1ZRgDIAEoBUgA",
"QgcKBXZhbHVlIqAECgxDbGllbnRDb25maWcSFgoOc2VydmVyX3RhcmdldHMY",
"ASADKAkSLQoLY2xpZW50X3R5cGUYAiABKA4yGC5ncnBjLnRlc3RpbmcuQ2xp",
"ZW50VHlwZRI1Cg9zZWN1cml0eV9wYXJhbXMYAyABKAsyHC5ncnBjLnRlc3Rp",
"bmcuU2VjdXJpdHlQYXJhbXMSJAocb3V0c3RhbmRpbmdfcnBjc19wZXJfY2hh",
"bm5lbBgEIAEoBRIXCg9jbGllbnRfY2hhbm5lbHMYBSABKAUSHAoUYXN5bmNf",
"Y2xpZW50X3RocmVhZHMYByABKAUSJwoIcnBjX3R5cGUYCCABKA4yFS5ncnBj",
"LnRlc3RpbmcuUnBjVHlwZRItCgtsb2FkX3BhcmFtcxgKIAEoCzIYLmdycGMu",
"dGVzdGluZy5Mb2FkUGFyYW1zEjMKDnBheWxvYWRfY29uZmlnGAsgASgLMhsu",
"Z3JwYy50ZXN0aW5nLlBheWxvYWRDb25maWcSNwoQaGlzdG9ncmFtX3BhcmFt",
"cxgMIAEoCzIdLmdycGMudGVzdGluZy5IaXN0b2dyYW1QYXJhbXMSEQoJY29y",
"ZV9saXN0GA0gAygFEhIKCmNvcmVfbGltaXQYDiABKAUSGAoQb3RoZXJfY2xp",
"ZW50X2FwaRgPIAEoCRIuCgxjaGFubmVsX2FyZ3MYECADKAsyGC5ncnBjLnRl",
"c3RpbmcuQ2hhbm5lbEFyZyI4CgxDbGllbnRTdGF0dXMSKAoFc3RhdHMYASAB",
"KAsyGS5ncnBjLnRlc3RpbmcuQ2xpZW50U3RhdHMiFQoETWFyaxINCgVyZXNl",
"dBgBIAEoCCJoCgpDbGllbnRBcmdzEisKBXNldHVwGAEgASgLMhouZ3JwYy50",
"ZXN0aW5nLkNsaWVudENvbmZpZ0gAEiIKBG1hcmsYAiABKAsyEi5ncnBjLnRl",
"c3RpbmcuTWFya0gAQgkKB2FyZ3R5cGUitAIKDFNlcnZlckNvbmZpZxItCgtz",
"ZXJ2ZXJfdHlwZRgBIAEoDjIYLmdycGMudGVzdGluZy5TZXJ2ZXJUeXBlEjUK",
"D3NlY3VyaXR5X3BhcmFtcxgCIAEoCzIcLmdycGMudGVzdGluZy5TZWN1cml0",
"eVBhcmFtcxIMCgRwb3J0GAQgASgFEhwKFGFzeW5jX3NlcnZlcl90aHJlYWRz",
"GAcgASgFEhIKCmNvcmVfbGltaXQYCCABKAUSMwoOcGF5bG9hZF9jb25maWcY",
"CSABKAsyGy5ncnBjLnRlc3RpbmcuUGF5bG9hZENvbmZpZxIRCgljb3JlX2xp",
"c3QYCiADKAUSGAoQb3RoZXJfc2VydmVyX2FwaRgLIAEoCRIcChNyZXNvdXJj",
"ZV9xdW90YV9zaXplGOkHIAEoBSJoCgpTZXJ2ZXJBcmdzEisKBXNldHVwGAEg",
"ASgLMhouZ3JwYy50ZXN0aW5nLlNlcnZlckNvbmZpZ0gAEiIKBG1hcmsYAiAB",
"KAsyEi5ncnBjLnRlc3RpbmcuTWFya0gAQgkKB2FyZ3R5cGUiVQoMU2VydmVy",
"U3RhdHVzEigKBXN0YXRzGAEgASgLMhkuZ3JwYy50ZXN0aW5nLlNlcnZlclN0",
"YXRzEgwKBHBvcnQYAiABKAUSDQoFY29yZXMYAyABKAUiDQoLQ29yZVJlcXVl",
"c3QiHQoMQ29yZVJlc3BvbnNlEg0KBWNvcmVzGAEgASgFIgYKBFZvaWQi/QEK",
"CFNjZW5hcmlvEgwKBG5hbWUYASABKAkSMQoNY2xpZW50X2NvbmZpZxgCIAEo",
"CzIaLmdycGMudGVzdGluZy5DbGllbnRDb25maWcSEwoLbnVtX2NsaWVudHMY",
"AyABKAUSMQoNc2VydmVyX2NvbmZpZxgEIAEoCzIaLmdycGMudGVzdGluZy5T",
"ZXJ2ZXJDb25maWcSEwoLbnVtX3NlcnZlcnMYBSABKAUSFgoOd2FybXVwX3Nl",
"Y29uZHMYBiABKAUSGQoRYmVuY2htYXJrX3NlY29uZHMYByABKAUSIAoYc3Bh",
"d25fbG9jYWxfd29ya2VyX2NvdW50GAggASgFIjYKCVNjZW5hcmlvcxIpCglz",
"Y2VuYXJpb3MYASADKAsyFi5ncnBjLnRlc3RpbmcuU2NlbmFyaW8i+AIKFVNj",
"ZW5hcmlvUmVzdWx0U3VtbWFyeRILCgNxcHMYASABKAESGwoTcXBzX3Blcl9z",
"ZXJ2ZXJfY29yZRgCIAEoARIaChJzZXJ2ZXJfc3lzdGVtX3RpbWUYAyABKAES",
"GAoQc2VydmVyX3VzZXJfdGltZRgEIAEoARIaChJjbGllbnRfc3lzdGVtX3Rp",
"bWUYBSABKAESGAoQY2xpZW50X3VzZXJfdGltZRgGIAEoARISCgpsYXRlbmN5",
"XzUwGAcgASgBEhIKCmxhdGVuY3lfOTAYCCABKAESEgoKbGF0ZW5jeV85NRgJ",
"IAEoARISCgpsYXRlbmN5Xzk5GAogASgBEhMKC2xhdGVuY3lfOTk5GAsgASgB",
"EhgKEHNlcnZlcl9jcHVfdXNhZ2UYDCABKAESJgoec3VjY2Vzc2Z1bF9yZXF1",
"ZXN0c19wZXJfc2Vjb25kGA0gASgBEiIKGmZhaWxlZF9yZXF1ZXN0c19wZXJf",
"c2Vjb25kGA4gASgBIoMDCg5TY2VuYXJpb1Jlc3VsdBIoCghzY2VuYXJpbxgB",
"IAEoCzIWLmdycGMudGVzdGluZy5TY2VuYXJpbxIuCglsYXRlbmNpZXMYAiAB",
"KAsyGy5ncnBjLnRlc3RpbmcuSGlzdG9ncmFtRGF0YRIvCgxjbGllbnRfc3Rh",
"dHMYAyADKAsyGS5ncnBjLnRlc3RpbmcuQ2xpZW50U3RhdHMSLwoMc2VydmVy",
"X3N0YXRzGAQgAygLMhkuZ3JwYy50ZXN0aW5nLlNlcnZlclN0YXRzEhQKDHNl",
"cnZlcl9jb3JlcxgFIAMoBRI0CgdzdW1tYXJ5GAYgASgLMiMuZ3JwYy50ZXN0",
"aW5nLlNjZW5hcmlvUmVzdWx0U3VtbWFyeRIWCg5jbGllbnRfc3VjY2VzcxgH",
"IAMoCBIWCg5zZXJ2ZXJfc3VjY2VzcxgIIAMoCBI5Cg9yZXF1ZXN0X3Jlc3Vs",
"dHMYCSADKAsyIC5ncnBjLnRlc3RpbmcuUmVxdWVzdFJlc3VsdENvdW50KkEK",
"CkNsaWVudFR5cGUSDwoLU1lOQ19DTElFTlQQABIQCgxBU1lOQ19DTElFTlQQ",
"ARIQCgxPVEhFUl9DTElFTlQQAipbCgpTZXJ2ZXJUeXBlEg8KC1NZTkNfU0VS",
"VkVSEAASEAoMQVNZTkNfU0VSVkVSEAESGAoUQVNZTkNfR0VORVJJQ19TRVJW",
"RVIQAhIQCgxPVEhFUl9TRVJWRVIQAyojCgdScGNUeXBlEgkKBVVOQVJZEAAS",
"DQoJU1RSRUFNSU5HEAFiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Grpc.Testing.PayloadsReflection.Descriptor, global::Grpc.Testing.StatsReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.ClientType), typeof(global::Grpc.Testing.ServerType), typeof(global::Grpc.Testing.RpcType), }, new pbr::GeneratedClrTypeInfo[] {
@ -94,7 +97,8 @@ namespace Grpc.Testing {
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClosedLoopParams), global::Grpc.Testing.ClosedLoopParams.Parser, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.LoadParams), global::Grpc.Testing.LoadParams.Parser, new[]{ "ClosedLoop", "Poisson" }, new[]{ "Load" }, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.SecurityParams), global::Grpc.Testing.SecurityParams.Parser, new[]{ "UseTestCa", "ServerHostOverride" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientConfig), global::Grpc.Testing.ClientConfig.Parser, new[]{ "ServerTargets", "ClientType", "SecurityParams", "OutstandingRpcsPerChannel", "ClientChannels", "AsyncClientThreads", "RpcType", "LoadParams", "PayloadConfig", "HistogramParams", "CoreList", "CoreLimit", "OtherClientApi" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ChannelArg), global::Grpc.Testing.ChannelArg.Parser, new[]{ "Name", "StrValue", "IntValue" }, new[]{ "Value" }, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientConfig), global::Grpc.Testing.ClientConfig.Parser, new[]{ "ServerTargets", "ClientType", "SecurityParams", "OutstandingRpcsPerChannel", "ClientChannels", "AsyncClientThreads", "RpcType", "LoadParams", "PayloadConfig", "HistogramParams", "CoreList", "CoreLimit", "OtherClientApi", "ChannelArgs" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientStatus), global::Grpc.Testing.ClientStatus.Parser, new[]{ "Stats" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Mark), global::Grpc.Testing.Mark.Parser, new[]{ "Reset" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ClientArgs), global::Grpc.Testing.ClientArgs.Parser, new[]{ "Setup", "Mark" }, new[]{ "Argtype" }, null, null),
@ -116,13 +120,13 @@ namespace Grpc.Testing {
#region Enums
public enum ClientType {
/// <summary>
/// Many languages support a basic distinction between using
/// sync or async client, and this allows the specification
/// Many languages support a basic distinction between using
/// sync or async client, and this allows the specification
/// </summary>
[pbr::OriginalName("SYNC_CLIENT")] SyncClient = 0,
[pbr::OriginalName("ASYNC_CLIENT")] AsyncClient = 1,
/// <summary>
/// used for some language-specific variants
/// used for some language-specific variants
/// </summary>
[pbr::OriginalName("OTHER_CLIENT")] OtherClient = 2,
}
@ -132,7 +136,7 @@ namespace Grpc.Testing {
[pbr::OriginalName("ASYNC_SERVER")] AsyncServer = 1,
[pbr::OriginalName("ASYNC_GENERIC_SERVER")] AsyncGenericServer = 2,
/// <summary>
/// used for some language-specific variants
/// used for some language-specific variants
/// </summary>
[pbr::OriginalName("OTHER_SERVER")] OtherServer = 3,
}
@ -146,8 +150,8 @@ namespace Grpc.Testing {
#region Messages
/// <summary>
/// Parameters of poisson process distribution, which is a good representation
/// of activity coming in from independent identical stationary sources.
/// Parameters of poisson process distribution, which is a good representation
/// of activity coming in from independent identical stationary sources.
/// </summary>
public sealed partial class PoissonParams : pb::IMessage<PoissonParams> {
private static readonly pb::MessageParser<PoissonParams> _parser = new pb::MessageParser<PoissonParams>(() => new PoissonParams());
@ -185,7 +189,7 @@ namespace Grpc.Testing {
public const int OfferedLoadFieldNumber = 1;
private double offeredLoad_;
/// <summary>
/// The rate of arrivals (a.k.a. lambda parameter of the exp distribution).
/// The rate of arrivals (a.k.a. lambda parameter of the exp distribution).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double OfferedLoad {
@ -270,8 +274,8 @@ namespace Grpc.Testing {
}
/// <summary>
/// Once an RPC finishes, immediately start a new one.
/// No configuration parameters needed.
/// Once an RPC finishes, immediately start a new one.
/// No configuration parameters needed.
/// </summary>
public sealed partial class ClosedLoopParams : pb::IMessage<ClosedLoopParams> {
private static readonly pb::MessageParser<ClosedLoopParams> _parser = new pb::MessageParser<ClosedLoopParams>(() => new ClosedLoopParams());
@ -549,7 +553,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// presence of SecurityParams implies use of TLS
/// presence of SecurityParams implies use of TLS
/// </summary>
public sealed partial class SecurityParams : pb::IMessage<SecurityParams> {
private static readonly pb::MessageParser<SecurityParams> _parser = new pb::MessageParser<SecurityParams>(() => new SecurityParams());
@ -696,6 +700,210 @@ namespace Grpc.Testing {
}
public sealed partial class ChannelArg : pb::IMessage<ChannelArg> {
private static readonly pb::MessageParser<ChannelArg> _parser = new pb::MessageParser<ChannelArg>(() => new ChannelArg());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ChannelArg> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[4]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ChannelArg() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ChannelArg(ChannelArg other) : this() {
name_ = other.name_;
switch (other.ValueCase) {
case ValueOneofCase.StrValue:
StrValue = other.StrValue;
break;
case ValueOneofCase.IntValue:
IntValue = other.IntValue;
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ChannelArg Clone() {
return new ChannelArg(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "str_value" field.</summary>
public const int StrValueFieldNumber = 2;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string StrValue {
get { return valueCase_ == ValueOneofCase.StrValue ? (string) value_ : ""; }
set {
value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
valueCase_ = ValueOneofCase.StrValue;
}
}
/// <summary>Field number for the "int_value" field.</summary>
public const int IntValueFieldNumber = 3;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int IntValue {
get { return valueCase_ == ValueOneofCase.IntValue ? (int) value_ : 0; }
set {
value_ = value;
valueCase_ = ValueOneofCase.IntValue;
}
}
private object value_;
/// <summary>Enum of possible cases for the "value" oneof.</summary>
public enum ValueOneofCase {
None = 0,
StrValue = 2,
IntValue = 3,
}
private ValueOneofCase valueCase_ = ValueOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public ValueOneofCase ValueCase {
get { return valueCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearValue() {
valueCase_ = ValueOneofCase.None;
value_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ChannelArg);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(ChannelArg other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (StrValue != other.StrValue) return false;
if (IntValue != other.IntValue) return false;
if (ValueCase != other.ValueCase) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (valueCase_ == ValueOneofCase.StrValue) hash ^= StrValue.GetHashCode();
if (valueCase_ == ValueOneofCase.IntValue) hash ^= IntValue.GetHashCode();
hash ^= (int) valueCase_;
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (valueCase_ == ValueOneofCase.StrValue) {
output.WriteRawTag(18);
output.WriteString(StrValue);
}
if (valueCase_ == ValueOneofCase.IntValue) {
output.WriteRawTag(24);
output.WriteInt32(IntValue);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (valueCase_ == ValueOneofCase.StrValue) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(StrValue);
}
if (valueCase_ == ValueOneofCase.IntValue) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntValue);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(ChannelArg other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
switch (other.ValueCase) {
case ValueOneofCase.StrValue:
StrValue = other.StrValue;
break;
case ValueOneofCase.IntValue:
IntValue = other.IntValue;
break;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
StrValue = input.ReadString();
break;
}
case 24: {
IntValue = input.ReadInt32();
break;
}
}
}
}
}
public sealed partial class ClientConfig : pb::IMessage<ClientConfig> {
private static readonly pb::MessageParser<ClientConfig> _parser = new pb::MessageParser<ClientConfig>(() => new ClientConfig());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -703,7 +911,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[4]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[5]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -733,6 +941,7 @@ namespace Grpc.Testing {
coreList_ = other.coreList_.Clone();
coreLimit_ = other.coreLimit_;
otherClientApi_ = other.otherClientApi_;
channelArgs_ = other.channelArgs_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -746,7 +955,7 @@ namespace Grpc.Testing {
= pb::FieldCodec.ForString(10);
private readonly pbc::RepeatedField<string> serverTargets_ = new pbc::RepeatedField<string>();
/// <summary>
/// List of targets to connect to. At least one target needs to be specified.
/// List of targets to connect to. At least one target needs to be specified.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> ServerTargets {
@ -779,8 +988,8 @@ namespace Grpc.Testing {
public const int OutstandingRpcsPerChannelFieldNumber = 4;
private int outstandingRpcsPerChannel_;
/// <summary>
/// How many concurrent RPCs to start for each channel.
/// For synchronous client, use a separate thread for each outstanding RPC.
/// How many concurrent RPCs to start for each channel.
/// For synchronous client, use a separate thread for each outstanding RPC.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int OutstandingRpcsPerChannel {
@ -794,8 +1003,8 @@ namespace Grpc.Testing {
public const int ClientChannelsFieldNumber = 5;
private int clientChannels_;
/// <summary>
/// Number of independent client channels to create.
/// i-th channel will connect to server_target[i % server_targets.size()]
/// Number of independent client channels to create.
/// i-th channel will connect to server_target[i % server_targets.size()]
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ClientChannels {
@ -809,7 +1018,7 @@ namespace Grpc.Testing {
public const int AsyncClientThreadsFieldNumber = 7;
private int asyncClientThreads_;
/// <summary>
/// Only for async client. Number of threads to use to start/manage RPCs.
/// Only for async client. Number of threads to use to start/manage RPCs.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int AsyncClientThreads {
@ -834,7 +1043,7 @@ namespace Grpc.Testing {
public const int LoadParamsFieldNumber = 10;
private global::Grpc.Testing.LoadParams loadParams_;
/// <summary>
/// The requested load for the entire client (aggregated over all the threads).
/// The requested load for the entire client (aggregated over all the threads).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.LoadParams LoadParams {
@ -872,7 +1081,7 @@ namespace Grpc.Testing {
= pb::FieldCodec.ForInt32(106);
private readonly pbc::RepeatedField<int> coreList_ = new pbc::RepeatedField<int>();
/// <summary>
/// Specify the cores we should run the client on, if desired
/// Specify the cores we should run the client on, if desired
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> CoreList {
@ -894,7 +1103,7 @@ namespace Grpc.Testing {
public const int OtherClientApiFieldNumber = 15;
private string otherClientApi_ = "";
/// <summary>
/// If we use an OTHER_CLIENT client_type, this string gives more detail
/// If we use an OTHER_CLIENT client_type, this string gives more detail
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string OtherClientApi {
@ -904,6 +1113,16 @@ namespace Grpc.Testing {
}
}
/// <summary>Field number for the "channel_args" field.</summary>
public const int ChannelArgsFieldNumber = 16;
private static readonly pb::FieldCodec<global::Grpc.Testing.ChannelArg> _repeated_channelArgs_codec
= pb::FieldCodec.ForMessage(130, global::Grpc.Testing.ChannelArg.Parser);
private readonly pbc::RepeatedField<global::Grpc.Testing.ChannelArg> channelArgs_ = new pbc::RepeatedField<global::Grpc.Testing.ChannelArg>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Grpc.Testing.ChannelArg> ChannelArgs {
get { return channelArgs_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as ClientConfig);
@ -930,6 +1149,7 @@ namespace Grpc.Testing {
if(!coreList_.Equals(other.coreList_)) return false;
if (CoreLimit != other.CoreLimit) return false;
if (OtherClientApi != other.OtherClientApi) return false;
if(!channelArgs_.Equals(other.channelArgs_)) return false;
return true;
}
@ -949,6 +1169,7 @@ namespace Grpc.Testing {
hash ^= coreList_.GetHashCode();
if (CoreLimit != 0) hash ^= CoreLimit.GetHashCode();
if (OtherClientApi.Length != 0) hash ^= OtherClientApi.GetHashCode();
hash ^= channelArgs_.GetHashCode();
return hash;
}
@ -1005,6 +1226,7 @@ namespace Grpc.Testing {
output.WriteRawTag(122);
output.WriteString(OtherClientApi);
}
channelArgs_.WriteTo(output, _repeated_channelArgs_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -1045,6 +1267,7 @@ namespace Grpc.Testing {
if (OtherClientApi.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(OtherClientApi);
}
size += channelArgs_.CalculateSize(_repeated_channelArgs_codec);
return size;
}
@ -1100,6 +1323,7 @@ namespace Grpc.Testing {
if (other.OtherClientApi.Length != 0) {
OtherClientApi = other.OtherClientApi;
}
channelArgs_.Add(other.channelArgs_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -1175,6 +1399,10 @@ namespace Grpc.Testing {
OtherClientApi = input.ReadString();
break;
}
case 130: {
channelArgs_.AddEntriesFrom(input, _repeated_channelArgs_codec);
break;
}
}
}
}
@ -1188,7 +1416,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[5]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[6]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -1305,7 +1533,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// Request current stats
/// Request current stats
/// </summary>
public sealed partial class Mark : pb::IMessage<Mark> {
private static readonly pb::MessageParser<Mark> _parser = new pb::MessageParser<Mark>(() => new Mark());
@ -1314,7 +1542,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[6]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[7]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -1343,7 +1571,7 @@ namespace Grpc.Testing {
public const int ResetFieldNumber = 1;
private bool reset_;
/// <summary>
/// if true, the stats will be reset after taking their snapshot.
/// if true, the stats will be reset after taking their snapshot.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Reset {
@ -1434,7 +1662,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[7]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[8]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -1620,7 +1848,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[8]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[9]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -1679,7 +1907,7 @@ namespace Grpc.Testing {
public const int PortFieldNumber = 4;
private int port_;
/// <summary>
/// Port on which to listen. Zero means pick unused port.
/// Port on which to listen. Zero means pick unused port.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Port {
@ -1693,7 +1921,7 @@ namespace Grpc.Testing {
public const int AsyncServerThreadsFieldNumber = 7;
private int asyncServerThreads_;
/// <summary>
/// Only for async server. Number of threads used to serve the requests.
/// Only for async server. Number of threads used to serve the requests.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int AsyncServerThreads {
@ -1707,7 +1935,7 @@ namespace Grpc.Testing {
public const int CoreLimitFieldNumber = 8;
private int coreLimit_;
/// <summary>
/// Specify the number of cores to limit server to, if desired
/// Specify the number of cores to limit server to, if desired
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CoreLimit {
@ -1721,7 +1949,10 @@ namespace Grpc.Testing {
public const int PayloadConfigFieldNumber = 9;
private global::Grpc.Testing.PayloadConfig payloadConfig_;
/// <summary>
/// payload config, used in generic server
/// payload config, used in generic server.
/// Note this must NOT be used in proto (non-generic) servers. For proto servers,
/// 'response sizes' must be configured from the 'response_size' field of the
/// 'SimpleRequest' objects in RPC requests.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.PayloadConfig PayloadConfig {
@ -1737,7 +1968,7 @@ namespace Grpc.Testing {
= pb::FieldCodec.ForInt32(82);
private readonly pbc::RepeatedField<int> coreList_ = new pbc::RepeatedField<int>();
/// <summary>
/// Specify the cores we should run the server on, if desired
/// Specify the cores we should run the server on, if desired
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> CoreList {
@ -1748,7 +1979,7 @@ namespace Grpc.Testing {
public const int OtherServerApiFieldNumber = 11;
private string otherServerApi_ = "";
/// <summary>
/// If we use an OTHER_SERVER client_type, this string gives more detail
/// If we use an OTHER_SERVER client_type, this string gives more detail
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string OtherServerApi {
@ -1762,7 +1993,7 @@ namespace Grpc.Testing {
public const int ResourceQuotaSizeFieldNumber = 1001;
private int resourceQuotaSize_;
/// <summary>
/// Buffer pool size (no buffer pool specified if unset)
/// Buffer pool size (no buffer pool specified if unset)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ResourceQuotaSize {
@ -1987,7 +2218,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[9]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[10]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -2173,7 +2404,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[10]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[11]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -2215,7 +2446,7 @@ namespace Grpc.Testing {
public const int PortFieldNumber = 2;
private int port_;
/// <summary>
/// the port bound by the server
/// the port bound by the server
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Port {
@ -2229,7 +2460,7 @@ namespace Grpc.Testing {
public const int CoresFieldNumber = 3;
private int cores_;
/// <summary>
/// Number of cores available to the server
/// Number of cores available to the server
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Cores {
@ -2358,7 +2589,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[11]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[12]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -2447,7 +2678,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[12]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[13]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -2476,7 +2707,7 @@ namespace Grpc.Testing {
public const int CoresFieldNumber = 1;
private int cores_;
/// <summary>
/// Number of cores available on the server
/// Number of cores available on the server
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Cores {
@ -2567,7 +2798,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[13]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[14]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -2650,7 +2881,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// A single performance scenario: input to qps_json_driver
/// A single performance scenario: input to qps_json_driver
/// </summary>
public sealed partial class Scenario : pb::IMessage<Scenario> {
private static readonly pb::MessageParser<Scenario> _parser = new pb::MessageParser<Scenario>(() => new Scenario());
@ -2659,7 +2890,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[14]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[15]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -2695,7 +2926,7 @@ namespace Grpc.Testing {
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// Human readable name for this scenario
/// Human readable name for this scenario
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
@ -2709,7 +2940,7 @@ namespace Grpc.Testing {
public const int ClientConfigFieldNumber = 2;
private global::Grpc.Testing.ClientConfig clientConfig_;
/// <summary>
/// Client configuration
/// Client configuration
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.ClientConfig ClientConfig {
@ -2723,7 +2954,7 @@ namespace Grpc.Testing {
public const int NumClientsFieldNumber = 3;
private int numClients_;
/// <summary>
/// Number of clients to start for the test
/// Number of clients to start for the test
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int NumClients {
@ -2737,7 +2968,7 @@ namespace Grpc.Testing {
public const int ServerConfigFieldNumber = 4;
private global::Grpc.Testing.ServerConfig serverConfig_;
/// <summary>
/// Server configuration
/// Server configuration
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.ServerConfig ServerConfig {
@ -2751,7 +2982,7 @@ namespace Grpc.Testing {
public const int NumServersFieldNumber = 5;
private int numServers_;
/// <summary>
/// Number of servers to start for the test
/// Number of servers to start for the test
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int NumServers {
@ -2765,7 +2996,7 @@ namespace Grpc.Testing {
public const int WarmupSecondsFieldNumber = 6;
private int warmupSeconds_;
/// <summary>
/// Warmup period, in seconds
/// Warmup period, in seconds
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int WarmupSeconds {
@ -2779,7 +3010,7 @@ namespace Grpc.Testing {
public const int BenchmarkSecondsFieldNumber = 7;
private int benchmarkSeconds_;
/// <summary>
/// Benchmark time, in seconds
/// Benchmark time, in seconds
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int BenchmarkSeconds {
@ -2793,7 +3024,7 @@ namespace Grpc.Testing {
public const int SpawnLocalWorkerCountFieldNumber = 8;
private int spawnLocalWorkerCount_;
/// <summary>
/// Number of workers to spawn locally (usually zero)
/// Number of workers to spawn locally (usually zero)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int SpawnLocalWorkerCount {
@ -3002,7 +3233,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// A set of scenarios to be run with qps_json_driver
/// A set of scenarios to be run with qps_json_driver
/// </summary>
public sealed partial class Scenarios : pb::IMessage<Scenarios> {
private static readonly pb::MessageParser<Scenarios> _parser = new pb::MessageParser<Scenarios>(() => new Scenarios());
@ -3011,7 +3242,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[15]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[16]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -3114,8 +3345,8 @@ namespace Grpc.Testing {
}
/// <summary>
/// Basic summary that can be computed from ClientStats and ServerStats
/// once the scenario has finished.
/// Basic summary that can be computed from ClientStats and ServerStats
/// once the scenario has finished.
/// </summary>
public sealed partial class ScenarioResultSummary : pb::IMessage<ScenarioResultSummary> {
private static readonly pb::MessageParser<ScenarioResultSummary> _parser = new pb::MessageParser<ScenarioResultSummary>(() => new ScenarioResultSummary());
@ -3124,7 +3355,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[16]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[17]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -3166,7 +3397,7 @@ namespace Grpc.Testing {
public const int QpsFieldNumber = 1;
private double qps_;
/// <summary>
/// Total number of operations per second over all clients.
/// Total number of operations per second over all clients.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double Qps {
@ -3180,7 +3411,7 @@ namespace Grpc.Testing {
public const int QpsPerServerCoreFieldNumber = 2;
private double qpsPerServerCore_;
/// <summary>
/// QPS per one server core.
/// QPS per one server core.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double QpsPerServerCore {
@ -3194,7 +3425,7 @@ namespace Grpc.Testing {
public const int ServerSystemTimeFieldNumber = 3;
private double serverSystemTime_;
/// <summary>
/// server load based on system_time (0.85 => 85%)
/// server load based on system_time (0.85 => 85%)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double ServerSystemTime {
@ -3208,7 +3439,7 @@ namespace Grpc.Testing {
public const int ServerUserTimeFieldNumber = 4;
private double serverUserTime_;
/// <summary>
/// server load based on user_time (0.85 => 85%)
/// server load based on user_time (0.85 => 85%)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double ServerUserTime {
@ -3222,7 +3453,7 @@ namespace Grpc.Testing {
public const int ClientSystemTimeFieldNumber = 5;
private double clientSystemTime_;
/// <summary>
/// client load based on system_time (0.85 => 85%)
/// client load based on system_time (0.85 => 85%)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double ClientSystemTime {
@ -3236,7 +3467,7 @@ namespace Grpc.Testing {
public const int ClientUserTimeFieldNumber = 6;
private double clientUserTime_;
/// <summary>
/// client load based on user_time (0.85 => 85%)
/// client load based on user_time (0.85 => 85%)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double ClientUserTime {
@ -3250,7 +3481,7 @@ namespace Grpc.Testing {
public const int Latency50FieldNumber = 7;
private double latency50_;
/// <summary>
/// X% latency percentiles (in nanoseconds)
/// X% latency percentiles (in nanoseconds)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double Latency50 {
@ -3308,7 +3539,7 @@ namespace Grpc.Testing {
public const int ServerCpuUsageFieldNumber = 12;
private double serverCpuUsage_;
/// <summary>
/// server cpu usage percentage
/// server cpu usage percentage
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double ServerCpuUsage {
@ -3322,7 +3553,7 @@ namespace Grpc.Testing {
public const int SuccessfulRequestsPerSecondFieldNumber = 13;
private double successfulRequestsPerSecond_;
/// <summary>
/// Number of requests that succeeded/failed
/// Number of requests that succeeded/failed
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public double SuccessfulRequestsPerSecond {
@ -3626,7 +3857,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// Results of a single benchmark scenario.
/// Results of a single benchmark scenario.
/// </summary>
public sealed partial class ScenarioResult : pb::IMessage<ScenarioResult> {
private static readonly pb::MessageParser<ScenarioResult> _parser = new pb::MessageParser<ScenarioResult>(() => new ScenarioResult());
@ -3635,7 +3866,7 @@ namespace Grpc.Testing {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[17]; }
get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[18]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -3672,7 +3903,7 @@ namespace Grpc.Testing {
public const int ScenarioFieldNumber = 1;
private global::Grpc.Testing.Scenario scenario_;
/// <summary>
/// Inputs used to run the scenario.
/// Inputs used to run the scenario.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.Scenario Scenario {
@ -3686,7 +3917,7 @@ namespace Grpc.Testing {
public const int LatenciesFieldNumber = 2;
private global::Grpc.Testing.HistogramData latencies_;
/// <summary>
/// Histograms from all clients merged into one histogram.
/// Histograms from all clients merged into one histogram.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.HistogramData Latencies {
@ -3702,7 +3933,7 @@ namespace Grpc.Testing {
= pb::FieldCodec.ForMessage(26, global::Grpc.Testing.ClientStats.Parser);
private readonly pbc::RepeatedField<global::Grpc.Testing.ClientStats> clientStats_ = new pbc::RepeatedField<global::Grpc.Testing.ClientStats>();
/// <summary>
/// Client stats for each client
/// Client stats for each client
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Grpc.Testing.ClientStats> ClientStats {
@ -3715,7 +3946,7 @@ namespace Grpc.Testing {
= pb::FieldCodec.ForMessage(34, global::Grpc.Testing.ServerStats.Parser);
private readonly pbc::RepeatedField<global::Grpc.Testing.ServerStats> serverStats_ = new pbc::RepeatedField<global::Grpc.Testing.ServerStats>();
/// <summary>
/// Server stats for each server
/// Server stats for each server
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Grpc.Testing.ServerStats> ServerStats {
@ -3728,7 +3959,7 @@ namespace Grpc.Testing {
= pb::FieldCodec.ForInt32(42);
private readonly pbc::RepeatedField<int> serverCores_ = new pbc::RepeatedField<int>();
/// <summary>
/// Number of cores available to each server
/// Number of cores available to each server
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> ServerCores {
@ -3739,7 +3970,7 @@ namespace Grpc.Testing {
public const int SummaryFieldNumber = 6;
private global::Grpc.Testing.ScenarioResultSummary summary_;
/// <summary>
/// An after-the-fact computed summary
/// An after-the-fact computed summary
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.ScenarioResultSummary Summary {
@ -3755,7 +3986,7 @@ namespace Grpc.Testing {
= pb::FieldCodec.ForBool(58);
private readonly pbc::RepeatedField<bool> clientSuccess_ = new pbc::RepeatedField<bool>();
/// <summary>
/// Information on success or failure of each worker
/// Information on success or failure of each worker
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<bool> ClientSuccess {
@ -3778,7 +4009,7 @@ namespace Grpc.Testing {
= pb::FieldCodec.ForMessage(74, global::Grpc.Testing.RequestResultCount.Parser);
private readonly pbc::RepeatedField<global::Grpc.Testing.RequestResultCount> requestResults_ = new pbc::RepeatedField<global::Grpc.Testing.RequestResultCount>();
/// <summary>
/// Number of failed requests (one row per status code seen)
/// Number of failed requests (one row per status code seen)
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Grpc.Testing.RequestResultCount> RequestResults {

@ -35,13 +35,13 @@ namespace Grpc.Testing {
}
#region Messages
/// <summary>
/// An empty message that you can re-use to avoid defining duplicated empty
/// messages in your project. A typical example is to use it as argument or the
/// return value of a service API. For instance:
/// An empty message that you can re-use to avoid defining duplicated empty
/// messages in your project. A typical example is to use it as argument or the
/// return value of a service API. For instance:
///
/// service Foo {
/// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
/// };
/// service Foo {
/// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
/// };
/// </summary>
public sealed partial class Empty : pb::IMessage<Empty> {
private static readonly pb::MessageParser<Empty> _parser = new pb::MessageParser<Empty>(() => new Empty());

@ -33,53 +33,47 @@
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
<Reference Include="CommandLineParser.Unofficial">
<HintPath>..\packages\CommandLineParser.Unofficial.2.0.275\lib\net45\CommandLineParser.Unofficial.dll</HintPath>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Core">
<HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
<HintPath>..\packages\Google.Apis.Core.1.21.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
<Reference Include="Google.Apis">
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
<HintPath>..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.PlatformServices">
<HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
<HintPath>..\packages\Google.Apis.1.21.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth">
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
<HintPath>..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices">
<HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
<HintPath>..\packages\Google.Apis.Auth.1.21.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf">
<HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
<HintPath>..\packages\Google.Protobuf.3.2.0\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.6.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Castle.Core">
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<HintPath>..\packages\Castle.Core.4.0.0\lib\net45\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.6.38-alpha\lib\net45\Moq.dll</HintPath>
<HintPath>..\packages\Moq.4.7.0\lib\net45\Moq.dll</HintPath>
</Reference>
<Reference Include="System.Interactive.Async">
<HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net45\System.Interactive.Async.dll</HintPath>
<Reference Include="CommandLine">
<HintPath>..\packages\CommandLineParser.2.1.1-beta\lib\net45\CommandLine.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

@ -75,12 +75,12 @@ namespace Grpc.Testing {
}
#region Enums
/// <summary>
/// DEPRECATED, don't use. To be removed shortly.
/// The type of payload that should be returned.
/// DEPRECATED, don't use. To be removed shortly.
/// The type of payload that should be returned.
/// </summary>
public enum PayloadType {
/// <summary>
/// Compressable text format.
/// Compressable text format.
/// </summary>
[pbr::OriginalName("COMPRESSABLE")] Compressable = 0,
}
@ -89,9 +89,9 @@ namespace Grpc.Testing {
#region Messages
/// <summary>
/// TODO(dgq): Go back to using well-known types once
/// https://github.com/grpc/grpc/issues/6980 has been fixed.
/// import "google/protobuf/wrappers.proto";
/// TODO(dgq): Go back to using well-known types once
/// https://github.com/grpc/grpc/issues/6980 has been fixed.
/// import "google/protobuf/wrappers.proto";
/// </summary>
public sealed partial class BoolValue : pb::IMessage<BoolValue> {
private static readonly pb::MessageParser<BoolValue> _parser = new pb::MessageParser<BoolValue>(() => new BoolValue());
@ -129,7 +129,7 @@ namespace Grpc.Testing {
public const int ValueFieldNumber = 1;
private bool value_;
/// <summary>
/// The bool value.
/// The bool value.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Value {
@ -214,7 +214,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// A block of data, to simply increase gRPC message size.
/// A block of data, to simply increase gRPC message size.
/// </summary>
public sealed partial class Payload : pb::IMessage<Payload> {
private static readonly pb::MessageParser<Payload> _parser = new pb::MessageParser<Payload>(() => new Payload());
@ -253,8 +253,8 @@ namespace Grpc.Testing {
public const int TypeFieldNumber = 1;
private global::Grpc.Testing.PayloadType type_ = 0;
/// <summary>
/// DEPRECATED, don't use. To be removed shortly.
/// The type of data in body.
/// DEPRECATED, don't use. To be removed shortly.
/// The type of data in body.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.PayloadType Type {
@ -268,7 +268,7 @@ namespace Grpc.Testing {
public const int BodyFieldNumber = 2;
private pb::ByteString body_ = pb::ByteString.Empty;
/// <summary>
/// Primary contents of payload.
/// Primary contents of payload.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString Body {
@ -369,8 +369,8 @@ namespace Grpc.Testing {
}
/// <summary>
/// A protobuf representation for grpc status. This is used by test
/// clients to specify a status that the server should attempt to return.
/// A protobuf representation for grpc status. This is used by test
/// clients to specify a status that the server should attempt to return.
/// </summary>
public sealed partial class EchoStatus : pb::IMessage<EchoStatus> {
private static readonly pb::MessageParser<EchoStatus> _parser = new pb::MessageParser<EchoStatus>(() => new EchoStatus());
@ -518,7 +518,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// Unary request.
/// Unary request.
/// </summary>
public sealed partial class SimpleRequest : pb::IMessage<SimpleRequest> {
private static readonly pb::MessageParser<SimpleRequest> _parser = new pb::MessageParser<SimpleRequest>(() => new SimpleRequest());
@ -563,9 +563,9 @@ namespace Grpc.Testing {
public const int ResponseTypeFieldNumber = 1;
private global::Grpc.Testing.PayloadType responseType_ = 0;
/// <summary>
/// DEPRECATED, don't use. To be removed shortly.
/// Desired payload type in the response from the server.
/// If response_type is RANDOM, server randomly chooses one from other formats.
/// DEPRECATED, don't use. To be removed shortly.
/// Desired payload type in the response from the server.
/// If response_type is RANDOM, server randomly chooses one from other formats.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.PayloadType ResponseType {
@ -579,7 +579,7 @@ namespace Grpc.Testing {
public const int ResponseSizeFieldNumber = 2;
private int responseSize_;
/// <summary>
/// Desired payload size in the response from the server.
/// Desired payload size in the response from the server.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ResponseSize {
@ -593,7 +593,7 @@ namespace Grpc.Testing {
public const int PayloadFieldNumber = 3;
private global::Grpc.Testing.Payload payload_;
/// <summary>
/// Optional input payload sent along with the request.
/// Optional input payload sent along with the request.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.Payload Payload {
@ -607,7 +607,7 @@ namespace Grpc.Testing {
public const int FillUsernameFieldNumber = 4;
private bool fillUsername_;
/// <summary>
/// Whether SimpleResponse should include username.
/// Whether SimpleResponse should include username.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool FillUsername {
@ -621,7 +621,7 @@ namespace Grpc.Testing {
public const int FillOauthScopeFieldNumber = 5;
private bool fillOauthScope_;
/// <summary>
/// Whether SimpleResponse should include OAuth scope.
/// Whether SimpleResponse should include OAuth scope.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool FillOauthScope {
@ -635,10 +635,10 @@ namespace Grpc.Testing {
public const int ResponseCompressedFieldNumber = 6;
private global::Grpc.Testing.BoolValue responseCompressed_;
/// <summary>
/// Whether to request the server to compress the response. This field is
/// "nullable" in order to interoperate seamlessly with clients not able to
/// implement the full compression tests by introspecting the call to verify
/// the response's compression status.
/// Whether to request the server to compress the response. This field is
/// "nullable" in order to interoperate seamlessly with clients not able to
/// implement the full compression tests by introspecting the call to verify
/// the response's compression status.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.BoolValue ResponseCompressed {
@ -652,7 +652,7 @@ namespace Grpc.Testing {
public const int ResponseStatusFieldNumber = 7;
private global::Grpc.Testing.EchoStatus responseStatus_;
/// <summary>
/// Whether server should return a given status
/// Whether server should return a given status
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.EchoStatus ResponseStatus {
@ -666,7 +666,7 @@ namespace Grpc.Testing {
public const int ExpectCompressedFieldNumber = 8;
private global::Grpc.Testing.BoolValue expectCompressed_;
/// <summary>
/// Whether the server should expect this request to be compressed.
/// Whether the server should expect this request to be compressed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.BoolValue ExpectCompressed {
@ -887,7 +887,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// Unary response, as configured by the request.
/// Unary response, as configured by the request.
/// </summary>
public sealed partial class SimpleResponse : pb::IMessage<SimpleResponse> {
private static readonly pb::MessageParser<SimpleResponse> _parser = new pb::MessageParser<SimpleResponse>(() => new SimpleResponse());
@ -927,7 +927,7 @@ namespace Grpc.Testing {
public const int PayloadFieldNumber = 1;
private global::Grpc.Testing.Payload payload_;
/// <summary>
/// Payload to increase message size.
/// Payload to increase message size.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.Payload Payload {
@ -941,8 +941,8 @@ namespace Grpc.Testing {
public const int UsernameFieldNumber = 2;
private string username_ = "";
/// <summary>
/// The user the request came from, for verifying authentication was
/// successful when the client expected it.
/// The user the request came from, for verifying authentication was
/// successful when the client expected it.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Username {
@ -956,7 +956,7 @@ namespace Grpc.Testing {
public const int OauthScopeFieldNumber = 3;
private string oauthScope_ = "";
/// <summary>
/// OAuth scope.
/// OAuth scope.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string OauthScope {
@ -1079,7 +1079,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// Client-streaming request.
/// Client-streaming request.
/// </summary>
public sealed partial class StreamingInputCallRequest : pb::IMessage<StreamingInputCallRequest> {
private static readonly pb::MessageParser<StreamingInputCallRequest> _parser = new pb::MessageParser<StreamingInputCallRequest>(() => new StreamingInputCallRequest());
@ -1118,7 +1118,7 @@ namespace Grpc.Testing {
public const int PayloadFieldNumber = 1;
private global::Grpc.Testing.Payload payload_;
/// <summary>
/// Optional input payload sent along with the request.
/// Optional input payload sent along with the request.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.Payload Payload {
@ -1132,10 +1132,10 @@ namespace Grpc.Testing {
public const int ExpectCompressedFieldNumber = 2;
private global::Grpc.Testing.BoolValue expectCompressed_;
/// <summary>
/// Whether the server should expect this request to be compressed. This field
/// is "nullable" in order to interoperate seamlessly with servers not able to
/// implement the full compression tests by introspecting the call to verify
/// the request's compression status.
/// Whether the server should expect this request to be compressed. This field
/// is "nullable" in order to interoperate seamlessly with servers not able to
/// implement the full compression tests by introspecting the call to verify
/// the request's compression status.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.BoolValue ExpectCompressed {
@ -1248,7 +1248,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// Client-streaming response.
/// Client-streaming response.
/// </summary>
public sealed partial class StreamingInputCallResponse : pb::IMessage<StreamingInputCallResponse> {
private static readonly pb::MessageParser<StreamingInputCallResponse> _parser = new pb::MessageParser<StreamingInputCallResponse>(() => new StreamingInputCallResponse());
@ -1286,7 +1286,7 @@ namespace Grpc.Testing {
public const int AggregatedPayloadSizeFieldNumber = 1;
private int aggregatedPayloadSize_;
/// <summary>
/// Aggregated size of payloads received from the client.
/// Aggregated size of payloads received from the client.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int AggregatedPayloadSize {
@ -1371,7 +1371,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// Configuration for a particular response.
/// Configuration for a particular response.
/// </summary>
public sealed partial class ResponseParameters : pb::IMessage<ResponseParameters> {
private static readonly pb::MessageParser<ResponseParameters> _parser = new pb::MessageParser<ResponseParameters>(() => new ResponseParameters());
@ -1411,7 +1411,7 @@ namespace Grpc.Testing {
public const int SizeFieldNumber = 1;
private int size_;
/// <summary>
/// Desired payload sizes in responses from the server.
/// Desired payload sizes in responses from the server.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Size {
@ -1425,8 +1425,8 @@ namespace Grpc.Testing {
public const int IntervalUsFieldNumber = 2;
private int intervalUs_;
/// <summary>
/// Desired interval between consecutive responses in the response stream in
/// microseconds.
/// Desired interval between consecutive responses in the response stream in
/// microseconds.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int IntervalUs {
@ -1440,10 +1440,10 @@ namespace Grpc.Testing {
public const int CompressedFieldNumber = 3;
private global::Grpc.Testing.BoolValue compressed_;
/// <summary>
/// Whether to request the server to compress the response. This field is
/// "nullable" in order to interoperate seamlessly with clients not able to
/// implement the full compression tests by introspecting the call to verify
/// the response's compression status.
/// Whether to request the server to compress the response. This field is
/// "nullable" in order to interoperate seamlessly with clients not able to
/// implement the full compression tests by introspecting the call to verify
/// the response's compression status.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.BoolValue Compressed {
@ -1566,7 +1566,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// Server-streaming request.
/// Server-streaming request.
/// </summary>
public sealed partial class StreamingOutputCallRequest : pb::IMessage<StreamingOutputCallRequest> {
private static readonly pb::MessageParser<StreamingOutputCallRequest> _parser = new pb::MessageParser<StreamingOutputCallRequest>(() => new StreamingOutputCallRequest());
@ -1607,11 +1607,11 @@ namespace Grpc.Testing {
public const int ResponseTypeFieldNumber = 1;
private global::Grpc.Testing.PayloadType responseType_ = 0;
/// <summary>
/// DEPRECATED, don't use. To be removed shortly.
/// Desired payload type in the response from the server.
/// If response_type is RANDOM, the payload from each response in the stream
/// might be of different types. This is to simulate a mixed type of payload
/// stream.
/// DEPRECATED, don't use. To be removed shortly.
/// Desired payload type in the response from the server.
/// If response_type is RANDOM, the payload from each response in the stream
/// might be of different types. This is to simulate a mixed type of payload
/// stream.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.PayloadType ResponseType {
@ -1627,7 +1627,7 @@ namespace Grpc.Testing {
= pb::FieldCodec.ForMessage(18, global::Grpc.Testing.ResponseParameters.Parser);
private readonly pbc::RepeatedField<global::Grpc.Testing.ResponseParameters> responseParameters_ = new pbc::RepeatedField<global::Grpc.Testing.ResponseParameters>();
/// <summary>
/// Configuration for each expected response message.
/// Configuration for each expected response message.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Grpc.Testing.ResponseParameters> ResponseParameters {
@ -1638,7 +1638,7 @@ namespace Grpc.Testing {
public const int PayloadFieldNumber = 3;
private global::Grpc.Testing.Payload payload_;
/// <summary>
/// Optional input payload sent along with the request.
/// Optional input payload sent along with the request.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.Payload Payload {
@ -1652,7 +1652,7 @@ namespace Grpc.Testing {
public const int ResponseStatusFieldNumber = 7;
private global::Grpc.Testing.EchoStatus responseStatus_;
/// <summary>
/// Whether server should return a given status
/// Whether server should return a given status
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.EchoStatus ResponseStatus {
@ -1790,7 +1790,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// Server-streaming response, as configured by the request and parameters.
/// Server-streaming response, as configured by the request and parameters.
/// </summary>
public sealed partial class StreamingOutputCallResponse : pb::IMessage<StreamingOutputCallResponse> {
private static readonly pb::MessageParser<StreamingOutputCallResponse> _parser = new pb::MessageParser<StreamingOutputCallResponse>(() => new StreamingOutputCallResponse());
@ -1828,7 +1828,7 @@ namespace Grpc.Testing {
public const int PayloadFieldNumber = 1;
private global::Grpc.Testing.Payload payload_;
/// <summary>
/// Payload to increase response size.
/// Payload to increase response size.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Grpc.Testing.Payload Payload {
@ -1919,8 +1919,8 @@ namespace Grpc.Testing {
}
/// <summary>
/// For reconnect interop test only.
/// Client tells server what reconnection parameters it used.
/// For reconnect interop test only.
/// Client tells server what reconnection parameters it used.
/// </summary>
public sealed partial class ReconnectParams : pb::IMessage<ReconnectParams> {
private static readonly pb::MessageParser<ReconnectParams> _parser = new pb::MessageParser<ReconnectParams>(() => new ReconnectParams());
@ -2040,9 +2040,9 @@ namespace Grpc.Testing {
}
/// <summary>
/// For reconnect interop test only.
/// Server tells client whether its reconnects are following the spec and the
/// reconnect backoffs it saw.
/// For reconnect interop test only.
/// Server tells client whether its reconnects are following the spec and the
/// reconnect backoffs it saw.
/// </summary>
public sealed partial class ReconnectInfo : pb::IMessage<ReconnectInfo> {
private static readonly pb::MessageParser<ReconnectInfo> _parser = new pb::MessageParser<ReconnectInfo>(() => new ReconnectInfo());

@ -44,7 +44,7 @@ namespace Grpc.Testing {
}
#region Messages
/// <summary>
/// Reponse message containing the gauge name and value
/// Reponse message containing the gauge name and value
/// </summary>
public sealed partial class GaugeResponse : pb::IMessage<GaugeResponse> {
private static readonly pb::MessageParser<GaugeResponse> _parser = new pb::MessageParser<GaugeResponse>(() => new GaugeResponse());
@ -282,7 +282,7 @@ namespace Grpc.Testing {
}
/// <summary>
/// Request message containing the gauge name
/// Request message containing the gauge name
/// </summary>
public sealed partial class GaugeRequest : pb::IMessage<GaugeRequest> {
private static readonly pb::MessageParser<GaugeRequest> _parser = new pb::MessageParser<GaugeRequest>(() => new GaugeRequest());

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

Loading…
Cancel
Save