Merge github.com:grpc/grpc into epex3

pull/10507/head
Craig Tiller 8 years ago
commit cacaa1950d
  1. 22
      BUILD
  2. 123
      CMakeLists.txt
  3. 163
      Makefile
  4. 6
      binding.gyp
  5. 24
      build.yaml
  6. 1
      config.m4
  7. 2
      examples/csharp/helloworld-from-cli/global.json
  8. 3
      gRPC-Core.podspec
  9. 2
      grpc.gemspec
  10. 2
      include/grpc++/impl/codegen/status.h
  11. 61
      include/grpc++/support/error_details.h
  12. 3
      include/grpc/impl/codegen/grpc_types.h
  13. 2
      package.xml
  14. 85
      src/core/ext/transport/chttp2/transport/chttp2_transport.c
  15. 45
      src/core/ext/transport/chttp2/transport/frame_settings.c
  16. 30
      src/core/ext/transport/chttp2/transport/frame_settings.h
  17. 101
      src/core/ext/transport/chttp2/transport/hpack_encoder.c
  18. 15
      src/core/ext/transport/chttp2/transport/hpack_encoder.h
  19. 26
      src/core/ext/transport/chttp2/transport/hpack_parser.c
  20. 75
      src/core/ext/transport/chttp2/transport/http2_settings.c
  21. 74
      src/core/ext/transport/chttp2/transport/http2_settings.h
  22. 36
      src/core/ext/transport/chttp2/transport/writing.c
  23. 3
      src/core/ext/transport/cronet/transport/cronet_transport.c
  24. 4
      src/core/lib/channel/message_size_filter.c
  25. 3
      src/core/lib/iomgr/resolve_address_uv.c
  26. 4
      src/core/lib/iomgr/sockaddr_utils.c
  27. 2
      src/core/lib/security/credentials/credentials.h
  28. 6
      src/core/lib/slice/slice.c
  29. 1
      src/core/lib/transport/pid_controller.c
  30. 62
      src/cpp/util/error_details.cc
  31. 35
      src/csharp/Grpc.Auth/project.json
  32. 39
      src/csharp/Grpc.Core.Testing/project.json
  33. 35
      src/csharp/Grpc.HealthCheck/project.json
  34. 35
      src/csharp/Grpc.Reflection/project.json
  35. 85
      src/node/ext/call.cc
  36. 9
      src/node/ext/call.h
  37. 2
      src/node/ext/call_credentials.cc
  38. 2
      src/node/ext/channel.cc
  39. 12
      src/node/ext/node_grpc.cc
  40. 4
      src/node/ext/server.cc
  41. 3
      src/node/ext/server_uv.cc
  42. 9
      src/objective-c/tests/InteropTests.m
  43. 43
      src/proto/grpc/status/BUILD
  44. 2
      src/proto/grpc/status/README
  45. 92
      src/proto/grpc/status/status.proto
  46. 1
      src/python/grpcio/grpc_core_dependencies.py
  47. 44
      src/ruby/spec/generic/rpc_server_pool_spec.rb
  48. 4
      templates/CMakeLists.txt.template
  49. 5
      templates/binding.gyp.template
  50. 2
      test/core/security/credentials_test.c
  51. 61
      test/core/transport/chttp2/hpack_encoder_test.c
  52. 154
      test/cpp/microbenchmarks/bm_chttp2_hpack.cc
  53. 16
      test/cpp/util/BUILD
  54. 120
      test/cpp/util/error_details_test.cc
  55. 184
      tools/codegen/core/gen_settings_ids.py
  56. 2
      tools/distrib/check_copyright.py
  57. 7
      tools/dockerfile/test/bazel/Dockerfile
  58. 2
      tools/doxygen/Doxyfile.core.internal
  59. 23
      tools/gce/linux_performance_worker_init.sh
  60. 12
      tools/gce/linux_worker_init.sh
  61. 2
      tools/internal_ci/README.md
  62. 2
      tools/internal_ci/linux/grpc_portability.cfg
  63. 2
      tools/internal_ci/linux/sanitizer/grpc_c_asan.cfg
  64. 4
      tools/internal_ci/linux/sanitizer/grpc_c_asan.sh
  65. 39
      tools/internal_ci/linux/sanitizer/grpc_c_msan.cfg
  66. 40
      tools/internal_ci/linux/sanitizer/grpc_c_msan.sh
  67. 39
      tools/internal_ci/linux/sanitizer/grpc_c_tsan.cfg
  68. 40
      tools/internal_ci/linux/sanitizer/grpc_c_tsan.sh
  69. 39
      tools/internal_ci/linux/sanitizer/grpc_cpp_asan.cfg
  70. 40
      tools/internal_ci/linux/sanitizer/grpc_cpp_asan.sh
  71. 39
      tools/internal_ci/linux/sanitizer/grpc_cpp_tsan.cfg
  72. 40
      tools/internal_ci/linux/sanitizer/grpc_cpp_tsan.sh
  73. 2
      tools/profiling/microbenchmarks/bm_diff.py
  74. 1
      tools/profiling/microbenchmarks/bm_json.py
  75. 40
      tools/run_tests/generated/sources_and_headers.json
  76. 38
      tools/run_tests/generated/tests.json
  77. 20
      tools/run_tests/performance/scenario_config.py
  78. 24
      vsprojects/grpc.sln
  79. 178
      vsprojects/vcxproj/grpc++_error_details/grpc++_error_details.vcxproj
  80. 47
      vsprojects/vcxproj/grpc++_error_details/grpc++_error_details.vcxproj.filters
  81. 3
      vsprojects/vcxproj/grpc/grpc.vcxproj
  82. 6
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  83. 3
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
  84. 6
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
  85. 203
      vsprojects/vcxproj/test/error_details_test/error_details_test.vcxproj
  86. 36
      vsprojects/vcxproj/test/error_details_test/error_details_test.vcxproj.filters

22
BUILD

@ -164,6 +164,22 @@ grpc_cc_library(
], ],
) )
grpc_cc_library(
name = "grpc++_error_details",
srcs = [
"src/cpp/util/error_details.cc",
],
hdrs = [
"include/grpc++/support/error_details.h",
],
language = "c++",
standalone = True,
deps = [
"grpc++",
"//src/proto/grpc/status:status_proto",
],
)
grpc_cc_library( grpc_cc_library(
name = "grpc_plugin_support", name = "grpc_plugin_support",
srcs = [ srcs = [
@ -457,7 +473,6 @@ grpc_cc_library(
"src/core/lib/iomgr/endpoint_pair_windows.c", "src/core/lib/iomgr/endpoint_pair_windows.c",
"src/core/lib/iomgr/error.c", "src/core/lib/iomgr/error.c",
"src/core/lib/iomgr/ev_epoll_linux.c", "src/core/lib/iomgr/ev_epoll_linux.c",
"src/core/lib/iomgr/lockfree_event.c",
"src/core/lib/iomgr/ev_poll_posix.c", "src/core/lib/iomgr/ev_poll_posix.c",
"src/core/lib/iomgr/ev_posix.c", "src/core/lib/iomgr/ev_posix.c",
"src/core/lib/iomgr/exec_ctx.c", "src/core/lib/iomgr/exec_ctx.c",
@ -468,6 +483,7 @@ grpc_cc_library(
"src/core/lib/iomgr/iomgr_uv.c", "src/core/lib/iomgr/iomgr_uv.c",
"src/core/lib/iomgr/iomgr_windows.c", "src/core/lib/iomgr/iomgr_windows.c",
"src/core/lib/iomgr/load_file.c", "src/core/lib/iomgr/load_file.c",
"src/core/lib/iomgr/lockfree_event.c",
"src/core/lib/iomgr/network_status_tracker.c", "src/core/lib/iomgr/network_status_tracker.c",
"src/core/lib/iomgr/polling_entity.c", "src/core/lib/iomgr/polling_entity.c",
"src/core/lib/iomgr/pollset_set_uv.c", "src/core/lib/iomgr/pollset_set_uv.c",
@ -584,7 +600,6 @@ grpc_cc_library(
"src/core/lib/iomgr/error.h", "src/core/lib/iomgr/error.h",
"src/core/lib/iomgr/error_internal.h", "src/core/lib/iomgr/error_internal.h",
"src/core/lib/iomgr/ev_epoll_linux.h", "src/core/lib/iomgr/ev_epoll_linux.h",
"src/core/lib/iomgr/lockfree_event.h",
"src/core/lib/iomgr/ev_poll_posix.h", "src/core/lib/iomgr/ev_poll_posix.h",
"src/core/lib/iomgr/ev_posix.h", "src/core/lib/iomgr/ev_posix.h",
"src/core/lib/iomgr/exec_ctx.h", "src/core/lib/iomgr/exec_ctx.h",
@ -594,6 +609,7 @@ grpc_cc_library(
"src/core/lib/iomgr/iomgr_internal.h", "src/core/lib/iomgr/iomgr_internal.h",
"src/core/lib/iomgr/iomgr_posix.h", "src/core/lib/iomgr/iomgr_posix.h",
"src/core/lib/iomgr/load_file.h", "src/core/lib/iomgr/load_file.h",
"src/core/lib/iomgr/lockfree_event.h",
"src/core/lib/iomgr/network_status_tracker.h", "src/core/lib/iomgr/network_status_tracker.h",
"src/core/lib/iomgr/polling_entity.h", "src/core/lib/iomgr/polling_entity.h",
"src/core/lib/iomgr/pollset.h", "src/core/lib/iomgr/pollset.h",
@ -980,6 +996,7 @@ grpc_cc_library(
"src/core/ext/transport/chttp2/transport/frame_ping.c", "src/core/ext/transport/chttp2/transport/frame_ping.c",
"src/core/ext/transport/chttp2/transport/frame_rst_stream.c", "src/core/ext/transport/chttp2/transport/frame_rst_stream.c",
"src/core/ext/transport/chttp2/transport/frame_settings.c", "src/core/ext/transport/chttp2/transport/frame_settings.c",
"src/core/ext/transport/chttp2/transport/http2_settings.c",
"src/core/ext/transport/chttp2/transport/frame_window_update.c", "src/core/ext/transport/chttp2/transport/frame_window_update.c",
"src/core/ext/transport/chttp2/transport/hpack_encoder.c", "src/core/ext/transport/chttp2/transport/hpack_encoder.c",
"src/core/ext/transport/chttp2/transport/hpack_parser.c", "src/core/ext/transport/chttp2/transport/hpack_parser.c",
@ -1002,6 +1019,7 @@ grpc_cc_library(
"src/core/ext/transport/chttp2/transport/frame_ping.h", "src/core/ext/transport/chttp2/transport/frame_ping.h",
"src/core/ext/transport/chttp2/transport/frame_rst_stream.h", "src/core/ext/transport/chttp2/transport/frame_rst_stream.h",
"src/core/ext/transport/chttp2/transport/frame_settings.h", "src/core/ext/transport/chttp2/transport/frame_settings.h",
"src/core/ext/transport/chttp2/transport/http2_settings.h",
"src/core/ext/transport/chttp2/transport/frame_window_update.h", "src/core/ext/transport/chttp2/transport/frame_window_update.h",
"src/core/ext/transport/chttp2/transport/hpack_encoder.h", "src/core/ext/transport/chttp2/transport/hpack_encoder.h",
"src/core/ext/transport/chttp2/transport/hpack_parser.h", "src/core/ext/transport/chttp2/transport/hpack_parser.h",

@ -167,6 +167,7 @@ if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module")
if(NOT PROTOBUF_ROOT_DIR) if(NOT PROTOBUF_ROOT_DIR)
set(PROTOBUF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/protobuf) set(PROTOBUF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/protobuf)
endif() endif()
set(PROTOBUF_WELLKNOWN_IMPORT_DIR ${PROTOBUF_ROOT_DIR}/src)
if(EXISTS "${PROTOBUF_ROOT_DIR}/cmake/CMakeLists.txt") if(EXISTS "${PROTOBUF_ROOT_DIR}/cmake/CMakeLists.txt")
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link static runtime libraries") set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link static runtime libraries")
add_subdirectory(${PROTOBUF_ROOT_DIR}/cmake third_party/protobuf) add_subdirectory(${PROTOBUF_ROOT_DIR}/cmake third_party/protobuf)
@ -199,6 +200,7 @@ elseif("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "package")
find_package(Protobuf MODULE) find_package(Protobuf MODULE)
set(_gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND)\n find_package(Protobuf)\nendif()") set(_gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND)\n find_package(Protobuf)\nendif()")
endif() endif()
set(PROTOBUF_WELLKNOWN_IMPORT_DIR /usr/local/include)
endif() endif()
if("${gRPC_SSL_PROVIDER}" STREQUAL "module") if("${gRPC_SSL_PROVIDER}" STREQUAL "module")
@ -301,7 +303,7 @@ function(protobuf_generate_grpc_cpp)
return() return()
endif() endif()
set(_protobuf_include_path -I .) set(_protobuf_include_path -I . -I ${PROTOBUF_WELLKNOWN_IMPORT_DIR})
foreach(FIL ${ARGN}) foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE) get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE) get_filename_component(FIL_WE ${FIL} NAME_WE)
@ -661,6 +663,7 @@ add_dependencies(buildtests_cxx cxx_slice_test)
add_dependencies(buildtests_cxx cxx_string_ref_test) add_dependencies(buildtests_cxx cxx_string_ref_test)
add_dependencies(buildtests_cxx cxx_time_test) add_dependencies(buildtests_cxx cxx_time_test)
add_dependencies(buildtests_cxx end2end_test) add_dependencies(buildtests_cxx end2end_test)
add_dependencies(buildtests_cxx error_details_test)
add_dependencies(buildtests_cxx filter_end2end_test) add_dependencies(buildtests_cxx filter_end2end_test)
add_dependencies(buildtests_cxx generic_end2end_test) add_dependencies(buildtests_cxx generic_end2end_test)
add_dependencies(buildtests_cxx golden_file_test) add_dependencies(buildtests_cxx golden_file_test)
@ -1047,6 +1050,7 @@ add_library(grpc
src/core/ext/transport/chttp2/transport/hpack_encoder.c src/core/ext/transport/chttp2/transport/hpack_encoder.c
src/core/ext/transport/chttp2/transport/hpack_parser.c src/core/ext/transport/chttp2/transport/hpack_parser.c
src/core/ext/transport/chttp2/transport/hpack_table.c src/core/ext/transport/chttp2/transport/hpack_table.c
src/core/ext/transport/chttp2/transport/http2_settings.c
src/core/ext/transport/chttp2/transport/huffsyms.c src/core/ext/transport/chttp2/transport/huffsyms.c
src/core/ext/transport/chttp2/transport/incoming_metadata.c src/core/ext/transport/chttp2/transport/incoming_metadata.c
src/core/ext/transport/chttp2/transport/parsing.c src/core/ext/transport/chttp2/transport/parsing.c
@ -1374,6 +1378,7 @@ add_library(grpc_cronet
src/core/ext/transport/chttp2/transport/hpack_encoder.c src/core/ext/transport/chttp2/transport/hpack_encoder.c
src/core/ext/transport/chttp2/transport/hpack_parser.c src/core/ext/transport/chttp2/transport/hpack_parser.c
src/core/ext/transport/chttp2/transport/hpack_table.c src/core/ext/transport/chttp2/transport/hpack_table.c
src/core/ext/transport/chttp2/transport/http2_settings.c
src/core/ext/transport/chttp2/transport/huffsyms.c src/core/ext/transport/chttp2/transport/huffsyms.c
src/core/ext/transport/chttp2/transport/incoming_metadata.c src/core/ext/transport/chttp2/transport/incoming_metadata.c
src/core/ext/transport/chttp2/transport/parsing.c src/core/ext/transport/chttp2/transport/parsing.c
@ -1944,6 +1949,7 @@ add_library(grpc_unsecure
src/core/ext/transport/chttp2/transport/hpack_encoder.c src/core/ext/transport/chttp2/transport/hpack_encoder.c
src/core/ext/transport/chttp2/transport/hpack_parser.c src/core/ext/transport/chttp2/transport/hpack_parser.c
src/core/ext/transport/chttp2/transport/hpack_table.c src/core/ext/transport/chttp2/transport/hpack_table.c
src/core/ext/transport/chttp2/transport/http2_settings.c
src/core/ext/transport/chttp2/transport/huffsyms.c src/core/ext/transport/chttp2/transport/huffsyms.c
src/core/ext/transport/chttp2/transport/incoming_metadata.c src/core/ext/transport/chttp2/transport/incoming_metadata.c
src/core/ext/transport/chttp2/transport/parsing.c src/core/ext/transport/chttp2/transport/parsing.c
@ -2699,6 +2705,7 @@ add_library(grpc++_cronet
src/core/ext/transport/chttp2/transport/hpack_encoder.c src/core/ext/transport/chttp2/transport/hpack_encoder.c
src/core/ext/transport/chttp2/transport/hpack_parser.c src/core/ext/transport/chttp2/transport/hpack_parser.c
src/core/ext/transport/chttp2/transport/hpack_table.c src/core/ext/transport/chttp2/transport/hpack_table.c
src/core/ext/transport/chttp2/transport/http2_settings.c
src/core/ext/transport/chttp2/transport/huffsyms.c src/core/ext/transport/chttp2/transport/huffsyms.c
src/core/ext/transport/chttp2/transport/incoming_metadata.c src/core/ext/transport/chttp2/transport/incoming_metadata.c
src/core/ext/transport/chttp2/transport/parsing.c src/core/ext/transport/chttp2/transport/parsing.c
@ -2906,6 +2913,72 @@ if (gRPC_INSTALL)
) )
endif() endif()
add_library(grpc++_error_details
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/status/status.grpc.pb.h
src/cpp/util/error_details.cc
)
if(WIN32 AND MSVC)
set_target_properties(grpc++_error_details PROPERTIES COMPILE_PDB_NAME "grpc++_error_details"
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)
if (gRPC_INSTALL)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/grpc++_error_details.pdb
DESTINATION ${CMAKE_INSTALL_LIBDIR} OPTIONAL
)
endif()
endif()
protobuf_generate_grpc_cpp(
src/proto/grpc/status/status.proto
)
target_include_directories(grpc++_error_details
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
PRIVATE ${PROTOBUF_ROOT_DIR}/src
PRIVATE ${ZLIB_INCLUDE_DIR}
PRIVATE ${BENCHMARK}/include
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 ${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(grpc++_error_details
${_gRPC_BASELIB_LIBRARIES}
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc++
)
foreach(_hdr
include/grpc++/support/error_details.h
)
string(REPLACE "include/" "" _path ${_hdr})
get_filename_component(_path ${_path} PATH)
install(FILES ${_hdr}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${_path}"
)
endforeach()
if (gRPC_INSTALL)
install(TARGETS grpc++_error_details EXPORT gRPCTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
if (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS)
add_library(grpc++_proto_reflection_desc_db add_library(grpc++_proto_reflection_desc_db
@ -8995,7 +9068,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_executable(bm_cq_multiple_threads add_executable(bm_cq_multiple_threads
test/cpp/microbenchmarks/bm_cq_multiple_threads.cc test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
third_party/googletest/src/gtest-all.cc third_party/googletest/googletest/src/gtest-all.cc
) )
@ -9012,8 +9085,8 @@ target_include_directories(bm_cq_multiple_threads
PRIVATE ${CARES_PLATFORM_INCLUDE_DIR} PRIVATE ${CARES_PLATFORM_INCLUDE_DIR}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include
PRIVATE third_party/googletest/include PRIVATE third_party/googletest/googletest/include
PRIVATE third_party/googletest PRIVATE third_party/googletest/googletest
PRIVATE ${_gRPC_PROTO_GENS_DIR} PRIVATE ${_gRPC_PROTO_GENS_DIR}
) )
@ -9891,6 +9964,48 @@ target_link_libraries(end2end_test
endif (gRPC_BUILD_TESTS) endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS) if (gRPC_BUILD_TESTS)
add_executable(error_details_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
test/cpp/util/error_details_test.cc
third_party/googletest/googletest/src/gtest-all.cc
)
protobuf_generate_grpc_cpp(
src/proto/grpc/testing/echo_messages.proto
)
target_include_directories(error_details_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 ${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(error_details_test
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
grpc++_error_details
grpc++
${_gRPC_GFLAGS_LIBRARIES}
)
endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
add_executable(filter_end2end_test add_executable(filter_end2end_test
test/cpp/end2end/filter_end2end_test.cc test/cpp/end2end/filter_end2end_test.cc
third_party/googletest/googletest/src/gtest-all.cc third_party/googletest/googletest/src/gtest-all.cc

@ -1126,6 +1126,7 @@ cxx_slice_test: $(BINDIR)/$(CONFIG)/cxx_slice_test
cxx_string_ref_test: $(BINDIR)/$(CONFIG)/cxx_string_ref_test cxx_string_ref_test: $(BINDIR)/$(CONFIG)/cxx_string_ref_test
cxx_time_test: $(BINDIR)/$(CONFIG)/cxx_time_test cxx_time_test: $(BINDIR)/$(CONFIG)/cxx_time_test
end2end_test: $(BINDIR)/$(CONFIG)/end2end_test end2end_test: $(BINDIR)/$(CONFIG)/end2end_test
error_details_test: $(BINDIR)/$(CONFIG)/error_details_test
filter_end2end_test: $(BINDIR)/$(CONFIG)/filter_end2end_test filter_end2end_test: $(BINDIR)/$(CONFIG)/filter_end2end_test
generic_end2end_test: $(BINDIR)/$(CONFIG)/generic_end2end_test generic_end2end_test: $(BINDIR)/$(CONFIG)/generic_end2end_test
golden_file_test: $(BINDIR)/$(CONFIG)/golden_file_test golden_file_test: $(BINDIR)/$(CONFIG)/golden_file_test
@ -1305,12 +1306,12 @@ static: static_c static_cxx
static_c: pc_c pc_c_unsecure cache.mk $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc_cronet.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a static_c: pc_c pc_c_unsecure cache.mk $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc_cronet.a $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.a
static_cxx: pc_cxx pc_cxx_unsecure cache.mk $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_cronet.a $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a static_cxx: pc_cxx pc_cxx_unsecure cache.mk $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_cronet.a $(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure.a
shared: shared_c shared_cxx shared: shared_c shared_cxx
shared_c: pc_c pc_c_unsecure cache.mk $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) shared_c: pc_c pc_c_unsecure cache.mk $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)
shared_cxx: pc_cxx pc_cxx_unsecure cache.mk $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) shared_cxx: pc_cxx pc_cxx_unsecure cache.mk $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)
shared_csharp: shared_c $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) shared_csharp: shared_c $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP)
grpc_csharp_ext: shared_csharp grpc_csharp_ext: shared_csharp
@ -1552,6 +1553,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/cxx_string_ref_test \ $(BINDIR)/$(CONFIG)/cxx_string_ref_test \
$(BINDIR)/$(CONFIG)/cxx_time_test \ $(BINDIR)/$(CONFIG)/cxx_time_test \
$(BINDIR)/$(CONFIG)/end2end_test \ $(BINDIR)/$(CONFIG)/end2end_test \
$(BINDIR)/$(CONFIG)/error_details_test \
$(BINDIR)/$(CONFIG)/filter_end2end_test \ $(BINDIR)/$(CONFIG)/filter_end2end_test \
$(BINDIR)/$(CONFIG)/generic_end2end_test \ $(BINDIR)/$(CONFIG)/generic_end2end_test \
$(BINDIR)/$(CONFIG)/golden_file_test \ $(BINDIR)/$(CONFIG)/golden_file_test \
@ -1671,6 +1673,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/cxx_string_ref_test \ $(BINDIR)/$(CONFIG)/cxx_string_ref_test \
$(BINDIR)/$(CONFIG)/cxx_time_test \ $(BINDIR)/$(CONFIG)/cxx_time_test \
$(BINDIR)/$(CONFIG)/end2end_test \ $(BINDIR)/$(CONFIG)/end2end_test \
$(BINDIR)/$(CONFIG)/error_details_test \
$(BINDIR)/$(CONFIG)/filter_end2end_test \ $(BINDIR)/$(CONFIG)/filter_end2end_test \
$(BINDIR)/$(CONFIG)/generic_end2end_test \ $(BINDIR)/$(CONFIG)/generic_end2end_test \
$(BINDIR)/$(CONFIG)/golden_file_test \ $(BINDIR)/$(CONFIG)/golden_file_test \
@ -2040,6 +2043,8 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/cxx_time_test || ( echo test cxx_time_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/cxx_time_test || ( echo test cxx_time_test failed ; exit 1 )
$(E) "[RUN] Testing end2end_test" $(E) "[RUN] Testing end2end_test"
$(Q) $(BINDIR)/$(CONFIG)/end2end_test || ( echo test end2end_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/end2end_test || ( echo test end2end_test failed ; exit 1 )
$(E) "[RUN] Testing error_details_test"
$(Q) $(BINDIR)/$(CONFIG)/error_details_test || ( echo test error_details_test failed ; exit 1 )
$(E) "[RUN] Testing filter_end2end_test" $(E) "[RUN] Testing filter_end2end_test"
$(Q) $(BINDIR)/$(CONFIG)/filter_end2end_test || ( echo test filter_end2end_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/filter_end2end_test || ( echo test filter_end2end_test failed ; exit 1 )
$(E) "[RUN] Testing generic_end2end_test" $(E) "[RUN] Testing generic_end2end_test"
@ -2144,6 +2149,8 @@ ifeq ($(CONFIG),opt)
$(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++.a
$(E) "[STRIP] Stripping libgrpc++_cronet.a" $(E) "[STRIP] Stripping libgrpc++_cronet.a"
$(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet.a $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet.a
$(E) "[STRIP] Stripping libgrpc++_error_details.a"
$(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a
$(E) "[STRIP] Stripping libgrpc++_reflection.a" $(E) "[STRIP] Stripping libgrpc++_reflection.a"
$(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a
$(E) "[STRIP] Stripping libgrpc++_unsecure.a" $(E) "[STRIP] Stripping libgrpc++_unsecure.a"
@ -2168,6 +2175,8 @@ ifeq ($(CONFIG),opt)
$(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)
$(E) "[STRIP] Stripping $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[STRIP] Stripping $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
$(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)
$(E) "[STRIP] Stripping $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
$(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)
$(E) "[STRIP] Stripping $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[STRIP] Stripping $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
$(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(Q) $(STRIP) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)
$(E) "[STRIP] Stripping $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[STRIP] Stripping $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
@ -2249,6 +2258,21 @@ $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc: src/proto/grp
$(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $< $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $<
endif endif
ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/status/status.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/status/status.grpc.pb.cc: protoc_dep_error
else
$(GENDIR)/src/proto/grpc/status/status.pb.cc: src/proto/grpc/status/status.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --cpp_out=$(GENDIR) $<
$(GENDIR)/src/proto/grpc/status/status.grpc.pb.cc: src/proto/grpc/status/status.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $<
endif
ifeq ($(NO_PROTOC),true) ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: protoc_dep_error $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: protoc_dep_error
@ -2507,6 +2531,9 @@ install-static_cxx: static_cxx strip-static_cxx install-pkg-config_cxx
$(E) "[INSTALL] Installing libgrpc++_cronet.a" $(E) "[INSTALL] Installing libgrpc++_cronet.a"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet.a $(prefix)/lib/libgrpc++_cronet.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet.a $(prefix)/lib/libgrpc++_cronet.a
$(E) "[INSTALL] Installing libgrpc++_error_details.a"
$(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a $(prefix)/lib/libgrpc++_error_details.a
$(E) "[INSTALL] Installing libgrpc++_reflection.a" $(E) "[INSTALL] Installing libgrpc++_reflection.a"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(prefix)/lib/libgrpc++_reflection.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection.a $(prefix)/lib/libgrpc++_reflection.a
@ -2578,6 +2605,15 @@ ifeq ($(SYSTEM),MINGW32)
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.3 $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.3
$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so
endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
$(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/$(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)
ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_error_details.a
else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so.3
$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_error_details.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
@ -2954,6 +2990,7 @@ LIBGRPC_SRC = \
src/core/ext/transport/chttp2/transport/hpack_encoder.c \ src/core/ext/transport/chttp2/transport/hpack_encoder.c \
src/core/ext/transport/chttp2/transport/hpack_parser.c \ src/core/ext/transport/chttp2/transport/hpack_parser.c \
src/core/ext/transport/chttp2/transport/hpack_table.c \ src/core/ext/transport/chttp2/transport/hpack_table.c \
src/core/ext/transport/chttp2/transport/http2_settings.c \
src/core/ext/transport/chttp2/transport/huffsyms.c \ src/core/ext/transport/chttp2/transport/huffsyms.c \
src/core/ext/transport/chttp2/transport/incoming_metadata.c \ src/core/ext/transport/chttp2/transport/incoming_metadata.c \
src/core/ext/transport/chttp2/transport/parsing.c \ src/core/ext/transport/chttp2/transport/parsing.c \
@ -3279,6 +3316,7 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/transport/chttp2/transport/hpack_encoder.c \ src/core/ext/transport/chttp2/transport/hpack_encoder.c \
src/core/ext/transport/chttp2/transport/hpack_parser.c \ src/core/ext/transport/chttp2/transport/hpack_parser.c \
src/core/ext/transport/chttp2/transport/hpack_table.c \ src/core/ext/transport/chttp2/transport/hpack_table.c \
src/core/ext/transport/chttp2/transport/http2_settings.c \
src/core/ext/transport/chttp2/transport/huffsyms.c \ src/core/ext/transport/chttp2/transport/huffsyms.c \
src/core/ext/transport/chttp2/transport/incoming_metadata.c \ src/core/ext/transport/chttp2/transport/incoming_metadata.c \
src/core/ext/transport/chttp2/transport/parsing.c \ src/core/ext/transport/chttp2/transport/parsing.c \
@ -3820,6 +3858,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/transport/chttp2/transport/hpack_encoder.c \ src/core/ext/transport/chttp2/transport/hpack_encoder.c \
src/core/ext/transport/chttp2/transport/hpack_parser.c \ src/core/ext/transport/chttp2/transport/hpack_parser.c \
src/core/ext/transport/chttp2/transport/hpack_table.c \ src/core/ext/transport/chttp2/transport/hpack_table.c \
src/core/ext/transport/chttp2/transport/http2_settings.c \
src/core/ext/transport/chttp2/transport/huffsyms.c \ src/core/ext/transport/chttp2/transport/huffsyms.c \
src/core/ext/transport/chttp2/transport/incoming_metadata.c \ src/core/ext/transport/chttp2/transport/incoming_metadata.c \
src/core/ext/transport/chttp2/transport/parsing.c \ src/core/ext/transport/chttp2/transport/parsing.c \
@ -4560,6 +4599,7 @@ LIBGRPC++_CRONET_SRC = \
src/core/ext/transport/chttp2/transport/hpack_encoder.c \ src/core/ext/transport/chttp2/transport/hpack_encoder.c \
src/core/ext/transport/chttp2/transport/hpack_parser.c \ src/core/ext/transport/chttp2/transport/hpack_parser.c \
src/core/ext/transport/chttp2/transport/hpack_table.c \ src/core/ext/transport/chttp2/transport/hpack_table.c \
src/core/ext/transport/chttp2/transport/http2_settings.c \
src/core/ext/transport/chttp2/transport/huffsyms.c \ src/core/ext/transport/chttp2/transport/huffsyms.c \
src/core/ext/transport/chttp2/transport/incoming_metadata.c \ src/core/ext/transport/chttp2/transport/incoming_metadata.c \
src/core/ext/transport/chttp2/transport/parsing.c \ src/core/ext/transport/chttp2/transport/parsing.c \
@ -4776,6 +4816,77 @@ endif
endif endif
LIBGRPC++_ERROR_DETAILS_SRC = \
$(GENDIR)/src/proto/grpc/status/status.pb.cc $(GENDIR)/src/proto/grpc/status/status.grpc.pb.cc \
src/cpp/util/error_details.cc \
PUBLIC_HEADERS_CXX += \
include/grpc++/support/error_details.h \
LIBGRPC++_ERROR_DETAILS_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC++_ERROR_DETAILS_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure libraries if you don't have OpenSSL.
$(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a: openssl_dep_error
$(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): openssl_dep_error
else
ifeq ($(NO_PROTOBUF),true)
# You can't build a C++ library if you don't have protobuf - a bit overreached, but still okay.
$(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a: protobuf_dep_error
$(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): protobuf_dep_error
else
$(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBGRPC++_ERROR_DETAILS_OBJS) $(LIBGPR_OBJS) $(ZLIB_MERGE_OBJS) $(CARES_MERGE_OBJS)
$(E) "[AR] Creating $@"
$(Q) mkdir -p `dirname $@`
$(Q) rm -f $(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a
$(Q) $(AR) $(AROPTS) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a $(LIBGRPC++_ERROR_DETAILS_OBJS) $(LIBGPR_OBJS) $(ZLIB_MERGE_OBJS) $(CARES_MERGE_OBJS)
ifeq ($(SYSTEM),Darwin)
$(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a
endif
ifeq ($(SYSTEM),MINGW32)
$(LIBDIR)/$(CONFIG)/grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_ERROR_DETAILS_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(OPENSSL_DEP)
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_error_details$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_ERROR_DETAILS_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++$(SHARED_VERSION_CPP)-dll
else
$(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_ERROR_DETAILS_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT_CPP) $(OPENSSL_DEP)
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_ERROR_DETAILS_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++
else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_error_details.so.3 -o $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_ERROR_DETAILS_OBJS) $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) -lgrpc++
$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP).so.1
$(Q) ln -sf $(SHARED_PREFIX)grpc++_error_details$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details$(SHARED_VERSION_CPP).so
endif
endif
endif
endif
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(LIBGRPC++_ERROR_DETAILS_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/src/cpp/util/error_details.o: $(GENDIR)/src/proto/grpc/status/status.pb.cc $(GENDIR)/src/proto/grpc/status/status.grpc.pb.cc
LIBGRPC++_PROTO_REFLECTION_DESC_DB_SRC = \ LIBGRPC++_PROTO_REFLECTION_DESC_DB_SRC = \
test/cpp/util/proto_reflection_descriptor_database.cc \ test/cpp/util/proto_reflection_descriptor_database.cc \
$(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.pb.cc $(GENDIR)/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.cc \
@ -14326,6 +14437,53 @@ endif
endif endif
ERROR_DETAILS_TEST_SRC = \
$(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc \
test/cpp/util/error_details_test.cc \
ERROR_DETAILS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(ERROR_DETAILS_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/error_details_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)/error_details_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/error_details_test: $(PROTOBUF_DEP) $(ERROR_DETAILS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a $(LIBDIR)/$(CONFIG)/libgrpc++.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(ERROR_DETAILS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/error_details_test
endif
endif
$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/echo_messages.o: $(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a $(LIBDIR)/$(CONFIG)/libgrpc++.a
$(OBJDIR)/$(CONFIG)/test/cpp/util/error_details_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_error_details.a $(LIBDIR)/$(CONFIG)/libgrpc++.a
deps_error_details_test: $(ERROR_DETAILS_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(ERROR_DETAILS_TEST_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/util/error_details_test.o: $(GENDIR)/src/proto/grpc/testing/echo_messages.pb.cc $(GENDIR)/src/proto/grpc/testing/echo_messages.grpc.pb.cc
FILTER_END2END_TEST_SRC = \ FILTER_END2END_TEST_SRC = \
test/cpp/end2end/filter_end2end_test.cc \ test/cpp/end2end/filter_end2end_test.cc \
@ -19280,6 +19438,7 @@ src/cpp/common/secure_create_auth_context.cc: $(OPENSSL_DEP)
src/cpp/ext/proto_server_reflection.cc: $(OPENSSL_DEP) src/cpp/ext/proto_server_reflection.cc: $(OPENSSL_DEP)
src/cpp/ext/proto_server_reflection_plugin.cc: $(OPENSSL_DEP) src/cpp/ext/proto_server_reflection_plugin.cc: $(OPENSSL_DEP)
src/cpp/server/secure_server_credentials.cc: $(OPENSSL_DEP) src/cpp/server/secure_server_credentials.cc: $(OPENSSL_DEP)
src/cpp/util/error_details.cc: $(OPENSSL_DEP)
src/csharp/ext/grpc_csharp_ext.c: $(OPENSSL_DEP) src/csharp/ext/grpc_csharp_ext.c: $(OPENSSL_DEP)
test/core/bad_client/bad_client.c: $(OPENSSL_DEP) test/core/bad_client/bad_client.c: $(OPENSSL_DEP)
test/core/bad_ssl/server_common.c: $(OPENSSL_DEP) test/core/bad_ssl/server_common.c: $(OPENSSL_DEP)

@ -519,9 +519,10 @@
# the OpenSSL headers, from the downloaded Node development package, # the OpenSSL headers, from the downloaded Node development package,
# which is typically located in `.node-gyp` in your home directory. # which is typically located in `.node-gyp` in your home directory.
'target_name': 'WINDOWS_BUILD_WARNING', 'target_name': 'WINDOWS_BUILD_WARNING',
'actions': [ 'rules': [
{ {
'action_name': 'WINDOWS_BUILD_WARNING', 'rule_name': 'WINDOWS_BUILD_WARNING',
'extension': 'S',
'inputs': [ 'inputs': [
'package.json' 'package.json'
], ],
@ -789,6 +790,7 @@
'src/core/ext/transport/chttp2/transport/hpack_encoder.c', 'src/core/ext/transport/chttp2/transport/hpack_encoder.c',
'src/core/ext/transport/chttp2/transport/hpack_parser.c', 'src/core/ext/transport/chttp2/transport/hpack_parser.c',
'src/core/ext/transport/chttp2/transport/hpack_table.c', 'src/core/ext/transport/chttp2/transport/hpack_table.c',
'src/core/ext/transport/chttp2/transport/http2_settings.c',
'src/core/ext/transport/chttp2/transport/huffsyms.c', 'src/core/ext/transport/chttp2/transport/huffsyms.c',
'src/core/ext/transport/chttp2/transport/incoming_metadata.c', 'src/core/ext/transport/chttp2/transport/incoming_metadata.c',
'src/core/ext/transport/chttp2/transport/parsing.c', 'src/core/ext/transport/chttp2/transport/parsing.c',

@ -668,6 +668,7 @@ filegroups:
- src/core/ext/transport/chttp2/transport/hpack_encoder.h - src/core/ext/transport/chttp2/transport/hpack_encoder.h
- src/core/ext/transport/chttp2/transport/hpack_parser.h - src/core/ext/transport/chttp2/transport/hpack_parser.h
- src/core/ext/transport/chttp2/transport/hpack_table.h - src/core/ext/transport/chttp2/transport/hpack_table.h
- src/core/ext/transport/chttp2/transport/http2_settings.h
- src/core/ext/transport/chttp2/transport/huffsyms.h - src/core/ext/transport/chttp2/transport/huffsyms.h
- src/core/ext/transport/chttp2/transport/incoming_metadata.h - src/core/ext/transport/chttp2/transport/incoming_metadata.h
- src/core/ext/transport/chttp2/transport/internal.h - src/core/ext/transport/chttp2/transport/internal.h
@ -687,6 +688,7 @@ filegroups:
- src/core/ext/transport/chttp2/transport/hpack_encoder.c - src/core/ext/transport/chttp2/transport/hpack_encoder.c
- src/core/ext/transport/chttp2/transport/hpack_parser.c - src/core/ext/transport/chttp2/transport/hpack_parser.c
- src/core/ext/transport/chttp2/transport/hpack_table.c - src/core/ext/transport/chttp2/transport/hpack_table.c
- src/core/ext/transport/chttp2/transport/http2_settings.c
- src/core/ext/transport/chttp2/transport/huffsyms.c - src/core/ext/transport/chttp2/transport/huffsyms.c
- src/core/ext/transport/chttp2/transport/incoming_metadata.c - src/core/ext/transport/chttp2/transport/incoming_metadata.c
- src/core/ext/transport/chttp2/transport/parsing.c - src/core/ext/transport/chttp2/transport/parsing.c
@ -1177,6 +1179,18 @@ libs:
platforms: platforms:
- linux - linux
secure: true secure: true
- name: grpc++_error_details
build: all
language: c++
public_headers:
- include/grpc++/support/error_details.h
src:
- src/proto/grpc/status/status.proto
- src/cpp/util/error_details.cc
deps:
- grpc++
baselib: true
vs_project_guid: '{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}'
- name: grpc++_proto_reflection_desc_db - name: grpc++_proto_reflection_desc_db
build: private build: private
language: c++ language: c++
@ -3569,6 +3583,16 @@ targets:
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: error_details_test
gtest: true
build: test
language: c++
src:
- src/proto/grpc/testing/echo_messages.proto
- test/cpp/util/error_details_test.cc
deps:
- grpc++_error_details
- grpc++
- name: filter_end2end_test - name: filter_end2end_test
gtest: true gtest: true
build: test build: test

@ -223,6 +223,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/transport/chttp2/transport/hpack_encoder.c \ src/core/ext/transport/chttp2/transport/hpack_encoder.c \
src/core/ext/transport/chttp2/transport/hpack_parser.c \ src/core/ext/transport/chttp2/transport/hpack_parser.c \
src/core/ext/transport/chttp2/transport/hpack_table.c \ src/core/ext/transport/chttp2/transport/hpack_table.c \
src/core/ext/transport/chttp2/transport/http2_settings.c \
src/core/ext/transport/chttp2/transport/huffsyms.c \ src/core/ext/transport/chttp2/transport/huffsyms.c \
src/core/ext/transport/chttp2/transport/incoming_metadata.c \ src/core/ext/transport/chttp2/transport/incoming_metadata.c \
src/core/ext/transport/chttp2/transport/parsing.c \ src/core/ext/transport/chttp2/transport/parsing.c \

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

@ -380,6 +380,7 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/hpack_encoder.h', 'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.h', 'src/core/ext/transport/chttp2/transport/hpack_parser.h',
'src/core/ext/transport/chttp2/transport/hpack_table.h', 'src/core/ext/transport/chttp2/transport/hpack_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/huffsyms.h',
'src/core/ext/transport/chttp2/transport/incoming_metadata.h', 'src/core/ext/transport/chttp2/transport/incoming_metadata.h',
'src/core/ext/transport/chttp2/transport/internal.h', 'src/core/ext/transport/chttp2/transport/internal.h',
@ -600,6 +601,7 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/hpack_encoder.c', 'src/core/ext/transport/chttp2/transport/hpack_encoder.c',
'src/core/ext/transport/chttp2/transport/hpack_parser.c', 'src/core/ext/transport/chttp2/transport/hpack_parser.c',
'src/core/ext/transport/chttp2/transport/hpack_table.c', 'src/core/ext/transport/chttp2/transport/hpack_table.c',
'src/core/ext/transport/chttp2/transport/http2_settings.c',
'src/core/ext/transport/chttp2/transport/huffsyms.c', 'src/core/ext/transport/chttp2/transport/huffsyms.c',
'src/core/ext/transport/chttp2/transport/incoming_metadata.c', 'src/core/ext/transport/chttp2/transport/incoming_metadata.c',
'src/core/ext/transport/chttp2/transport/parsing.c', 'src/core/ext/transport/chttp2/transport/parsing.c',
@ -834,6 +836,7 @@ Pod::Spec.new do |s|
'src/core/ext/transport/chttp2/transport/hpack_encoder.h', 'src/core/ext/transport/chttp2/transport/hpack_encoder.h',
'src/core/ext/transport/chttp2/transport/hpack_parser.h', 'src/core/ext/transport/chttp2/transport/hpack_parser.h',
'src/core/ext/transport/chttp2/transport/hpack_table.h', 'src/core/ext/transport/chttp2/transport/hpack_table.h',
'src/core/ext/transport/chttp2/transport/http2_settings.h',
'src/core/ext/transport/chttp2/transport/huffsyms.h', 'src/core/ext/transport/chttp2/transport/huffsyms.h',
'src/core/ext/transport/chttp2/transport/incoming_metadata.h', 'src/core/ext/transport/chttp2/transport/incoming_metadata.h',
'src/core/ext/transport/chttp2/transport/internal.h', 'src/core/ext/transport/chttp2/transport/internal.h',

@ -296,6 +296,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.h ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.h )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.h ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.h )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.h ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.h )
s.files += %w( src/core/ext/transport/chttp2/transport/http2_settings.h )
s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.h ) s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.h )
s.files += %w( src/core/ext/transport/chttp2/transport/incoming_metadata.h ) s.files += %w( src/core/ext/transport/chttp2/transport/incoming_metadata.h )
s.files += %w( src/core/ext/transport/chttp2/transport/internal.h ) s.files += %w( src/core/ext/transport/chttp2/transport/internal.h )
@ -516,6 +517,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.c ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_encoder.c )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.c ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_parser.c )
s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.c ) s.files += %w( src/core/ext/transport/chttp2/transport/hpack_table.c )
s.files += %w( src/core/ext/transport/chttp2/transport/http2_settings.c )
s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.c ) s.files += %w( src/core/ext/transport/chttp2/transport/huffsyms.c )
s.files += %w( src/core/ext/transport/chttp2/transport/incoming_metadata.c ) s.files += %w( src/core/ext/transport/chttp2/transport/incoming_metadata.c )
s.files += %w( src/core/ext/transport/chttp2/transport/parsing.c ) s.files += %w( src/core/ext/transport/chttp2/transport/parsing.c )

@ -53,7 +53,7 @@ class Status {
/// Construct an instance with \a code, \a error_message and \a error_details /// Construct an instance with \a code, \a error_message and \a error_details
Status(StatusCode code, const grpc::string& error_message, Status(StatusCode code, const grpc::string& error_message,
const grpc::string error_details) const grpc::string& error_details)
: code_(code), : code_(code),
error_message_(error_message), error_message_(error_message),
binary_error_details_(error_details) {} binary_error_details_(error_details) {}

@ -0,0 +1,61 @@
/*
*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GRPCXX_SUPPORT_ERROR_DETAILS_H
#define GRPCXX_SUPPORT_ERROR_DETAILS_H
#include <grpc++/support/status.h>
namespace google {
namespace rpc {
class Status;
} // namespace rpc
} // namespace google
namespace grpc {
// Maps a grpc::Status to a google::rpc::Status.
// The given \a to object will be cleared.
// On success, returns status with OK.
// Returns status with INVALID_ARGUMENT, if failed to deserialize.
// Returns status with FAILED_PRECONDITION, if \a to is nullptr.
Status ExtractErrorDetails(const Status& from, ::google::rpc::Status* to);
// Maps google::rpc::Status to a grpc::Status.
// Returns OK on success.
// Returns status with FAILED_PRECONDITION if \a to is nullptr.
Status SetErrorDetails(const ::google::rpc::Status& from, Status* to);
} // namespace grpc
#endif // GRPCXX_SUPPORT_ERROR_DETAILS_H

@ -217,6 +217,9 @@ typedef struct {
/** How much data are we willing to queue up per stream if /** How much data are we willing to queue up per stream if
GRPC_WRITE_BUFFER_HINT is set? This is an upper bound */ GRPC_WRITE_BUFFER_HINT is set? This is an upper bound */
#define GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE "grpc.http2.write_buffer_size" #define GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE "grpc.http2.write_buffer_size"
/** Should we allow receipt of true-binary data on http2 connections?
Defaults to on (1) */
#define GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY "grpc.http2.true_binary"
/** After a duration of this time the client/server pings its peer to see if the /** After a duration of this time the client/server pings its peer to see if the
transport is still alive. Int valued, milliseconds. */ transport is still alive. Int valued, milliseconds. */
#define GRPC_ARG_KEEPALIVE_TIME_MS "grpc.keepalive_time_ms" #define GRPC_ARG_KEEPALIVE_TIME_MS "grpc.keepalive_time_ms"

@ -305,6 +305,7 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_encoder.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_encoder.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_parser.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_table.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_table.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/http2_settings.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/huffsyms.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/huffsyms.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/incoming_metadata.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/incoming_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/internal.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/internal.h" role="src" />
@ -525,6 +526,7 @@
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_encoder.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_encoder.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_parser.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_parser.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_table.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/hpack_table.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/http2_settings.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/huffsyms.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/huffsyms.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/incoming_metadata.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/incoming_metadata.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/parsing.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/transport/chttp2/transport/parsing.c" role="src" />

@ -356,6 +356,8 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
DEFAULT_WINDOW); DEFAULT_WINDOW);
push_setting(exec_ctx, t, GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE, push_setting(exec_ctx, t, GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE,
DEFAULT_MAX_HEADER_LIST_SIZE); DEFAULT_MAX_HEADER_LIST_SIZE);
push_setting(exec_ctx, t,
GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA, 1);
t->ping_policy = (grpc_chttp2_repeated_ping_policy){ t->ping_policy = (grpc_chttp2_repeated_ping_policy){
.max_pings_without_data = DEFAULT_MAX_PINGS_BETWEEN_DATA, .max_pings_without_data = DEFAULT_MAX_PINGS_BETWEEN_DATA,
@ -486,26 +488,31 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
grpc_chttp2_setting_id setting_id; grpc_chttp2_setting_id setting_id;
grpc_integer_options integer_options; grpc_integer_options integer_options;
bool availability[2] /* server, client */; bool availability[2] /* server, client */;
} settings_map[] = {{GRPC_ARG_MAX_CONCURRENT_STREAMS, } settings_map[] = {
GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, {GRPC_ARG_MAX_CONCURRENT_STREAMS,
{-1, 0, INT32_MAX}, GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS,
{true, false}}, {-1, 0, INT32_MAX},
{GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER, {true, false}},
GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE, {GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER,
{-1, 0, INT32_MAX}, GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE,
{true, true}}, {-1, 0, INT32_MAX},
{GRPC_ARG_MAX_METADATA_SIZE, {true, true}},
GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE, {GRPC_ARG_MAX_METADATA_SIZE,
{-1, 0, INT32_MAX}, GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE,
{true, true}}, {-1, 0, INT32_MAX},
{GRPC_ARG_HTTP2_MAX_FRAME_SIZE, {true, true}},
GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE, {GRPC_ARG_HTTP2_MAX_FRAME_SIZE,
{-1, 16384, 16777215}, GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE,
{true, true}}, {-1, 16384, 16777215},
{GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES, {true, true}},
GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, {GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY,
{-1, 5, INT32_MAX}, GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA,
{true, true}}}; {1, 0, 1},
{true, true}},
{GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES,
GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE,
{-1, 5, INT32_MAX},
{true, true}}};
for (j = 0; j < (int)GPR_ARRAY_SIZE(settings_map); j++) { for (j = 0; j < (int)GPR_ARRAY_SIZE(settings_map); j++) {
if (0 == strcmp(channel_args->args[i].key, if (0 == strcmp(channel_args->args[i].key,
settings_map[j].channel_arg_name)) { settings_map[j].channel_arg_name)) {
@ -1890,6 +1897,7 @@ static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
grpc_slice hdr; grpc_slice hdr;
grpc_slice status_hdr; grpc_slice status_hdr;
grpc_slice http_status_hdr; grpc_slice http_status_hdr;
grpc_slice content_type_hdr;
grpc_slice message_pfx; grpc_slice message_pfx;
uint8_t *p; uint8_t *p;
uint32_t len = 0; uint32_t len = 0;
@ -1923,6 +1931,42 @@ static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
*p++ = '0'; *p++ = '0';
GPR_ASSERT(p == GRPC_SLICE_END_PTR(http_status_hdr)); GPR_ASSERT(p == GRPC_SLICE_END_PTR(http_status_hdr));
len += (uint32_t)GRPC_SLICE_LENGTH(http_status_hdr); len += (uint32_t)GRPC_SLICE_LENGTH(http_status_hdr);
content_type_hdr = grpc_slice_malloc(31);
p = GRPC_SLICE_START_PTR(content_type_hdr);
*p++ = 0x00;
*p++ = 12;
*p++ = 'c';
*p++ = 'o';
*p++ = 'n';
*p++ = 't';
*p++ = 'e';
*p++ = 'n';
*p++ = 't';
*p++ = '-';
*p++ = 't';
*p++ = 'y';
*p++ = 'p';
*p++ = 'e';
*p++ = 16;
*p++ = 'a';
*p++ = 'p';
*p++ = 'p';
*p++ = 'l';
*p++ = 'i';
*p++ = 'c';
*p++ = 'a';
*p++ = 't';
*p++ = 'i';
*p++ = 'o';
*p++ = 'n';
*p++ = '/';
*p++ = 'g';
*p++ = 'r';
*p++ = 'p';
*p++ = 'c';
GPR_ASSERT(p == GRPC_SLICE_END_PTR(content_type_hdr));
len += (uint32_t)GRPC_SLICE_LENGTH(content_type_hdr);
} }
status_hdr = grpc_slice_malloc(15 + (grpc_status >= 10)); status_hdr = grpc_slice_malloc(15 + (grpc_status >= 10));
@ -1992,6 +2036,7 @@ static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
grpc_slice_buffer_add(&t->qbuf, hdr); grpc_slice_buffer_add(&t->qbuf, hdr);
if (!s->sent_initial_metadata) { if (!s->sent_initial_metadata) {
grpc_slice_buffer_add(&t->qbuf, http_status_hdr); grpc_slice_buffer_add(&t->qbuf, http_status_hdr);
grpc_slice_buffer_add(&t->qbuf, content_type_hdr);
} }
grpc_slice_buffer_add(&t->qbuf, status_hdr); grpc_slice_buffer_add(&t->qbuf, status_hdr);
grpc_slice_buffer_add(&t->qbuf, message_pfx); grpc_slice_buffer_add(&t->qbuf, message_pfx);

@ -46,29 +46,6 @@
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/transport/http2_errors.h" #include "src/core/lib/transport/http2_errors.h"
#define MAX_MAX_HEADER_LIST_SIZE (1024 * 1024 * 1024)
/* HTTP/2 mandated initial connection settings */
const grpc_chttp2_setting_parameters
grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS] = {
{NULL, 0, 0, 0, GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE,
GRPC_HTTP2_PROTOCOL_ERROR},
{"HEADER_TABLE_SIZE", 4096, 0, 0xffffffff,
GRPC_CHTTP2_CLAMP_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},
{"ENABLE_PUSH", 1, 0, 1, GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE,
GRPC_HTTP2_PROTOCOL_ERROR},
{"MAX_CONCURRENT_STREAMS", 0xffffffffu, 0, 0xffffffffu,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},
{"INITIAL_WINDOW_SIZE", 65535, 0, 0x7fffffffu,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE,
GRPC_HTTP2_FLOW_CONTROL_ERROR},
{"MAX_FRAME_SIZE", 16384, 16384, 16777215,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},
{"MAX_HEADER_LIST_SIZE", MAX_MAX_HEADER_LIST_SIZE, 0,
MAX_MAX_HEADER_LIST_SIZE, GRPC_CHTTP2_CLAMP_INVALID_VALUE,
GRPC_HTTP2_PROTOCOL_ERROR},
};
static uint8_t *fill_header(uint8_t *out, uint32_t length, uint8_t flags) { static uint8_t *fill_header(uint8_t *out, uint32_t length, uint8_t flags) {
*out++ = (uint8_t)(length >> 16); *out++ = (uint8_t)(length >> 16);
*out++ = (uint8_t)(length >> 8); *out++ = (uint8_t)(length >> 8);
@ -98,9 +75,8 @@ grpc_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *new,
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (new[i] != old[i] || (force_mask & (1u << i)) != 0) { if (new[i] != old[i] || (force_mask & (1u << i)) != 0) {
GPR_ASSERT(i); *p++ = (uint8_t)(grpc_setting_id_to_wire_id[i] >> 8);
*p++ = (uint8_t)(i >> 8); *p++ = (uint8_t)(grpc_setting_id_to_wire_id[i]);
*p++ = (uint8_t)(i);
*p++ = (uint8_t)(new[i] >> 24); *p++ = (uint8_t)(new[i] >> 24);
*p++ = (uint8_t)(new[i] >> 16); *p++ = (uint8_t)(new[i] >> 16);
*p++ = (uint8_t)(new[i] >> 8); *p++ = (uint8_t)(new[i] >> 8);
@ -154,6 +130,7 @@ grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx, void *p,
const uint8_t *cur = GRPC_SLICE_START_PTR(slice); const uint8_t *cur = GRPC_SLICE_START_PTR(slice);
const uint8_t *end = GRPC_SLICE_END_PTR(slice); const uint8_t *end = GRPC_SLICE_END_PTR(slice);
char *msg; char *msg;
grpc_chttp2_setting_id id;
if (parser->is_ack) { if (parser->is_ack) {
return GRPC_ERROR_NONE; return GRPC_ERROR_NONE;
@ -216,9 +193,9 @@ grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx, void *p,
parser->value |= *cur; parser->value |= *cur;
cur++; cur++;
if (parser->id > 0 && parser->id < GRPC_CHTTP2_NUM_SETTINGS) { if (grpc_wire_id_to_setting_id(parser->id, &id)) {
const grpc_chttp2_setting_parameters *sp = const grpc_chttp2_setting_parameters *sp =
&grpc_chttp2_settings_parameters[parser->id]; &grpc_chttp2_settings_parameters[id];
if (parser->value < sp->min_value || parser->value > sp->max_value) { if (parser->value < sp->min_value || parser->value > sp->max_value) {
switch (sp->invalid_value_behavior) { switch (sp->invalid_value_behavior) {
case GRPC_CHTTP2_CLAMP_INVALID_VALUE: case GRPC_CHTTP2_CLAMP_INVALID_VALUE:
@ -237,19 +214,19 @@ grpc_error *grpc_chttp2_settings_parser_parse(grpc_exec_ctx *exec_ctx, void *p,
return err; return err;
} }
} }
if (parser->id == GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE && if (id == GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE &&
parser->incoming_settings[parser->id] != parser->value) { parser->incoming_settings[id] != parser->value) {
t->initial_window_update += t->initial_window_update +=
(int64_t)parser->value - parser->incoming_settings[parser->id]; (int64_t)parser->value - parser->incoming_settings[id];
if (grpc_http_trace) { if (grpc_http_trace) {
gpr_log(GPR_DEBUG, "adding %d for initial_window change", gpr_log(GPR_DEBUG, "adding %d for initial_window change",
(int)t->initial_window_update); (int)t->initial_window_update);
} }
} }
parser->incoming_settings[parser->id] = parser->value; parser->incoming_settings[id] = parser->value;
if (grpc_http_trace) { if (grpc_http_trace) {
gpr_log(GPR_DEBUG, "CHTTP2:%s:%s: got setting %d = %d", gpr_log(GPR_DEBUG, "CHTTP2:%s:%s: got setting %s = %d",
t->is_client ? "CLI" : "SVR", t->peer_string, parser->id, t->is_client ? "CLI" : "SVR", t->peer_string, sp->name,
parser->value); parser->value);
} }
} else if (grpc_http_trace) { } else if (grpc_http_trace) {

@ -37,6 +37,7 @@
#include <grpc/slice.h> #include <grpc/slice.h>
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/iomgr/exec_ctx.h"
typedef enum { typedef enum {
@ -48,17 +49,6 @@ typedef enum {
GRPC_CHTTP2_SPS_VAL3 GRPC_CHTTP2_SPS_VAL3
} grpc_chttp2_settings_parse_state; } grpc_chttp2_settings_parse_state;
/* The things HTTP/2 defines as connection level settings */
typedef enum {
GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE = 1,
GRPC_CHTTP2_SETTINGS_ENABLE_PUSH = 2,
GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 3,
GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 4,
GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE = 5,
GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 6,
GRPC_CHTTP2_NUM_SETTINGS
} grpc_chttp2_setting_id;
typedef struct { typedef struct {
grpc_chttp2_settings_parse_state state; grpc_chttp2_settings_parse_state state;
uint32_t *target_settings; uint32_t *target_settings;
@ -68,24 +58,6 @@ typedef struct {
uint32_t incoming_settings[GRPC_CHTTP2_NUM_SETTINGS]; uint32_t incoming_settings[GRPC_CHTTP2_NUM_SETTINGS];
} grpc_chttp2_settings_parser; } grpc_chttp2_settings_parser;
typedef enum {
GRPC_CHTTP2_CLAMP_INVALID_VALUE,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE
} grpc_chttp2_invalid_value_behavior;
typedef struct {
const char *name;
uint32_t default_value;
uint32_t min_value;
uint32_t max_value;
grpc_chttp2_invalid_value_behavior invalid_value_behavior;
uint32_t error_value;
} grpc_chttp2_setting_parameters;
/* HTTP/2 mandated connection setting parameters */
extern const grpc_chttp2_setting_parameters
grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS];
/* Create a settings frame by diffing old & new, and updating old to be new */ /* Create a settings frame by diffing old & new, and updating old to be new */
grpc_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *newval, grpc_slice grpc_chttp2_settings_create(uint32_t *old, const uint32_t *newval,
uint32_t force_mask, size_t count); uint32_t force_mask, size_t count);

@ -86,6 +86,7 @@ typedef struct {
grpc_transport_one_way_stats *stats; grpc_transport_one_way_stats *stats;
/* maximum size of a frame */ /* maximum size of a frame */
size_t max_frame_size; size_t max_frame_size;
bool use_true_binary_metadata;
} framer_state; } framer_state;
/* fills p (which is expected to be 9 bytes long) with a data frame header */ /* fills p (which is expected to be 9 bytes long) with a data frame header */
@ -290,86 +291,113 @@ static void emit_indexed(grpc_chttp2_hpack_compressor *c, uint32_t elem_index,
len); len);
} }
static grpc_slice get_wire_value(grpc_mdelem elem, uint8_t *huffman_prefix) { typedef struct {
grpc_slice data;
uint8_t huffman_prefix;
bool insert_null_before_wire_value;
} wire_value;
static wire_value get_wire_value(grpc_mdelem elem, bool true_binary_enabled) {
if (grpc_is_binary_header(GRPC_MDKEY(elem))) { if (grpc_is_binary_header(GRPC_MDKEY(elem))) {
*huffman_prefix = 0x80; if (true_binary_enabled) {
return grpc_chttp2_base64_encode_and_huffman_compress(GRPC_MDVALUE(elem)); return (wire_value){
.huffman_prefix = 0x00,
.insert_null_before_wire_value = true,
.data = grpc_slice_ref_internal(GRPC_MDVALUE(elem)),
};
} else {
return (wire_value){
.huffman_prefix = 0x80,
.insert_null_before_wire_value = false,
.data = grpc_chttp2_base64_encode_and_huffman_compress(
GRPC_MDVALUE(elem)),
};
}
} else {
/* TODO(ctiller): opportunistically compress non-binary headers */
return (wire_value){
.huffman_prefix = 0x00,
.insert_null_before_wire_value = false,
.data = grpc_slice_ref_internal(GRPC_MDVALUE(elem)),
};
} }
/* TODO(ctiller): opportunistically compress non-binary headers */ }
*huffman_prefix = 0x00;
return grpc_slice_ref_internal(GRPC_MDVALUE(elem)); static size_t wire_value_length(wire_value v) {
return GPR_SLICE_LENGTH(v.data) + v.insert_null_before_wire_value;
}
static void add_wire_value(framer_state *st, wire_value v) {
if (v.insert_null_before_wire_value) *add_tiny_header_data(st, 1) = 0;
add_header_data(st, v.data);
} }
static void emit_lithdr_incidx(grpc_chttp2_hpack_compressor *c, static void emit_lithdr_incidx(grpc_chttp2_hpack_compressor *c,
uint32_t key_index, grpc_mdelem elem, uint32_t key_index, grpc_mdelem elem,
framer_state *st) { framer_state *st) {
uint32_t len_pfx = GRPC_CHTTP2_VARINT_LENGTH(key_index, 2); uint32_t len_pfx = GRPC_CHTTP2_VARINT_LENGTH(key_index, 2);
uint8_t huffman_prefix; wire_value value = get_wire_value(elem, st->use_true_binary_metadata);
grpc_slice value_slice = get_wire_value(elem, &huffman_prefix); size_t len_val = wire_value_length(value);
size_t len_val = GRPC_SLICE_LENGTH(value_slice);
uint32_t len_val_len; uint32_t len_val_len;
GPR_ASSERT(len_val <= UINT32_MAX); GPR_ASSERT(len_val <= UINT32_MAX);
len_val_len = GRPC_CHTTP2_VARINT_LENGTH((uint32_t)len_val, 1); len_val_len = GRPC_CHTTP2_VARINT_LENGTH((uint32_t)len_val, 1);
GRPC_CHTTP2_WRITE_VARINT(key_index, 2, 0x40, GRPC_CHTTP2_WRITE_VARINT(key_index, 2, 0x40,
add_tiny_header_data(st, len_pfx), len_pfx); add_tiny_header_data(st, len_pfx), len_pfx);
GRPC_CHTTP2_WRITE_VARINT((uint32_t)len_val, 1, huffman_prefix, GRPC_CHTTP2_WRITE_VARINT((uint32_t)len_val, 1, value.huffman_prefix,
add_tiny_header_data(st, len_val_len), len_val_len); add_tiny_header_data(st, len_val_len), len_val_len);
add_header_data(st, value_slice); add_wire_value(st, value);
} }
static void emit_lithdr_noidx(grpc_chttp2_hpack_compressor *c, static void emit_lithdr_noidx(grpc_chttp2_hpack_compressor *c,
uint32_t key_index, grpc_mdelem elem, uint32_t key_index, grpc_mdelem elem,
framer_state *st) { framer_state *st) {
uint32_t len_pfx = GRPC_CHTTP2_VARINT_LENGTH(key_index, 4); uint32_t len_pfx = GRPC_CHTTP2_VARINT_LENGTH(key_index, 4);
uint8_t huffman_prefix; wire_value value = get_wire_value(elem, st->use_true_binary_metadata);
grpc_slice value_slice = get_wire_value(elem, &huffman_prefix); size_t len_val = wire_value_length(value);
size_t len_val = GRPC_SLICE_LENGTH(value_slice);
uint32_t len_val_len; uint32_t len_val_len;
GPR_ASSERT(len_val <= UINT32_MAX); GPR_ASSERT(len_val <= UINT32_MAX);
len_val_len = GRPC_CHTTP2_VARINT_LENGTH((uint32_t)len_val, 1); len_val_len = GRPC_CHTTP2_VARINT_LENGTH((uint32_t)len_val, 1);
GRPC_CHTTP2_WRITE_VARINT(key_index, 4, 0x00, GRPC_CHTTP2_WRITE_VARINT(key_index, 4, 0x00,
add_tiny_header_data(st, len_pfx), len_pfx); add_tiny_header_data(st, len_pfx), len_pfx);
GRPC_CHTTP2_WRITE_VARINT((uint32_t)len_val, 1, huffman_prefix, GRPC_CHTTP2_WRITE_VARINT((uint32_t)len_val, 1, value.huffman_prefix,
add_tiny_header_data(st, len_val_len), len_val_len); add_tiny_header_data(st, len_val_len), len_val_len);
add_header_data(st, value_slice); add_wire_value(st, value);
} }
static void emit_lithdr_incidx_v(grpc_chttp2_hpack_compressor *c, static void emit_lithdr_incidx_v(grpc_chttp2_hpack_compressor *c,
grpc_mdelem elem, framer_state *st) { grpc_mdelem elem, framer_state *st) {
uint32_t len_key = (uint32_t)GRPC_SLICE_LENGTH(GRPC_MDKEY(elem)); uint32_t len_key = (uint32_t)GRPC_SLICE_LENGTH(GRPC_MDKEY(elem));
uint8_t huffman_prefix; wire_value value = get_wire_value(elem, st->use_true_binary_metadata);
grpc_slice value_slice = get_wire_value(elem, &huffman_prefix); uint32_t len_val = (uint32_t)wire_value_length(value);
uint32_t len_val = (uint32_t)GRPC_SLICE_LENGTH(value_slice);
uint32_t len_key_len = GRPC_CHTTP2_VARINT_LENGTH(len_key, 1); uint32_t len_key_len = GRPC_CHTTP2_VARINT_LENGTH(len_key, 1);
uint32_t len_val_len = GRPC_CHTTP2_VARINT_LENGTH(len_val, 1); uint32_t len_val_len = GRPC_CHTTP2_VARINT_LENGTH(len_val, 1);
GPR_ASSERT(len_key <= UINT32_MAX); GPR_ASSERT(len_key <= UINT32_MAX);
GPR_ASSERT(GRPC_SLICE_LENGTH(value_slice) <= UINT32_MAX); GPR_ASSERT(wire_value_length(value) <= UINT32_MAX);
*add_tiny_header_data(st, 1) = 0x40; *add_tiny_header_data(st, 1) = 0x40;
GRPC_CHTTP2_WRITE_VARINT(len_key, 1, 0x00, GRPC_CHTTP2_WRITE_VARINT(len_key, 1, 0x00,
add_tiny_header_data(st, len_key_len), len_key_len); add_tiny_header_data(st, len_key_len), len_key_len);
add_header_data(st, grpc_slice_ref_internal(GRPC_MDKEY(elem))); add_header_data(st, grpc_slice_ref_internal(GRPC_MDKEY(elem)));
GRPC_CHTTP2_WRITE_VARINT(len_val, 1, huffman_prefix, GRPC_CHTTP2_WRITE_VARINT(len_val, 1, value.huffman_prefix,
add_tiny_header_data(st, len_val_len), len_val_len); add_tiny_header_data(st, len_val_len), len_val_len);
add_header_data(st, value_slice); add_wire_value(st, value);
} }
static void emit_lithdr_noidx_v(grpc_chttp2_hpack_compressor *c, static void emit_lithdr_noidx_v(grpc_chttp2_hpack_compressor *c,
grpc_mdelem elem, framer_state *st) { grpc_mdelem elem, framer_state *st) {
uint32_t len_key = (uint32_t)GRPC_SLICE_LENGTH(GRPC_MDKEY(elem)); uint32_t len_key = (uint32_t)GRPC_SLICE_LENGTH(GRPC_MDKEY(elem));
uint8_t huffman_prefix; wire_value value = get_wire_value(elem, st->use_true_binary_metadata);
grpc_slice value_slice = get_wire_value(elem, &huffman_prefix); uint32_t len_val = (uint32_t)wire_value_length(value);
uint32_t len_val = (uint32_t)GRPC_SLICE_LENGTH(value_slice);
uint32_t len_key_len = GRPC_CHTTP2_VARINT_LENGTH(len_key, 1); uint32_t len_key_len = GRPC_CHTTP2_VARINT_LENGTH(len_key, 1);
uint32_t len_val_len = GRPC_CHTTP2_VARINT_LENGTH(len_val, 1); uint32_t len_val_len = GRPC_CHTTP2_VARINT_LENGTH(len_val, 1);
GPR_ASSERT(len_key <= UINT32_MAX); GPR_ASSERT(len_key <= UINT32_MAX);
GPR_ASSERT(GRPC_SLICE_LENGTH(value_slice) <= UINT32_MAX); GPR_ASSERT(wire_value_length(value) <= UINT32_MAX);
*add_tiny_header_data(st, 1) = 0x00; *add_tiny_header_data(st, 1) = 0x00;
GRPC_CHTTP2_WRITE_VARINT(len_key, 1, 0x00, GRPC_CHTTP2_WRITE_VARINT(len_key, 1, 0x00,
add_tiny_header_data(st, len_key_len), len_key_len); add_tiny_header_data(st, len_key_len), len_key_len);
add_header_data(st, grpc_slice_ref_internal(GRPC_MDKEY(elem))); add_header_data(st, grpc_slice_ref_internal(GRPC_MDKEY(elem)));
GRPC_CHTTP2_WRITE_VARINT(len_val, 1, huffman_prefix, GRPC_CHTTP2_WRITE_VARINT(len_val, 1, value.huffman_prefix,
add_tiny_header_data(st, len_val_len), len_val_len); add_tiny_header_data(st, len_val_len), len_val_len);
add_header_data(st, value_slice); add_wire_value(st, value);
} }
static void emit_advertise_table_size_change(grpc_chttp2_hpack_compressor *c, static void emit_advertise_table_size_change(grpc_chttp2_hpack_compressor *c,
@ -595,23 +623,22 @@ void grpc_chttp2_hpack_compressor_set_max_table_size(
void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx, void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx,
grpc_chttp2_hpack_compressor *c, grpc_chttp2_hpack_compressor *c,
uint32_t stream_id, grpc_metadata_batch *metadata,
grpc_metadata_batch *metadata, int is_eof, const grpc_encode_header_options *options,
size_t max_frame_size,
grpc_transport_one_way_stats *stats,
grpc_slice_buffer *outbuf) { grpc_slice_buffer *outbuf) {
framer_state st; framer_state st;
grpc_linked_mdelem *l; grpc_linked_mdelem *l;
gpr_timespec deadline; gpr_timespec deadline;
GPR_ASSERT(stream_id != 0); GPR_ASSERT(options->stream_id != 0);
st.seen_regular_header = 0; st.seen_regular_header = 0;
st.stream_id = stream_id; st.stream_id = options->stream_id;
st.output = outbuf; st.output = outbuf;
st.is_first_frame = 1; st.is_first_frame = 1;
st.stats = stats; st.stats = options->stats;
st.max_frame_size = max_frame_size; st.max_frame_size = options->max_frame_size;
st.use_true_binary_metadata = options->use_true_binary_metadata;
/* Encode a metadata batch; store the returned values, representing /* Encode a metadata batch; store the returned values, representing
a metadata element that needs to be unreffed back into the metadata a metadata element that needs to be unreffed back into the metadata
@ -630,5 +657,5 @@ void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx,
deadline_enc(exec_ctx, c, deadline, &st); deadline_enc(exec_ctx, c, deadline, &st);
} }
finish_frame(&st, 1, is_eof); finish_frame(&st, 1, options->is_eof);
} }

@ -90,11 +90,18 @@ void grpc_chttp2_hpack_compressor_set_max_table_size(
void grpc_chttp2_hpack_compressor_set_max_usable_size( void grpc_chttp2_hpack_compressor_set_max_usable_size(
grpc_chttp2_hpack_compressor *c, uint32_t max_table_size); grpc_chttp2_hpack_compressor *c, uint32_t max_table_size);
typedef struct {
uint32_t stream_id;
bool is_eof;
bool use_true_binary_metadata;
size_t max_frame_size;
grpc_transport_one_way_stats *stats;
} grpc_encode_header_options;
void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx, void grpc_chttp2_encode_header(grpc_exec_ctx *exec_ctx,
grpc_chttp2_hpack_compressor *c, uint32_t id, grpc_chttp2_hpack_compressor *c,
grpc_metadata_batch *metadata, int is_eof, grpc_metadata_batch *metadata,
size_t max_frame_size, const grpc_encode_header_options *options,
grpc_transport_one_way_stats *stats,
grpc_slice_buffer *outbuf); grpc_slice_buffer *outbuf);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */ #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */

@ -38,11 +38,6 @@
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
/* This is here for grpc_is_binary_header
* TODO(murgatroid99): Remove this
*/
#include <grpc/grpc.h>
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <grpc/support/port_platform.h> #include <grpc/support/port_platform.h>
@ -55,13 +50,11 @@
#include "src/core/lib/support/string.h" #include "src/core/lib/support/string.h"
#include "src/core/lib/transport/http2_errors.h" #include "src/core/lib/transport/http2_errors.h"
/* TODO(ctiller): remove before submission */
#include "src/core/lib/slice/slice_string_helpers.h"
extern int grpc_http_trace; extern int grpc_http_trace;
typedef enum { typedef enum {
NOT_BINARY, NOT_BINARY,
BINARY_BEGIN,
B64_BYTE0, B64_BYTE0,
B64_BYTE1, B64_BYTE1,
B64_BYTE2, B64_BYTE2,
@ -1325,6 +1318,19 @@ static grpc_error *append_string(grpc_exec_ctx *exec_ctx,
case NOT_BINARY: case NOT_BINARY:
append_bytes(str, cur, (size_t)(end - cur)); append_bytes(str, cur, (size_t)(end - cur));
return GRPC_ERROR_NONE; return GRPC_ERROR_NONE;
case BINARY_BEGIN:
if (cur == end) {
p->binary = BINARY_BEGIN;
return GRPC_ERROR_NONE;
}
if (*cur == 0) {
/* 'true-binary' case */
++cur;
p->binary = NOT_BINARY;
append_bytes(str, cur, (size_t)(end - cur));
return GRPC_ERROR_NONE;
}
/* fallthrough */
b64_byte0: b64_byte0:
case B64_BYTE0: case B64_BYTE0:
if (cur == end) { if (cur == end) {
@ -1409,6 +1415,8 @@ static grpc_error *finish_str(grpc_exec_ctx *exec_ctx,
switch ((binary_state)p->binary) { switch ((binary_state)p->binary) {
case NOT_BINARY: case NOT_BINARY:
break; break;
case BINARY_BEGIN:
break;
case B64_BYTE0: case B64_BYTE0:
break; break;
case B64_BYTE1: case B64_BYTE1:
@ -1571,7 +1579,7 @@ static grpc_error *parse_value_string(grpc_exec_ctx *exec_ctx,
const uint8_t *cur, const uint8_t *end, const uint8_t *cur, const uint8_t *end,
bool is_binary) { bool is_binary) {
return begin_parse_string(exec_ctx, p, cur, end, return begin_parse_string(exec_ctx, p, cur, end,
is_binary ? B64_BYTE0 : NOT_BINARY, &p->value); is_binary ? BINARY_BEGIN : NOT_BINARY, &p->value);
} }
static grpc_error *parse_value_string_with_indexed_key( static grpc_error *parse_value_string_with_indexed_key(

@ -0,0 +1,75 @@
/*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Automatically generated by tools/codegen/core/gen_settings_ids.py
*/
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
#include <grpc/support/useful.h>
#include "src/core/lib/transport/http2_errors.h"
const uint16_t grpc_setting_id_to_wire_id[] = {1, 2, 3, 4, 5, 6, 65027};
bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out) {
uint32_t i = wire_id - 1;
uint32_t x = i % 256;
uint32_t y = i / 256;
uint32_t h = x;
switch (y) {
case 254:
h += 4;
break;
}
*out = (grpc_chttp2_setting_id)h;
return h < GPR_ARRAY_SIZE(grpc_setting_id_to_wire_id) &&
grpc_setting_id_to_wire_id[h] == wire_id;
}
const grpc_chttp2_setting_parameters
grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS] = {
{"HEADER_TABLE_SIZE", 4096u, 0u, 4294967295u,
GRPC_CHTTP2_CLAMP_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},
{"ENABLE_PUSH", 1u, 0u, 1u, GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE,
GRPC_HTTP2_PROTOCOL_ERROR},
{"MAX_CONCURRENT_STREAMS", 4294967295u, 0u, 4294967295u,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},
{"INITIAL_WINDOW_SIZE", 65535u, 0u, 2147483647u,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE,
GRPC_HTTP2_FLOW_CONTROL_ERROR},
{"MAX_FRAME_SIZE", 16384u, 16384u, 16777215u,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},
{"MAX_HEADER_LIST_SIZE", 16777216u, 0u, 16777216u,
GRPC_CHTTP2_CLAMP_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},
{"GRPC_ALLOW_TRUE_BINARY_METADATA", 0u, 0u, 1u,
GRPC_CHTTP2_CLAMP_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},
};

@ -0,0 +1,74 @@
/*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Automatically generated by tools/codegen/core/gen_settings_ids.py
*/
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H
#include <stdbool.h>
#include <stdint.h>
typedef enum {
GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE = 0, /* wire id 1 */
GRPC_CHTTP2_SETTINGS_ENABLE_PUSH = 1, /* wire id 2 */
GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 2, /* wire id 3 */
GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 3, /* wire id 4 */
GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE = 4, /* wire id 5 */
GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 5, /* wire id 6 */
GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA = 6, /* wire id 65027 */
} grpc_chttp2_setting_id;
#define GRPC_CHTTP2_NUM_SETTINGS 7
extern const uint16_t grpc_setting_id_to_wire_id[];
bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out);
typedef enum {
GRPC_CHTTP2_CLAMP_INVALID_VALUE,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE
} grpc_chttp2_invalid_value_behavior;
typedef struct {
const char *name;
uint32_t default_value;
uint32_t min_value;
uint32_t max_value;
grpc_chttp2_invalid_value_behavior invalid_value_behavior;
uint32_t error_value;
} grpc_chttp2_setting_parameters;
extern const grpc_chttp2_setting_parameters
grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS];
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */

@ -219,10 +219,18 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
/* send initial metadata if it's available */ /* send initial metadata if it's available */
if (!sent_initial_metadata && s->send_initial_metadata) { if (!sent_initial_metadata && s->send_initial_metadata) {
grpc_chttp2_encode_header( grpc_encode_header_options hopt = {
exec_ctx, &t->hpack_compressor, s->id, s->send_initial_metadata, 0, .stream_id = s->id,
t->settings[GRPC_ACKED_SETTINGS][GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE], .is_eof = false,
&s->stats.outgoing, &t->outbuf); .use_true_binary_metadata =
t->settings
[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA] != 0,
.max_frame_size = t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
.stats = &s->stats.outgoing};
grpc_chttp2_encode_header(exec_ctx, &t->hpack_compressor,
s->send_initial_metadata, &hopt, &t->outbuf);
s->send_initial_metadata = NULL; s->send_initial_metadata = NULL;
s->sent_initial_metadata = true; s->sent_initial_metadata = true;
sent_initial_metadata = true; sent_initial_metadata = true;
@ -315,11 +323,21 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
grpc_chttp2_encode_data(s->id, &s->flow_controlled_buffer, 0, true, grpc_chttp2_encode_data(s->id, &s->flow_controlled_buffer, 0, true,
&s->stats.outgoing, &t->outbuf); &s->stats.outgoing, &t->outbuf);
} else { } else {
grpc_chttp2_encode_header( grpc_encode_header_options hopt = {
exec_ctx, &t->hpack_compressor, s->id, s->send_trailing_metadata, .stream_id = s->id,
true, t->settings[GRPC_ACKED_SETTINGS] .is_eof = true,
[GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE], .use_true_binary_metadata =
&s->stats.outgoing, &t->outbuf); t->settings
[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA] !=
0,
.max_frame_size =
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
.stats = &s->stats.outgoing};
grpc_chttp2_encode_header(exec_ctx, &t->hpack_compressor,
s->send_trailing_metadata, &hopt,
&t->outbuf);
} }
s->send_trailing_metadata = NULL; s->send_trailing_metadata = NULL;
s->sent_trailing_metadata = true; s->sent_trailing_metadata = true;

@ -1124,7 +1124,8 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
if (stream_state->rs.compressed) { if (stream_state->rs.compressed) {
stream_state->rs.sbs.base.flags |= GRPC_WRITE_INTERNAL_COMPRESS; stream_state->rs.sbs.base.flags |= GRPC_WRITE_INTERNAL_COMPRESS;
} }
*((grpc_byte_buffer **)stream_op->recv_message) = *((grpc_byte_buffer **)
stream_op->payload->recv_message.recv_message) =
(grpc_byte_buffer *)&stream_state->rs.sbs; (grpc_byte_buffer *)&stream_state->rs.sbs;
grpc_closure_sched( grpc_closure_sched(
exec_ctx, stream_op->payload->recv_message.recv_message_ready, exec_ctx, stream_op->payload->recv_message.recv_message_ready,

@ -218,14 +218,14 @@ static grpc_error* init_channel_elem(grpc_exec_ctx* exec_ctx,
if (strcmp(args->channel_args->args[i].key, if (strcmp(args->channel_args->args[i].key,
GRPC_ARG_MAX_SEND_MESSAGE_LENGTH) == 0) { GRPC_ARG_MAX_SEND_MESSAGE_LENGTH) == 0) {
const grpc_integer_options options = { const grpc_integer_options options = {
GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH, 0, INT_MAX}; GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH, -1, INT_MAX};
chand->max_send_size = chand->max_send_size =
grpc_channel_arg_get_integer(&args->channel_args->args[i], options); grpc_channel_arg_get_integer(&args->channel_args->args[i], options);
} }
if (strcmp(args->channel_args->args[i].key, if (strcmp(args->channel_args->args[i].key,
GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH) == 0) { GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH) == 0) {
const grpc_integer_options options = { const grpc_integer_options options = {
GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH, 0, INT_MAX}; GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH, -1, INT_MAX};
chand->max_recv_size = chand->max_recv_size =
grpc_channel_arg_get_integer(&args->channel_args->args[i], options); grpc_channel_arg_get_integer(&args->channel_args->args[i], options);
} }

@ -69,8 +69,9 @@ static int retry_named_port_failure(int status, request *r,
int retry_status; int retry_status;
uv_getaddrinfo_t *req = gpr_malloc(sizeof(uv_getaddrinfo_t)); uv_getaddrinfo_t *req = gpr_malloc(sizeof(uv_getaddrinfo_t));
req->data = r; req->data = r;
r->port = svc[i][1];
retry_status = uv_getaddrinfo(uv_default_loop(), req, getaddrinfo_cb, retry_status = uv_getaddrinfo(uv_default_loop(), req, getaddrinfo_cb,
r->host, svc[i][1], r->hints); r->host, r->port, r->hints);
if (retry_status < 0 || getaddrinfo_cb == NULL) { if (retry_status < 0 || getaddrinfo_cb == NULL) {
// The callback will not be called // The callback will not be called
gpr_free(req); gpr_free(req);

@ -55,7 +55,9 @@ int grpc_sockaddr_is_v4mapped(const grpc_resolved_address *resolved_addr,
GPR_ASSERT(resolved_addr != resolved_addr4_out); GPR_ASSERT(resolved_addr != resolved_addr4_out);
const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr; const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr;
struct sockaddr_in *addr4_out = struct sockaddr_in *addr4_out =
(struct sockaddr_in *)resolved_addr4_out->addr; resolved_addr4_out == NULL
? NULL
: (struct sockaddr_in *)resolved_addr4_out->addr;
if (addr->sa_family == AF_INET6) { if (addr->sa_family == AF_INET6) {
const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr; const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr;
if (memcmp(addr6->sin6_addr.s6_addr, kV4MappedPrefix, if (memcmp(addr6->sin6_addr.s6_addr, kV4MappedPrefix,

@ -71,7 +71,7 @@ typedef enum {
#define GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS 60 #define GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS 60
#define GRPC_COMPUTE_ENGINE_METADATA_HOST "metadata" #define GRPC_COMPUTE_ENGINE_METADATA_HOST "metadata.google.internal"
#define GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH \ #define GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH \
"/computeMetadata/v1/instance/service-accounts/default/token" "/computeMetadata/v1/instance/service-accounts/default/token"

@ -197,6 +197,7 @@ grpc_slice grpc_slice_new_with_len(void *p, size_t len,
} }
grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t length) { grpc_slice grpc_slice_from_copied_buffer(const char *source, size_t length) {
if (length == 0) return grpc_empty_slice();
grpc_slice slice = grpc_slice_malloc(length); grpc_slice slice = grpc_slice_malloc(length);
memcpy(GRPC_SLICE_START_PTR(slice), source, length); memcpy(GRPC_SLICE_START_PTR(slice), source, length);
return slice; return slice;
@ -382,8 +383,9 @@ grpc_slice grpc_slice_split_head(grpc_slice *source, size_t split) {
} }
int grpc_slice_default_eq_impl(grpc_slice a, grpc_slice b) { int grpc_slice_default_eq_impl(grpc_slice a, grpc_slice b) {
return GRPC_SLICE_LENGTH(a) == GRPC_SLICE_LENGTH(b) && if (GRPC_SLICE_LENGTH(a) != GRPC_SLICE_LENGTH(b)) return false;
0 == memcmp(GRPC_SLICE_START_PTR(a), GRPC_SLICE_START_PTR(b), if (GRPC_SLICE_LENGTH(a) == 0) return true;
return 0 == memcmp(GRPC_SLICE_START_PTR(a), GRPC_SLICE_START_PTR(b),
GRPC_SLICE_LENGTH(a)); GRPC_SLICE_LENGTH(a));
} }

@ -49,6 +49,7 @@ void grpc_pid_controller_reset(grpc_pid_controller *pid_controller) {
double grpc_pid_controller_update(grpc_pid_controller *pid_controller, double grpc_pid_controller_update(grpc_pid_controller *pid_controller,
double error, double dt) { double error, double dt) {
if (dt == 0) return pid_controller->last_control_value;
/* integrate error using the trapezoid rule */ /* integrate error using the trapezoid rule */
pid_controller->error_integral += pid_controller->error_integral +=
dt * (pid_controller->last_error + error) * 0.5; dt * (pid_controller->last_error + error) * 0.5;

@ -0,0 +1,62 @@
/*
*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <grpc++/support/error_details.h>
#include "src/proto/grpc/status/status.pb.h"
namespace grpc {
Status ExtractErrorDetails(const Status& from, ::google::rpc::Status* to) {
if (to == nullptr) {
return Status(StatusCode::FAILED_PRECONDITION, "");
}
if (!to->ParseFromString(from.error_details())) {
return Status(StatusCode::INVALID_ARGUMENT, "");
}
return Status::OK;
}
Status SetErrorDetails(const ::google::rpc::Status& from, Status* to) {
if (to == nullptr) {
return Status(StatusCode::FAILED_PRECONDITION, "");
}
StatusCode code = StatusCode::UNKNOWN;
if (from.code() >= StatusCode::OK && from.code() <= StatusCode::DATA_LOSS) {
code = static_cast<StatusCode>(from.code());
}
*to = Status(code, from.message(), from.SerializeAsString());
return Status::OK;
}
} // namespace grpc

@ -1,35 +0,0 @@
{
"version": "1.3.0-dev",
"title": "gRPC C# Auth",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",
"packOptions": {
"summary": "Auth library for C# implementation of gRPC - an RPC library and framework",
"description": "Auth library for C# implementation of gRPC - an RPC library and framework. See project site for more info.",
"owners": [ "grpc-packages" ],
"licenseUrl": "https://github.com/grpc/grpc/blob/master/LICENSE",
"projectUrl": "https://github.com/grpc/grpc",
"requireLicenseAcceptance": false,
"tags": [ "gRPC RPC Protocol HTTP/2 Auth OAuth2" ],
},
"buildOptions": {
"define": [ "SIGNED" ],
"keyFile": "../keys/Grpc.snk",
"xmlDoc": true,
"compile": {
"includeFiles": [ "../Grpc.Core/Version.cs" ]
}
},
"dependencies": {
"Grpc.Core": "1.3.0-dev",
"Google.Apis.Auth": "1.21.0"
},
"frameworks": {
"net45": { },
"netstandard1.5": {
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
}
}

@ -1,39 +0,0 @@
{
"version": "1.3.0-dev",
"title": "gRPC C# Core Testing",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2017, Google Inc.",
"packOptions": {
"summary": "Testing support for gRPC C#",
"description": "Useful when testing code that uses gRPC.",
"owners": [ "grpc-packages" ],
"licenseUrl": "https://github.com/grpc/grpc/blob/master/LICENSE",
"projectUrl": "https://github.com/grpc/grpc",
"requireLicenseAcceptance": false,
"tags": [ "gRPC test testing" ]
},
"buildOptions": {
"define": [ "SIGNED" ],
"keyFile": "../keys/Grpc.snk",
"xmlDoc": true,
"compile": {
"includeFiles": [ "../Grpc.Core/Version.cs" ]
}
},
"dependencies": {
"Grpc.Core": "1.3.0-dev"
},
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": ""
}
},
"netstandard1.5": {
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
}
}

@ -1,35 +0,0 @@
{
"version": "1.3.0-dev",
"title": "gRPC C# Healthchecking",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",
"packOptions": {
"summary": "Implementation of gRPC health service",
"description": "Example implementation of grpc.health.v1 service that can be used for health-checking.",
"owners": [ "grpc-packages" ],
"licenseUrl": "https://github.com/grpc/grpc/blob/master/LICENSE",
"projectUrl": "https://github.com/grpc/grpc",
"requireLicenseAcceptance": false,
"tags": [ "gRPC health check" ]
},
"buildOptions": {
"define": [ "SIGNED" ],
"keyFile": "../keys/Grpc.snk",
"xmlDoc": true,
"compile": {
"includeFiles": [ "../Grpc.Core/Version.cs" ]
}
},
"dependencies": {
"Grpc.Core": "1.3.0-dev",
"Google.Protobuf": "3.2.0"
},
"frameworks": {
"net45": {},
"netstandard1.5": {
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
}
}

@ -1,35 +0,0 @@
{
"version": "1.3.0-dev",
"title": "gRPC C# Reflection",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2016, Google Inc.",
"packOptions": {
"summary": "Implementation of gRPC reflection service",
"description": "Provides information about services running on a gRPC C# server.",
"owners": [ "grpc-packages" ],
"licenseUrl": "https://github.com/grpc/grpc/blob/master/LICENSE",
"projectUrl": "https://github.com/grpc/grpc",
"requireLicenseAcceptance": false,
"tags": [ "gRPC reflection" ]
},
"buildOptions": {
"define": [ "SIGNED" ],
"keyFile": "../keys/Grpc.snk",
"xmlDoc": true,
"compile": {
"includeFiles": [ "../Grpc.Core/Version.cs" ]
}
},
"dependencies": {
"Grpc.Core": "1.3.0-dev",
"Google.Protobuf": "3.2.0"
},
"frameworks": {
"net45": {},
"netstandard1.5": {
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
}
}

@ -99,7 +99,6 @@ Local<Value> nanErrorWithCode(const char *msg, grpc_call_error code) {
bool CreateMetadataArray(Local<Object> metadata, grpc_metadata_array *array) { bool CreateMetadataArray(Local<Object> metadata, grpc_metadata_array *array) {
HandleScope scope; HandleScope scope;
grpc_metadata_array_init(array);
Local<Array> keys = Nan::GetOwnPropertyNames(metadata).ToLocalChecked(); Local<Array> keys = Nan::GetOwnPropertyNames(metadata).ToLocalChecked();
for (unsigned int i = 0; i < keys->Length(); i++) { for (unsigned int i = 0; i < keys->Length(); i++) {
Local<String> current_key = Nan::To<String>( Local<String> current_key = Nan::To<String>(
@ -111,18 +110,20 @@ bool CreateMetadataArray(Local<Object> metadata, grpc_metadata_array *array) {
array->capacity += Local<Array>::Cast(value_array)->Length(); array->capacity += Local<Array>::Cast(value_array)->Length();
} }
array->metadata = reinterpret_cast<grpc_metadata*>( array->metadata = reinterpret_cast<grpc_metadata*>(
gpr_malloc(array->capacity * sizeof(grpc_metadata))); gpr_zalloc(array->capacity * sizeof(grpc_metadata)));
for (unsigned int i = 0; i < keys->Length(); i++) { for (unsigned int i = 0; i < keys->Length(); i++) {
Local<String> current_key(Nan::To<String>(keys->Get(i)).ToLocalChecked()); Local<String> current_key(Nan::To<String>(keys->Get(i)).ToLocalChecked());
Local<Array> values = Local<Array>::Cast( Local<Array> values = Local<Array>::Cast(
Nan::Get(metadata, current_key).ToLocalChecked()); Nan::Get(metadata, current_key).ToLocalChecked());
grpc_slice key_slice = grpc_slice_intern(CreateSliceFromString(current_key)); grpc_slice key_slice = CreateSliceFromString(current_key);
grpc_slice key_intern_slice = grpc_slice_intern(key_slice);
grpc_slice_unref(key_slice);
for (unsigned int j = 0; j < values->Length(); j++) { for (unsigned int j = 0; j < values->Length(); j++) {
Local<Value> value = Nan::Get(values, j).ToLocalChecked(); Local<Value> value = Nan::Get(values, j).ToLocalChecked();
grpc_metadata *current = &array->metadata[array->count]; grpc_metadata *current = &array->metadata[array->count];
current->key = key_slice; current->key = key_intern_slice;
// Only allow binary headers for "-bin" keys // Only allow binary headers for "-bin" keys
if (grpc_is_binary_header(key_slice)) { if (grpc_is_binary_header(key_intern_slice)) {
if (::node::Buffer::HasInstance(value)) { if (::node::Buffer::HasInstance(value)) {
current->value = CreateSliceFromBuffer(value); current->value = CreateSliceFromBuffer(value);
} else { } else {
@ -142,6 +143,14 @@ bool CreateMetadataArray(Local<Object> metadata, grpc_metadata_array *array) {
return true; return true;
} }
void DestroyMetadataArray(grpc_metadata_array *array) {
for (size_t i = 0; i < array->count; i++) {
// Don't unref keys because they are interned
grpc_slice_unref(array->metadata[i].value);
}
grpc_metadata_array_destroy(array);
}
Local<Value> ParseMetadata(const grpc_metadata_array *metadata_array) { Local<Value> ParseMetadata(const grpc_metadata_array *metadata_array) {
EscapableHandleScope scope; EscapableHandleScope scope;
grpc_metadata *metadata_elements = metadata_array->metadata; grpc_metadata *metadata_elements = metadata_array->metadata;
@ -179,6 +188,12 @@ Op::~Op() {
class SendMetadataOp : public Op { class SendMetadataOp : public Op {
public: public:
SendMetadataOp() {
grpc_metadata_array_init(&send_metadata);
}
~SendMetadataOp() {
DestroyMetadataArray(&send_metadata);
}
Local<Value> GetNodeValue() const { Local<Value> GetNodeValue() const {
EscapableHandleScope scope; EscapableHandleScope scope;
return scope.Escape(Nan::True()); return scope.Escape(Nan::True());
@ -187,17 +202,16 @@ class SendMetadataOp : public Op {
if (!value->IsObject()) { if (!value->IsObject()) {
return false; return false;
} }
grpc_metadata_array array;
MaybeLocal<Object> maybe_metadata = Nan::To<Object>(value); MaybeLocal<Object> maybe_metadata = Nan::To<Object>(value);
if (maybe_metadata.IsEmpty()) { if (maybe_metadata.IsEmpty()) {
return false; return false;
} }
if (!CreateMetadataArray(maybe_metadata.ToLocalChecked(), if (!CreateMetadataArray(maybe_metadata.ToLocalChecked(),
&array)) { &send_metadata)) {
return false; return false;
} }
out->data.send_initial_metadata.count = array.count; out->data.send_initial_metadata.count = send_metadata.count;
out->data.send_initial_metadata.metadata = array.metadata; out->data.send_initial_metadata.metadata = send_metadata.metadata;
return true; return true;
} }
bool IsFinalOp() { bool IsFinalOp() {
@ -207,6 +221,8 @@ class SendMetadataOp : public Op {
std::string GetTypeString() const { std::string GetTypeString() const {
return "send_metadata"; return "send_metadata";
} }
private:
grpc_metadata_array send_metadata;
}; };
class SendMessageOp : public Op { class SendMessageOp : public Op {
@ -272,8 +288,12 @@ class SendClientCloseOp : public Op {
class SendServerStatusOp : public Op { class SendServerStatusOp : public Op {
public: public:
SendServerStatusOp() {
grpc_metadata_array_init(&status_metadata);
}
~SendServerStatusOp() { ~SendServerStatusOp() {
grpc_slice_unref(details); grpc_slice_unref(details);
DestroyMetadataArray(&status_metadata);
} }
Local<Value> GetNodeValue() const { Local<Value> GetNodeValue() const {
EscapableHandleScope scope; EscapableHandleScope scope;
@ -313,12 +333,13 @@ class SendServerStatusOp : public Op {
} }
Local<String> details = Nan::To<String>( Local<String> details = Nan::To<String>(
maybe_details.ToLocalChecked()).ToLocalChecked(); maybe_details.ToLocalChecked()).ToLocalChecked();
grpc_metadata_array array; if (!CreateMetadataArray(metadata, &status_metadata)) {
if (!CreateMetadataArray(metadata, &array)) {
return false; return false;
} }
out->data.send_status_from_server.trailing_metadata_count = array.count; out->data.send_status_from_server.trailing_metadata_count =
out->data.send_status_from_server.trailing_metadata = array.metadata; status_metadata.count;
out->data.send_status_from_server.trailing_metadata =
status_metadata.metadata;
out->data.send_status_from_server.status = out->data.send_status_from_server.status =
static_cast<grpc_status_code>(code); static_cast<grpc_status_code>(code);
this->details = CreateSliceFromString(details); this->details = CreateSliceFromString(details);
@ -335,6 +356,7 @@ class SendServerStatusOp : public Op {
private: private:
grpc_slice details; grpc_slice details;
grpc_metadata_array status_metadata;
}; };
class GetMetadataOp : public Op { class GetMetadataOp : public Op {
@ -466,8 +488,10 @@ class ServerCloseResponseOp : public Op {
int cancelled; int cancelled;
}; };
tag::tag(Callback *callback, OpVec *ops, Call *call) : tag::tag(Callback *callback, OpVec *ops, Call *call, Local<Value> call_value) :
callback(callback), ops(ops), call(call){ callback(callback), ops(ops), call(call){
HandleScope scope;
call_persist.Reset(call_value);
} }
tag::~tag() { tag::~tag() {
@ -513,15 +537,20 @@ void DestroyTag(void *tag) {
delete tag_struct; delete tag_struct;
} }
void Call::DestroyCall() {
if (this->wrapped_call != NULL) {
grpc_call_destroy(this->wrapped_call);
this->wrapped_call = NULL;
}
}
Call::Call(grpc_call *call) : wrapped_call(call), Call::Call(grpc_call *call) : wrapped_call(call),
pending_batches(0), pending_batches(0),
has_final_op_completed(false) { has_final_op_completed(false) {
} }
Call::~Call() { Call::~Call() {
if (wrapped_call != NULL) { DestroyCall();
grpc_call_destroy(wrapped_call);
}
} }
void Call::Init(Local<Object> exports) { void Call::Init(Local<Object> exports) {
@ -568,12 +597,19 @@ void Call::CompleteBatch(bool is_final_op) {
} }
this->pending_batches--; this->pending_batches--;
if (this->has_final_op_completed && this->pending_batches == 0) { if (this->has_final_op_completed && this->pending_batches == 0) {
grpc_call_destroy(this->wrapped_call); this->DestroyCall();
this->wrapped_call = NULL;
} }
} }
NAN_METHOD(Call::New) { NAN_METHOD(Call::New) {
/* Arguments:
* 0: Channel to make the call on
* 1: Method
* 2: Deadline
* 3: host
* 4: parent Call
* 5: propagation flags
*/
if (info.IsConstructCall()) { if (info.IsConstructCall()) {
Call *call; Call *call;
if (info[0]->IsExternal()) { if (info[0]->IsExternal()) {
@ -618,25 +654,26 @@ NAN_METHOD(Call::New) {
double deadline = Nan::To<double>(info[2]).FromJust(); double deadline = Nan::To<double>(info[2]).FromJust();
grpc_channel *wrapped_channel = channel->GetWrappedChannel(); grpc_channel *wrapped_channel = channel->GetWrappedChannel();
grpc_call *wrapped_call; grpc_call *wrapped_call;
grpc_slice method = CreateSliceFromString(
Nan::To<String>(info[1]).ToLocalChecked());
if (info[3]->IsString()) { if (info[3]->IsString()) {
grpc_slice *host = new grpc_slice; grpc_slice *host = new grpc_slice;
*host = CreateSliceFromString( *host = CreateSliceFromString(
Nan::To<String>(info[3]).ToLocalChecked()); Nan::To<String>(info[3]).ToLocalChecked());
wrapped_call = grpc_channel_create_call( wrapped_call = grpc_channel_create_call(
wrapped_channel, parent_call, propagate_flags, wrapped_channel, parent_call, propagate_flags,
GetCompletionQueue(), CreateSliceFromString( GetCompletionQueue(), method,
Nan::To<String>(info[1]).ToLocalChecked()),
host, MillisecondsToTimespec(deadline), NULL); host, MillisecondsToTimespec(deadline), NULL);
delete host; delete host;
} else if (info[3]->IsUndefined() || info[3]->IsNull()) { } else if (info[3]->IsUndefined() || info[3]->IsNull()) {
wrapped_call = grpc_channel_create_call( wrapped_call = grpc_channel_create_call(
wrapped_channel, parent_call, propagate_flags, wrapped_channel, parent_call, propagate_flags,
GetCompletionQueue(), CreateSliceFromString( GetCompletionQueue(), method,
Nan::To<String>(info[1]).ToLocalChecked()),
NULL, MillisecondsToTimespec(deadline), NULL); NULL, MillisecondsToTimespec(deadline), NULL);
} else { } else {
return Nan::ThrowTypeError("Call's fourth argument must be a string"); return Nan::ThrowTypeError("Call's fourth argument must be a string");
} }
grpc_slice_unref(method);
call = new Call(wrapped_call); call = new Call(wrapped_call);
Nan::Set(info.This(), Nan::New("channel_").ToLocalChecked(), Nan::Set(info.This(), Nan::New("channel_").ToLocalChecked(),
channel_object); channel_object);
@ -721,7 +758,7 @@ NAN_METHOD(Call::StartBatch) {
Callback *callback = new Callback(callback_func); Callback *callback = new Callback(callback_func);
grpc_call_error error = grpc_call_start_batch( grpc_call_error error = grpc_call_start_batch(
call->wrapped_call, &ops[0], nops, new struct tag( call->wrapped_call, &ops[0], nops, new struct tag(
callback, op_vector.release(), call), NULL); callback, op_vector.release(), call, info.This()), NULL);
if (error != GRPC_CALL_OK) { if (error != GRPC_CALL_OK) {
return Nan::ThrowError(nanErrorWithCode("startBatch failed", error)); return Nan::ThrowError(nanErrorWithCode("startBatch failed", error));
} }

@ -58,6 +58,8 @@ v8::Local<v8::Value> ParseMetadata(const grpc_metadata_array *metadata_array);
bool CreateMetadataArray(v8::Local<v8::Object> metadata, bool CreateMetadataArray(v8::Local<v8::Object> metadata,
grpc_metadata_array *array); grpc_metadata_array *array);
void DestroyMetadataArray(grpc_metadata_array *array);
/* Wrapper class for grpc_call structs. */ /* Wrapper class for grpc_call structs. */
class Call : public Nan::ObjectWrap { class Call : public Nan::ObjectWrap {
public: public:
@ -76,6 +78,8 @@ class Call : public Nan::ObjectWrap {
Call(const Call &); Call(const Call &);
Call &operator=(const Call &); Call &operator=(const Call &);
void DestroyCall();
static NAN_METHOD(New); static NAN_METHOD(New);
static NAN_METHOD(StartBatch); static NAN_METHOD(StartBatch);
static NAN_METHOD(Cancel); static NAN_METHOD(Cancel);
@ -109,11 +113,14 @@ class Op {
typedef std::vector<unique_ptr<Op>> OpVec; typedef std::vector<unique_ptr<Op>> OpVec;
struct tag { struct tag {
tag(Nan::Callback *callback, OpVec *ops, Call *call); tag(Nan::Callback *callback, OpVec *ops, Call *call,
v8::Local<v8::Value> call_value);
~tag(); ~tag();
Nan::Callback *callback; Nan::Callback *callback;
OpVec *ops; OpVec *ops;
Call *call; Call *call;
Nan::Persistent<v8::Value, Nan::CopyablePersistentTraits<v8::Value>>
call_persist;
}; };
v8::Local<v8::Value> GetTagNodeValue(void *tag); v8::Local<v8::Value> GetTagNodeValue(void *tag);

@ -211,6 +211,7 @@ NAN_METHOD(PluginCallback) {
Utf8String details_utf8_str(info[1]); Utf8String details_utf8_str(info[1]);
char *details = *details_utf8_str; char *details = *details_utf8_str;
grpc_metadata_array array; grpc_metadata_array array;
grpc_metadata_array_init(&array);
Local<Object> callback_data = Nan::To<Object>(info[3]).ToLocalChecked(); Local<Object> callback_data = Nan::To<Object>(info[3]).ToLocalChecked();
if (!CreateMetadataArray(Nan::To<Object>(info[2]).ToLocalChecked(), if (!CreateMetadataArray(Nan::To<Object>(info[2]).ToLocalChecked(),
&array)){ &array)){
@ -226,6 +227,7 @@ NAN_METHOD(PluginCallback) {
Nan::New("user_data").ToLocalChecked() Nan::New("user_data").ToLocalChecked()
).ToLocalChecked().As<External>()->Value(); ).ToLocalChecked().As<External>()->Value();
cb(user_data, array.metadata, array.count, code, details); cb(user_data, array.metadata, array.count, code, details);
DestroyMetadataArray(&array);
} }
NAUV_WORK_CB(SendPluginCallback) { NAUV_WORK_CB(SendPluginCallback) {

@ -280,7 +280,7 @@ NAN_METHOD(Channel::WatchConnectivityState) {
channel->wrapped_channel, last_state, MillisecondsToTimespec(deadline), channel->wrapped_channel, last_state, MillisecondsToTimespec(deadline),
GetCompletionQueue(), GetCompletionQueue(),
new struct tag(callback, new struct tag(callback,
ops.release(), NULL)); ops.release(), NULL, Nan::Null()));
CompletionQueueNext(); CompletionQueueNext();
} }

@ -286,8 +286,10 @@ NAN_METHOD(MetadataKeyIsLegal) {
"headerKeyIsLegal's argument must be a string"); "headerKeyIsLegal's argument must be a string");
} }
Local<String> key = Nan::To<String>(info[0]).ToLocalChecked(); Local<String> key = Nan::To<String>(info[0]).ToLocalChecked();
grpc_slice slice = CreateSliceFromString(key);
info.GetReturnValue().Set(static_cast<bool>( info.GetReturnValue().Set(static_cast<bool>(
grpc_header_key_is_legal(CreateSliceFromString(key)))); grpc_header_key_is_legal(slice)));
grpc_slice_unref(slice);
} }
NAN_METHOD(MetadataNonbinValueIsLegal) { NAN_METHOD(MetadataNonbinValueIsLegal) {
@ -296,8 +298,10 @@ NAN_METHOD(MetadataNonbinValueIsLegal) {
"metadataNonbinValueIsLegal's argument must be a string"); "metadataNonbinValueIsLegal's argument must be a string");
} }
Local<String> value = Nan::To<String>(info[0]).ToLocalChecked(); Local<String> value = Nan::To<String>(info[0]).ToLocalChecked();
grpc_slice slice = CreateSliceFromString(value);
info.GetReturnValue().Set(static_cast<bool>( info.GetReturnValue().Set(static_cast<bool>(
grpc_header_nonbin_value_is_legal(CreateSliceFromString(value)))); grpc_header_nonbin_value_is_legal(slice)));
grpc_slice_unref(slice);
} }
NAN_METHOD(MetadataKeyIsBinary) { NAN_METHOD(MetadataKeyIsBinary) {
@ -306,8 +310,10 @@ NAN_METHOD(MetadataKeyIsBinary) {
"metadataKeyIsLegal's argument must be a string"); "metadataKeyIsLegal's argument must be a string");
} }
Local<String> key = Nan::To<String>(info[0]).ToLocalChecked(); Local<String> key = Nan::To<String>(info[0]).ToLocalChecked();
grpc_slice slice = CreateSliceFromString(key);
info.GetReturnValue().Set(static_cast<bool>( info.GetReturnValue().Set(static_cast<bool>(
grpc_is_binary_header(CreateSliceFromString(key)))); grpc_is_binary_header(slice)));
grpc_slice_unref(slice);
} }
static grpc_ssl_roots_override_result get_ssl_roots_override( static grpc_ssl_roots_override_result get_ssl_roots_override(

@ -193,7 +193,7 @@ NAN_METHOD(Server::RequestCall) {
GetCompletionQueue(), GetCompletionQueue(),
GetCompletionQueue(), GetCompletionQueue(),
new struct tag(new Callback(info[0].As<Function>()), ops.release(), new struct tag(new Callback(info[0].As<Function>()), ops.release(),
NULL)); NULL, Nan::Null()));
if (error != GRPC_CALL_OK) { if (error != GRPC_CALL_OK) {
return Nan::ThrowError(nanErrorWithCode("requestCall failed", error)); return Nan::ThrowError(nanErrorWithCode("requestCall failed", error));
} }
@ -246,7 +246,7 @@ NAN_METHOD(Server::TryShutdown) {
grpc_server_shutdown_and_notify( grpc_server_shutdown_and_notify(
server->wrapped_server, GetCompletionQueue(), server->wrapped_server, GetCompletionQueue(),
new struct tag(new Nan::Callback(info[0].As<Function>()), ops.release(), new struct tag(new Nan::Callback(info[0].As<Function>()), ops.release(),
NULL)); NULL, Nan::Null()));
CompletionQueueNext(); CompletionQueueNext();
} }

@ -118,7 +118,8 @@ void Server::ShutdownServer() {
grpc_server_shutdown_and_notify( grpc_server_shutdown_and_notify(
this->wrapped_server, GetCompletionQueue(), this->wrapped_server, GetCompletionQueue(),
new struct tag(new Callback(**shutdown_callback), ops.release(), NULL)); new struct tag(new Callback(**shutdown_callback), ops.release(), NULL,
Nan::Null()));
grpc_server_cancel_all_calls(this->wrapped_server); grpc_server_cancel_all_calls(this->wrapped_server);
CompletionQueueNext(); CompletionQueueNext();
this->wrapped_server = NULL; this->wrapped_server = NULL;

@ -100,6 +100,15 @@
return 0; return 0;
} }
+ (void)setUp {
#ifdef GRPC_COMPILE_WITH_CRONET
// Cronet setup
[Cronet setHttp2Enabled:YES];
[Cronet start];
[GRPCCall useCronetWithEngine:[Cronet getGlobalEngine]];
#endif
}
- (void)setUp { - (void)setUp {
self.continueAfterFailure = NO; self.continueAfterFailure = NO;

@ -0,0 +1,43 @@
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
licenses(["notice"]) # 3-clause BSD
package(default_visibility = ["//visibility:public"])
load("//bazel:grpc_build_system.bzl", "grpc_proto_library")
grpc_proto_library(
name = "status_proto",
srcs = ["status.proto"],
has_services = False,
well_known_protos = "@submodule_protobuf//:well_known_protos",
)

@ -0,0 +1,2 @@
The status.proto file is copied from
https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto.

@ -0,0 +1,92 @@
// Copyright 2016 Google Inc.
//
// 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.
syntax = "proto3";
package google.rpc;
import "google/protobuf/any.proto";
option go_package = "google.golang.org/genproto/googleapis/rpc/status;status";
option java_multiple_files = true;
option java_outer_classname = "StatusProto";
option java_package = "com.google.rpc";
option objc_class_prefix = "RPC";
// The `Status` type defines a logical error model that is suitable for different
// programming environments, including REST APIs and RPC APIs. It is used by
// [gRPC](https://github.com/grpc). The error model is designed to be:
//
// - Simple to use and understand for most users
// - Flexible enough to meet unexpected needs
//
// # Overview
//
// The `Status` message contains three pieces of data: error code, error message,
// and error details. The error code should be an enum value of
// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The
// error message should be a developer-facing English message that helps
// developers *understand* and *resolve* the error. If a localized user-facing
// error message is needed, put the localized message in the error details or
// localize it in the client. The optional error details may contain arbitrary
// information about the error. There is a predefined set of error detail types
// in the package `google.rpc` which can be used for common error conditions.
//
// # Language mapping
//
// The `Status` message is the logical representation of the error model, but it
// is not necessarily the actual wire format. When the `Status` message is
// exposed in different client libraries and different wire protocols, it can be
// mapped differently. For example, it will likely be mapped to some exceptions
// in Java, but more likely mapped to some error codes in C.
//
// # Other uses
//
// The error model and the `Status` message can be used in a variety of
// environments, either with or without APIs, to provide a
// consistent developer experience across different environments.
//
// Example uses of this error model include:
//
// - Partial errors. If a service needs to return partial errors to the client,
// it may embed the `Status` in the normal response to indicate the partial
// errors.
//
// - Workflow errors. A typical workflow has multiple steps. Each step may
// have a `Status` message for error reporting purpose.
//
// - Batch operations. If a client uses batch request and batch response, the
// `Status` message should be used directly inside batch response, one for
// each error sub-response.
//
// - Asynchronous operations. If an API call embeds asynchronous operation
// results in its response, the status of those operations should be
// represented directly using the `Status` message.
//
// - Logging. If some API errors are stored in logs, the message `Status` could
// be used directly after any stripping needed for security/privacy reasons.
message Status {
// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
int32 code = 1;
// A developer-facing error message, which should be in English. Any
// user-facing error message should be localized and sent in the
// [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
string message = 2;
// A list of messages that carry the error details. There will be a
// common set of message types for APIs to use.
repeated google.protobuf.Any details = 3;
}

@ -217,6 +217,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/transport/chttp2/transport/hpack_encoder.c', 'src/core/ext/transport/chttp2/transport/hpack_encoder.c',
'src/core/ext/transport/chttp2/transport/hpack_parser.c', 'src/core/ext/transport/chttp2/transport/hpack_parser.c',
'src/core/ext/transport/chttp2/transport/hpack_table.c', 'src/core/ext/transport/chttp2/transport/hpack_table.c',
'src/core/ext/transport/chttp2/transport/http2_settings.c',
'src/core/ext/transport/chttp2/transport/huffsyms.c', 'src/core/ext/transport/chttp2/transport/huffsyms.c',
'src/core/ext/transport/chttp2/transport/incoming_metadata.c', 'src/core/ext/transport/chttp2/transport/incoming_metadata.c',
'src/core/ext/transport/chttp2/transport/parsing.c', 'src/core/ext/transport/chttp2/transport/parsing.c',

@ -52,28 +52,31 @@ describe GRPC::Pool do
expect(p.ready_for_work?).to be(false) expect(p.ready_for_work?).to be(false)
end end
it 'it stops being ready after all workers jobs waiting or running' do it 'it stops being ready after all workers are busy' do
p = Pool.new(5) p = Pool.new(5)
p.start p.start
job = proc { sleep(3) } # sleep so workers busy when done scheduling
5.times do wait_mu = Mutex.new
expect(p.ready_for_work?).to be(true) wait_cv = ConditionVariable.new
p.schedule(&job) wait = true
job = proc do
wait_mu.synchronize do
wait_cv.wait(wait_mu) while wait
end
end end
expect(p.ready_for_work?).to be(false)
end
it 'it becomes ready again after jobs complete' do
p = Pool.new(5)
p.start
job = proc {}
5.times do 5.times do
expect(p.ready_for_work?).to be(true) expect(p.ready_for_work?).to be(true)
p.schedule(&job) p.schedule(&job)
end end
expect(p.ready_for_work?).to be(false) expect(p.ready_for_work?).to be(false)
sleep 5 # give the pool time do get at least one task done
expect(p.ready_for_work?).to be(true) wait_mu.synchronize do
wait = false
wait_cv.broadcast
end
end end
end end
@ -105,13 +108,20 @@ describe GRPC::Pool do
it 'stops jobs when there are long running jobs' do it 'stops jobs when there are long running jobs' do
p = Pool.new(1) p = Pool.new(1)
p.start p.start
o, q = Object.new, Queue.new
wait_forever_mu = Mutex.new
wait_forever_cv = ConditionVariable.new
wait_forever = true
job_running = Queue.new
job = proc do job = proc do
sleep(5) # long running job_running.push(Object.new)
q.push(o) wait_forever_mu.synchronize do
wait_forever_cv.wait while wait_forever
end
end end
p.schedule(&job) p.schedule(&job)
sleep(1) # should ensure the long job gets scheduled job_running.pop
expect { p.stop }.not_to raise_error expect { p.stop }.not_to raise_error
end end
end end

@ -212,6 +212,7 @@
if(NOT PROTOBUF_ROOT_DIR) if(NOT PROTOBUF_ROOT_DIR)
set(PROTOBUF_ROOT_DIR <%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/third_party/protobuf) set(PROTOBUF_ROOT_DIR <%text>${CMAKE_CURRENT_SOURCE_DIR}</%text>/third_party/protobuf)
endif() endif()
set(PROTOBUF_WELLKNOWN_IMPORT_DIR <%text>${PROTOBUF_ROOT_DIR}</%text>/src)
if(EXISTS "<%text>${PROTOBUF_ROOT_DIR}</%text>/cmake/CMakeLists.txt") if(EXISTS "<%text>${PROTOBUF_ROOT_DIR}</%text>/cmake/CMakeLists.txt")
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link static runtime libraries") set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link static runtime libraries")
add_subdirectory(<%text>${PROTOBUF_ROOT_DIR}</%text>/cmake third_party/protobuf) add_subdirectory(<%text>${PROTOBUF_ROOT_DIR}</%text>/cmake third_party/protobuf)
@ -244,6 +245,7 @@
find_package(Protobuf MODULE) find_package(Protobuf MODULE)
set(_gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND)\n find_package(Protobuf)\nendif()") set(_gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND)\n find_package(Protobuf)\nendif()")
endif() endif()
set(PROTOBUF_WELLKNOWN_IMPORT_DIR /usr/local/include)
endif() endif()
if("<%text>${gRPC_SSL_PROVIDER}</%text>" STREQUAL "module") if("<%text>${gRPC_SSL_PROVIDER}</%text>" STREQUAL "module")
@ -346,7 +348,7 @@
return() return()
endif() endif()
set(_protobuf_include_path -I .) set(_protobuf_include_path -I . -I <%text>${PROTOBUF_WELLKNOWN_IMPORT_DIR}</%text>)
foreach(FIL <%text>${ARGN}</%text>) foreach(FIL <%text>${ARGN}</%text>)
get_filename_component(ABS_FIL <%text>${FIL}</%text> ABSOLUTE) get_filename_component(ABS_FIL <%text>${FIL}</%text> ABSOLUTE)
get_filename_component(FIL_WE <%text>${FIL}</%text> NAME_WE) get_filename_component(FIL_WE <%text>${FIL}</%text> NAME_WE)

@ -217,9 +217,10 @@
# the OpenSSL headers, from the downloaded Node development package, # the OpenSSL headers, from the downloaded Node development package,
# which is typically located in `.node-gyp` in your home directory. # which is typically located in `.node-gyp` in your home directory.
'target_name': 'WINDOWS_BUILD_WARNING', 'target_name': 'WINDOWS_BUILD_WARNING',
'actions': [ 'rules': [
{ {
'action_name': 'WINDOWS_BUILD_WARNING', 'rule_name': 'WINDOWS_BUILD_WARNING',
'extension': 'S',
'inputs': [ 'inputs': [
'package.json' 'package.json'
], ],

@ -582,7 +582,7 @@ static void on_oauth2_creds_get_metadata_failure(
static void validate_compute_engine_http_request( static void validate_compute_engine_http_request(
const grpc_httpcli_request *request) { const grpc_httpcli_request *request) {
GPR_ASSERT(request->handshaker != &grpc_httpcli_ssl); GPR_ASSERT(request->handshaker != &grpc_httpcli_ssl);
GPR_ASSERT(strcmp(request->host, "metadata") == 0); GPR_ASSERT(strcmp(request->host, "metadata.google.internal") == 0);
GPR_ASSERT( GPR_ASSERT(
strcmp(request->http.path, strcmp(request->http.path,
"/computeMetadata/v1/instance/service-accounts/default/token") == "/computeMetadata/v1/instance/service-accounts/default/token") ==

@ -60,9 +60,9 @@ size_t cap_to_delete = 0;
/* verify that the output generated by encoding the stream matches the /* verify that the output generated by encoding the stream matches the
hexstring passed in */ hexstring passed in */
static void verify(grpc_exec_ctx *exec_ctx, size_t window_available, int eof, static void verify(grpc_exec_ctx *exec_ctx, size_t window_available, bool eof,
size_t expect_window_used, const char *expected, bool use_true_binary_metadata, size_t expect_window_used,
size_t nheaders, ...) { const char *expected, size_t nheaders, ...) {
grpc_slice_buffer output; grpc_slice_buffer output;
grpc_slice merged; grpc_slice merged;
grpc_slice expect = parse_hexstring(expected); grpc_slice expect = parse_hexstring(expected);
@ -103,8 +103,14 @@ static void verify(grpc_exec_ctx *exec_ctx, size_t window_available, int eof,
grpc_transport_one_way_stats stats; grpc_transport_one_way_stats stats;
memset(&stats, 0, sizeof(stats)); memset(&stats, 0, sizeof(stats));
grpc_chttp2_encode_header(exec_ctx, &g_compressor, 0xdeadbeef, &b, eof, 16384, grpc_encode_header_options hopt = {
&stats, &output); .stream_id = 0xdeadbeef,
.is_eof = eof,
.use_true_binary_metadata = use_true_binary_metadata,
.max_frame_size = 16384,
.stats = &stats,
};
grpc_chttp2_encode_header(exec_ctx, &g_compressor, &b, &hopt, &output);
merged = grpc_slice_merge(output.slices, output.count); merged = grpc_slice_merge(output.slices, output.count);
grpc_slice_buffer_destroy_internal(exec_ctx, &output); grpc_slice_buffer_destroy_internal(exec_ctx, &output);
grpc_metadata_batch_destroy(exec_ctx, &b); grpc_metadata_batch_destroy(exec_ctx, &b);
@ -127,25 +133,28 @@ static void verify(grpc_exec_ctx *exec_ctx, size_t window_available, int eof,
static void test_basic_headers(grpc_exec_ctx *exec_ctx) { static void test_basic_headers(grpc_exec_ctx *exec_ctx) {
int i; int i;
verify(exec_ctx, 0, 0, 0, "000005 0104 deadbeef 40 0161 0161", 1, "a", "a"); verify(exec_ctx, 0, false, false, 0, "000005 0104 deadbeef 40 0161 0161", 1,
verify(exec_ctx, 0, 0, 0, "000001 0104 deadbeef be", 1, "a", "a"); "a", "a");
verify(exec_ctx, 0, 0, 0, "000001 0104 deadbeef be", 1, "a", "a"); verify(exec_ctx, 0, false, false, 0, "000001 0104 deadbeef be", 1, "a", "a");
verify(exec_ctx, 0, 0, 0, "000006 0104 deadbeef be 40 0162 0163", 2, "a", "a", verify(exec_ctx, 0, false, false, 0, "000001 0104 deadbeef be", 1, "a", "a");
"b", "c"); verify(exec_ctx, 0, false, false, 0, "000006 0104 deadbeef be 40 0162 0163",
verify(exec_ctx, 0, 0, 0, "000002 0104 deadbeef bf be", 2, "a", "a", "b", 2, "a", "a", "b", "c");
"c"); verify(exec_ctx, 0, false, false, 0, "000002 0104 deadbeef bf be", 2, "a",
verify(exec_ctx, 0, 0, 0, "000004 0104 deadbeef 7f 00 0164", 1, "a", "d"); "a", "b", "c");
verify(exec_ctx, 0, false, false, 0, "000004 0104 deadbeef 7f 00 0164", 1,
"a", "d");
/* flush out what's there to make a few values look very popular */ /* flush out what's there to make a few values look very popular */
for (i = 0; i < 350; i++) { for (i = 0; i < 350; i++) {
verify(exec_ctx, 0, 0, 0, "000003 0104 deadbeef c0 bf be", 3, "a", "a", "b", verify(exec_ctx, 0, false, false, 0, "000003 0104 deadbeef c0 bf be", 3,
"c", "a", "d"); "a", "a", "b", "c", "a", "d");
} }
verify(exec_ctx, 0, 0, 0, "000006 0104 deadbeef c0 00 016b 0176", 2, "a", "a", verify(exec_ctx, 0, false, false, 0, "000006 0104 deadbeef c0 00 016b 0176",
"k", "v"); 2, "a", "a", "k", "v");
/* this could be 000004 0104 deadbeef 0f 30 0176 also */ /* this could be 000004 0104 deadbeef 0f 30 0176 also */
verify(exec_ctx, 0, 0, 0, "000004 0104 deadbeef 0f 2f 0176", 1, "a", "v"); verify(exec_ctx, 0, false, false, 0, "000004 0104 deadbeef 0f 2f 0176", 1,
"a", "v");
} }
static void encode_int_to_str(int i, char *p) { static void encode_int_to_str(int i, char *p) {
@ -179,17 +188,17 @@ static void test_decode_table_overflow(grpc_exec_ctx *exec_ctx) {
} }
if (i > 0) { if (i > 0) {
verify(exec_ctx, 0, 0, 0, expect, 2, "aa", "ba", key, value); verify(exec_ctx, 0, false, false, 0, expect, 2, "aa", "ba", key, value);
} else { } else {
verify(exec_ctx, 0, 0, 0, expect, 1, key, value); verify(exec_ctx, 0, false, false, 0, expect, 1, key, value);
} }
gpr_free(expect); gpr_free(expect);
} }
/* if the above passes, then we must have just knocked this pair out of the /* if the above passes, then we must have just knocked this pair out of the
decoder stack, and so we'll be forced to re-encode it */ decoder stack, and so we'll be forced to re-encode it */
verify(exec_ctx, 0, 0, 0, "000007 0104 deadbeef 40 026161 026261", 1, "aa", verify(exec_ctx, 0, false, false, 0, "000007 0104 deadbeef 40 026161 026261",
"ba"); 1, "aa", "ba");
} }
static void verify_table_size_change_match_elem_size(grpc_exec_ctx *exec_ctx, static void verify_table_size_change_match_elem_size(grpc_exec_ctx *exec_ctx,
@ -214,8 +223,12 @@ static void verify_table_size_change_match_elem_size(grpc_exec_ctx *exec_ctx,
grpc_transport_one_way_stats stats; grpc_transport_one_way_stats stats;
memset(&stats, 0, sizeof(stats)); memset(&stats, 0, sizeof(stats));
grpc_chttp2_encode_header(exec_ctx, &g_compressor, 0xdeadbeef, &b, 0, 16384, grpc_encode_header_options hopt = {.stream_id = 0xdeadbeef,
&stats, &output); .is_eof = false,
.use_true_binary_metadata = false,
.max_frame_size = 16384,
.stats = &stats};
grpc_chttp2_encode_header(exec_ctx, &g_compressor, &b, &hopt, &output);
grpc_slice_buffer_destroy_internal(exec_ctx, &output); grpc_slice_buffer_destroy_internal(exec_ctx, &output);
grpc_metadata_batch_destroy(exec_ctx, &b); grpc_metadata_batch_destroy(exec_ctx, &b);

@ -90,10 +90,15 @@ static void BM_HpackEncoderEncodeHeader(benchmark::State &state) {
grpc_slice_buffer outbuf; grpc_slice_buffer outbuf;
grpc_slice_buffer_init(&outbuf); grpc_slice_buffer_init(&outbuf);
while (state.KeepRunning()) { while (state.KeepRunning()) {
uint32_t stream_id = static_cast<uint32_t>(state.iterations()); grpc_encode_header_options hopt = {
grpc_chttp2_encode_header(&exec_ctx, &c, stream_id, &b, state.range(0), static_cast<uint32_t>(state.iterations()),
state.range(1), &stats, &outbuf); state.range(0) != 0,
if (!logged_representative_output) { Fixture::kEnableTrueBinary,
(size_t)state.range(1),
&stats,
};
grpc_chttp2_encode_header(&exec_ctx, &c, &b, &hopt, &outbuf);
if (!logged_representative_output && state.iterations() > 3) {
logged_representative_output = true; logged_representative_output = true;
for (size_t i = 0; i < outbuf.count; i++) { for (size_t i = 0; i < outbuf.count; i++) {
char *s = grpc_dump_slice(outbuf.slices[i], GPR_DUMP_HEX); char *s = grpc_dump_slice(outbuf.slices[i], GPR_DUMP_HEX);
@ -122,6 +127,7 @@ namespace hpack_encoder_fixtures {
class EmptyBatch { class EmptyBatch {
public: public:
static constexpr bool kEnableTrueBinary = false;
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
return {}; return {};
} }
@ -129,6 +135,7 @@ class EmptyBatch {
class SingleStaticElem { class SingleStaticElem {
public: public:
static constexpr bool kEnableTrueBinary = false;
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
return {GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE}; return {GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE};
} }
@ -136,6 +143,7 @@ class SingleStaticElem {
class SingleInternedElem { class SingleInternedElem {
public: public:
static constexpr bool kEnableTrueBinary = false;
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
return {grpc_mdelem_from_slices( return {grpc_mdelem_from_slices(
exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc")), exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc")),
@ -143,9 +151,10 @@ class SingleInternedElem {
} }
}; };
template <int kLength> template <int kLength, bool kTrueBinary>
class SingleInternedBinaryElem { class SingleInternedBinaryElem {
public: public:
static constexpr bool kEnableTrueBinary = kTrueBinary;
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
grpc_slice bytes = MakeBytes(); grpc_slice bytes = MakeBytes();
std::vector<grpc_mdelem> out = {grpc_mdelem_from_slices( std::vector<grpc_mdelem> out = {grpc_mdelem_from_slices(
@ -167,6 +176,7 @@ class SingleInternedBinaryElem {
class SingleInternedKeyElem { class SingleInternedKeyElem {
public: public:
static constexpr bool kEnableTrueBinary = false;
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
return {grpc_mdelem_from_slices( return {grpc_mdelem_from_slices(
exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc")), exec_ctx, grpc_slice_intern(grpc_slice_from_static_string("abc")),
@ -176,6 +186,7 @@ class SingleInternedKeyElem {
class SingleNonInternedElem { class SingleNonInternedElem {
public: public:
static constexpr bool kEnableTrueBinary = false;
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
return {grpc_mdelem_from_slices(exec_ctx, return {grpc_mdelem_from_slices(exec_ctx,
grpc_slice_from_static_string("abc"), grpc_slice_from_static_string("abc"),
@ -183,9 +194,10 @@ class SingleNonInternedElem {
} }
}; };
template <int kLength> template <int kLength, bool kTrueBinary>
class SingleNonInternedBinaryElem { class SingleNonInternedBinaryElem {
public: public:
static constexpr bool kEnableTrueBinary = kTrueBinary;
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
return {grpc_mdelem_from_slices( return {grpc_mdelem_from_slices(
exec_ctx, grpc_slice_from_static_string("abc-bin"), MakeBytes())}; exec_ctx, grpc_slice_from_static_string("abc-bin"), MakeBytes())};
@ -203,6 +215,7 @@ class SingleNonInternedBinaryElem {
class RepresentativeClientInitialMetadata { class RepresentativeClientInitialMetadata {
public: public:
static constexpr bool kEnableTrueBinary = true;
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
return { return {
GRPC_MDELEM_SCHEME_HTTP, GRPC_MDELEM_METHOD_POST, GRPC_MDELEM_SCHEME_HTTP, GRPC_MDELEM_METHOD_POST,
@ -224,6 +237,7 @@ class RepresentativeClientInitialMetadata {
class RepresentativeServerInitialMetadata { class RepresentativeServerInitialMetadata {
public: public:
static constexpr bool kEnableTrueBinary = true;
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
return {GRPC_MDELEM_STATUS_200, return {GRPC_MDELEM_STATUS_200,
GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC, GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC,
@ -233,6 +247,7 @@ class RepresentativeServerInitialMetadata {
class RepresentativeServerTrailingMetadata { class RepresentativeServerTrailingMetadata {
public: public:
static constexpr bool kEnableTrueBinary = true;
static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) { static std::vector<grpc_mdelem> GetElems(grpc_exec_ctx *exec_ctx) {
return {GRPC_MDELEM_GRPC_STATUS_0}; return {GRPC_MDELEM_GRPC_STATUS_0};
} }
@ -247,28 +262,67 @@ BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleInternedKeyElem)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleInternedElem) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleInternedElem)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleInternedBinaryElem<1>) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleInternedBinaryElem<1, false>)
->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleInternedBinaryElem<3, false>)
->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleInternedBinaryElem<10, false>)
->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleInternedBinaryElem<31, false>)
->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleInternedBinaryElem<100, false>)
->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleInternedBinaryElem<1, true>)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleInternedBinaryElem<3>) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleInternedBinaryElem<3, true>)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleInternedBinaryElem<10>) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleInternedBinaryElem<10, true>)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleInternedBinaryElem<31>) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleInternedBinaryElem<31, true>)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleInternedBinaryElem<100>) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleInternedBinaryElem<100, true>)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleNonInternedElem) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleNonInternedElem)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleNonInternedBinaryElem<1>) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleNonInternedBinaryElem<1, false>)
->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleNonInternedBinaryElem<3, false>)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleNonInternedBinaryElem<3>) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleNonInternedBinaryElem<10, false>)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleNonInternedBinaryElem<10>) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleNonInternedBinaryElem<31, false>)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleNonInternedBinaryElem<31>) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleNonInternedBinaryElem<100, false>)
->Args({0, 16384}); ->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleNonInternedBinaryElem<100>) SingleNonInternedBinaryElem<1, true>)
->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleNonInternedBinaryElem<3, true>)
->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleNonInternedBinaryElem<10, true>)
->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleNonInternedBinaryElem<31, true>)
->Args({0, 16384});
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader,
SingleNonInternedBinaryElem<100, true>)
->Args({0, 16384}); ->Args({0, 16384});
// test with a tiny frame size, to highlight continuation costs // test with a tiny frame size, to highlight continuation costs
BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleNonInternedElem) BENCHMARK_TEMPLATE(BM_HpackEncoderEncodeHeader, SingleNonInternedElem)
@ -421,7 +475,27 @@ class NonIndexedElem {
} }
}; };
class NonIndexedBinaryElem1 { template <int kLength, bool kTrueBinary>
class NonIndexedBinaryElem;
template <int kLength>
class NonIndexedBinaryElem<kLength, true> {
public:
static std::vector<grpc_slice> GetInitSlices() { return {}; }
static std::vector<grpc_slice> GetBenchmarkSlices() {
std::vector<uint8_t> v = {
0x00, 0x07, 'a', 'b', 'c',
'-', 'b', 'i', 'n', static_cast<uint8_t>(kLength + 1),
0};
for (int i = 0; i < kLength; i++) {
v.push_back(static_cast<uint8_t>(i));
}
return {MakeSlice(v)};
}
};
template <>
class NonIndexedBinaryElem<1, false> {
public: public:
static std::vector<grpc_slice> GetInitSlices() { return {}; } static std::vector<grpc_slice> GetInitSlices() { return {}; }
static std::vector<grpc_slice> GetBenchmarkSlices() { static std::vector<grpc_slice> GetBenchmarkSlices() {
@ -430,7 +504,8 @@ class NonIndexedBinaryElem1 {
} }
}; };
class NonIndexedBinaryElem3 { template <>
class NonIndexedBinaryElem<3, false> {
public: public:
static std::vector<grpc_slice> GetInitSlices() { return {}; } static std::vector<grpc_slice> GetInitSlices() { return {}; }
static std::vector<grpc_slice> GetBenchmarkSlices() { static std::vector<grpc_slice> GetBenchmarkSlices() {
@ -439,7 +514,8 @@ class NonIndexedBinaryElem3 {
} }
}; };
class NonIndexedBinaryElem10 { template <>
class NonIndexedBinaryElem<10, false> {
public: public:
static std::vector<grpc_slice> GetInitSlices() { return {}; } static std::vector<grpc_slice> GetInitSlices() { return {}; }
static std::vector<grpc_slice> GetBenchmarkSlices() { static std::vector<grpc_slice> GetBenchmarkSlices() {
@ -449,7 +525,8 @@ class NonIndexedBinaryElem10 {
} }
}; };
class NonIndexedBinaryElem31 { template <>
class NonIndexedBinaryElem<31, false> {
public: public:
static std::vector<grpc_slice> GetInitSlices() { return {}; } static std::vector<grpc_slice> GetInitSlices() { return {}; }
static std::vector<grpc_slice> GetBenchmarkSlices() { static std::vector<grpc_slice> GetBenchmarkSlices() {
@ -461,7 +538,8 @@ class NonIndexedBinaryElem31 {
} }
}; };
class NonIndexedBinaryElem100 { template <>
class NonIndexedBinaryElem<100, false> {
public: public:
static std::vector<grpc_slice> GetInitSlices() { return {}; } static std::vector<grpc_slice> GetInitSlices() { return {}; }
static std::vector<grpc_slice> GetBenchmarkSlices() { static std::vector<grpc_slice> GetBenchmarkSlices() {
@ -570,11 +648,16 @@ BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, IndexedSingleInternedElem);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, AddIndexedSingleInternedElem); BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, AddIndexedSingleInternedElem);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, KeyIndexedSingleInternedElem); BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, KeyIndexedSingleInternedElem);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedElem); BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedElem);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem1); BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<1, false>);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem3); BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<3, false>);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem10); BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<10, false>);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem31); BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<31, false>);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem100); BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<100, false>);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<1, true>);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<3, true>);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<10, true>);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<31, true>);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, NonIndexedBinaryElem<100, true>);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, BENCHMARK_TEMPLATE(BM_HpackParserParseHeader,
RepresentativeClientInitialMetadata); RepresentativeClientInitialMetadata);
BENCHMARK_TEMPLATE(BM_HpackParserParseHeader, BENCHMARK_TEMPLATE(BM_HpackParserParseHeader,
@ -584,23 +667,4 @@ BENCHMARK_TEMPLATE(BM_HpackParserParseHeader,
} // namespace hpack_parser_fixtures } // namespace hpack_parser_fixtures
static void BM_Base16SomeStuff(benchmark::State &state) {
uint8_t *bytes = new uint8_t[state.range(0)];
for (int i = 0; i < state.range(0); i++) {
bytes[i] = static_cast<uint8_t>(rand());
}
uint8_t *encoded = new uint8_t[state.range(0) * 2];
static const uint8_t hex[] = "0123456789abcdef";
while (state.KeepRunning()) {
for (int i = 0; i < state.range(0); i++) {
encoded[2 * i + 0] = hex[encoded[i] >> 8];
encoded[2 * i + 1] = hex[encoded[i] & 0xf];
}
}
delete[] encoded;
delete[] bytes;
state.SetBytesProcessed(state.iterations() * state.range(0));
}
BENCHMARK(BM_Base16SomeStuff)->Range(1, 4096);
BENCHMARK_MAIN(); BENCHMARK_MAIN();

@ -62,7 +62,6 @@ cc_library(
cc_library( cc_library(
name = "test_util", name = "test_util",
srcs = [ srcs = [
# "test/cpp/end2end/test_service_impl.cc",
"byte_buffer_proto_helper.cc", "byte_buffer_proto_helper.cc",
"create_test_channel.cc", "create_test_channel.cc",
"string_ref_helper.cc", "string_ref_helper.cc",
@ -83,3 +82,18 @@ cc_library(
"//test/core/util:gpr_test_util", "//test/core/util:gpr_test_util",
], ],
) )
cc_test(
name = "error_details_test",
srcs = [
"error_details_test.cc",
],
deps = [
"//:grpc++_error_details",
"//external:gtest",
"//src/proto/grpc/testing:echo_messages_proto",
],
)

@ -0,0 +1,120 @@
/*
*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <grpc++/support/error_details.h>
#include <gtest/gtest.h>
#include "src/proto/grpc/status/status.pb.h"
#include "src/proto/grpc/testing/echo_messages.pb.h"
namespace grpc {
namespace {
TEST(ExtractTest, Success) {
google::rpc::Status expected;
expected.set_code(13); // INTERNAL
expected.set_message("I am an error message");
testing::EchoRequest expected_details;
expected_details.set_message(grpc::string(100, '\0'));
expected.add_details()->PackFrom(expected_details);
google::rpc::Status to;
grpc::string error_details = expected.SerializeAsString();
Status from(static_cast<StatusCode>(expected.code()), expected.message(),
error_details);
EXPECT_TRUE(ExtractErrorDetails(from, &to).ok());
EXPECT_EQ(expected.code(), to.code());
EXPECT_EQ(expected.message(), to.message());
EXPECT_EQ(1, to.details_size());
testing::EchoRequest details;
to.details(0).UnpackTo(&details);
EXPECT_EQ(expected_details.message(), details.message());
}
TEST(ExtractTest, NullInput) {
EXPECT_EQ(StatusCode::FAILED_PRECONDITION,
ExtractErrorDetails(Status(), nullptr).error_code());
}
TEST(ExtractTest, Unparsable) {
grpc::string error_details("I am not a status object");
Status from(StatusCode::INTERNAL, "", error_details);
google::rpc::Status to;
EXPECT_EQ(StatusCode::INVALID_ARGUMENT,
ExtractErrorDetails(from, &to).error_code());
}
TEST(SetTest, Success) {
google::rpc::Status expected;
expected.set_code(13); // INTERNAL
expected.set_message("I am an error message");
testing::EchoRequest expected_details;
expected_details.set_message(grpc::string(100, '\0'));
expected.add_details()->PackFrom(expected_details);
Status to;
Status s = SetErrorDetails(expected, &to);
EXPECT_TRUE(s.ok());
EXPECT_EQ(expected.code(), to.error_code());
EXPECT_EQ(expected.message(), to.error_message());
EXPECT_EQ(expected.SerializeAsString(), to.error_details());
}
TEST(SetTest, NullInput) {
EXPECT_EQ(StatusCode::FAILED_PRECONDITION,
SetErrorDetails(google::rpc::Status(), nullptr).error_code());
}
TEST(SetTest, OutOfScopeErrorCode) {
google::rpc::Status expected;
expected.set_code(20); // Out of scope (DATA_LOSS is 15).
expected.set_message("I am an error message");
testing::EchoRequest expected_details;
expected_details.set_message(grpc::string(100, '\0'));
expected.add_details()->PackFrom(expected_details);
Status to;
Status s = SetErrorDetails(expected, &to);
EXPECT_TRUE(s.ok());
EXPECT_EQ(StatusCode::UNKNOWN, to.error_code());
EXPECT_EQ(expected.message(), to.error_message());
EXPECT_EQ(expected.SerializeAsString(), to.error_details());
}
} // namespace
} // namespace grpc
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}

@ -0,0 +1,184 @@
#!/usr/bin/env python2.7
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import collections
import perfection
import sys
_MAX_HEADER_LIST_SIZE = 16 * 1024 * 1024
Setting = collections.namedtuple('Setting', 'id default min max on_error')
OnError = collections.namedtuple('OnError', 'behavior code')
clamp_invalid_value = OnError('CLAMP_INVALID_VALUE', 'PROTOCOL_ERROR')
disconnect_on_invalid_value = lambda e: OnError('DISCONNECT_ON_INVALID_VALUE', e)
DecoratedSetting = collections.namedtuple('DecoratedSetting', 'enum name setting')
_SETTINGS = {
'HEADER_TABLE_SIZE': Setting(1, 4096, 0, 0xffffffff, clamp_invalid_value),
'ENABLE_PUSH': Setting(2, 1, 0, 1, disconnect_on_invalid_value('PROTOCOL_ERROR')),
'MAX_CONCURRENT_STREAMS': Setting(3, 0xffffffff, 0, 0xffffffff, disconnect_on_invalid_value('PROTOCOL_ERROR')),
'INITIAL_WINDOW_SIZE': Setting(4, 65535, 0, 0x7fffffff, disconnect_on_invalid_value('FLOW_CONTROL_ERROR')),
'MAX_FRAME_SIZE': Setting(5, 16384, 16384, 16777215, disconnect_on_invalid_value('PROTOCOL_ERROR')),
'MAX_HEADER_LIST_SIZE': Setting(6, _MAX_HEADER_LIST_SIZE, 0, _MAX_HEADER_LIST_SIZE, clamp_invalid_value),
'GRPC_ALLOW_TRUE_BINARY_METADATA': Setting(0xfe03, 0, 0, 1, clamp_invalid_value),
}
H = open('src/core/ext/transport/chttp2/transport/http2_settings.h', 'w')
C = open('src/core/ext/transport/chttp2/transport/http2_settings.c', 'w')
# utility: print a big comment block into a set of files
def put_banner(files, banner):
for f in files:
print >>f, '/*'
for line in banner:
print >>f, ' * %s' % line
print >>f, ' */'
print >>f
# copy-paste copyright notice from this file
with open(sys.argv[0]) as my_source:
copyright = []
for line in my_source:
if line[0] != '#': break
for line in my_source:
if line[0] == '#':
copyright.append(line)
break
for line in my_source:
if line[0] != '#':
break
copyright.append(line)
put_banner([H,C], [line[2:].rstrip() for line in copyright])
put_banner([H,C], ["Automatically generated by tools/codegen/core/gen_settings_ids.py"])
print >>H, "#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H"
print >>H, "#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H"
print >>H
print >>H, "#include <stdint.h>"
print >>H, "#include <stdbool.h>"
print >>H
print >>C, "#include \"src/core/ext/transport/chttp2/transport/http2_settings.h\""
print >>C
print >>C, "#include <grpc/support/useful.h>"
print >>C, "#include \"src/core/lib/transport/http2_errors.h\""
print >>C
p = perfection.hash_parameters(sorted(x.id for x in _SETTINGS.values()))
print p
def hash(i):
i += p.offset
x = i % p.t
y = i / p.t
return x + p.r[y]
decorated_settings = [DecoratedSetting(hash(setting.id), name, setting)
for name, setting in _SETTINGS.iteritems()]
print >>H, 'typedef enum {'
for decorated_setting in sorted(decorated_settings):
print >>H, ' GRPC_CHTTP2_SETTINGS_%s = %d, /* wire id %d */' % (
decorated_setting.name, decorated_setting.enum, decorated_setting.setting.id)
print >>H, '} grpc_chttp2_setting_id;'
print >>H
print >>H, '#define GRPC_CHTTP2_NUM_SETTINGS %d' % (max(x.enum for x in decorated_settings) + 1)
print >>H, 'extern const uint16_t grpc_setting_id_to_wire_id[];'
print >>C, 'const uint16_t grpc_setting_id_to_wire_id[] = {%s};' % ','.join(
'%d' % s for s in p.slots)
print >>H
print >>H, "bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out);"
cgargs = {
'r': ','.join('%d' % (r if r is not None else 0) for r in p.r),
't': p.t,
'offset': abs(p.offset),
'offset_sign': '+' if p.offset > 0 else '-'
}
print >>C, """
bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out) {
uint32_t i = wire_id %(offset_sign)s %(offset)d;
uint32_t x = i %% %(t)d;
uint32_t y = i / %(t)d;
uint32_t h = x;
switch (y) {
""" % cgargs
for i, r in enumerate(p.r):
if not r: continue
if r < 0: print >>C, 'case %d: h -= %d; break;' % (i, -r)
else: print >>C, 'case %d: h += %d; break;' % (i, r)
print >>C, """
}
*out = (grpc_chttp2_setting_id)h;
return h < GPR_ARRAY_SIZE(grpc_setting_id_to_wire_id) && grpc_setting_id_to_wire_id[h] == wire_id;
}
""" % cgargs
print >>H, """
typedef enum {
GRPC_CHTTP2_CLAMP_INVALID_VALUE,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE
} grpc_chttp2_invalid_value_behavior;
typedef struct {
const char *name;
uint32_t default_value;
uint32_t min_value;
uint32_t max_value;
grpc_chttp2_invalid_value_behavior invalid_value_behavior;
uint32_t error_value;
} grpc_chttp2_setting_parameters;
extern const grpc_chttp2_setting_parameters grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS];
"""
print >>C, "const grpc_chttp2_setting_parameters grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS] = {"
i = 0
for decorated_setting in sorted(decorated_settings):
while i < decorated_setting.enum:
print >>C, "{NULL, 0, 0, 0, GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE, GRPC_HTTP2_PROTOCOL_ERROR},"
i += 1
print >>C, "{\"%s\", %du, %du, %du, GRPC_CHTTP2_%s, GRPC_HTTP2_%s}," % (
decorated_setting.name,
decorated_setting.setting.default,
decorated_setting.setting.min,
decorated_setting.setting.max,
decorated_setting.setting.on_error.behavior,
decorated_setting.setting.on_error.code,
)
i += 1
print >>C, "};"
print >>H
print >>H, "#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HTTP2_SETTINGS_H */"
H.close()
C.close()

@ -113,6 +113,8 @@ _EXEMPT = frozenset((
'src/php/tests/bootstrap.php', 'src/php/tests/bootstrap.php',
# census.proto copied from github # census.proto copied from github
'tools/grpcz/census.proto', 'tools/grpcz/census.proto',
# status.proto copied from googleapis
'src/proto/grpc/status/status.proto',
)) ))

@ -72,6 +72,13 @@ RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
RUN apt-get -y update RUN apt-get -y update
RUN apt-get -y install bazel RUN apt-get -y install bazel
# Pin Bazel to 0.4.4
# Installing Bazel via apt-get first is required before installing 0.4.4 to
# allow gRPC to build without errors. See https://github.com/grpc/grpc/issues/10553
RUN curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/0.4.4/bazel-0.4.4-installer-linux-x86_64.sh
RUN chmod +x ./bazel-0.4.4-installer-linux-x86_64.sh
RUN ./bazel-0.4.4-installer-linux-x86_64.sh
RUN mkdir -p /var/local/jenkins RUN mkdir -p /var/local/jenkins
# Define the default command. # Define the default command.

@ -1005,6 +1005,8 @@ src/core/ext/transport/chttp2/transport/hpack_parser.c \
src/core/ext/transport/chttp2/transport/hpack_parser.h \ src/core/ext/transport/chttp2/transport/hpack_parser.h \
src/core/ext/transport/chttp2/transport/hpack_table.c \ src/core/ext/transport/chttp2/transport/hpack_table.c \
src/core/ext/transport/chttp2/transport/hpack_table.h \ src/core/ext/transport/chttp2/transport/hpack_table.h \
src/core/ext/transport/chttp2/transport/http2_settings.c \
src/core/ext/transport/chttp2/transport/http2_settings.h \
src/core/ext/transport/chttp2/transport/huffsyms.c \ src/core/ext/transport/chttp2/transport/huffsyms.c \
src/core/ext/transport/chttp2/transport/huffsyms.h \ src/core/ext/transport/chttp2/transport/huffsyms.h \
src/core/ext/transport/chttp2/transport/incoming_metadata.c \ src/core/ext/transport/chttp2/transport/incoming_metadata.c \

@ -40,11 +40,6 @@ sudo apt-get update
sudo apt-get install -y openjdk-8-jdk sudo apt-get install -y openjdk-8-jdk
sudo apt-get install -y unzip lsof sudo apt-get install -y unzip lsof
# Add pubkey of jenkins@grpc-jenkins-master to authorized keys of jenkins@
# This needs to happen as the last step to prevent Jenkins master from connecting
# to a machine that hasn't been properly setup yet.
cat jenkins_master.pub | sudo tee --append ~jenkins/.ssh/authorized_keys
sudo apt-get install -y \ sudo apt-get install -y \
autoconf \ autoconf \
autotools-dev \ autotools-dev \
@ -169,3 +164,21 @@ git clone -v https://github.com/brendangregg/FlameGraph ~/FlameGraph
# Install scipy and numpy for benchmarking scripts # Install scipy and numpy for benchmarking scripts
sudo apt-get install python-scipy python-numpy sudo apt-get install python-scipy python-numpy
# Update Linux kernel to 4.9
wget \
kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.20/linux-headers-4.9.20-040920_4.9.20-040920.201703310531_all.deb \
kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.20/linux-headers-4.9.20-040920-generic_4.9.20-040920.201703310531_amd64.deb \
kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.20/linux-image-4.9.20-040920-generic_4.9.20-040920.201703310531_amd64.deb
sudo dpkg -i linux-headers-4.9*.deb linux-image-4.9*.deb
rm linux-*
# Add pubkey of jenkins@grpc-jenkins-master to authorized keys of jenkins@
# This needs to happen as the last step to prevent Jenkins master from connecting
# to a machine that hasn't been properly setup yet.
cat jenkins_master.pub | sudo tee --append ~jenkins/.ssh/authorized_keys
# Restart for VM to pick up kernel update
echo 'Successfully initialized the linux worker, going for reboot in 10 seconds'
sleep 10
sudo reboot

@ -59,19 +59,27 @@ sudo usermod -aG docker jenkins
# Use "overlay" storage driver for docker # Use "overlay" storage driver for docker
# see https://github.com/grpc/grpc/issues/4988 # see https://github.com/grpc/grpc/issues/4988
echo 'DOCKER_OPTS="${DOCKER_OPTS} --storage-driver=overlay"' | sudo tee --append /etc/default/docker printf "{\n\t\"storage-driver\": \"overlay\"\n}" | sudo tee /etc/docker/daemon.json
# Install RVM # Install RVM
# TODO(jtattermusch): why is RVM needed? # TODO(jtattermusch): why is RVM needed?
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable --ruby curl -sSL https://get.rvm.io | bash -s stable --ruby
# Upgrade Linux kernel to 4.9
wget \
kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.20/linux-headers-4.9.20-040920_4.9.20-040920.201703310531_all.deb \
kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.20/linux-headers-4.9.20-040920-generic_4.9.20-040920.201703310531_amd64.deb \
kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.20/linux-image-4.9.20-040920-generic_4.9.20-040920.201703310531_amd64.deb
sudo dpkg -i linux-headers-4.9*.deb linux-image-4.9*.deb
rm linux-*
# Add pubkey of jenkins@grpc-jenkins-master to authorized keys of jenkins@ # Add pubkey of jenkins@grpc-jenkins-master to authorized keys of jenkins@
# This needs to happen as the last step to prevent Jenkins master from connecting # This needs to happen as the last step to prevent Jenkins master from connecting
# to a machine that hasn't been properly setup yet. # to a machine that hasn't been properly setup yet.
cat jenkins_master.pub | sudo tee --append ~jenkins/.ssh/authorized_keys cat jenkins_master.pub | sudo tee --append ~jenkins/.ssh/authorized_keys
# Restart for docker to pickup the config changes. # Restart for docker to pick up the config changes.
echo 'Successfully initialized the linux worker, going for reboot in 10 seconds' echo 'Successfully initialized the linux worker, going for reboot in 10 seconds'
sleep 10 sleep 10

@ -1,4 +1,4 @@
#Internal continuous integration # Internal continuous integration
gRPC's externally facing testing is managed by Jenkins CI (see `tools/jenkins` gRPC's externally facing testing is managed by Jenkins CI (see `tools/jenkins`
directory). Nevertheless, some of the tests are better suited for being run directory). Nevertheless, some of the tests are better suited for being run

@ -31,7 +31,7 @@
# Location of the continuous shell script in repository. # Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/grpc_portability.sh" build_file: "grpc/tools/internal_ci/linux/grpc_portability.sh"
timeout_mins: 720 timeout_mins: 1440
action { action {
define_artifacts { define_artifacts {
regex: "**/*sponge_log.xml" regex: "**/*sponge_log.xml"

@ -30,7 +30,7 @@
# Config file for the internal CI (in protobuf text format) # Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository. # Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/grpc_master_sanitizers.sh" build_file: "grpc/tools/internal_ci/linux/sanitizer/grpc_c_asan.sh"
timeout_mins: 1440 timeout_mins: 1440
action { action {
define_artifacts { define_artifacts {

@ -31,10 +31,10 @@
set -ex set -ex
# change to grpc repo root # change to grpc repo root
cd $(dirname $0)/../../.. cd $(dirname $0)/../../../..
git submodule update --init git submodule update --init
# download docker images from dockerhub # download docker images from dockerhub
export DOCKERHUB_ORGANIZATION=grpctesting export DOCKERHUB_ORGANIZATION=grpctesting
tools/run_tests/run_tests_matrix.py -f sanitizers linux tools/run_tests/run_tests_matrix.py -f c asan

@ -0,0 +1,39 @@
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/sanitizer/grpc_c_msan.sh"
timeout_mins: 1440
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

@ -0,0 +1,40 @@
#!/bin/bash
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -ex
# change to grpc repo root
cd $(dirname $0)/../../../..
git submodule update --init
# download docker images from dockerhub
export DOCKERHUB_ORGANIZATION=grpctesting
tools/run_tests/run_tests_matrix.py -f c msan

@ -0,0 +1,39 @@
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/sanitizer/grpc_c_tsan.sh"
timeout_mins: 1440
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

@ -0,0 +1,40 @@
#!/bin/bash
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -ex
# change to grpc repo root
cd $(dirname $0)/../../../..
git submodule update --init
# download docker images from dockerhub
export DOCKERHUB_ORGANIZATION=grpctesting
tools/run_tests/run_tests_matrix.py -f c tsan

@ -0,0 +1,39 @@
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/sanitizer/grpc_cpp_asan.sh"
timeout_mins: 1440
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

@ -0,0 +1,40 @@
#!/bin/bash
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -ex
# change to grpc repo root
cd $(dirname $0)/../../../..
git submodule update --init
# download docker images from dockerhub
export DOCKERHUB_ORGANIZATION=grpctesting
tools/run_tests/run_tests_matrix.py -f cpp asan

@ -0,0 +1,39 @@
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/linux/sanitizer/grpc_cpp_tsan.sh"
timeout_mins: 1440
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

@ -0,0 +1,40 @@
#!/bin/bash
# Copyright 2017, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set -ex
# change to grpc repo root
cd $(dirname $0)/../../../..
git submodule update --init
# download docker images from dockerhub
export DOCKERHUB_ORGANIZATION=grpctesting
tools/run_tests/run_tests_matrix.py -f cpp tsan

@ -226,7 +226,7 @@ really_interesting = set()
for name, bm in benchmarks.items(): for name, bm in benchmarks.items():
print name print name
really_interesting.update(bm.process()) really_interesting.update(bm.process())
fields = [f for f in args.track if f in args.track] fields = [f for f in args.track if f in really_interesting]
headers = ['Benchmark'] + fields headers = ['Benchmark'] + fields
rows = [] rows = []

@ -203,4 +203,5 @@ def expand_json(js, js2 = None):
row['real_time'] = bm2['real_time'] row['real_time'] = bm2['real_time']
row['iterations'] = bm2['iterations'] row['iterations'] = bm2['iterations']
bm2['already_used'] = True bm2['already_used'] = True
break
yield row yield row

@ -2967,6 +2967,24 @@
"third_party": false, "third_party": false,
"type": "target" "type": "target"
}, },
{
"deps": [
"grpc++",
"grpc++_error_details"
],
"headers": [
"src/proto/grpc/testing/echo_messages.grpc.pb.h",
"src/proto/grpc/testing/echo_messages.pb.h"
],
"is_filegroup": false,
"language": "c++",
"name": "error_details_test",
"src": [
"test/cpp/util/error_details_test.cc"
],
"third_party": false,
"type": "target"
},
{ {
"deps": [ "deps": [
"gpr", "gpr",
@ -5818,6 +5836,25 @@
"third_party": false, "third_party": false,
"type": "lib" "type": "lib"
}, },
{
"deps": [
"grpc++"
],
"headers": [
"include/grpc++/support/error_details.h",
"src/proto/grpc/status/status.grpc.pb.h",
"src/proto/grpc/status/status.pb.h"
],
"is_filegroup": false,
"language": "c++",
"name": "grpc++_error_details",
"src": [
"include/grpc++/support/error_details.h",
"src/cpp/util/error_details.cc"
],
"third_party": false,
"type": "lib"
},
{ {
"deps": [ "deps": [
"grpc++", "grpc++",
@ -8351,6 +8388,7 @@
"src/core/ext/transport/chttp2/transport/hpack_encoder.h", "src/core/ext/transport/chttp2/transport/hpack_encoder.h",
"src/core/ext/transport/chttp2/transport/hpack_parser.h", "src/core/ext/transport/chttp2/transport/hpack_parser.h",
"src/core/ext/transport/chttp2/transport/hpack_table.h", "src/core/ext/transport/chttp2/transport/hpack_table.h",
"src/core/ext/transport/chttp2/transport/http2_settings.h",
"src/core/ext/transport/chttp2/transport/huffsyms.h", "src/core/ext/transport/chttp2/transport/huffsyms.h",
"src/core/ext/transport/chttp2/transport/incoming_metadata.h", "src/core/ext/transport/chttp2/transport/incoming_metadata.h",
"src/core/ext/transport/chttp2/transport/internal.h", "src/core/ext/transport/chttp2/transport/internal.h",
@ -8387,6 +8425,8 @@
"src/core/ext/transport/chttp2/transport/hpack_parser.h", "src/core/ext/transport/chttp2/transport/hpack_parser.h",
"src/core/ext/transport/chttp2/transport/hpack_table.c", "src/core/ext/transport/chttp2/transport/hpack_table.c",
"src/core/ext/transport/chttp2/transport/hpack_table.h", "src/core/ext/transport/chttp2/transport/hpack_table.h",
"src/core/ext/transport/chttp2/transport/http2_settings.c",
"src/core/ext/transport/chttp2/transport/http2_settings.h",
"src/core/ext/transport/chttp2/transport/huffsyms.c", "src/core/ext/transport/chttp2/transport/huffsyms.c",
"src/core/ext/transport/chttp2/transport/huffsyms.h", "src/core/ext/transport/chttp2/transport/huffsyms.h",
"src/core/ext/transport/chttp2/transport/incoming_metadata.c", "src/core/ext/transport/chttp2/transport/incoming_metadata.c",

@ -3195,6 +3195,28 @@
"windows" "windows"
] ]
}, },
{
"args": [],
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "error_details_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
]
},
{ {
"args": [], "args": [],
"ci_platforms": [ "ci_platforms": [
@ -41456,7 +41478,7 @@
{ {
"args": [ "args": [
"--scenarios_json", "--scenarios_json",
"{\"scenarios\": [{\"name\": \"cpp_protobuf_async_unary_ping_pong_secure_1mb\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 0, \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"server_type\": \"ASYNC_SERVER\"}, \"num_clients\": 1, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"payload_config\": {\"simple_params\": {\"resp_size\": 1048576, \"req_size\": 1048576}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"UNARY\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}}]}" "{\"scenarios\": [{\"name\": \"cpp_protobuf_async_unary_ping_pong_secure_1MB\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 0, \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"server_type\": \"ASYNC_SERVER\"}, \"num_clients\": 1, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"payload_config\": {\"simple_params\": {\"resp_size\": 1048576, \"req_size\": 1048576}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"UNARY\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}}]}"
], ],
"boringssl": true, "boringssl": true,
"ci_platforms": [ "ci_platforms": [
@ -41475,7 +41497,7 @@
"platforms": [ "platforms": [
"linux" "linux"
], ],
"shortname": "json_run_localhost:cpp_protobuf_async_unary_ping_pong_secure_1mb", "shortname": "json_run_localhost:cpp_protobuf_async_unary_ping_pong_secure_1MB",
"timeout_seconds": 360 "timeout_seconds": 360
}, },
{ {
@ -42035,7 +42057,7 @@
{ {
"args": [ "args": [
"--scenarios_json", "--scenarios_json",
"{\"scenarios\": [{\"name\": \"cpp_protobuf_async_unary_ping_pong_insecure_1mb\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 0, \"security_params\": null, \"server_type\": \"ASYNC_SERVER\"}, \"num_clients\": 1, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": null, \"payload_config\": {\"simple_params\": {\"resp_size\": 1048576, \"req_size\": 1048576}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"UNARY\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}}]}" "{\"scenarios\": [{\"name\": \"cpp_protobuf_async_unary_ping_pong_insecure_1MB\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 0, \"security_params\": null, \"server_type\": \"ASYNC_SERVER\"}, \"num_clients\": 1, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": null, \"payload_config\": {\"simple_params\": {\"resp_size\": 1048576, \"req_size\": 1048576}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"UNARY\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}}]}"
], ],
"boringssl": true, "boringssl": true,
"ci_platforms": [ "ci_platforms": [
@ -42054,7 +42076,7 @@
"platforms": [ "platforms": [
"linux" "linux"
], ],
"shortname": "json_run_localhost:cpp_protobuf_async_unary_ping_pong_insecure_1mb", "shortname": "json_run_localhost:cpp_protobuf_async_unary_ping_pong_insecure_1MB",
"timeout_seconds": 360 "timeout_seconds": 360
}, },
{ {
@ -42734,7 +42756,7 @@
{ {
"args": [ "args": [
"--scenarios_json", "--scenarios_json",
"{\"scenarios\": [{\"name\": \"cpp_protobuf_async_unary_ping_pong_secure_1mb\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 0, \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"server_type\": \"ASYNC_SERVER\"}, \"num_clients\": 1, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"payload_config\": {\"simple_params\": {\"resp_size\": 1048576, \"req_size\": 1048576}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"UNARY\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}}]}" "{\"scenarios\": [{\"name\": \"cpp_protobuf_async_unary_ping_pong_secure_1MB\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 0, \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"server_type\": \"ASYNC_SERVER\"}, \"num_clients\": 1, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"payload_config\": {\"simple_params\": {\"resp_size\": 1048576, \"req_size\": 1048576}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"UNARY\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}}]}"
], ],
"boringssl": true, "boringssl": true,
"ci_platforms": [ "ci_platforms": [
@ -42765,7 +42787,7 @@
"platforms": [ "platforms": [
"linux" "linux"
], ],
"shortname": "json_run_localhost:cpp_protobuf_async_unary_ping_pong_secure_1mb_low_thread_count", "shortname": "json_run_localhost:cpp_protobuf_async_unary_ping_pong_secure_1MB_low_thread_count",
"timeout_seconds": 360 "timeout_seconds": 360
}, },
{ {
@ -43589,7 +43611,7 @@
{ {
"args": [ "args": [
"--scenarios_json", "--scenarios_json",
"{\"scenarios\": [{\"name\": \"cpp_protobuf_async_unary_ping_pong_insecure_1mb\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 0, \"security_params\": null, \"server_type\": \"ASYNC_SERVER\"}, \"num_clients\": 1, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": null, \"payload_config\": {\"simple_params\": {\"resp_size\": 1048576, \"req_size\": 1048576}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"UNARY\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}}]}" "{\"scenarios\": [{\"name\": \"cpp_protobuf_async_unary_ping_pong_insecure_1MB\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 0, \"security_params\": null, \"server_type\": \"ASYNC_SERVER\"}, \"num_clients\": 1, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": null, \"payload_config\": {\"simple_params\": {\"resp_size\": 1048576, \"req_size\": 1048576}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"UNARY\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}}]}"
], ],
"boringssl": true, "boringssl": true,
"ci_platforms": [ "ci_platforms": [
@ -43620,7 +43642,7 @@
"platforms": [ "platforms": [
"linux" "linux"
], ],
"shortname": "json_run_localhost:cpp_protobuf_async_unary_ping_pong_insecure_1mb_low_thread_count", "shortname": "json_run_localhost:cpp_protobuf_async_unary_ping_pong_insecure_1MB_low_thread_count",
"timeout_seconds": 360 "timeout_seconds": 360
}, },
{ {

@ -304,11 +304,11 @@ class CXXLanguage:
excluded_poll_engines = ['poll-cv']) excluded_poll_engines = ['poll-cv'])
yield _ping_pong_scenario( yield _ping_pong_scenario(
'cpp_protobuf_async_unary_ping_pong_%s_1mb' % secstr, rpc_type='UNARY', 'cpp_protobuf_async_unary_ping_pong_%s_1MB' % secstr, rpc_type='UNARY',
client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
req_size=1024*1024, resp_size=1024*1024, req_size=1024*1024, resp_size=1024*1024,
secure=secure, secure=secure,
categories=smoketest_categories) categories=smoketest_categories + [SCALABLE])
for rpc_type in ['unary', 'streaming']: for rpc_type in ['unary', 'streaming']:
for synchronicity in ['sync', 'async']: for synchronicity in ['sync', 'async']:
@ -464,10 +464,10 @@ class CSharpLanguage:
categories=[SCALABLE]) categories=[SCALABLE])
yield _ping_pong_scenario( yield _ping_pong_scenario(
'csharp_protobuf_async_unary_ping_pong_1mb', rpc_type='UNARY', 'csharp_protobuf_async_unary_ping_pong_1MB', rpc_type='UNARY',
client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
req_size=1024*1024, resp_size=1024*1024, req_size=1024*1024, resp_size=1024*1024,
categories=[SMOKETEST]) categories=[SMOKETEST, SCALABLE])
def __str__(self): def __str__(self):
@ -510,10 +510,10 @@ class NodeLanguage:
client_language='c++') client_language='c++')
yield _ping_pong_scenario( yield _ping_pong_scenario(
'node_protobuf_async_unary_ping_pong_1mb', rpc_type='UNARY', 'node_protobuf_unary_ping_pong_1MB', rpc_type='UNARY',
client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER',
req_size=1024*1024, resp_size=1024*1024, req_size=1024*1024, resp_size=1024*1024,
categories=[SMOKETEST]) categories=[SCALABLE, SMOKETEST])
# TODO(murgatroid99): fix bugs with this scenario and re-enable it # TODO(murgatroid99): fix bugs with this scenario and re-enable it
# yield _ping_pong_scenario( # yield _ping_pong_scenario(
@ -596,10 +596,10 @@ class PythonLanguage:
server_language='c++', async_server_threads=1) server_language='c++', async_server_threads=1)
yield _ping_pong_scenario( yield _ping_pong_scenario(
'python_protobuf_sync_unary_ping_pong_1mb', rpc_type='UNARY', 'python_protobuf_sync_unary_ping_pong_1MB', rpc_type='UNARY',
client_type='SYNC_CLIENT', server_type='ASYNC_SERVER', client_type='SYNC_CLIENT', server_type='ASYNC_SERVER',
req_size=1024*1024, resp_size=1024*1024, req_size=1024*1024, resp_size=1024*1024,
categories=[SMOKETEST]) categories=[SMOKETEST, SCALABLE])
def __str__(self): def __str__(self):
return 'python' return 'python'
@ -648,10 +648,10 @@ class RubyLanguage:
server_language='c++', async_server_threads=1) server_language='c++', async_server_threads=1)
yield _ping_pong_scenario( yield _ping_pong_scenario(
'ruby_protobuf_async_unary_ping_pong_1mb', rpc_type='UNARY', 'ruby_protobuf_unary_ping_pong_1MB', rpc_type='UNARY',
client_type='SYNC_CLIENT', server_type='SYNC_SERVER', client_type='SYNC_CLIENT', server_type='SYNC_SERVER',
req_size=1024*1024, resp_size=1024*1024, req_size=1024*1024, resp_size=1024*1024,
categories=[SMOKETEST]) categories=[SMOKETEST, SCALABLE])
def __str__(self): def __str__(self):
return 'ruby' return 'ruby'

@ -57,6 +57,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc++", "vcxproj\.\grpc++\
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc++_error_details", "vcxproj\.\grpc++_error_details\grpc++_error_details.vcxproj", "{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}"
ProjectSection(myProperties) = preProject
lib = "True"
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
{C187A093-A0FE-489D-A40A-6E33DE0F9FEB} = {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc++_unsecure", "vcxproj\.\grpc++_unsecure\grpc++_unsecure.vcxproj", "{6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grpc++_unsecure", "vcxproj\.\grpc++_unsecure\grpc++_unsecure.vcxproj", "{6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}"
ProjectSection(myProperties) = preProject ProjectSection(myProperties) = preProject
lib = "True" lib = "True"
@ -294,6 +302,22 @@ Global
{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release-DLL|Win32.Build.0 = Release-DLL|Win32 {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release-DLL|Win32.Build.0 = Release-DLL|Win32
{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release-DLL|x64.ActiveCfg = Release-DLL|x64 {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release-DLL|x64.ActiveCfg = Release-DLL|x64
{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release-DLL|x64.Build.0 = Release-DLL|x64 {C187A093-A0FE-489D-A40A-6E33DE0F9FEB}.Release-DLL|x64.Build.0 = Release-DLL|x64
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Debug|Win32.ActiveCfg = Debug|Win32
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Debug|x64.ActiveCfg = Debug|x64
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Release|Win32.ActiveCfg = Release|Win32
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Release|x64.ActiveCfg = Release|x64
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Debug|Win32.Build.0 = Debug|Win32
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Debug|x64.Build.0 = Debug|x64
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Release|Win32.Build.0 = Release|Win32
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Release|x64.Build.0 = Release|x64
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Debug-DLL|Win32.ActiveCfg = Debug|Win32
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Debug-DLL|Win32.Build.0 = Debug|Win32
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Debug-DLL|x64.ActiveCfg = Debug|x64
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Debug-DLL|x64.Build.0 = Debug|x64
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Release-DLL|Win32.ActiveCfg = Release|Win32
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Release-DLL|Win32.Build.0 = Release|Win32
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Release-DLL|x64.ActiveCfg = Release|x64
{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}.Release-DLL|x64.Build.0 = Release|x64
{6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}.Debug|Win32.ActiveCfg = Debug|Win32 {6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}.Debug|Win32.ActiveCfg = Debug|Win32
{6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}.Debug|x64.ActiveCfg = Debug|x64 {6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}.Debug|x64.ActiveCfg = Debug|x64
{6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}.Release|Win32.ActiveCfg = Release|Win32 {6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}.Release|Win32.ActiveCfg = Release|Win32

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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>{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}</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>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(SolutionDir)\..\vsprojects\global.props" />
<Import Project="$(SolutionDir)\..\vsprojects\winsock.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<TargetName>grpc++_error_details</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>grpc++_error_details</TargetName>
</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>Windows</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>Windows</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>Windows</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>Windows</SubSystem>
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation>
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\error_details.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(SolutionDir)\..\src\proto\grpc\status\status.pb.cc">
</ClCompile>
<ClInclude Include="$(SolutionDir)\..\src\proto\grpc\status\status.pb.h">
</ClInclude>
<ClCompile Include="$(SolutionDir)\..\src\proto\grpc\status\status.grpc.pb.cc">
</ClCompile>
<ClInclude Include="$(SolutionDir)\..\src\proto\grpc\status\status.grpc.pb.h">
</ClInclude>
<ClCompile Include="$(SolutionDir)\..\src\cpp\util\error_details.cc">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj">
<Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</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>
</Target>
</Project>

@ -0,0 +1,47 @@
<?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\status\status.proto">
<Filter>src\proto\grpc\status</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\cpp\util\error_details.cc">
<Filter>src\cpp\util</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(SolutionDir)\..\include\grpc++\support\error_details.h">
<Filter>include\grpc++\support</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="include">
<UniqueIdentifier>{013272b5-4742-ba38-7cb6-25ff3484ac1d}</UniqueIdentifier>
</Filter>
<Filter Include="include\grpc++">
<UniqueIdentifier>{f589296d-1ee4-913f-0345-7d8bf51f657b}</UniqueIdentifier>
</Filter>
<Filter Include="include\grpc++\support">
<UniqueIdentifier>{3455fa30-ad44-8790-9dc2-ff4ac7dd9e6c}</UniqueIdentifier>
</Filter>
<Filter Include="src">
<UniqueIdentifier>{cf07aafe-1d45-af88-81fb-0bbd5afd247f}</UniqueIdentifier>
</Filter>
<Filter Include="src\cpp">
<UniqueIdentifier>{00726556-da02-06d8-bb32-902f55133c6b}</UniqueIdentifier>
</Filter>
<Filter Include="src\cpp\util">
<UniqueIdentifier>{fd90d13e-cc1f-e8cc-56ee-650231b08f56}</UniqueIdentifier>
</Filter>
<Filter Include="src\proto">
<UniqueIdentifier>{ec6be373-4683-335e-03d9-dc636e34d7ef}</UniqueIdentifier>
</Filter>
<Filter Include="src\proto\grpc">
<UniqueIdentifier>{8200edf2-9498-6cd9-d8f3-81ad881ca82c}</UniqueIdentifier>
</Filter>
<Filter Include="src\proto\grpc\status">
<UniqueIdentifier>{79c5c1ea-19a8-bf5a-5e0a-3de6ad3a0465}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

@ -425,6 +425,7 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_encoder.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_encoder.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_parser.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_parser.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\http2_settings.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\incoming_metadata.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\incoming_metadata.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\internal.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\internal.h" />
@ -788,6 +789,8 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\http2_settings.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\incoming_metadata.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\incoming_metadata.c">

@ -424,6 +424,9 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.c">
<Filter>src\core\ext\transport\chttp2\transport</Filter> <Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\http2_settings.c">
<Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.c">
<Filter>src\core\ext\transport\chttp2\transport</Filter> <Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClCompile> </ClCompile>
@ -1178,6 +1181,9 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.h"> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.h">
<Filter>src\core\ext\transport\chttp2\transport</Filter> <Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\http2_settings.h">
<Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.h"> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.h">
<Filter>src\core\ext\transport\chttp2\transport</Filter> <Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClInclude> </ClInclude>

@ -415,6 +415,7 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_encoder.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_encoder.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_parser.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_parser.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\http2_settings.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\incoming_metadata.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\incoming_metadata.h" />
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\internal.h" /> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\internal.h" />
@ -758,6 +759,8 @@
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\http2_settings.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.c">
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\incoming_metadata.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\incoming_metadata.c">

@ -430,6 +430,9 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.c">
<Filter>src\core\ext\transport\chttp2\transport</Filter> <Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\http2_settings.c">
<Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.c"> <ClCompile Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.c">
<Filter>src\core\ext\transport\chttp2\transport</Filter> <Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClCompile> </ClCompile>
@ -1091,6 +1094,9 @@
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.h"> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\hpack_table.h">
<Filter>src\core\ext\transport\chttp2\transport</Filter> <Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\http2_settings.h">
<Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.h"> <ClInclude Include="$(SolutionDir)\..\src\core\ext\transport\chttp2\transport\huffsyms.h">
<Filter>src\core\ext\transport\chttp2\transport</Filter> <Filter>src\core\ext\transport\chttp2\transport</Filter>
</ClInclude> </ClInclude>

@ -0,0 +1,203 @@
<?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>{2DE1AE9E-D53C-5854-9122-317E34F90C31}</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>error_details_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>error_details_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)\..\test\cpp\util\error_details_test.cc">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++_error_details\grpc++_error_details.vcxproj">
<Project>{9F58AD72-49E1-4D10-B826-9E190AB0AAC0}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj">
<Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</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,36 @@
<?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)\..\test\cpp\util\error_details_test.cc">
<Filter>test\cpp\util</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Filter Include="src">
<UniqueIdentifier>{35c957dd-436b-c57a-791d-2737bc179e41}</UniqueIdentifier>
</Filter>
<Filter Include="src\proto">
<UniqueIdentifier>{c8721123-0390-f97d-5aad-0dd4979d5030}</UniqueIdentifier>
</Filter>
<Filter Include="src\proto\grpc">
<UniqueIdentifier>{6dbad4a6-6b97-b25a-4f89-6edb20a1e7e0}</UniqueIdentifier>
</Filter>
<Filter Include="src\proto\grpc\testing">
<UniqueIdentifier>{5f343032-7701-4924-a1d2-06f46d52d1b3}</UniqueIdentifier>
</Filter>
<Filter Include="test">
<UniqueIdentifier>{688e4f7d-b9aa-342c-ffa7-2ee3ca51cd42}</UniqueIdentifier>
</Filter>
<Filter Include="test\cpp">
<UniqueIdentifier>{a4e0ed0a-c1bb-60d6-003b-91c3989f6e6e}</UniqueIdentifier>
</Filter>
<Filter Include="test\cpp\util">
<UniqueIdentifier>{60a99fd3-4904-d29f-b456-7f601092d055}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
Loading…
Cancel
Save