Merge github.com:grpc/grpc into grpc_millis

pull/11888/head
Craig Tiller 8 years ago
commit 4deeb65805
  1. 4
      BUILD
  2. 59
      CMakeLists.txt
  3. 58
      Makefile
  4. 6
      bazel/grpc_build_system.bzl
  5. 1
      binding.gyp
  6. 19
      build.yaml
  7. 1
      config.m4
  8. 1
      config.w32
  9. 3
      gRPC-Core.podspec
  10. 2
      grpc.gemspec
  11. 4
      include/grpc++/impl/codegen/core_codegen.h
  12. 4
      include/grpc++/impl/codegen/core_codegen_interface.h
  13. 41
      include/grpc++/impl/codegen/server_interface.h
  14. 14
      include/grpc++/support/slice.h
  15. 2
      package.xml
  16. 12
      src/compiler/php_generator.cc
  17. 3
      src/compiler/php_generator.h
  18. 17
      src/compiler/php_generator_helpers.h
  19. 5
      src/compiler/php_plugin.cc
  20. 46
      src/core/ext/filters/client_channel/http_proxy.c
  21. 5
      src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.c
  22. 25
      src/core/lib/iomgr/ev_epoll_limited_pollers_linux.c
  23. 25
      src/core/lib/iomgr/ev_epollsig_linux.c
  24. 6
      src/core/lib/support/env.h
  25. 32
      src/core/lib/support/env_linux.c
  26. 5
      src/core/lib/support/env_posix.c
  27. 5
      src/core/lib/support/env_windows.c
  28. 8
      src/core/lib/support/log.c
  29. 4
      src/core/plugin_registry/grpc_cronet_plugin_registry.c
  30. 4
      src/core/plugin_registry/grpc_plugin_registry.c
  31. 40
      src/core/tsi/gts_transport_security.c
  32. 37
      src/core/tsi/gts_transport_security.h
  33. 5
      src/cpp/common/core_codegen.cc
  34. 18
      src/cpp/server/server_builder.cc
  35. 13
      src/cpp/util/slice_cc.cc
  36. 5
      src/proto/grpc/testing/control.proto
  37. 1
      src/python/grpcio/grpc_core_dependencies.py
  38. 6
      src/python/grpcio_tests/.gitignore
  39. 13
      test/cpp/interop/BUILD
  40. 4
      test/cpp/qps/BUILD
  41. 18
      test/cpp/qps/client.h
  42. 39
      test/cpp/qps/driver.cc
  43. 5
      test/cpp/qps/driver.h
  44. 9
      test/cpp/qps/qps_json_driver.cc
  45. 5
      test/cpp/qps/qps_openloop_test.cc
  46. 8
      test/cpp/qps/qps_worker.cc
  47. 4
      test/cpp/qps/qps_worker.h
  48. 21
      test/cpp/qps/report.cc
  49. 7
      test/cpp/qps/report.h
  50. 5
      test/cpp/qps/secure_sync_unary_ping_pong_test.cc
  51. 15
      test/cpp/qps/server.h
  52. 5
      test/cpp/qps/worker.cc
  53. 43
      test/cpp/server/BUILD
  54. 162
      test/cpp/server/server_request_call_test.cc
  55. 3
      test/cpp/util/byte_buffer_proto_helper.cc
  56. 21
      test/cpp/util/byte_buffer_test.cc
  57. 3
      test/cpp/util/cli_call.cc
  58. 40
      test/cpp/util/create_test_channel.cc
  59. 6
      test/cpp/util/create_test_channel.h
  60. 33
      test/cpp/util/slice_test.cc
  61. 4
      tools/distrib/python/grpcio_tools/setup.py
  62. 2
      tools/doxygen/Doxyfile.core.internal
  63. 9
      tools/internal_ci/linux/grpc_build_artifacts.sh
  64. 3
      tools/internal_ci/windows/grpc_build_artifacts.bat
  65. 26
      tools/interop_matrix/client_matrix.py
  66. 2
      tools/interop_matrix/run_interop_matrix_tests.py
  67. 4
      tools/run_tests/artifacts/build_artifact_python.bat
  68. 4
      tools/run_tests/dockerize/build_interop_image.sh
  69. 30
      tools/run_tests/generated/sources_and_headers.json
  70. 22
      tools/run_tests/generated/tests.json
  71. 2
      tools/run_tests/sanity/core_banned_functions.py
  72. 3
      vsprojects/vcxproj/grpc/grpc.vcxproj
  73. 6
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  74. 223
      vsprojects/vcxproj/test/server_request_call_test/server_request_call_test.vcxproj
  75. 39
      vsprojects/vcxproj/test/server_request_call_test/server_request_call_test.vcxproj.filters

@ -1404,12 +1404,14 @@ grpc_cc_library(
name = "tsi", name = "tsi",
srcs = [ srcs = [
"src/core/tsi/fake_transport_security.c", "src/core/tsi/fake_transport_security.c",
"src/core/tsi/gts_transport_security.c",
"src/core/tsi/ssl_transport_security.c", "src/core/tsi/ssl_transport_security.c",
"src/core/tsi/transport_security.c", "src/core/tsi/transport_security.c",
"src/core/tsi/transport_security_adapter.c", "src/core/tsi/transport_security_adapter.c",
], ],
hdrs = [ hdrs = [
"src/core/tsi/fake_transport_security.h", "src/core/tsi/fake_transport_security.h",
"src/core/tsi/gts_transport_security.h",
"src/core/tsi/ssl_transport_security.h", "src/core/tsi/ssl_transport_security.h",
"src/core/tsi/ssl_types.h", "src/core/tsi/ssl_types.h",
"src/core/tsi/transport_security.h", "src/core/tsi/transport_security.h",
@ -1422,6 +1424,7 @@ grpc_cc_library(
language = "c", language = "c",
deps = [ deps = [
"gpr", "gpr",
"grpc_base",
"grpc_trace", "grpc_trace",
], ],
) )
@ -1540,6 +1543,7 @@ grpc_cc_library(
":grpc++", ":grpc++",
"//src/proto/grpc/reflection/v1alpha:reflection_proto", "//src/proto/grpc/reflection/v1alpha:reflection_proto",
], ],
alwayslink = 1,
) )
grpc_cc_library( grpc_cc_library(

@ -751,6 +751,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx server_crash_test) add_dependencies(buildtests_cxx server_crash_test)
endif() endif()
add_dependencies(buildtests_cxx server_crash_test_client) add_dependencies(buildtests_cxx server_crash_test_client)
add_dependencies(buildtests_cxx server_request_call_test)
add_dependencies(buildtests_cxx shutdown_test) add_dependencies(buildtests_cxx shutdown_test)
add_dependencies(buildtests_cxx status_test) add_dependencies(buildtests_cxx status_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX) if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
@ -1124,6 +1125,7 @@ add_library(grpc
src/core/lib/security/util/json_util.c src/core/lib/security/util/json_util.c
src/core/lib/surface/init_secure.c src/core/lib/surface/init_secure.c
src/core/tsi/fake_transport_security.c src/core/tsi/fake_transport_security.c
src/core/tsi/gts_transport_security.c
src/core/tsi/ssl_transport_security.c src/core/tsi/ssl_transport_security.c
src/core/tsi/transport_security.c src/core/tsi/transport_security.c
src/core/tsi/transport_security_adapter.c src/core/tsi/transport_security_adapter.c
@ -1490,6 +1492,7 @@ add_library(grpc_cronet
src/core/lib/security/util/json_util.c src/core/lib/security/util/json_util.c
src/core/lib/surface/init_secure.c src/core/lib/surface/init_secure.c
src/core/tsi/fake_transport_security.c src/core/tsi/fake_transport_security.c
src/core/tsi/gts_transport_security.c
src/core/tsi/ssl_transport_security.c src/core/tsi/ssl_transport_security.c
src/core/tsi/transport_security.c src/core/tsi/transport_security.c
src/core/tsi/transport_security_adapter.c src/core/tsi/transport_security_adapter.c
@ -12035,6 +12038,62 @@ target_link_libraries(server_crash_test_client
endif (gRPC_BUILD_TESTS) endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS)
add_executable(server_request_call_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_request_call_test.cc
third_party/googletest/googletest/src/gtest-all.cc
third_party/googletest/googlemock/src/gmock-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_request_call_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 ${CARES_BUILD_INCLUDE_DIR}
PRIVATE ${CARES_INCLUDE_DIR}
PRIVATE ${CARES_PLATFORM_INCLUDE_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest/googletest
PRIVATE third_party/googletest/googlemock/include
PRIVATE third_party/googletest/googlemock
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(server_request_call_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(shutdown_test add_executable(shutdown_test
test/cpp/end2end/shutdown_test.cc test/cpp/end2end/shutdown_test.cc
third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googletest/src/gtest-all.cc

@ -1167,6 +1167,7 @@ server_builder_test: $(BINDIR)/$(CONFIG)/server_builder_test
server_context_test_spouse_test: $(BINDIR)/$(CONFIG)/server_context_test_spouse_test server_context_test_spouse_test: $(BINDIR)/$(CONFIG)/server_context_test_spouse_test
server_crash_test: $(BINDIR)/$(CONFIG)/server_crash_test server_crash_test: $(BINDIR)/$(CONFIG)/server_crash_test
server_crash_test_client: $(BINDIR)/$(CONFIG)/server_crash_test_client server_crash_test_client: $(BINDIR)/$(CONFIG)/server_crash_test_client
server_request_call_test: $(BINDIR)/$(CONFIG)/server_request_call_test
shutdown_test: $(BINDIR)/$(CONFIG)/shutdown_test shutdown_test: $(BINDIR)/$(CONFIG)/shutdown_test
status_test: $(BINDIR)/$(CONFIG)/status_test status_test: $(BINDIR)/$(CONFIG)/status_test
streaming_throughput_test: $(BINDIR)/$(CONFIG)/streaming_throughput_test streaming_throughput_test: $(BINDIR)/$(CONFIG)/streaming_throughput_test
@ -1595,6 +1596,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/server_context_test_spouse_test \ $(BINDIR)/$(CONFIG)/server_context_test_spouse_test \
$(BINDIR)/$(CONFIG)/server_crash_test \ $(BINDIR)/$(CONFIG)/server_crash_test \
$(BINDIR)/$(CONFIG)/server_crash_test_client \ $(BINDIR)/$(CONFIG)/server_crash_test_client \
$(BINDIR)/$(CONFIG)/server_request_call_test \
$(BINDIR)/$(CONFIG)/shutdown_test \ $(BINDIR)/$(CONFIG)/shutdown_test \
$(BINDIR)/$(CONFIG)/status_test \ $(BINDIR)/$(CONFIG)/status_test \
$(BINDIR)/$(CONFIG)/streaming_throughput_test \ $(BINDIR)/$(CONFIG)/streaming_throughput_test \
@ -1709,6 +1711,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/server_context_test_spouse_test \ $(BINDIR)/$(CONFIG)/server_context_test_spouse_test \
$(BINDIR)/$(CONFIG)/server_crash_test \ $(BINDIR)/$(CONFIG)/server_crash_test \
$(BINDIR)/$(CONFIG)/server_crash_test_client \ $(BINDIR)/$(CONFIG)/server_crash_test_client \
$(BINDIR)/$(CONFIG)/server_request_call_test \
$(BINDIR)/$(CONFIG)/shutdown_test \ $(BINDIR)/$(CONFIG)/shutdown_test \
$(BINDIR)/$(CONFIG)/status_test \ $(BINDIR)/$(CONFIG)/status_test \
$(BINDIR)/$(CONFIG)/streaming_throughput_test \ $(BINDIR)/$(CONFIG)/streaming_throughput_test \
@ -2103,6 +2106,8 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/server_context_test_spouse_test || ( echo test server_context_test_spouse_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/server_context_test_spouse_test || ( echo test server_context_test_spouse_test failed ; exit 1 )
$(E) "[RUN] Testing server_crash_test" $(E) "[RUN] Testing server_crash_test"
$(Q) $(BINDIR)/$(CONFIG)/server_crash_test || ( echo test server_crash_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/server_crash_test || ( echo test server_crash_test failed ; exit 1 )
$(E) "[RUN] Testing server_request_call_test"
$(Q) $(BINDIR)/$(CONFIG)/server_request_call_test || ( echo test server_request_call_test failed ; exit 1 )
$(E) "[RUN] Testing shutdown_test" $(E) "[RUN] Testing shutdown_test"
$(Q) $(BINDIR)/$(CONFIG)/shutdown_test || ( echo test shutdown_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/shutdown_test || ( echo test shutdown_test failed ; exit 1 )
$(E) "[RUN] Testing status_test" $(E) "[RUN] Testing status_test"
@ -3064,6 +3069,7 @@ LIBGRPC_SRC = \
src/core/lib/security/util/json_util.c \ src/core/lib/security/util/json_util.c \
src/core/lib/surface/init_secure.c \ src/core/lib/surface/init_secure.c \
src/core/tsi/fake_transport_security.c \ src/core/tsi/fake_transport_security.c \
src/core/tsi/gts_transport_security.c \
src/core/tsi/ssl_transport_security.c \ src/core/tsi/ssl_transport_security.c \
src/core/tsi/transport_security.c \ src/core/tsi/transport_security.c \
src/core/tsi/transport_security_adapter.c \ src/core/tsi/transport_security_adapter.c \
@ -3428,6 +3434,7 @@ LIBGRPC_CRONET_SRC = \
src/core/lib/security/util/json_util.c \ src/core/lib/security/util/json_util.c \
src/core/lib/surface/init_secure.c \ src/core/lib/surface/init_secure.c \
src/core/tsi/fake_transport_security.c \ src/core/tsi/fake_transport_security.c \
src/core/tsi/gts_transport_security.c \
src/core/tsi/ssl_transport_security.c \ src/core/tsi/ssl_transport_security.c \
src/core/tsi/transport_security.c \ src/core/tsi/transport_security.c \
src/core/tsi/transport_security_adapter.c \ src/core/tsi/transport_security_adapter.c \
@ -16010,6 +16017,56 @@ endif
endif endif
SERVER_REQUEST_CALL_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_request_call_test.cc \
SERVER_REQUEST_CALL_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(SERVER_REQUEST_CALL_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/server_request_call_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_request_call_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/server_request_call_test: $(PROTOBUF_DEP) $(SERVER_REQUEST_CALL_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_REQUEST_CALL_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_request_call_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_request_call_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_request_call_test: $(SERVER_REQUEST_CALL_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(SERVER_REQUEST_CALL_TEST_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/server/server_request_call_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
SHUTDOWN_TEST_SRC = \ SHUTDOWN_TEST_SRC = \
test/cpp/end2end/shutdown_test.cc \ test/cpp/end2end/shutdown_test.cc \
@ -19174,6 +19231,7 @@ src/core/lib/surface/init_secure.c: $(OPENSSL_DEP)
src/core/plugin_registry/grpc_cronet_plugin_registry.c: $(OPENSSL_DEP) src/core/plugin_registry/grpc_cronet_plugin_registry.c: $(OPENSSL_DEP)
src/core/plugin_registry/grpc_plugin_registry.c: $(OPENSSL_DEP) src/core/plugin_registry/grpc_plugin_registry.c: $(OPENSSL_DEP)
src/core/tsi/fake_transport_security.c: $(OPENSSL_DEP) src/core/tsi/fake_transport_security.c: $(OPENSSL_DEP)
src/core/tsi/gts_transport_security.c: $(OPENSSL_DEP)
src/core/tsi/ssl_transport_security.c: $(OPENSSL_DEP) src/core/tsi/ssl_transport_security.c: $(OPENSSL_DEP)
src/core/tsi/transport_security.c: $(OPENSSL_DEP) src/core/tsi/transport_security.c: $(OPENSSL_DEP)
src/core/tsi/transport_security_adapter.c: $(OPENSSL_DEP) src/core/tsi/transport_security_adapter.c: $(OPENSSL_DEP)

@ -25,7 +25,8 @@
def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [], def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [],
external_deps = [], deps = [], standalone = False, external_deps = [], deps = [], standalone = False,
language = "C++", testonly = False, visibility = None): language = "C++", testonly = False, visibility = None,
alwayslink = 0):
copts = [] copts = []
if language.upper() == "C": if language.upper() == "C":
copts = ["-std=c99"] copts = ["-std=c99"]
@ -40,7 +41,8 @@ def grpc_cc_library(name, srcs = [], public_hdrs = [], hdrs = [],
linkopts = ["-pthread"], linkopts = ["-pthread"],
includes = [ includes = [
"include" "include"
] ],
alwayslink = alwayslink,
) )
def grpc_proto_plugin(name, srcs = [], deps = []): def grpc_proto_plugin(name, srcs = [], deps = []):

@ -814,6 +814,7 @@
'src/core/lib/security/util/json_util.c', 'src/core/lib/security/util/json_util.c',
'src/core/lib/surface/init_secure.c', 'src/core/lib/surface/init_secure.c',
'src/core/tsi/fake_transport_security.c', 'src/core/tsi/fake_transport_security.c',
'src/core/tsi/gts_transport_security.c',
'src/core/tsi/ssl_transport_security.c', 'src/core/tsi/ssl_transport_security.c',
'src/core/tsi/transport_security.c', 'src/core/tsi/transport_security.c',
'src/core/tsi/transport_security_adapter.c', 'src/core/tsi/transport_security_adapter.c',

@ -876,6 +876,7 @@ filegroups:
- name: tsi - name: tsi
headers: headers:
- src/core/tsi/fake_transport_security.h - src/core/tsi/fake_transport_security.h
- src/core/tsi/gts_transport_security.h
- src/core/tsi/ssl_transport_security.h - src/core/tsi/ssl_transport_security.h
- src/core/tsi/ssl_types.h - src/core/tsi/ssl_types.h
- src/core/tsi/transport_security.h - src/core/tsi/transport_security.h
@ -883,14 +884,17 @@ filegroups:
- src/core/tsi/transport_security_interface.h - src/core/tsi/transport_security_interface.h
src: src:
- src/core/tsi/fake_transport_security.c - src/core/tsi/fake_transport_security.c
- src/core/tsi/gts_transport_security.c
- src/core/tsi/ssl_transport_security.c - src/core/tsi/ssl_transport_security.c
- src/core/tsi/transport_security.c - src/core/tsi/transport_security.c
- src/core/tsi/transport_security_adapter.c - src/core/tsi/transport_security_adapter.c
deps: deps:
- gpr - gpr
plugin: grpc_tsi_gts
secure: true secure: true
uses: uses:
- grpc_trace - grpc_trace
- grpc_base
- name: grpc++_base - name: grpc++_base
language: c++ language: c++
public_headers: public_headers:
@ -4384,6 +4388,21 @@ targets:
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: server_request_call_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_request_call_test.cc
deps:
- grpc++_test_util
- grpc_test_util
- gpr_test_util
- grpc++
- grpc
- gpr
- name: shutdown_test - name: shutdown_test
gtest: true gtest: true
build: test build: test

@ -264,6 +264,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/security/util/json_util.c \ src/core/lib/security/util/json_util.c \
src/core/lib/surface/init_secure.c \ src/core/lib/surface/init_secure.c \
src/core/tsi/fake_transport_security.c \ src/core/tsi/fake_transport_security.c \
src/core/tsi/gts_transport_security.c \
src/core/tsi/ssl_transport_security.c \ src/core/tsi/ssl_transport_security.c \
src/core/tsi/transport_security.c \ src/core/tsi/transport_security.c \
src/core/tsi/transport_security_adapter.c \ src/core/tsi/transport_security_adapter.c \

@ -241,6 +241,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\security\\util\\json_util.c " + "src\\core\\lib\\security\\util\\json_util.c " +
"src\\core\\lib\\surface\\init_secure.c " + "src\\core\\lib\\surface\\init_secure.c " +
"src\\core\\tsi\\fake_transport_security.c " + "src\\core\\tsi\\fake_transport_security.c " +
"src\\core\\tsi\\gts_transport_security.c " +
"src\\core\\tsi\\ssl_transport_security.c " + "src\\core\\tsi\\ssl_transport_security.c " +
"src\\core\\tsi\\transport_security.c " + "src\\core\\tsi\\transport_security.c " +
"src\\core\\tsi\\transport_security_adapter.c " + "src\\core\\tsi\\transport_security_adapter.c " +

@ -398,6 +398,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/transport/tsi_error.h', 'src/core/lib/security/transport/tsi_error.h',
'src/core/lib/security/util/json_util.h', 'src/core/lib/security/util/json_util.h',
'src/core/tsi/fake_transport_security.h', 'src/core/tsi/fake_transport_security.h',
'src/core/tsi/gts_transport_security.h',
'src/core/tsi/ssl_transport_security.h', 'src/core/tsi/ssl_transport_security.h',
'src/core/tsi/ssl_types.h', 'src/core/tsi/ssl_types.h',
'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security.h',
@ -637,6 +638,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/util/json_util.c', 'src/core/lib/security/util/json_util.c',
'src/core/lib/surface/init_secure.c', 'src/core/lib/surface/init_secure.c',
'src/core/tsi/fake_transport_security.c', 'src/core/tsi/fake_transport_security.c',
'src/core/tsi/gts_transport_security.c',
'src/core/tsi/ssl_transport_security.c', 'src/core/tsi/ssl_transport_security.c',
'src/core/tsi/transport_security.c', 'src/core/tsi/transport_security.c',
'src/core/tsi/transport_security_adapter.c', 'src/core/tsi/transport_security_adapter.c',
@ -880,6 +882,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/transport/tsi_error.h', 'src/core/lib/security/transport/tsi_error.h',
'src/core/lib/security/util/json_util.h', 'src/core/lib/security/util/json_util.h',
'src/core/tsi/fake_transport_security.h', 'src/core/tsi/fake_transport_security.h',
'src/core/tsi/gts_transport_security.h',
'src/core/tsi/ssl_transport_security.h', 'src/core/tsi/ssl_transport_security.h',
'src/core/tsi/ssl_types.h', 'src/core/tsi/ssl_types.h',
'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security.h',

@ -330,6 +330,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/transport/tsi_error.h ) s.files += %w( src/core/lib/security/transport/tsi_error.h )
s.files += %w( src/core/lib/security/util/json_util.h ) s.files += %w( src/core/lib/security/util/json_util.h )
s.files += %w( src/core/tsi/fake_transport_security.h ) s.files += %w( src/core/tsi/fake_transport_security.h )
s.files += %w( src/core/tsi/gts_transport_security.h )
s.files += %w( src/core/tsi/ssl_transport_security.h ) s.files += %w( src/core/tsi/ssl_transport_security.h )
s.files += %w( src/core/tsi/ssl_types.h ) s.files += %w( src/core/tsi/ssl_types.h )
s.files += %w( src/core/tsi/transport_security.h ) s.files += %w( src/core/tsi/transport_security.h )
@ -573,6 +574,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/util/json_util.c ) s.files += %w( src/core/lib/security/util/json_util.c )
s.files += %w( src/core/lib/surface/init_secure.c ) s.files += %w( src/core/lib/surface/init_secure.c )
s.files += %w( src/core/tsi/fake_transport_security.c ) s.files += %w( src/core/tsi/fake_transport_security.c )
s.files += %w( src/core/tsi/gts_transport_security.c )
s.files += %w( src/core/tsi/ssl_transport_security.c ) s.files += %w( src/core/tsi/ssl_transport_security.c )
s.files += %w( src/core/tsi/transport_security.c ) s.files += %w( src/core/tsi/transport_security.c )
s.files += %w( src/core/tsi/transport_security_adapter.c ) s.files += %w( src/core/tsi/transport_security_adapter.c )

@ -60,6 +60,10 @@ class CoreCodegen final : public CoreCodegenInterface {
void gpr_cv_signal(gpr_cv* cv) override; void gpr_cv_signal(gpr_cv* cv) override;
void gpr_cv_broadcast(gpr_cv* cv) override; void gpr_cv_broadcast(gpr_cv* cv) override;
grpc_call_error grpc_call_cancel_with_status(grpc_call* call,
grpc_status_code status,
const char* description,
void* reserved) override;
void grpc_call_ref(grpc_call* call) override; void grpc_call_ref(grpc_call* call) override;
void grpc_call_unref(grpc_call* call) override; void grpc_call_unref(grpc_call* call) override;
virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) override; virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) override;

@ -89,6 +89,10 @@ class CoreCodegenInterface {
virtual grpc_slice grpc_slice_new_with_user_data(void* p, size_t len, virtual grpc_slice grpc_slice_new_with_user_data(void* p, size_t len,
void (*destroy)(void*), void (*destroy)(void*),
void* user_data) = 0; void* user_data) = 0;
virtual grpc_call_error grpc_call_cancel_with_status(grpc_call* call,
grpc_status_code status,
const char* description,
void* reserved) = 0;
virtual void grpc_call_ref(grpc_call* call) = 0; virtual void grpc_call_ref(grpc_call* call) = 0;
virtual void grpc_call_unref(grpc_call* call) = 0; virtual void grpc_call_unref(grpc_call* call) = 0;
virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) = 0; virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) = 0;

@ -177,22 +177,49 @@ class ServerInterface : public internal::CallHook {
ServerCompletionQueue* notification_cq, void* tag, ServerCompletionQueue* notification_cq, void* tag,
Message* request) Message* request)
: RegisteredAsyncRequest(server, context, stream, call_cq, tag), : RegisteredAsyncRequest(server, context, stream, call_cq, tag),
registered_method_(registered_method),
server_(server),
context_(context),
stream_(stream),
call_cq_(call_cq),
notification_cq_(notification_cq),
tag_(tag),
request_(request) { request_(request) {
IssueRequest(registered_method, &payload_, notification_cq); IssueRequest(registered_method, &payload_, notification_cq);
} }
bool FinalizeResult(void** tag, bool* status) override { bool FinalizeResult(void** tag, bool* status) override {
bool serialization_status = if (*status) {
*status && payload_ && if (payload_ == nullptr ||
SerializationTraits<Message>::Deserialize(payload_, request_).ok(); !SerializationTraits<Message>::Deserialize(payload_, request_)
bool ret = RegisteredAsyncRequest::FinalizeResult(tag, status); .ok()) {
*status = serialization_status && *status; // If deserialization fails, we cancel the call and instantiate
return ret; // a new instance of ourselves to request another call. We then
// return false, which prevents the call from being returned to
// the application.
g_core_codegen_interface->grpc_call_cancel_with_status(
call_, GRPC_STATUS_INTERNAL, "Unable to parse request", nullptr);
g_core_codegen_interface->grpc_call_unref(call_);
new PayloadAsyncRequest(registered_method_, server_, context_,
stream_, call_cq_, notification_cq_, tag_,
request_);
delete this;
return false;
}
}
return RegisteredAsyncRequest::FinalizeResult(tag, status);
} }
private: private:
grpc_byte_buffer* payload_; void* const registered_method_;
ServerInterface* const server_;
ServerContext* const context_;
internal::ServerAsyncStreamingInterface* const stream_;
CompletionQueue* const call_cq_;
ServerCompletionQueue* const notification_cq_;
void* const tag_;
Message* const request_; Message* const request_;
grpc_byte_buffer* payload_;
}; };
class GenericAsyncRequest : public BaseAsyncRequest { class GenericAsyncRequest : public BaseAsyncRequest {

@ -44,6 +44,20 @@ class Slice final {
/// Construct a slice from \a slice, stealing a reference. /// Construct a slice from \a slice, stealing a reference.
Slice(grpc_slice slice, StealRef); Slice(grpc_slice slice, StealRef);
/// Allocate a slice of specified size
Slice(size_t len);
/// Construct a slice from a copied buffer
Slice(const void* buf, size_t len);
/// Construct a slice from a copied string
Slice(const grpc::string& str);
enum StaticSlice { STATIC_SLICE };
/// Construct a slice from a static buffer
Slice(const void* buf, size_t len, StaticSlice);
/// Copy constructor, adds a reference. /// Copy constructor, adds a reference.
Slice(const Slice& other); Slice(const Slice& other);

@ -344,6 +344,7 @@
<file baseinstalldir="/" name="src/core/lib/security/transport/tsi_error.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/transport/tsi_error.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/util/json_util.h" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/util/json_util.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/fake_transport_security.h" role="src" /> <file baseinstalldir="/" name="src/core/tsi/fake_transport_security.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/gts_transport_security.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/ssl_transport_security.h" role="src" /> <file baseinstalldir="/" name="src/core/tsi/ssl_transport_security.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/ssl_types.h" role="src" /> <file baseinstalldir="/" name="src/core/tsi/ssl_types.h" role="src" />
<file baseinstalldir="/" name="src/core/tsi/transport_security.h" role="src" /> <file baseinstalldir="/" name="src/core/tsi/transport_security.h" role="src" />
@ -587,6 +588,7 @@
<file baseinstalldir="/" name="src/core/lib/security/util/json_util.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/security/util/json_util.c" role="src" />
<file baseinstalldir="/" name="src/core/lib/surface/init_secure.c" role="src" /> <file baseinstalldir="/" name="src/core/lib/surface/init_secure.c" role="src" />
<file baseinstalldir="/" name="src/core/tsi/fake_transport_security.c" role="src" /> <file baseinstalldir="/" name="src/core/tsi/fake_transport_security.c" role="src" />
<file baseinstalldir="/" name="src/core/tsi/gts_transport_security.c" role="src" />
<file baseinstalldir="/" name="src/core/tsi/ssl_transport_security.c" role="src" /> <file baseinstalldir="/" name="src/core/tsi/ssl_transport_security.c" role="src" />
<file baseinstalldir="/" name="src/core/tsi/transport_security.c" role="src" /> <file baseinstalldir="/" name="src/core/tsi/transport_security.c" role="src" />
<file baseinstalldir="/" name="src/core/tsi/transport_security_adapter.c" role="src" /> <file baseinstalldir="/" name="src/core/tsi/transport_security_adapter.c" role="src" />

@ -97,13 +97,14 @@ void PrintMethod(const MethodDescriptor *method, Printer *out) {
} }
// Prints out the service descriptor object // Prints out the service descriptor object
void PrintService(const ServiceDescriptor *service, Printer *out) { void PrintService(const ServiceDescriptor *service,
const grpc::string &parameter, Printer *out) {
map<grpc::string, grpc::string> vars; map<grpc::string, grpc::string> vars;
out->Print("/**\n"); out->Print("/**\n");
out->Print(GetPHPComments(service, " *").c_str()); out->Print(GetPHPComments(service, " *").c_str());
out->Print(" */\n"); out->Print(" */\n");
vars["name"] = service->name(); vars["name"] = GetPHPServiceClassname(service, parameter);
out->Print(vars, "class $name$Client extends \\Grpc\\BaseStub {\n\n"); out->Print(vars, "class $name$ extends \\Grpc\\BaseStub {\n\n");
out->Indent(); out->Indent();
out->Indent(); out->Indent();
out->Print( out->Print(
@ -131,7 +132,8 @@ void PrintService(const ServiceDescriptor *service, Printer *out) {
} }
grpc::string GenerateFile(const FileDescriptor *file, grpc::string GenerateFile(const FileDescriptor *file,
const ServiceDescriptor *service) { const ServiceDescriptor *service,
const grpc::string &parameter) {
grpc::string output; grpc::string output;
{ {
StringOutputStream output_stream(&output); StringOutputStream output_stream(&output);
@ -150,7 +152,7 @@ grpc::string GenerateFile(const FileDescriptor *file,
vars["package"] = MessageIdentifierName(file->package()); vars["package"] = MessageIdentifierName(file->package());
out.Print(vars, "namespace $package$;\n\n"); out.Print(vars, "namespace $package$;\n\n");
PrintService(service, &out); PrintService(service, parameter, &out);
} }
return output; return output;
} }

@ -24,7 +24,8 @@
namespace grpc_php_generator { namespace grpc_php_generator {
grpc::string GenerateFile(const grpc::protobuf::FileDescriptor *file, grpc::string GenerateFile(const grpc::protobuf::FileDescriptor *file,
const grpc::protobuf::ServiceDescriptor *service); const grpc::protobuf::ServiceDescriptor *service,
const grpc::string &parameter);
} // namespace grpc_php_generator } // namespace grpc_php_generator

@ -26,9 +26,22 @@
namespace grpc_php_generator { namespace grpc_php_generator {
inline grpc::string GetPHPServiceClassname(
const grpc::protobuf::ServiceDescriptor *service,
const grpc::string &parameter) {
grpc::string suffix;
if (parameter == "") {
suffix = "Client";
} else {
suffix = parameter;
}
return service->name() + suffix;
}
inline grpc::string GetPHPServiceFilename( inline grpc::string GetPHPServiceFilename(
const grpc::protobuf::FileDescriptor *file, const grpc::protobuf::FileDescriptor *file,
const grpc::protobuf::ServiceDescriptor *service) { const grpc::protobuf::ServiceDescriptor *service,
const grpc::string &parameter) {
std::vector<grpc::string> tokens = std::vector<grpc::string> tokens =
grpc_generator::tokenize(file->package(), "."); grpc_generator::tokenize(file->package(), ".");
std::ostringstream oss; std::ostringstream oss;
@ -36,7 +49,7 @@ inline grpc::string GetPHPServiceFilename(
oss << (i == 0 ? "" : "/") oss << (i == 0 ? "" : "/")
<< grpc_generator::CapitalizeFirstLetter(tokens[i]); << grpc_generator::CapitalizeFirstLetter(tokens[i]);
} }
return oss.str() + "/" + service->name() + "Client.php"; return oss.str() + "/" + GetPHPServiceClassname(service, parameter) + ".php";
} }
// ReplaceAll replaces all instances of search with replace in s. // ReplaceAll replaces all instances of search with replace in s.

@ -41,10 +41,11 @@ class PHPGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
} }
for (int i = 0; i < file->service_count(); i++) { for (int i = 0; i < file->service_count(); i++) {
grpc::string code = GenerateFile(file, file->service(i)); grpc::string code = GenerateFile(file, file->service(i), parameter);
// Get output file name // Get output file name
grpc::string file_name = GetPHPServiceFilename(file, file->service(i)); grpc::string file_name =
GetPHPServiceFilename(file, file->service(i), parameter);
std::unique_ptr<grpc::protobuf::io::ZeroCopyOutputStream> output( std::unique_ptr<grpc::protobuf::io::ZeroCopyOutputStream> output(
context->Open(file_name)); context->Open(file_name));

@ -22,6 +22,7 @@
#include <string.h> #include <string.h>
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
@ -30,6 +31,7 @@
#include "src/core/ext/filters/client_channel/uri_parser.h" #include "src/core/ext/filters/client_channel/uri_parser.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/support/env.h" #include "src/core/lib/support/env.h"
#include "src/core/lib/support/string.h"
static char* grpc_get_http_proxy_server(grpc_exec_ctx* exec_ctx) { static char* grpc_get_http_proxy_server(grpc_exec_ctx* exec_ctx) {
char* uri_str = gpr_getenv("http_proxy"); char* uri_str = gpr_getenv("http_proxy");
@ -80,6 +82,50 @@ static bool proxy_mapper_map_name(grpc_exec_ctx* exec_ctx,
grpc_uri_destroy(uri); grpc_uri_destroy(uri);
return false; return false;
} }
char* no_proxy_str = gpr_getenv("no_proxy");
if (no_proxy_str != NULL) {
static const char* NO_PROXY_SEPARATOR = ",";
bool use_proxy = true;
char* server_host;
char* server_port;
if (!gpr_split_host_port(uri->path[0] == '/' ? uri->path + 1 : uri->path,
&server_host, &server_port)) {
gpr_log(GPR_INFO,
"unable to split host and port, not checking no_proxy list for "
"host '%s'",
server_uri);
} else {
size_t uri_len = strlen(server_host);
char** no_proxy_hosts;
size_t num_no_proxy_hosts;
gpr_string_split(no_proxy_str, NO_PROXY_SEPARATOR, &no_proxy_hosts,
&num_no_proxy_hosts);
for (size_t i = 0; i < num_no_proxy_hosts; i++) {
char* no_proxy_entry = no_proxy_hosts[i];
size_t no_proxy_len = strlen(no_proxy_entry);
if (no_proxy_len <= uri_len &&
gpr_stricmp(no_proxy_entry, &server_host[uri_len - no_proxy_len]) ==
0) {
gpr_log(GPR_INFO, "not using proxy for host in no_proxy list '%s'",
server_uri);
use_proxy = false;
break;
}
}
for (size_t i = 0; i < num_no_proxy_hosts; i++) {
gpr_free(no_proxy_hosts[i]);
}
gpr_free(no_proxy_hosts);
gpr_free(server_host);
gpr_free(server_port);
if (!use_proxy) {
grpc_uri_destroy(uri);
gpr_free(*name_to_resolve);
*name_to_resolve = NULL;
return false;
}
}
}
grpc_arg new_arg = grpc_channel_arg_string_create( grpc_arg new_arg = grpc_channel_arg_string_create(
GRPC_ARG_HTTP_CONNECT_SERVER, GRPC_ARG_HTTP_CONNECT_SERVER,
uri->path[0] == '/' ? uri->path + 1 : uri->path); uri->path[0] == '/' ? uri->path + 1 : uri->path);

@ -1699,7 +1699,6 @@ static void lb_on_server_status_received_locked(grpc_exec_ctx *exec_ctx,
static void glb_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, static void glb_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy,
const grpc_lb_policy_args *args) { const grpc_lb_policy_args *args) {
glb_lb_policy *glb_policy = (glb_lb_policy *)policy; glb_lb_policy *glb_policy = (glb_lb_policy *)policy;
if (glb_policy->updating_lb_channel) { if (glb_policy->updating_lb_channel) {
if (GRPC_TRACER_ON(grpc_lb_glb_trace)) { if (GRPC_TRACER_ON(grpc_lb_glb_trace)) {
gpr_log(GPR_INFO, gpr_log(GPR_INFO,
@ -1807,9 +1806,11 @@ static void glb_lb_channel_on_connectivity_changed_cb(grpc_exec_ctx *exec_ctx,
// lb_on_server_status_received will pick up the cancel and reinit // lb_on_server_status_received will pick up the cancel and reinit
// lb_call. // lb_call.
if (glb_policy->pending_update_args != NULL) { if (glb_policy->pending_update_args != NULL) {
const grpc_lb_policy_args *args = glb_policy->pending_update_args; grpc_lb_policy_args *args = glb_policy->pending_update_args;
glb_policy->pending_update_args = NULL; glb_policy->pending_update_args = NULL;
glb_update_locked(exec_ctx, &glb_policy->base, args); glb_update_locked(exec_ctx, &glb_policy->base, args);
grpc_channel_args_destroy(exec_ctx, args->args);
gpr_free(args);
} }
} else if (glb_policy->started_picking && !glb_policy->shutting_down) { } else if (glb_policy->started_picking && !glb_policy->shutting_down) {
if (glb_policy->retry_timer_active) { if (glb_policy->retry_timer_active) {

@ -932,24 +932,12 @@ static int fd_wrapped_fd(grpc_fd *fd) {
static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd, static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure *on_done, int *release_fd, grpc_closure *on_done, int *release_fd,
const char *reason) { const char *reason) {
bool is_fd_closed = false;
grpc_error *error = GRPC_ERROR_NONE; grpc_error *error = GRPC_ERROR_NONE;
polling_island *unref_pi = NULL; polling_island *unref_pi = NULL;
gpr_mu_lock(&fd->po.mu); gpr_mu_lock(&fd->po.mu);
fd->on_done_closure = on_done; fd->on_done_closure = on_done;
/* If release_fd is not NULL, we should be relinquishing control of the file
descriptor fd->fd (but we still own the grpc_fd structure). */
if (release_fd != NULL) {
*release_fd = fd->fd;
} else {
close(fd->fd);
is_fd_closed = true;
}
fd->orphaned = true;
/* Remove the active status but keep referenced. We want this grpc_fd struct /* Remove the active status but keep referenced. We want this grpc_fd struct
to be alive (and not added to freelist) until the end of this function */ to be alive (and not added to freelist) until the end of this function */
REF_BY(fd, 1, reason); REF_BY(fd, 1, reason);
@ -964,13 +952,24 @@ static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
before doing this.) */ before doing this.) */
if (fd->po.pi != NULL) { if (fd->po.pi != NULL) {
polling_island *pi_latest = polling_island_lock(fd->po.pi); polling_island *pi_latest = polling_island_lock(fd->po.pi);
polling_island_remove_fd_locked(pi_latest, fd, is_fd_closed, &error); polling_island_remove_fd_locked(pi_latest, fd, false /* is_fd_closed */,
&error);
gpr_mu_unlock(&pi_latest->mu); gpr_mu_unlock(&pi_latest->mu);
unref_pi = fd->po.pi; unref_pi = fd->po.pi;
fd->po.pi = NULL; fd->po.pi = NULL;
} }
/* If release_fd is not NULL, we should be relinquishing control of the file
descriptor fd->fd (but we still own the grpc_fd structure). */
if (release_fd != NULL) {
*release_fd = fd->fd;
} else {
close(fd->fd);
}
fd->orphaned = true;
GRPC_CLOSURE_SCHED(exec_ctx, fd->on_done_closure, GRPC_ERROR_REF(error)); GRPC_CLOSURE_SCHED(exec_ctx, fd->on_done_closure, GRPC_ERROR_REF(error));
gpr_mu_unlock(&fd->po.mu); gpr_mu_unlock(&fd->po.mu);

@ -856,24 +856,12 @@ static int fd_wrapped_fd(grpc_fd *fd) {
static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd, static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure *on_done, int *release_fd, grpc_closure *on_done, int *release_fd,
const char *reason) { const char *reason) {
bool is_fd_closed = false;
grpc_error *error = GRPC_ERROR_NONE; grpc_error *error = GRPC_ERROR_NONE;
polling_island *unref_pi = NULL; polling_island *unref_pi = NULL;
gpr_mu_lock(&fd->po.mu); gpr_mu_lock(&fd->po.mu);
fd->on_done_closure = on_done; fd->on_done_closure = on_done;
/* If release_fd is not NULL, we should be relinquishing control of the file
descriptor fd->fd (but we still own the grpc_fd structure). */
if (release_fd != NULL) {
*release_fd = fd->fd;
} else {
close(fd->fd);
is_fd_closed = true;
}
fd->orphaned = true;
/* Remove the active status but keep referenced. We want this grpc_fd struct /* Remove the active status but keep referenced. We want this grpc_fd struct
to be alive (and not added to freelist) until the end of this function */ to be alive (and not added to freelist) until the end of this function */
REF_BY(fd, 1, reason); REF_BY(fd, 1, reason);
@ -888,13 +876,24 @@ static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
before doing this.) */ before doing this.) */
if (fd->po.pi != NULL) { if (fd->po.pi != NULL) {
polling_island *pi_latest = polling_island_lock(fd->po.pi); polling_island *pi_latest = polling_island_lock(fd->po.pi);
polling_island_remove_fd_locked(pi_latest, fd, is_fd_closed, &error); polling_island_remove_fd_locked(pi_latest, fd, false /* is_fd_closed */,
&error);
gpr_mu_unlock(&pi_latest->mu); gpr_mu_unlock(&pi_latest->mu);
unref_pi = fd->po.pi; unref_pi = fd->po.pi;
fd->po.pi = NULL; fd->po.pi = NULL;
} }
/* If release_fd is not NULL, we should be relinquishing control of the file
descriptor fd->fd (but we still own the grpc_fd structure). */
if (release_fd != NULL) {
*release_fd = fd->fd;
} else {
close(fd->fd);
}
fd->orphaned = true;
GRPC_CLOSURE_SCHED(exec_ctx, fd->on_done_closure, GRPC_ERROR_REF(error)); GRPC_CLOSURE_SCHED(exec_ctx, fd->on_done_closure, GRPC_ERROR_REF(error));
gpr_mu_unlock(&fd->po.mu); gpr_mu_unlock(&fd->po.mu);

@ -36,6 +36,12 @@ char *gpr_getenv(const char *name);
/* Sets the the environment with the specified name to the specified value. */ /* Sets the the environment with the specified name to the specified value. */
void gpr_setenv(const char *name, const char *value); void gpr_setenv(const char *name, const char *value);
/* This is a version of gpr_getenv that does not produce any output if it has to
use an insecure version of the function. It is ONLY to be used to solve the
problem in which we need to check an env variable to configure the verbosity
level of logging. So DO NOT USE THIS. */
const char *gpr_getenv_silent(const char *name, char **dst);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

@ -38,7 +38,9 @@
#include "src/core/lib/support/string.h" #include "src/core/lib/support/string.h"
char *gpr_getenv(const char *name) { const char *gpr_getenv_silent(const char *name, char **dst) {
const char *insecure_func_used = NULL;
char *result = NULL;
#if defined(GPR_BACKWARDS_COMPATIBILITY_MODE) #if defined(GPR_BACKWARDS_COMPATIBILITY_MODE)
typedef char *(*getenv_type)(const char *); typedef char *(*getenv_type)(const char *);
static getenv_type getenv_func = NULL; static getenv_type getenv_func = NULL;
@ -48,22 +50,28 @@ char *gpr_getenv(const char *name) {
for (size_t i = 0; getenv_func == NULL && i < GPR_ARRAY_SIZE(names); i++) { for (size_t i = 0; getenv_func == NULL && i < GPR_ARRAY_SIZE(names); i++) {
getenv_func = (getenv_type)dlsym(RTLD_DEFAULT, names[i]); getenv_func = (getenv_type)dlsym(RTLD_DEFAULT, names[i]);
if (getenv_func != NULL && strstr(names[i], "secure") == NULL) { if (getenv_func != NULL && strstr(names[i], "secure") == NULL) {
gpr_log(GPR_DEBUG, insecure_func_used = names[i];
"Warning: insecure environment read function '%s' used",
names[i]);
} }
} }
char *result = getenv_func(name); result = getenv_func(name);
return result == NULL ? result : gpr_strdup(result);
#elif __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 17) #elif __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 17)
char *result = secure_getenv(name); result = secure_getenv(name);
return result == NULL ? result : gpr_strdup(result);
#else #else
gpr_log(GPR_DEBUG, "Warning: insecure environment read function '%s' used", result = getenv(name);
"getenv"); insecure_func_used = "getenv";
char *result = getenv(name);
return result == NULL ? result : gpr_strdup(result);
#endif #endif
*dst = result == NULL ? result : gpr_strdup(result);
return insecure_func_used;
}
char *gpr_getenv(const char *name) {
char *result = NULL;
const char *insecure_func_used = gpr_getenv_silent(name, &result);
if (insecure_func_used != NULL) {
gpr_log(GPR_DEBUG, "Warning: insecure environment read function '%s' used",
insecure_func_used);
}
return result;
} }
void gpr_setenv(const char *name, const char *value) { void gpr_setenv(const char *name, const char *value) {

@ -29,6 +29,11 @@
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/lib/support/string.h" #include "src/core/lib/support/string.h"
const char *gpr_getenv_silent(const char *name, char **dst) {
*dst = gpr_getenv(name);
return NULL;
}
char *gpr_getenv(const char *name) { char *gpr_getenv(const char *name) {
char *result = getenv(name); char *result = getenv(name);
return result == NULL ? result : gpr_strdup(result); return result == NULL ? result : gpr_strdup(result);

@ -30,6 +30,11 @@
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
const char *gpr_getenv_silent(const char *name, char **dst) {
*dst = gpr_getenv(name);
return NULL;
}
char *gpr_getenv(const char *name) { char *gpr_getenv(const char *name) {
char *result = NULL; char *result = NULL;
DWORD size; DWORD size;

@ -64,7 +64,8 @@ void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print) {
} }
void gpr_log_verbosity_init() { void gpr_log_verbosity_init() {
char *verbosity = gpr_getenv("GRPC_VERBOSITY"); char *verbosity = NULL;
const char *insecure_getenv = gpr_getenv_silent("GRPC_VERBOSITY", &verbosity);
gpr_atm min_severity_to_print = GPR_LOG_SEVERITY_ERROR; gpr_atm min_severity_to_print = GPR_LOG_SEVERITY_ERROR;
if (verbosity != NULL) { if (verbosity != NULL) {
@ -81,6 +82,11 @@ void gpr_log_verbosity_init() {
GPR_LOG_VERBOSITY_UNSET) { GPR_LOG_VERBOSITY_UNSET) {
gpr_atm_no_barrier_store(&g_min_severity_to_print, min_severity_to_print); gpr_atm_no_barrier_store(&g_min_severity_to_print, min_severity_to_print);
} }
if (insecure_getenv != NULL) {
gpr_log(GPR_DEBUG, "Warning: insecure environment read function '%s' used",
insecure_getenv);
}
} }
void gpr_set_log_function(gpr_log_func f) { void gpr_set_log_function(gpr_log_func f) {

@ -26,6 +26,8 @@ extern void grpc_deadline_filter_init(void);
extern void grpc_deadline_filter_shutdown(void); extern void grpc_deadline_filter_shutdown(void);
extern void grpc_client_channel_init(void); extern void grpc_client_channel_init(void);
extern void grpc_client_channel_shutdown(void); extern void grpc_client_channel_shutdown(void);
extern void grpc_tsi_gts_init(void);
extern void grpc_tsi_gts_shutdown(void);
extern void grpc_load_reporting_plugin_init(void); extern void grpc_load_reporting_plugin_init(void);
extern void grpc_load_reporting_plugin_shutdown(void); extern void grpc_load_reporting_plugin_shutdown(void);
@ -38,6 +40,8 @@ void grpc_register_built_in_plugins(void) {
grpc_deadline_filter_shutdown); grpc_deadline_filter_shutdown);
grpc_register_plugin(grpc_client_channel_init, grpc_register_plugin(grpc_client_channel_init,
grpc_client_channel_shutdown); grpc_client_channel_shutdown);
grpc_register_plugin(grpc_tsi_gts_init,
grpc_tsi_gts_shutdown);
grpc_register_plugin(grpc_load_reporting_plugin_init, grpc_register_plugin(grpc_load_reporting_plugin_init,
grpc_load_reporting_plugin_shutdown); grpc_load_reporting_plugin_shutdown);
} }

@ -22,6 +22,8 @@ extern void grpc_http_filters_init(void);
extern void grpc_http_filters_shutdown(void); extern void grpc_http_filters_shutdown(void);
extern void grpc_chttp2_plugin_init(void); extern void grpc_chttp2_plugin_init(void);
extern void grpc_chttp2_plugin_shutdown(void); extern void grpc_chttp2_plugin_shutdown(void);
extern void grpc_tsi_gts_init(void);
extern void grpc_tsi_gts_shutdown(void);
extern void grpc_deadline_filter_init(void); extern void grpc_deadline_filter_init(void);
extern void grpc_deadline_filter_shutdown(void); extern void grpc_deadline_filter_shutdown(void);
extern void grpc_client_channel_init(void); extern void grpc_client_channel_init(void);
@ -58,6 +60,8 @@ void grpc_register_built_in_plugins(void) {
grpc_http_filters_shutdown); grpc_http_filters_shutdown);
grpc_register_plugin(grpc_chttp2_plugin_init, grpc_register_plugin(grpc_chttp2_plugin_init,
grpc_chttp2_plugin_shutdown); grpc_chttp2_plugin_shutdown);
grpc_register_plugin(grpc_tsi_gts_init,
grpc_tsi_gts_shutdown);
grpc_register_plugin(grpc_deadline_filter_init, grpc_register_plugin(grpc_deadline_filter_init,
grpc_deadline_filter_shutdown); grpc_deadline_filter_shutdown);
grpc_register_plugin(grpc_client_channel_init, grpc_register_plugin(grpc_client_channel_init,

@ -0,0 +1,40 @@
/*
*
* Copyright 2017 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include "src/core/tsi/gts_transport_security.h"
#include <string.h>
static gts_shared_resource g_gts_resource;
gts_shared_resource *gts_get_shared_resource(void) { return &g_gts_resource; }
void grpc_tsi_gts_init() {
memset(&g_gts_resource, 0, sizeof(gts_shared_resource));
gpr_mu_init(&g_gts_resource.mu);
}
void grpc_tsi_gts_shutdown() {
gpr_mu_destroy(&g_gts_resource.mu);
if (g_gts_resource.cq == NULL) {
return;
}
grpc_completion_queue_destroy(g_gts_resource.cq);
grpc_channel_destroy(g_gts_resource.channel);
gpr_thd_join(g_gts_resource.thread_id);
}

@ -0,0 +1,37 @@
/*
*
* Copyright 2017 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H
#define GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H
#include <grpc/grpc.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
typedef struct gts_shared_resource {
gpr_thd_id thread_id;
grpc_channel *channel;
grpc_completion_queue *cq;
gpr_mu mu;
} gts_shared_resource;
/* This method returns the address of gts_shared_resource object shared by all
* TSI handshakes. */
gts_shared_resource *gts_get_shared_resource(void);
#endif /* GRPC_CORE_TSI_GTS_TRANSPORT_SECURITY_H */

@ -93,6 +93,11 @@ void CoreCodegen::grpc_byte_buffer_destroy(grpc_byte_buffer* bb) {
::grpc_byte_buffer_destroy(bb); ::grpc_byte_buffer_destroy(bb);
} }
grpc_call_error CoreCodegen::grpc_call_cancel_with_status(
grpc_call* call, grpc_status_code status, const char* description,
void* reserved) {
return ::grpc_call_cancel_with_status(call, status, description, reserved);
}
void CoreCodegen::grpc_call_ref(grpc_call* call) { ::grpc_call_ref(call); } void CoreCodegen::grpc_call_ref(grpc_call* call) { ::grpc_call_ref(call); }
void CoreCodegen::grpc_call_unref(grpc_call* call) { ::grpc_call_unref(call); } void CoreCodegen::grpc_call_unref(grpc_call* call) { ::grpc_call_unref(call); }
void* CoreCodegen::grpc_call_arena_alloc(grpc_call* call, size_t length) { void* CoreCodegen::grpc_call_arena_alloc(grpc_call* call, size_t length) {

@ -250,14 +250,6 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() {
has_sync_methods && num_frequently_polled_cqs > 0; has_sync_methods && num_frequently_polled_cqs > 0;
if (has_sync_methods) { if (has_sync_methods) {
// This is a Sync server
gpr_log(GPR_INFO,
"Synchronous server. Num CQs: %d, Min pollers: %d, Max Pollers: "
"%d, CQ timeout (msec): %d",
sync_server_settings_.num_cqs, sync_server_settings_.min_pollers,
sync_server_settings_.max_pollers,
sync_server_settings_.cq_timeout_msec);
grpc_cq_polling_type polling_type = grpc_cq_polling_type polling_type =
is_hybrid_server ? GRPC_CQ_NON_POLLING : GRPC_CQ_DEFAULT_POLLING; is_hybrid_server ? GRPC_CQ_NON_POLLING : GRPC_CQ_DEFAULT_POLLING;
@ -272,6 +264,16 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() {
sync_server_settings_.min_pollers, sync_server_settings_.max_pollers, sync_server_settings_.min_pollers, sync_server_settings_.max_pollers,
sync_server_settings_.cq_timeout_msec)); sync_server_settings_.cq_timeout_msec));
if (has_sync_methods) {
// This is a Sync server
gpr_log(GPR_INFO,
"Synchronous server. Num CQs: %d, Min pollers: %d, Max Pollers: "
"%d, CQ timeout (msec): %d",
sync_server_settings_.num_cqs, sync_server_settings_.min_pollers,
sync_server_settings_.max_pollers,
sync_server_settings_.cq_timeout_msec);
}
ServerInitializer* initializer = server->initializer(); ServerInitializer* initializer = server->initializer();
// Register all the completion queues with the server. i.e // Register all the completion queues with the server. i.e

@ -28,6 +28,19 @@ Slice::Slice(grpc_slice slice, AddRef) : slice_(grpc_slice_ref(slice)) {}
Slice::Slice(grpc_slice slice, StealRef) : slice_(slice) {} Slice::Slice(grpc_slice slice, StealRef) : slice_(slice) {}
Slice::Slice(size_t len) : slice_(grpc_slice_malloc(len)) {}
Slice::Slice(const void* buf, size_t len)
: slice_(grpc_slice_from_copied_buffer(reinterpret_cast<const char*>(buf),
len)) {}
Slice::Slice(const grpc::string& str)
: slice_(grpc_slice_from_copied_buffer(str.c_str(), str.length())) {}
Slice::Slice(const void* buf, size_t len, StaticSlice)
: slice_(grpc_slice_from_static_buffer(reinterpret_cast<const char*>(buf),
len)) {}
Slice::Slice(const Slice& other) : slice_(grpc_slice_ref(other.slice_)) {} Slice::Slice(const Slice& other) : slice_(grpc_slice_ref(other.slice_)) {}
} // namespace grpc } // namespace grpc

@ -64,6 +64,7 @@ message LoadParams {
message SecurityParams { message SecurityParams {
bool use_test_ca = 1; bool use_test_ca = 1;
string server_host_override = 2; string server_host_override = 2;
string cred_type = 3;
} }
message ChannelArg { message ChannelArg {
@ -240,6 +241,10 @@ message ScenarioResultSummary
// Number of polls called inside completion queue per request // Number of polls called inside completion queue per request
double client_polls_per_request = 15; double client_polls_per_request = 15;
double server_polls_per_request = 16; double server_polls_per_request = 16;
// Queries per CPU-sec over all servers or clients
double server_queries_per_cpu_sec = 17;
double client_queries_per_cpu_sec = 18;
} }
// Results of a single benchmark scenario. // Results of a single benchmark scenario.

@ -240,6 +240,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/security/util/json_util.c', 'src/core/lib/security/util/json_util.c',
'src/core/lib/surface/init_secure.c', 'src/core/lib/surface/init_secure.c',
'src/core/tsi/fake_transport_security.c', 'src/core/tsi/fake_transport_security.c',
'src/core/tsi/gts_transport_security.c',
'src/core/tsi/ssl_transport_security.c', 'src/core/tsi/ssl_transport_security.c',
'src/core/tsi/transport_security.c', 'src/core/tsi/transport_security.c',
'src/core/tsi/transport_security_adapter.c', 'src/core/tsi/transport_security_adapter.c',

@ -1,5 +1 @@
proto/ /src/
src/
*_pb2.py
*_pb2_grpc.py
*.egg-info/

@ -88,13 +88,22 @@ grpc_cc_library(
], ],
) )
grpc_cc_binary( grpc_cc_library(
name = "interop_client", name = "interop_client_main",
srcs = [ srcs = [
"client.cc", "client.cc",
], ],
language = "C++",
deps = [ deps = [
":client_helper_lib", ":client_helper_lib",
],
)
grpc_cc_binary(
name = "interop_client",
language = "C++",
deps = [
":interop_client_main",
"//:grpc++", "//:grpc++",
], ],
) )

@ -81,6 +81,7 @@ grpc_cc_library(
"//src/proto/grpc/testing:services_proto", "//src/proto/grpc/testing:services_proto",
"//test/core/util:gpr_test_util", "//test/core/util:gpr_test_util",
"//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",
], ],
) )
@ -148,6 +149,7 @@ grpc_cc_binary(
":driver_impl", ":driver_impl",
"//:grpc++", "//:grpc++",
"//test/cpp/util:test_config", "//test/cpp/util:test_config",
"//test/cpp/util:test_util",
], ],
external_deps = [ external_deps = [
"gflags", "gflags",
@ -162,6 +164,7 @@ grpc_cc_test(
":driver_impl", ":driver_impl",
":qps_worker_impl", ":qps_worker_impl",
"//test/cpp/util:test_config", "//test/cpp/util:test_config",
"//test/cpp/util:test_util",
], ],
) )
@ -173,6 +176,7 @@ grpc_cc_test(
":driver_impl", ":driver_impl",
"//:grpc++", "//:grpc++",
"//test/cpp/util:test_config", "//test/cpp/util:test_config",
"//test/cpp/util:test_util",
], ],
) )

@ -39,6 +39,7 @@
#include "test/cpp/qps/interarrival.h" #include "test/cpp/qps/interarrival.h"
#include "test/cpp/qps/usage_timer.h" #include "test/cpp/qps/usage_timer.h"
#include "test/cpp/util/create_test_channel.h" #include "test/cpp/util/create_test_channel.h"
#include "test/cpp/util/test_credentials_provider.h"
namespace grpc { namespace grpc {
namespace testing { namespace testing {
@ -88,9 +89,7 @@ class ClientRequestCreator<ByteBuffer> {
if (payload_config.has_bytebuf_params()) { if (payload_config.has_bytebuf_params()) {
std::unique_ptr<char[]> buf( std::unique_ptr<char[]> buf(
new char[payload_config.bytebuf_params().req_size()]); new char[payload_config.bytebuf_params().req_size()]);
grpc_slice s = grpc_slice_from_copied_buffer( Slice slice(buf.get(), payload_config.bytebuf_params().req_size());
buf.get(), payload_config.bytebuf_params().req_size());
Slice slice(s, Slice::STEAL_REF);
*req = ByteBuffer(&slice, 1); *req = ByteBuffer(&slice, 1);
} else { } else {
GPR_ASSERT(false); // not appropriate for this specialization GPR_ASSERT(false); // not appropriate for this specialization
@ -407,9 +406,18 @@ class ClientImpl : public Client {
ChannelArguments args; ChannelArguments args;
args.SetInt("shard_to_ensure_no_subchannel_merges", shard); args.SetInt("shard_to_ensure_no_subchannel_merges", shard);
set_channel_args(config, &args); set_channel_args(config, &args);
grpc::string type;
if (config.has_security_params() &&
config.security_params().cred_type().empty()) {
type = kTlsCredentialsType;
} else {
type = config.security_params().cred_type();
}
channel_ = CreateTestChannel( channel_ = CreateTestChannel(
target, config.security_params().server_host_override(), target, type, config.security_params().server_host_override(),
config.has_security_params(), !config.security_params().use_test_ca(), !config.security_params().use_test_ca(),
std::shared_ptr<CallCredentials>(), args); std::shared_ptr<CallCredentials>(), args);
gpr_log(GPR_INFO, "Connecting to %s", target.c_str()); gpr_log(GPR_INFO, "Connecting to %s", target.c_str());
GPR_ASSERT(channel_->WaitForConnected( GPR_ASSERT(channel_->WaitForConnected(

@ -40,6 +40,7 @@
#include "test/cpp/qps/histogram.h" #include "test/cpp/qps/histogram.h"
#include "test/cpp/qps/qps_worker.h" #include "test/cpp/qps/qps_worker.h"
#include "test/cpp/qps/stats.h" #include "test/cpp/qps/stats.h"
#include "test/cpp/util/test_credentials_provider.h"
using std::list; using std::list;
using std::thread; using std::thread;
@ -172,13 +173,26 @@ static void postprocess_scenario_result(ScenarioResult* result) {
sum(result->client_stats(), CliPollCount) / histogram.Count()); sum(result->client_stats(), CliPollCount) / histogram.Count());
result->mutable_summary()->set_server_polls_per_request( result->mutable_summary()->set_server_polls_per_request(
sum(result->server_stats(), SvrPollCount) / histogram.Count()); sum(result->server_stats(), SvrPollCount) / histogram.Count());
auto server_queries_per_cpu_sec =
histogram.Count() / (sum(result->server_stats(), ServerSystemTime) +
sum(result->server_stats(), ServerUserTime));
auto client_queries_per_cpu_sec =
histogram.Count() / (sum(result->client_stats(), SystemTime) +
sum(result->client_stats(), UserTime));
result->mutable_summary()->set_server_queries_per_cpu_sec(
server_queries_per_cpu_sec);
result->mutable_summary()->set_client_queries_per_cpu_sec(
client_queries_per_cpu_sec);
} }
std::unique_ptr<ScenarioResult> RunScenario( std::unique_ptr<ScenarioResult> RunScenario(
const ClientConfig& initial_client_config, size_t num_clients, const ClientConfig& initial_client_config, size_t num_clients,
const ServerConfig& initial_server_config, size_t num_servers, const ServerConfig& initial_server_config, size_t num_servers,
int warmup_seconds, int benchmark_seconds, int spawn_local_worker_count, int warmup_seconds, int benchmark_seconds, int spawn_local_worker_count,
const char* qps_server_target_override) { const grpc::string& qps_server_target_override,
const grpc::string& credential_type) {
// Log everything from the driver // Log everything from the driver
gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG); gpr_set_log_verbosity(GPR_LOG_SEVERITY_DEBUG);
@ -214,7 +228,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
} }
int driver_port = grpc_pick_unused_port_or_die(); int driver_port = grpc_pick_unused_port_or_die();
local_workers.emplace_back(new QpsWorker(driver_port)); local_workers.emplace_back(new QpsWorker(driver_port, 0, credential_type));
char addr[256]; char addr[256];
sprintf(addr, "localhost:%d", driver_port); sprintf(addr, "localhost:%d", driver_port);
if (spawn_local_worker_count < 0) { if (spawn_local_worker_count < 0) {
@ -246,12 +260,14 @@ std::unique_ptr<ScenarioResult> RunScenario(
}; };
std::vector<ServerData> servers(num_servers); std::vector<ServerData> servers(num_servers);
std::unordered_map<string, std::deque<int>> hosts_cores; std::unordered_map<string, std::deque<int>> hosts_cores;
ChannelArguments channel_args;
for (size_t i = 0; i < num_servers; i++) { for (size_t i = 0; i < num_servers; i++) {
gpr_log(GPR_INFO, "Starting server on %s (worker #%" PRIuPTR ")", gpr_log(GPR_INFO, "Starting server on %s (worker #%" PRIuPTR ")",
workers[i].c_str(), i); workers[i].c_str(), i);
servers[i].stub = WorkerService::NewStub( servers[i].stub = WorkerService::NewStub(CreateChannel(
CreateChannel(workers[i], InsecureChannelCredentials())); workers[i], GetCredentialsProvider()->GetChannelCredentials(
credential_type, &channel_args)));
ServerConfig server_config = initial_server_config; ServerConfig server_config = initial_server_config;
if (server_config.core_limit() != 0) { if (server_config.core_limit() != 0) {
@ -269,8 +285,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
if (!servers[i].stream->Read(&init_status)) { if (!servers[i].stream->Read(&init_status)) {
gpr_log(GPR_ERROR, "Server %zu did not yield initial status", i); gpr_log(GPR_ERROR, "Server %zu did not yield initial status", i);
} }
if (qps_server_target_override != NULL && if (qps_server_target_override.length() > 0) {
strlen(qps_server_target_override) > 0) {
// overriding the qps server target only works if there is 1 server // overriding the qps server target only works if there is 1 server
GPR_ASSERT(num_servers == 1); GPR_ASSERT(num_servers == 1);
client_config.add_server_targets(qps_server_target_override); client_config.add_server_targets(qps_server_target_override);
@ -298,7 +313,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
gpr_log(GPR_INFO, "Starting client on %s (worker #%" PRIuPTR ")", gpr_log(GPR_INFO, "Starting client on %s (worker #%" PRIuPTR ")",
worker.c_str(), i + num_servers); worker.c_str(), i + num_servers);
clients[i].stub = WorkerService::NewStub( clients[i].stub = WorkerService::NewStub(
CreateChannel(worker, InsecureChannelCredentials())); CreateChannel(worker, GetCredentialsProvider()->GetChannelCredentials(
credential_type, &channel_args)));
ClientConfig per_client_config = client_config; ClientConfig per_client_config = client_config;
if (initial_client_config.core_limit() != 0) { if (initial_client_config.core_limit() != 0) {
@ -483,16 +499,19 @@ std::unique_ptr<ScenarioResult> RunScenario(
return result; return result;
} }
bool RunQuit() { bool RunQuit(const grpc::string& credential_type) {
// Get client, server lists // Get client, server lists
bool result = true; bool result = true;
auto workers = get_workers("QPS_WORKERS"); auto workers = get_workers("QPS_WORKERS");
if (workers.size() == 0) { if (workers.size() == 0) {
return false; return false;
} }
ChannelArguments channel_args;
for (size_t i = 0; i < workers.size(); i++) { for (size_t i = 0; i < workers.size(); i++) {
auto stub = WorkerService::NewStub( auto stub = WorkerService::NewStub(CreateChannel(
CreateChannel(workers[i], InsecureChannelCredentials())); workers[i], GetCredentialsProvider()->GetChannelCredentials(
credential_type, &channel_args)));
Void dummy; Void dummy;
grpc::ClientContext ctx; grpc::ClientContext ctx;
ctx.set_wait_for_ready(true); ctx.set_wait_for_ready(true);

@ -31,9 +31,10 @@ std::unique_ptr<ScenarioResult> RunScenario(
const grpc::testing::ClientConfig& client_config, size_t num_clients, const grpc::testing::ClientConfig& client_config, size_t num_clients,
const grpc::testing::ServerConfig& server_config, size_t num_servers, const grpc::testing::ServerConfig& server_config, size_t num_servers,
int warmup_seconds, int benchmark_seconds, int spawn_local_worker_count, int warmup_seconds, int benchmark_seconds, int spawn_local_worker_count,
const char* qps_server_target_override = ""); const grpc::string& qps_server_target_override,
const grpc::string& credential_type);
bool RunQuit(); bool RunQuit(const grpc::string& credential_type);
} // namespace testing } // namespace testing
} // namespace grpc } // namespace grpc

@ -31,6 +31,7 @@
#include "test/cpp/qps/parse_json.h" #include "test/cpp/qps/parse_json.h"
#include "test/cpp/qps/report.h" #include "test/cpp/qps/report.h"
#include "test/cpp/util/test_config.h" #include "test/cpp/util/test_config.h"
#include "test/cpp/util/test_credentials_provider.h"
DEFINE_string(scenarios_file, "", DEFINE_string(scenarios_file, "",
"JSON file containing an array of Scenario objects"); "JSON file containing an array of Scenario objects");
@ -61,6 +62,9 @@ DEFINE_string(qps_server_target_override, "",
DEFINE_string(json_file_out, "", "File to write the JSON output to."); DEFINE_string(json_file_out, "", "File to write the JSON output to.");
DEFINE_string(credential_type, grpc::testing::kInsecureCredentialsType,
"Credential type for communication with workers");
namespace grpc { namespace grpc {
namespace testing { namespace testing {
@ -72,7 +76,7 @@ static std::unique_ptr<ScenarioResult> RunAndReport(const Scenario& scenario,
scenario.server_config(), scenario.num_servers(), scenario.server_config(), scenario.num_servers(),
scenario.warmup_seconds(), scenario.benchmark_seconds(), scenario.warmup_seconds(), scenario.benchmark_seconds(),
scenario.spawn_local_worker_count(), scenario.spawn_local_worker_count(),
FLAGS_qps_server_target_override.c_str()); FLAGS_qps_server_target_override, FLAGS_credential_type);
// Amend the result with scenario config. Eventually we should adjust // Amend the result with scenario config. Eventually we should adjust
// RunScenario contract so we don't need to touch the result here. // RunScenario contract so we don't need to touch the result here.
@ -84,6 +88,7 @@ static std::unique_ptr<ScenarioResult> RunAndReport(const Scenario& scenario,
GetReporter()->ReportTimes(*result); GetReporter()->ReportTimes(*result);
GetReporter()->ReportCpuUsage(*result); GetReporter()->ReportCpuUsage(*result);
GetReporter()->ReportPollCount(*result); GetReporter()->ReportPollCount(*result);
GetReporter()->ReportQueriesPerCpuSec(*result);
for (int i = 0; *success && i < result->client_success_size(); i++) { for (int i = 0; *success && i < result->client_success_size(); i++) {
*success = result->client_success(i); *success = result->client_success(i);
@ -185,7 +190,7 @@ static bool QpsDriver() {
} else if (scjson) { } else if (scjson) {
json = FLAGS_scenarios_json.c_str(); json = FLAGS_scenarios_json.c_str();
} else if (FLAGS_quit) { } else if (FLAGS_quit) {
return RunQuit(); return RunQuit(FLAGS_credential_type);
} }
// Parse into an array of scenarios // Parse into an array of scenarios

@ -25,6 +25,7 @@
#include "test/cpp/qps/driver.h" #include "test/cpp/qps/driver.h"
#include "test/cpp/qps/report.h" #include "test/cpp/qps/report.h"
#include "test/cpp/util/test_config.h" #include "test/cpp/util/test_config.h"
#include "test/cpp/util/test_credentials_provider.h"
namespace grpc { namespace grpc {
namespace testing { namespace testing {
@ -48,8 +49,8 @@ static void RunQPS() {
server_config.set_server_type(ASYNC_SERVER); server_config.set_server_type(ASYNC_SERVER);
server_config.set_async_server_threads(8); server_config.set_async_server_threads(8);
const auto result = const auto result = RunScenario(client_config, 1, server_config, 1, WARMUP,
RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2); BENCHMARK, -2, "", kInsecureCredentialsType);
GetReporter()->ReportQPSPerCore(*result); GetReporter()->ReportQPSPerCore(*result);
GetReporter()->ReportLatency(*result); GetReporter()->ReportLatency(*result);

@ -41,6 +41,7 @@
#include "test/cpp/qps/client.h" #include "test/cpp/qps/client.h"
#include "test/cpp/qps/server.h" #include "test/cpp/qps/server.h"
#include "test/cpp/util/create_test_channel.h" #include "test/cpp/util/create_test_channel.h"
#include "test/cpp/util/test_credentials_provider.h"
namespace grpc { namespace grpc {
namespace testing { namespace testing {
@ -263,7 +264,8 @@ class WorkerServiceImpl final : public WorkerService::Service {
QpsWorker* worker_; QpsWorker* worker_;
}; };
QpsWorker::QpsWorker(int driver_port, int server_port) { QpsWorker::QpsWorker(int driver_port, int server_port,
const grpc::string& credential_type) {
impl_.reset(new WorkerServiceImpl(server_port, this)); impl_.reset(new WorkerServiceImpl(server_port, this));
gpr_atm_rel_store(&done_, static_cast<gpr_atm>(0)); gpr_atm_rel_store(&done_, static_cast<gpr_atm>(0));
@ -271,7 +273,9 @@ QpsWorker::QpsWorker(int driver_port, int server_port) {
gpr_join_host_port(&server_address, "::", driver_port); gpr_join_host_port(&server_address, "::", driver_port);
ServerBuilder builder; ServerBuilder builder;
builder.AddListeningPort(server_address, InsecureServerCredentials()); builder.AddListeningPort(
server_address,
GetCredentialsProvider()->GetServerCredentials(credential_type));
builder.RegisterService(impl_.get()); builder.RegisterService(impl_.get());
gpr_free(server_address); gpr_free(server_address);

@ -21,6 +21,7 @@
#include <memory> #include <memory>
#include <grpc++/support/config.h>
#include <grpc/support/atm.h> #include <grpc/support/atm.h>
namespace grpc { namespace grpc {
@ -33,7 +34,8 @@ class WorkerServiceImpl;
class QpsWorker { class QpsWorker {
public: public:
explicit QpsWorker(int driver_port, int server_port = 0); explicit QpsWorker(int driver_port, int server_port,
const grpc::string& credential_type);
~QpsWorker(); ~QpsWorker();
bool Done() const; bool Done() const;

@ -71,6 +71,12 @@ void CompositeReporter::ReportPollCount(const ScenarioResult& result) {
} }
} }
void CompositeReporter::ReportQueriesPerCpuSec(const ScenarioResult& result) {
for (size_t i = 0; i < reporters_.size(); ++i) {
reporters_[i]->ReportQueriesPerCpuSec(result);
}
}
void GprLogReporter::ReportQPS(const ScenarioResult& result) { void GprLogReporter::ReportQPS(const ScenarioResult& result) {
gpr_log(GPR_INFO, "QPS: %.1f", result.summary().qps()); gpr_log(GPR_INFO, "QPS: %.1f", result.summary().qps());
if (result.summary().failed_requests_per_second() > 0) { if (result.summary().failed_requests_per_second() > 0) {
@ -119,6 +125,13 @@ void GprLogReporter::ReportPollCount(const ScenarioResult& result) {
result.summary().server_polls_per_request()); result.summary().server_polls_per_request());
} }
void GprLogReporter::ReportQueriesPerCpuSec(const ScenarioResult& result) {
gpr_log(GPR_INFO, "Server Queries/CPU-sec: %.2f",
result.summary().server_queries_per_cpu_sec());
gpr_log(GPR_INFO, "Client Queries/CPU-sec: %.2f",
result.summary().client_queries_per_cpu_sec());
}
void JsonReporter::ReportQPS(const ScenarioResult& result) { void JsonReporter::ReportQPS(const ScenarioResult& result) {
grpc::string json_string = grpc::string json_string =
SerializeJson(result, "type.googleapis.com/grpc.testing.ScenarioResult"); SerializeJson(result, "type.googleapis.com/grpc.testing.ScenarioResult");
@ -147,6 +160,10 @@ void JsonReporter::ReportPollCount(const ScenarioResult& result) {
// NOP - all reporting is handled by ReportQPS. // NOP - all reporting is handled by ReportQPS.
} }
void JsonReporter::ReportQueriesPerCpuSec(const ScenarioResult& result) {
// NOP - all reporting is handled by ReportQPS.
}
void RpcReporter::ReportQPS(const ScenarioResult& result) { void RpcReporter::ReportQPS(const ScenarioResult& result) {
grpc::ClientContext context; grpc::ClientContext context;
grpc::Status status; grpc::Status status;
@ -183,5 +200,9 @@ void RpcReporter::ReportPollCount(const ScenarioResult& result) {
// NOP - all reporting is handled by ReportQPS. // NOP - all reporting is handled by ReportQPS.
} }
void RpcReporter::ReportQueriesPerCpuSec(const ScenarioResult& result) {
// NOP - all reporting is handled by ReportQPS.
}
} // namespace testing } // namespace testing
} // namespace grpc } // namespace grpc

@ -64,6 +64,9 @@ class Reporter {
/** Reports client and server poll usage inside completion queue. */ /** Reports client and server poll usage inside completion queue. */
virtual void ReportPollCount(const ScenarioResult& result) = 0; virtual void ReportPollCount(const ScenarioResult& result) = 0;
/** Reports queries per cpu-sec. */
virtual void ReportQueriesPerCpuSec(const ScenarioResult& result) = 0;
private: private:
const string name_; const string name_;
}; };
@ -82,6 +85,7 @@ class CompositeReporter : public Reporter {
void ReportTimes(const ScenarioResult& result) override; void ReportTimes(const ScenarioResult& result) override;
void ReportCpuUsage(const ScenarioResult& result) override; void ReportCpuUsage(const ScenarioResult& result) override;
void ReportPollCount(const ScenarioResult& result) override; void ReportPollCount(const ScenarioResult& result) override;
void ReportQueriesPerCpuSec(const ScenarioResult& result) override;
private: private:
std::vector<std::unique_ptr<Reporter> > reporters_; std::vector<std::unique_ptr<Reporter> > reporters_;
@ -99,6 +103,7 @@ class GprLogReporter : public Reporter {
void ReportTimes(const ScenarioResult& result) override; void ReportTimes(const ScenarioResult& result) override;
void ReportCpuUsage(const ScenarioResult& result) override; void ReportCpuUsage(const ScenarioResult& result) override;
void ReportPollCount(const ScenarioResult& result) override; void ReportPollCount(const ScenarioResult& result) override;
void ReportQueriesPerCpuSec(const ScenarioResult& result) override;
}; };
/** Dumps the report to a JSON file. */ /** Dumps the report to a JSON file. */
@ -114,6 +119,7 @@ class JsonReporter : public Reporter {
void ReportTimes(const ScenarioResult& result) override; void ReportTimes(const ScenarioResult& result) override;
void ReportCpuUsage(const ScenarioResult& result) override; void ReportCpuUsage(const ScenarioResult& result) override;
void ReportPollCount(const ScenarioResult& result) override; void ReportPollCount(const ScenarioResult& result) override;
void ReportQueriesPerCpuSec(const ScenarioResult& result) override;
const string report_file_; const string report_file_;
}; };
@ -130,6 +136,7 @@ class RpcReporter : public Reporter {
void ReportTimes(const ScenarioResult& result) override; void ReportTimes(const ScenarioResult& result) override;
void ReportCpuUsage(const ScenarioResult& result) override; void ReportCpuUsage(const ScenarioResult& result) override;
void ReportPollCount(const ScenarioResult& result) override; void ReportPollCount(const ScenarioResult& result) override;
void ReportQueriesPerCpuSec(const ScenarioResult& result) override;
std::unique_ptr<ReportQpsScenarioService::Stub> stub_; std::unique_ptr<ReportQpsScenarioService::Stub> stub_;
}; };

@ -24,6 +24,7 @@
#include "test/cpp/qps/driver.h" #include "test/cpp/qps/driver.h"
#include "test/cpp/qps/report.h" #include "test/cpp/qps/report.h"
#include "test/cpp/util/test_config.h" #include "test/cpp/util/test_config.h"
#include "test/cpp/util/test_credentials_provider.h"
namespace grpc { namespace grpc {
namespace testing { namespace testing {
@ -51,8 +52,8 @@ static void RunSynchronousUnaryPingPong() {
client_config.mutable_security_params()->CopyFrom(security); client_config.mutable_security_params()->CopyFrom(security);
server_config.mutable_security_params()->CopyFrom(security); server_config.mutable_security_params()->CopyFrom(security);
const auto result = const auto result = RunScenario(client_config, 1, server_config, 1, WARMUP,
RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2); BENCHMARK, -2, "", kInsecureCredentialsType);
GetReporter()->ReportQPS(*result); GetReporter()->ReportQPS(*result);
GetReporter()->ReportLatency(*result); GetReporter()->ReportLatency(*result);

@ -32,6 +32,7 @@
#include "test/core/end2end/data/ssl_test_data.h" #include "test/core/end2end/data/ssl_test_data.h"
#include "test/core/util/port.h" #include "test/core/util/port.h"
#include "test/cpp/qps/usage_timer.h" #include "test/cpp/qps/usage_timer.h"
#include "test/cpp/util/test_credentials_provider.h"
namespace grpc { namespace grpc {
namespace testing { namespace testing {
@ -89,12 +90,14 @@ class Server {
static std::shared_ptr<ServerCredentials> CreateServerCredentials( static std::shared_ptr<ServerCredentials> CreateServerCredentials(
const ServerConfig& config) { const ServerConfig& config) {
if (config.has_security_params()) { if (config.has_security_params()) {
SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, grpc::string type;
test_server1_cert}; if (config.security_params().cred_type().empty()) {
SslServerCredentialsOptions ssl_opts; type = kTlsCredentialsType;
ssl_opts.pem_root_certs = ""; } else {
ssl_opts.pem_key_cert_pairs.push_back(pkcp); type = config.security_params().cred_type();
return SslServerCredentials(ssl_opts); }
return GetCredentialsProvider()->GetServerCredentials(type);
} else { } else {
return InsecureServerCredentials(); return InsecureServerCredentials();
} }

@ -27,9 +27,12 @@
#include "test/cpp/qps/qps_worker.h" #include "test/cpp/qps/qps_worker.h"
#include "test/cpp/util/test_config.h" #include "test/cpp/util/test_config.h"
#include "test/cpp/util/test_credentials_provider.h"
DEFINE_int32(driver_port, 0, "Port for communication with driver"); DEFINE_int32(driver_port, 0, "Port for communication with driver");
DEFINE_int32(server_port, 0, "Port for operation as a server"); DEFINE_int32(server_port, 0, "Port for operation as a server");
DEFINE_string(credential_type, grpc::testing::kInsecureCredentialsType,
"Credential type for communication with driver");
static bool got_sigint = false; static bool got_sigint = false;
@ -39,7 +42,7 @@ namespace grpc {
namespace testing { namespace testing {
static void RunServer() { static void RunServer() {
QpsWorker worker(FLAGS_driver_port, FLAGS_server_port); QpsWorker worker(FLAGS_driver_port, FLAGS_server_port, FLAGS_credential_type);
while (!got_sigint && !worker.Done()) { while (!got_sigint && !worker.Done()) {
gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),

@ -0,0 +1,43 @@
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
licenses(["notice"]) # Apache v2
load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary")
grpc_cc_test(
name = "server_builder_test",
srcs = ["server_builder_test.cc"],
deps = [
"//:grpc++",
"//src/proto/grpc/testing:echo_proto",
"//test/core/util:grpc_test_util",
],
external_deps = [
"gtest",
],
)
grpc_cc_test(
name = "server_request_call_test",
srcs = ["server_request_call_test.cc"],
deps = [
"//:grpc++",
"//src/proto/grpc/testing:echo_proto",
"//test/core/util:grpc_test_util",
],
external_deps = [
"gtest",
],
)

@ -0,0 +1,162 @@
/*
*
* Copyright 2017 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <thread>
#include <grpc++/impl/codegen/config.h>
#include <gtest/gtest.h>
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/create_channel.h>
#include <grpc++/security/credentials.h>
#include <grpc/support/log.h>
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
namespace grpc {
namespace {
TEST(ServerRequestCallTest, ShortDeadlineDoesNotCauseOkayFalse) {
std::mutex mu;
bool shutting_down = false;
// grpc server config.
std::ostringstream s;
int p = grpc_pick_unused_port_or_die();
s << "[::1]:" << p;
const string address = s.str();
testing::EchoTestService::AsyncService service;
ServerBuilder builder;
builder.AddListeningPort(address, InsecureServerCredentials());
auto cq = builder.AddCompletionQueue();
builder.RegisterService(&service);
auto server = builder.BuildAndStart();
// server thread.
std::thread t([address, &service, &cq, &mu, &shutting_down] {
for (int n = 0; true; n++) {
ServerContext ctx;
testing::EchoRequest req;
ServerAsyncResponseWriter<testing::EchoResponse> responder(&ctx);
// if shutting down, don't enqueue a new request.
{
std::lock_guard<std::mutex> lock(mu);
if (!shutting_down) {
service.RequestEcho(&ctx, &req, &responder, cq.get(), cq.get(),
(void*)1);
}
}
bool ok;
void* tag;
if (!cq->Next(&tag, &ok)) {
break;
}
EXPECT_EQ((void*)1, tag);
// If not shutting down, ok must be true for new requests.
{
std::lock_guard<std::mutex> lock(mu);
if (!shutting_down && !ok) {
gpr_log(GPR_INFO, "!ok on request %d", n);
abort();
}
if (shutting_down && !ok) {
// Failed connection due to shutdown, continue flushing the CQ.
continue;
}
}
// Send a simple response after a small delay that would ensure the client
// deadline is exceeded.
gpr_log(GPR_INFO, "Got request %d", n);
testing::EchoResponse response;
response.set_message("foobar");
// A bit of sleep to make sure the deadline elapses.
gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
gpr_time_from_millis(50, GPR_TIMESPAN)));
{
std::lock_guard<std::mutex> lock(mu);
if (shutting_down) {
gpr_log(GPR_INFO,
"shut down while processing call, not calling Finish()");
// Continue flushing the CQ.
continue;
}
gpr_log(GPR_INFO, "Finishing request %d", n);
responder.Finish(response, grpc::Status::OK, (void*)2);
if (!cq->Next(&tag, &ok)) {
break;
}
EXPECT_EQ((void*)2, tag);
}
}
});
auto stub = testing::EchoTestService::NewStub(
CreateChannel(address, InsecureChannelCredentials()));
for (int i = 0; i < 100; i++) {
gpr_log(GPR_INFO, "Sending %d.", i);
testing::EchoRequest request;
/////////
// Comment out the following line to get ok=false due to invalid request.
// Otherwise, ok=false due to deadline being exceeded.
/////////
request.set_message("foobar");
// A simple request with a short deadline. The server will always exceed the
// deadline, whether due to the sleep or because the server was unable to
// even fetch the request from the CQ before the deadline elapsed.
testing::EchoResponse response;
::grpc::ClientContext ctx;
ctx.set_fail_fast(false);
ctx.set_deadline(std::chrono::system_clock::now() +
std::chrono::milliseconds(1));
grpc::Status status = stub->Echo(&ctx, request, &response);
EXPECT_EQ(DEADLINE_EXCEEDED, status.error_code());
gpr_log(GPR_INFO, "Success.");
}
gpr_log(GPR_INFO, "Done sending RPCs.");
// Shut down everything properly.
gpr_log(GPR_INFO, "Shutting down.");
{
std::lock_guard<std::mutex> lock(mu);
shutting_down = true;
}
server->Shutdown();
cq->Shutdown();
server->Wait();
t.join();
}
} // namespace
} // namespace grpc
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

@ -36,8 +36,7 @@ std::unique_ptr<ByteBuffer> SerializeToByteBuffer(
grpc::protobuf::Message* message) { grpc::protobuf::Message* message) {
grpc::string buf; grpc::string buf;
message->SerializeToString(&buf); message->SerializeToString(&buf);
grpc_slice s = grpc_slice_from_copied_string(buf.c_str()); Slice slice(buf);
Slice slice(s, Slice::STEAL_REF);
return std::unique_ptr<ByteBuffer>(new ByteBuffer(&slice, 1)); return std::unique_ptr<ByteBuffer>(new ByteBuffer(&slice, 1));
} }

@ -34,33 +34,30 @@ const char* kContent2 = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy world";
class ByteBufferTest : public ::testing::Test {}; class ByteBufferTest : public ::testing::Test {};
TEST_F(ByteBufferTest, CreateFromSingleSlice) { TEST_F(ByteBufferTest, CreateFromSingleSlice) {
grpc_slice hello = grpc_slice_from_copied_string(kContent1); Slice s(kContent1);
Slice s(hello, Slice::STEAL_REF);
ByteBuffer buffer(&s, 1); ByteBuffer buffer(&s, 1);
EXPECT_EQ(strlen(kContent1), buffer.Length());
} }
TEST_F(ByteBufferTest, CreateFromVector) { TEST_F(ByteBufferTest, CreateFromVector) {
grpc_slice hello = grpc_slice_from_copied_string(kContent1);
grpc_slice world = grpc_slice_from_copied_string(kContent2);
std::vector<Slice> slices; std::vector<Slice> slices;
slices.push_back(Slice(hello, Slice::STEAL_REF)); slices.emplace_back(kContent1);
slices.push_back(Slice(world, Slice::STEAL_REF)); slices.emplace_back(kContent2);
ByteBuffer buffer(&slices[0], 2); ByteBuffer buffer(&slices[0], 2);
EXPECT_EQ(strlen(kContent1) + strlen(kContent2), buffer.Length());
} }
TEST_F(ByteBufferTest, Clear) { TEST_F(ByteBufferTest, Clear) {
grpc_slice hello = grpc_slice_from_copied_string(kContent1); Slice s(kContent1);
Slice s(hello, Slice::STEAL_REF);
ByteBuffer buffer(&s, 1); ByteBuffer buffer(&s, 1);
buffer.Clear(); buffer.Clear();
EXPECT_EQ(static_cast<size_t>(0), buffer.Length());
} }
TEST_F(ByteBufferTest, Length) { TEST_F(ByteBufferTest, Length) {
grpc_slice hello = grpc_slice_from_copied_string(kContent1);
grpc_slice world = grpc_slice_from_copied_string(kContent2);
std::vector<Slice> slices; std::vector<Slice> slices;
slices.push_back(Slice(hello, Slice::STEAL_REF)); slices.emplace_back(kContent1);
slices.push_back(Slice(world, Slice::STEAL_REF)); slices.emplace_back(kContent2);
ByteBuffer buffer(&slices[0], 2); ByteBuffer buffer(&slices[0], 2);
EXPECT_EQ(strlen(kContent1) + strlen(kContent2), buffer.Length()); EXPECT_EQ(strlen(kContent1) + strlen(kContent2), buffer.Length());
} }

@ -119,8 +119,7 @@ void CliCall::WritesDone() {
} }
void CliCall::WriteAndWait(const grpc::string& request) { void CliCall::WriteAndWait(const grpc::string& request) {
grpc_slice s = grpc_slice_from_copied_string(request.c_str()); grpc::Slice req_slice(request);
grpc::Slice req_slice(s, grpc::Slice::STEAL_REF);
grpc::ByteBuffer send_buffer(&req_slice, 1); grpc::ByteBuffer send_buffer(&req_slice, 1);
gpr_mu_lock(&write_mu_); gpr_mu_lock(&write_mu_);

@ -51,29 +51,31 @@ void AddProdSslType() {
} // namespace } // namespace
// When ssl is enabled, if server is empty, override_hostname is used to // When cred_type is 'ssl', if server is empty, override_hostname is used to
// create channel. Otherwise, connect to server and override hostname if // create channel. Otherwise, connect to server and override hostname if
// override_hostname is provided. // override_hostname is provided.
// When ssl is not enabled, override_hostname is ignored. // When cred_type is not 'ssl', override_hostname is ignored.
// Set use_prod_root to true to use the SSL root for connecting to google. // Set use_prod_root to true to use the SSL root for connecting to google.
// In this case, path to the roots pem file must be set via environment variable // In this case, path to the roots pem file must be set via environment variable
// GRPC_DEFAULT_SSL_ROOTS_FILE_PATH. // GRPC_DEFAULT_SSL_ROOTS_FILE_PATH.
// Otherwise, root for test SSL cert will be used. // Otherwise, root for test SSL cert will be used.
// creds will be used to create a channel when enable_ssl is true. // creds will be used to create a channel when cred_type is 'ssl'.
// Use examples: // Use examples:
// CreateTestChannel( // CreateTestChannel(
// "1.1.1.1:12345", "override.hostname.com", true, false, creds); // "1.1.1.1:12345", "ssl", "override.hostname.com", false, creds);
// CreateTestChannel("test.google.com:443", "", true, true, creds); // CreateTestChannel("test.google.com:443", "ssl", "", true, creds);
// same as above // same as above
// CreateTestChannel("", "test.google.com:443", true, true, creds); // CreateTestChannel("", "ssl", "test.google.com:443", true, creds);
std::shared_ptr<Channel> CreateTestChannel( std::shared_ptr<Channel> CreateTestChannel(
const grpc::string& server, const grpc::string& override_hostname, const grpc::string& server, const grpc::string& cred_type,
bool enable_ssl, bool use_prod_roots, const grpc::string& override_hostname, bool use_prod_roots,
const std::shared_ptr<CallCredentials>& creds, const std::shared_ptr<CallCredentials>& creds,
const ChannelArguments& args) { const ChannelArguments& args) {
ChannelArguments channel_args(args); ChannelArguments channel_args(args);
std::shared_ptr<ChannelCredentials> channel_creds; std::shared_ptr<ChannelCredentials> channel_creds;
if (enable_ssl) { if (cred_type.empty()) {
return CreateChannel(server, InsecureChannelCredentials());
} else if (cred_type == testing::kTlsCredentialsType) { // cred_type == "ssl"
if (use_prod_roots) { if (use_prod_roots) {
gpr_once_init(&g_once_init_add_prod_ssl_provider, &AddProdSslType); gpr_once_init(&g_once_init_add_prod_ssl_provider, &AddProdSslType);
channel_creds = testing::GetCredentialsProvider()->GetChannelCredentials( channel_creds = testing::GetCredentialsProvider()->GetChannelCredentials(
@ -95,8 +97,26 @@ std::shared_ptr<Channel> CreateTestChannel(
} }
return CreateCustomChannel(connect_to, channel_creds, channel_args); return CreateCustomChannel(connect_to, channel_creds, channel_args);
} else { } else {
return CreateChannel(server, InsecureChannelCredentials()); channel_creds = testing::GetCredentialsProvider()->GetChannelCredentials(
cred_type, &channel_args);
GPR_ASSERT(channel_creds != nullptr);
return CreateChannel(server, channel_creds);
}
}
std::shared_ptr<Channel> CreateTestChannel(
const grpc::string& server, const grpc::string& override_hostname,
bool enable_ssl, bool use_prod_roots,
const std::shared_ptr<CallCredentials>& creds,
const ChannelArguments& args) {
grpc::string type;
if (enable_ssl) {
type = testing::kTlsCredentialsType;
} }
return CreateTestChannel(server, type, override_hostname, use_prod_roots,
creds, args);
} }
std::shared_ptr<Channel> CreateTestChannel( std::shared_ptr<Channel> CreateTestChannel(

@ -44,6 +44,12 @@ std::shared_ptr<Channel> CreateTestChannel(
const std::shared_ptr<CallCredentials>& creds, const std::shared_ptr<CallCredentials>& creds,
const ChannelArguments& args); const ChannelArguments& args);
std::shared_ptr<Channel> CreateTestChannel(
const grpc::string& server, const grpc::string& cred_type,
const grpc::string& override_hostname, bool use_prod_roots,
const std::shared_ptr<CallCredentials>& creds,
const ChannelArguments& args);
std::shared_ptr<Channel> CreateTestChannel( std::shared_ptr<Channel> CreateTestChannel(
const grpc::string& server, const grpc::string& credential_type, const grpc::string& server, const grpc::string& credential_type,
const std::shared_ptr<CallCredentials>& creds); const std::shared_ptr<CallCredentials>& creds);

@ -28,6 +28,9 @@ const char* kContent = "hello xxxxxxxxxxxxxxxxxxxx world";
class SliceTest : public ::testing::Test { class SliceTest : public ::testing::Test {
protected: protected:
void CheckSliceSize(const Slice& s, const grpc::string& content) {
EXPECT_EQ(content.size(), s.size());
}
void CheckSlice(const Slice& s, const grpc::string& content) { void CheckSlice(const Slice& s, const grpc::string& content) {
EXPECT_EQ(content.size(), s.size()); EXPECT_EQ(content.size(), s.size());
EXPECT_EQ(content, EXPECT_EQ(content,
@ -35,6 +38,31 @@ class SliceTest : public ::testing::Test {
} }
}; };
TEST_F(SliceTest, Empty) {
Slice empty_slice;
CheckSlice(empty_slice, "");
}
TEST_F(SliceTest, Sized) {
Slice sized_slice(strlen(kContent));
CheckSliceSize(sized_slice, kContent);
}
TEST_F(SliceTest, String) {
Slice spp(kContent);
CheckSlice(spp, kContent);
}
TEST_F(SliceTest, Buf) {
Slice spp(kContent, strlen(kContent));
CheckSlice(spp, kContent);
}
TEST_F(SliceTest, StaticBuf) {
Slice spp(kContent, strlen(kContent), Slice::STATIC_SLICE);
CheckSlice(spp, kContent);
}
TEST_F(SliceTest, Steal) { TEST_F(SliceTest, Steal) {
grpc_slice s = grpc_slice_from_copied_string(kContent); grpc_slice s = grpc_slice_from_copied_string(kContent);
Slice spp(s, Slice::STEAL_REF); Slice spp(s, Slice::STEAL_REF);
@ -48,11 +76,6 @@ TEST_F(SliceTest, Add) {
CheckSlice(spp, kContent); CheckSlice(spp, kContent);
} }
TEST_F(SliceTest, Empty) {
Slice empty_slice;
CheckSlice(empty_slice, "");
}
TEST_F(SliceTest, Cslice) { TEST_F(SliceTest, Cslice) {
grpc_slice s = grpc_slice_from_copied_string(kContent); grpc_slice s = grpc_slice_from_copied_string(kContent);
Slice spp(s, Slice::STEAL_REF); Slice spp(s, Slice::STEAL_REF);

@ -62,9 +62,9 @@ if EXTRA_ENV_COMPILE_ARGS is None:
# envvars) without adding yet more GRPC-specific envvars. # envvars) without adding yet more GRPC-specific envvars.
# See https://sourceforge.net/p/mingw-w64/bugs/363/ # See https://sourceforge.net/p/mingw-w64/bugs/363/
if '32' in platform.architecture()[0]: if '32' in platform.architecture()[0]:
EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime32 -D_timeb=__timeb32 -D_ftime_s=_ftime32_s' EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime32 -D_timeb=__timeb32 -D_ftime_s=_ftime32_s -D_hypot=hypot'
else: else:
EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime64 -D_timeb=__timeb64' EXTRA_ENV_COMPILE_ARGS += ' -D_ftime=_ftime64 -D_timeb=__timeb64 -D_hypot=hypot'
else: else:
# We need to statically link the C++ Runtime, only the C runtime is # We need to statically link the C++ Runtime, only the C runtime is
# available dynamically # available dynamically

@ -1404,6 +1404,8 @@ src/core/plugin_registry/grpc_plugin_registry.c \
src/core/tsi/README.md \ src/core/tsi/README.md \
src/core/tsi/fake_transport_security.c \ src/core/tsi/fake_transport_security.c \
src/core/tsi/fake_transport_security.h \ src/core/tsi/fake_transport_security.h \
src/core/tsi/gts_transport_security.c \
src/core/tsi/gts_transport_security.h \
src/core/tsi/ssl_transport_security.c \ src/core/tsi/ssl_transport_security.c \
src/core/tsi/ssl_transport_security.h \ src/core/tsi/ssl_transport_security.h \
src/core/tsi/ssl_types.h \ src/core/tsi/ssl_types.h \

@ -20,9 +20,10 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc source tools/internal_ci/helper_scripts/prepare_build_linux_rc
# TODO(jtattermusch): install ruby on the internal_ci worker set +ex
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 [[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
# TODO(jtattermusch): grep works around https://github.com/rvm/rvm/issues/4068 set -e # rvm commands are very verbose
curl -sSL https://get.rvm.io | grep -v __rvm_print_headline | bash -s stable --ruby rvm --default use ruby-2.4.1
set -ex
tools/run_tests/task_runner.py -f artifact linux tools/run_tests/task_runner.py -f artifact linux

@ -19,10 +19,13 @@ rename C:\Python34_32bit Python34_32bits
rename C:\Python35_32bit Python35_32bits rename C:\Python35_32bit Python35_32bits
rename C:\Python36_32bit Python36_32bits rename C:\Python36_32bit Python36_32bits
pacman -S --noconfirm mingw64/mingw-w64-x86_64-gcc mingw32/mingw-w64-i686-gcc
@rem make sure msys binaries are preferred over cygwin binaries @rem make sure msys binaries are preferred over cygwin binaries
@rem set path to python 2.7 @rem set path to python 2.7
set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH% set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH%
@rem enter repo root @rem enter repo root
cd /d %~dp0\..\..\.. cd /d %~dp0\..\..\..

@ -30,9 +30,27 @@ LANG_RUNTIME_MATRIX = {
} }
# Dictionary of releases per language. For each language, we need to provide # Dictionary of releases per language. For each language, we need to provide
# a tuple of release tag (used as the tag for the GCR image) and also github hash. # a release tag pointing to the latest build of the branch.
LANG_RELEASE_MATRIX = { LANG_RELEASE_MATRIX = {
'cxx': ['v1.0.1', 'v1.1.2'], 'cxx': [
'go': ['v1.0.1-GA', 'v1.3.0'], 'v1.0.1',
'java': ['v1.0.3', 'v1.1.2'], 'v1.1.4',
'v1.2.5',
'v1.3.9',
'v1.4.2',
],
'go': [
'v1.0.5',
'v1.2.1',
'v1.3.0',
'v1.4.2',
],
'java': [
'v1.0.3',
'v1.1.2',
'v1.2.0',
'v1.3.1',
'v1.4.0',
'v1.5.0',
],
} }

@ -168,7 +168,7 @@ def run_tests_for_lang(lang, runtime, images):
_xml_report_tree, _xml_report_tree,
resultset, resultset,
'grpc_interop_matrix', 'grpc_interop_matrix',
'%s__%s:%s'%(lang,runtime,release), '%s__%s %s'%(lang,runtime,release),
str(uuid.uuid4())) str(uuid.uuid4()))
_docker_images_cleanup = [] _docker_images_cleanup = []

@ -12,8 +12,8 @@
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem set path to python & mingw compiler
set PATH=C:\%1;C:\%1\scripts;C:\msys64\mingw%2\bin;%PATH% set PATH=C:\%1;C:\%1\scripts;C:\msys64\mingw%2\bin;C:\tools\msys64\mingw%2\bin;%PATH%
pip install --upgrade six pip install --upgrade six
pip install --upgrade setuptools pip install --upgrade setuptools

@ -69,8 +69,8 @@ fi
if [ "$DOCKERHUB_ORGANIZATION" != "" ] if [ "$DOCKERHUB_ORGANIZATION" != "" ]
then then
DOCKER_IMAGE_NAME=$DOCKERHUB_ORGANIZATION/$BASE_IMAGE BASE_IMAGE=$DOCKERHUB_ORGANIZATION/$BASE_IMAGE
docker pull $DOCKER_IMAGE_NAME docker pull $BASE_IMAGE
else else
# Make sure docker image has been built. Should be instantaneous if so. # Make sure docker image has been built. Should be instantaneous if so.
docker build -t $BASE_IMAGE --force-rm=true tools/dockerfile/interoptest/$BASE_NAME || exit $? docker build -t $BASE_IMAGE --force-rm=true tools/dockerfile/interoptest/$BASE_NAME || exit $?

@ -3952,6 +3952,32 @@
"third_party": false, "third_party": false,
"type": "target" "type": "target"
}, },
{
"deps": [
"gpr",
"gpr_test_util",
"grpc",
"grpc++",
"grpc++_test_util",
"grpc_test_util"
],
"headers": [
"src/proto/grpc/testing/echo.grpc.pb.h",
"src/proto/grpc/testing/echo.pb.h",
"src/proto/grpc/testing/echo_messages.grpc.pb.h",
"src/proto/grpc/testing/echo_messages.pb.h",
"src/proto/grpc/testing/echo_messages_mock.grpc.pb.h",
"src/proto/grpc/testing/echo_mock.grpc.pb.h"
],
"is_filegroup": false,
"language": "c++",
"name": "server_request_call_test",
"src": [
"test/cpp/server/server_request_call_test.cc"
],
"third_party": false,
"type": "target"
},
{ {
"deps": [ "deps": [
"gpr", "gpr",
@ -8894,10 +8920,12 @@
{ {
"deps": [ "deps": [
"gpr", "gpr",
"grpc_base",
"grpc_trace" "grpc_trace"
], ],
"headers": [ "headers": [
"src/core/tsi/fake_transport_security.h", "src/core/tsi/fake_transport_security.h",
"src/core/tsi/gts_transport_security.h",
"src/core/tsi/ssl_transport_security.h", "src/core/tsi/ssl_transport_security.h",
"src/core/tsi/ssl_types.h", "src/core/tsi/ssl_types.h",
"src/core/tsi/transport_security.h", "src/core/tsi/transport_security.h",
@ -8910,6 +8938,8 @@
"src": [ "src": [
"src/core/tsi/fake_transport_security.c", "src/core/tsi/fake_transport_security.c",
"src/core/tsi/fake_transport_security.h", "src/core/tsi/fake_transport_security.h",
"src/core/tsi/gts_transport_security.c",
"src/core/tsi/gts_transport_security.h",
"src/core/tsi/ssl_transport_security.c", "src/core/tsi/ssl_transport_security.c",
"src/core/tsi/ssl_transport_security.h", "src/core/tsi/ssl_transport_security.h",
"src/core/tsi/ssl_types.h", "src/core/tsi/ssl_types.h",

@ -3863,6 +3863,28 @@
"posix" "posix"
] ]
}, },
{
"args": [],
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "server_request_call_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
]
},
{ {
"args": [], "args": [],
"ci_platforms": [ "ci_platforms": [

@ -41,6 +41,8 @@ BANNED_EXCEPT = {
'grpc_closure_sched(' : ['src/core/lib/iomgr/closure.c'], 'grpc_closure_sched(' : ['src/core/lib/iomgr/closure.c'],
'grpc_closure_run(' : ['src/core/lib/iomgr/closure.c'], 'grpc_closure_run(' : ['src/core/lib/iomgr/closure.c'],
'grpc_closure_list_sched(' : ['src/core/lib/iomgr/closure.c'], 'grpc_closure_list_sched(' : ['src/core/lib/iomgr/closure.c'],
'gpr_getenv_silent(' : ['src/core/lib/support/log.c', 'src/core/lib/support/env_linux.c',
'src/core/lib/support/env_posix.c', 'src/core/lib/support/env_windows.c'],
} }
errors = 0 errors = 0

@ -455,6 +455,7 @@
<ClInclude Include="$(SolutionDir)\..\src\core\lib\security\transport\tsi_error.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\lib\security\transport\tsi_error.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\lib\security\util\json_util.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\lib\security\util\json_util.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\tsi\fake_transport_security.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\tsi\fake_transport_security.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\tsi\gts_transport_security.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\tsi\ssl_transport_security.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\tsi\ssl_transport_security.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\tsi\ssl_types.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\tsi\ssl_types.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\tsi\transport_security.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\tsi\transport_security.h" />
@ -879,6 +880,8 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\tsi\fake_transport_security.c"> <ClCompile Include="$(SolutionDir)\..\src\core\tsi\fake_transport_security.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\tsi\gts_transport_security.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\tsi\ssl_transport_security.c"> <ClCompile Include="$(SolutionDir)\..\src\core\tsi\ssl_transport_security.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\tsi\transport_security.c"> <ClCompile Include="$(SolutionDir)\..\src\core\tsi\transport_security.c">

@ -538,6 +538,9 @@
<ClCompile Include="$(SolutionDir)\..\src\core\tsi\fake_transport_security.c"> <ClCompile Include="$(SolutionDir)\..\src\core\tsi\fake_transport_security.c">
<Filter>src\core\tsi</Filter> <Filter>src\core\tsi</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\tsi\gts_transport_security.c">
<Filter>src\core\tsi</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\tsi\ssl_transport_security.c"> <ClCompile Include="$(SolutionDir)\..\src\core\tsi\ssl_transport_security.c">
<Filter>src\core\tsi</Filter> <Filter>src\core\tsi</Filter>
</ClCompile> </ClCompile>
@ -1319,6 +1322,9 @@
<ClInclude Include="$(SolutionDir)\..\src\core\tsi\fake_transport_security.h"> <ClInclude Include="$(SolutionDir)\..\src\core\tsi\fake_transport_security.h">
<Filter>src\core\tsi</Filter> <Filter>src\core\tsi</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\tsi\gts_transport_security.h">
<Filter>src\core\tsi</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\tsi\ssl_transport_security.h"> <ClInclude Include="$(SolutionDir)\..\src\core\tsi\ssl_transport_security.h">
<Filter>src\core\tsi</Filter> <Filter>src\core\tsi</Filter>
</ClInclude> </ClInclude>

@ -0,0 +1,223 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\1.0.204.1.props')" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F33164EE-1406-7E49-E894-7E795146B882}</ProjectGuid>
<IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected>
<IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration">
<PlatformToolset>v100</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration">
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration">
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'" Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)\..\vsprojects\cpptest.props" />
<Import Project="$(SolutionDir)\..\vsprojects\global.props" />
<Import Project="$(SolutionDir)\..\vsprojects\openssl.props" />
<Import Project="$(SolutionDir)\..\vsprojects\protobuf.props" />
<Import Project="$(SolutionDir)\..\vsprojects\winsock.props" />
<Import Project="$(SolutionDir)\..\vsprojects\zlib.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>server_request_call_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>server_request_call_test</TargetName>
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib>
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl>
<Configuration-grpc_dependencies_openssl>Release</Configuration-grpc_dependencies_openssl>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatWarningAsError>true</TreatWarningAsError>
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat>
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="$(SolutionDir)\..\src\proto\grpc\testing\echo_messages.pb.cc">
</ClCompile>
<ClInclude Include="$(SolutionDir)\..\src\proto\grpc\testing\echo_messages.pb.h">
</ClInclude>
<ClCompile Include="$(SolutionDir)\..\src\proto\grpc\testing\echo_messages.grpc.pb.cc">
</ClCompile>
<ClInclude Include="$(SolutionDir)\..\src\proto\grpc\testing\echo_messages.grpc.pb.h">
</ClInclude>
<ClCompile Include="$(SolutionDir)\..\src\proto\grpc\testing\echo.pb.cc">
</ClCompile>
<ClInclude Include="$(SolutionDir)\..\src\proto\grpc\testing\echo.pb.h">
</ClInclude>
<ClCompile Include="$(SolutionDir)\..\src\proto\grpc\testing\echo.grpc.pb.cc">
</ClCompile>
<ClInclude Include="$(SolutionDir)\..\src\proto\grpc\testing\echo.grpc.pb.h">
</ClInclude>
<ClCompile Include="$(SolutionDir)\..\test\cpp\server\server_request_call_test.cc">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++_test_util\grpc++_test_util.vcxproj">
<Project>{0BE77741-552A-929B-A497-4EF7ECE17A64}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc_test_util\grpc_test_util.vcxproj">
<Project>{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\gpr_test_util\gpr_test_util.vcxproj">
<Project>{EAB0A629-17A9-44DB-B5FF-E91A721FE037}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj">
<Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj">
<Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\gpr\gpr.vcxproj">
<Project>{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" />
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" />
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" />
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" />
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" />
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" />
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" />
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" />
</Target>
</Project>

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="$(SolutionDir)\..\src\proto\grpc\testing\echo_messages.proto">
<Filter>src\proto\grpc\testing</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\proto\grpc\testing\echo.proto">
<Filter>src\proto\grpc\testing</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\test\cpp\server\server_request_call_test.cc">
<Filter>test\cpp\server</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="src">
<UniqueIdentifier>{48583c1d-014b-ecf7-ece7-98145537c913}</UniqueIdentifier>
</Filter>
<Filter Include="src\proto">
<UniqueIdentifier>{f931e5e2-7d0e-a8d9-b072-1ed8095387a3}</UniqueIdentifier>
</Filter>
<Filter Include="src\proto\grpc">
<UniqueIdentifier>{55f7d797-a139-d9c5-8cc3-7fde09c1d28b}</UniqueIdentifier>
</Filter>
<Filter Include="src\proto\grpc\testing">
<UniqueIdentifier>{1b39e313-5219-fbc1-9d88-9154b406e4ba}</UniqueIdentifier>
</Filter>
<Filter Include="test">
<UniqueIdentifier>{613e68e0-6bd4-3936-f8c2-34e255688225}</UniqueIdentifier>
</Filter>
<Filter Include="test\cpp">
<UniqueIdentifier>{871d6909-5ab9-336d-41ea-380563fcd3b3}</UniqueIdentifier>
</Filter>
<Filter Include="test\cpp\server">
<UniqueIdentifier>{4939f87e-df84-7c23-cd10-c23c06c72683}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
Loading…
Cancel
Save