merge with head

pull/9205/head
yang-g 8 years ago
commit a7198021a6
  1. 1
      .gitignore
  2. 11
      BUILD
  3. 9811
      CMakeLists.txt
  4. 72
      INSTALL.md
  5. 346
      Makefile
  6. 2
      README.md
  7. 4
      Rakefile
  8. 39
      bazel/BUILD
  9. 1
      bazel/cc_grpc_library.bzl
  10. 4
      bazel/generate_cc.bzl
  11. 145
      binding.gyp
  12. 97
      build.yaml
  13. 32
      build_config.rb
  14. 9
      config.m4
  15. 1
      doc/PROTOCOL-HTTP2.md
  16. 2
      doc/environment_variables.md
  17. BIN
      doc/images/load-balancing.png
  18. 4
      doc/images/load-balancing.svg
  19. BIN
      doc/images/load_balancing_design.png
  20. 189
      doc/load-balancing.md
  21. 59
      doc/naming.md
  22. 7
      doc/negative-http2-interop-test-descriptions.md
  23. 147
      doc/service_config.md
  24. 42
      examples/cpp/helloworld/BUILD
  25. 4
      examples/cpp/helloworld/greeter_client.cc
  26. 4
      examples/cpp/helloworld/greeter_server.cc
  27. 52
      examples/protos/BUILD
  28. 11
      gRPC-Core.podspec
  29. 2
      grpc.def
  30. 8
      grpc.gemspec
  31. 9
      include/grpc++/impl/codegen/call.h
  32. 6
      include/grpc++/impl/codegen/config.h
  33. 4
      include/grpc++/support/channel_arguments.h
  34. 84
      include/grpc/impl/codegen/gpr_slice.h
  35. 9
      include/grpc/impl/codegen/grpc_types.h
  36. 28
      include/grpc/impl/codegen/slice.h
  37. 7
      include/grpc/slice_buffer.h
  38. 2
      include/grpc/support/log_windows.h
  39. 4
      package.json
  40. 54
      package.xml
  41. 4
      setup.cfg
  42. 3
      src/compiler/cpp_generator.cc
  43. 18
      src/core/ext/census/tracing.c
  44. 29
      src/core/ext/client_channel/client_channel.c
  45. 3
      src/core/ext/client_channel/client_channel_plugin.c
  46. 3
      src/core/ext/client_channel/connector.h
  47. 124
      src/core/ext/client_channel/http_connect_handshaker.c
  48. 17
      src/core/ext/client_channel/http_connect_handshaker.h
  49. 68
      src/core/ext/client_channel/http_proxy.c
  50. 20
      src/core/ext/client_channel/http_proxy.h
  51. 52
      src/core/ext/client_channel/proxy_mapper.c
  52. 73
      src/core/ext/client_channel/proxy_mapper.h
  53. 111
      src/core/ext/client_channel/proxy_mapper_registry.c
  54. 53
      src/core/ext/client_channel/proxy_mapper_registry.h
  55. 4
      src/core/ext/client_channel/resolver_registry.h
  56. 69
      src/core/ext/client_channel/subchannel.c
  57. 13
      src/core/ext/client_channel/subchannel.h
  58. 12
      src/core/ext/client_channel/subchannel_index.c
  59. 9
      src/core/ext/lb_policy/grpclb/grpclb.c
  60. 12
      src/core/ext/lb_policy/pick_first/pick_first.c
  61. 12
      src/core/ext/lb_policy/round_robin/round_robin.c
  62. 9
      src/core/ext/resolver/dns/native/dns_resolver.c
  63. 7
      src/core/ext/transport/chttp2/client/chttp2_connector.c
  64. 33
      src/core/ext/transport/chttp2/transport/chttp2_transport.c
  65. 2
      src/core/ext/transport/chttp2/transport/frame_rst_stream.c
  66. 6
      src/core/ext/transport/chttp2/transport/internal.h
  67. 14
      src/core/ext/transport/chttp2/transport/writing.c
  68. 2
      src/core/ext/transport/cronet/client/secure/cronet_channel_create.c
  69. 28
      src/core/ext/transport/cronet/transport/cronet_api_dummy.c
  70. 142
      src/core/ext/transport/cronet/transport/cronet_transport.c
  71. 5
      src/core/lib/iomgr/ev_epoll_linux.c
  72. 4
      src/core/lib/iomgr/ev_poll_posix.c
  73. 5
      src/core/lib/iomgr/resource_quota.c
  74. 6
      src/core/lib/iomgr/resource_quota.h
  75. 131
      src/core/lib/slice/slice_buffer.c
  76. 13
      src/core/lib/surface/call.c
  77. 8
      src/core/lib/surface/call_log_batch.c
  78. 5
      src/core/lib/surface/server.c
  79. 8
      src/cpp/common/channel_arguments.cc
  80. 23
      src/csharp/ext/grpc_csharp_ext.c
  81. 6
      src/node/ext/call.cc
  82. 12
      src/node/ext/call_credentials.cc
  83. 4
      src/node/ext/call_credentials.h
  84. 1
      src/node/ext/completion_queue.h
  85. 63
      src/node/ext/completion_queue_threadpool.cc
  86. 17
      src/node/ext/completion_queue_uv.cc
  87. 14
      src/node/ext/node_grpc.cc
  88. 2
      src/node/test/surface_test.js
  89. 5
      src/objective-c/CronetFramework.podspec
  90. 6
      src/objective-c/GRPCClient/GRPCCall+Cronet.h
  91. 6
      src/objective-c/GRPCClient/GRPCCall+Cronet.m
  92. 4
      src/objective-c/GRPCClient/private/GRPCChannel.m
  93. 8
      src/objective-c/GRPCClient/private/GRPCWrappedCall.m
  94. 8
      src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m
  95. 214
      src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
  96. 24
      src/objective-c/tests/CronetUnitTests/Info.plist
  97. 7
      src/objective-c/tests/Podfile
  98. 204
      src/objective-c/tests/Tests.xcodeproj/project.pbxproj
  99. 56
      src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/CronetUnitTests.xcscheme
  100. 7
      src/php/README.md
  101. Some files were not shown because too many files have changed in this diff Show More

1
.gitignore vendored

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

11
BUILD

@ -401,6 +401,7 @@ grpc_cc_library(
"include/grpc/impl/codegen/atm_gcc_atomic.h", "include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h", "include/grpc/impl/codegen/atm_gcc_sync.h",
"include/grpc/impl/codegen/atm_windows.h", "include/grpc/impl/codegen/atm_windows.h",
"include/grpc/impl/codegen/gpr_slice.h",
"include/grpc/impl/codegen/gpr_types.h", "include/grpc/impl/codegen/gpr_types.h",
"include/grpc/impl/codegen/port_platform.h", "include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h", "include/grpc/impl/codegen/slice.h",
@ -663,11 +664,14 @@ grpc_cc_library(
"src/core/ext/client_channel/connector.c", "src/core/ext/client_channel/connector.c",
"src/core/ext/client_channel/default_initial_connect_string.c", "src/core/ext/client_channel/default_initial_connect_string.c",
"src/core/ext/client_channel/http_connect_handshaker.c", "src/core/ext/client_channel/http_connect_handshaker.c",
"src/core/ext/client_channel/http_proxy.c",
"src/core/ext/client_channel/initial_connect_string.c", "src/core/ext/client_channel/initial_connect_string.c",
"src/core/ext/client_channel/lb_policy.c", "src/core/ext/client_channel/lb_policy.c",
"src/core/ext/client_channel/lb_policy_factory.c", "src/core/ext/client_channel/lb_policy_factory.c",
"src/core/ext/client_channel/lb_policy_registry.c", "src/core/ext/client_channel/lb_policy_registry.c",
"src/core/ext/client_channel/parse_address.c", "src/core/ext/client_channel/parse_address.c",
"src/core/ext/client_channel/proxy_mapper.c",
"src/core/ext/client_channel/proxy_mapper_registry.c",
"src/core/ext/client_channel/resolver.c", "src/core/ext/client_channel/resolver.c",
"src/core/ext/client_channel/resolver_factory.c", "src/core/ext/client_channel/resolver_factory.c",
"src/core/ext/client_channel/resolver_registry.c", "src/core/ext/client_channel/resolver_registry.c",
@ -680,11 +684,14 @@ grpc_cc_library(
"src/core/ext/client_channel/client_channel_factory.h", "src/core/ext/client_channel/client_channel_factory.h",
"src/core/ext/client_channel/connector.h", "src/core/ext/client_channel/connector.h",
"src/core/ext/client_channel/http_connect_handshaker.h", "src/core/ext/client_channel/http_connect_handshaker.h",
"src/core/ext/client_channel/http_proxy.h",
"src/core/ext/client_channel/initial_connect_string.h", "src/core/ext/client_channel/initial_connect_string.h",
"src/core/ext/client_channel/lb_policy.h", "src/core/ext/client_channel/lb_policy.h",
"src/core/ext/client_channel/lb_policy_factory.h", "src/core/ext/client_channel/lb_policy_factory.h",
"src/core/ext/client_channel/lb_policy_registry.h", "src/core/ext/client_channel/lb_policy_registry.h",
"src/core/ext/client_channel/parse_address.h", "src/core/ext/client_channel/parse_address.h",
"src/core/ext/client_channel/proxy_mapper.h",
"src/core/ext/client_channel/proxy_mapper_registry.h",
"src/core/ext/client_channel/resolver.h", "src/core/ext/client_channel/resolver.h",
"src/core/ext/client_channel/resolver_factory.h", "src/core/ext/client_channel/resolver_factory.h",
"src/core/ext/client_channel/resolver_registry.h", "src/core/ext/client_channel/resolver_registry.h",
@ -1026,7 +1033,7 @@ grpc_cc_library(
"src/core/ext/transport/cronet/transport/cronet_transport.c", "src/core/ext/transport/cronet/transport/cronet_transport.c",
], ],
hdrs = [ hdrs = [
"third_party/objective_c/Cronet/cronet_c_for_grpc.h", "third_party/Cronet/bidirectional_stream_c.h",
], ],
language = "c", language = "c",
public_hdrs = [ public_hdrs = [
@ -1078,6 +1085,7 @@ grpc_cc_library(
"src/cpp/common/completion_queue_cc.cc", "src/cpp/common/completion_queue_cc.cc",
"src/cpp/common/core_codegen.cc", "src/cpp/common/core_codegen.cc",
"src/cpp/common/rpc_method.cc", "src/cpp/common/rpc_method.cc",
"src/cpp/common/version_cc.cc",
"src/cpp/server/async_generic_service.cc", "src/cpp/server/async_generic_service.cc",
"src/cpp/server/create_default_thread_pool.cc", "src/cpp/server/create_default_thread_pool.cc",
"src/cpp/server/dynamic_thread_pool.cc", "src/cpp/server/dynamic_thread_pool.cc",
@ -1090,6 +1098,7 @@ grpc_cc_library(
"src/cpp/server/server_context.cc", "src/cpp/server/server_context.cc",
"src/cpp/server/server_credentials.cc", "src/cpp/server/server_credentials.cc",
"src/cpp/server/server_posix.cc", "src/cpp/server/server_posix.cc",
"src/cpp/thread_manager/thread_manager.cc",
"src/cpp/util/byte_buffer_cc.cc", "src/cpp/util/byte_buffer_cc.cc",
"src/cpp/util/slice_cc.cc", "src/cpp/util/slice_cc.cc",
"src/cpp/util/status.cc", "src/cpp/util/status.cc",

File diff suppressed because it is too large Load Diff

@ -61,49 +61,45 @@ gRPC C Core library.
There are several ways to build under Windows, of varying complexity depending There are several ways to build under Windows, of varying complexity depending
on experience with the tools involved. on experience with the tools involved.
<!-- ###Pre-generated Visual Studio solution
###Visual Studio
Versions 2013 and 2015 are both supported. You can use [their respective The pre-generated VS projects & solution are checked into the repository under the [vsprojects](/vsprojects) directory.
community
editions](https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx).
Building the C Core: ###Building using CMake (with BoringSSL)
- Open [grpc.sln](https://github.com/grpc/grpc/blob/master/vsprojects/grpc.sln). - Install [CMake](https://cmake.org/download/).
- Select your build target. - Install [Active State Perl](http://www.activestate.com/activeperl/) (`choco install activeperl`)
- Build the `grpc` project. - Install [Ninja](https://ninja-build.org/) (`choco install ninja`)
- Install [Go](https://golang.org/dl/) (`choco install golang`)
- Install [yasm](http://yasm.tortall.net/) and add it to `PATH` (`choco install yasm`)
- Run these commands in the repo root directory
```
> md .build
> cd .build
> call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x64
> cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release
> cmake --build .
```
NOTE: Currently you can only use Ninja to build using cmake on Windows (because of the boringssl dependency).
Building the C++ runtime: ###msys2 (with mingw)
- You need [CMake](https://cmake.org/) on your path to build protobuf (see below
for building using solely CMake).
- Run `vsprojects/build_protos.bat` (needs `cmake.exe` in your path).
- Open [buildtests_cxx.sln]()
- Select your build target.
- build the `grpc++` project.
-->
###msys2 The Makefile (and source code) should support msys2's mingw32 and mingw64
compilers. Building with msys2's native compiler is also possible, but
difficult.
This approach requires having [msys2](https://msys2.github.io/) installed. This approach requires having [msys2](https://msys2.github.io/) installed.
- The Makefile (and source code) should support msys2's mingw32 and mingw64 ```
compilers. Building with msys2's native compiler is also possible, but # Install prerequisites
difficult. MSYS2$ pacman -S autoconf automake gcc libtool mingw-w64-x86_64-toolchain perl pkg-config zlib
- The Makefile is expecting the Windows versions of OpenSSL (see MSYS2$ pacman -S mingw-w64-x86_64-gflags
https://slproweb.com/products/Win32OpenSSL.html). It's also possible to build ```
the Windows version of OpenSSL from scratch. The output should be `libeay32`
and `ssleay32`.
- If you are not installing the above files under msys2's path, you may specify
it, for instance, in the following way:
```CPPFLAGS=”-I/c/OpenSSL-Win32/include” LDFLAGS=”-L/c/OpenSSL-Win32/lib” make static_c```
- [protobuf3](https://github.com/google/protobuf/blob/master/src/README.md#c-installation---windows)
must be installed on the msys2 path.
###Cmake (experimental)
- Install [CMake](https://cmake.org/download/). ```
- Run it over [grpc's # From mingw shell
CMakeLists.txt](https://github.com/grpc/grpc/blob/master/CMakeLists.txt) to MINGW64$ export CPPFLAGS="-D_WIN32_WINNT=0x0600"
generate "projects" for your compiler. MINGW64$ make
- Build with your compiler of choice. The generated build files should have the ```
protobuf3 dependency baked in.
NOTE: While most of the make targets are buildable under Mingw, some haven't been ported to Windows yet
and may fail to build (mostly trying to include POSIX headers not available on Mingw).

@ -1023,6 +1023,9 @@ lame_client_test: $(BINDIR)/$(CONFIG)/lame_client_test
lb_policies_test: $(BINDIR)/$(CONFIG)/lb_policies_test lb_policies_test: $(BINDIR)/$(CONFIG)/lb_policies_test
load_file_test: $(BINDIR)/$(CONFIG)/load_file_test load_file_test: $(BINDIR)/$(CONFIG)/load_file_test
low_level_ping_pong_benchmark: $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark low_level_ping_pong_benchmark: $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark
memory_profile_client: $(BINDIR)/$(CONFIG)/memory_profile_client
memory_profile_server: $(BINDIR)/$(CONFIG)/memory_profile_server
memory_profile_test: $(BINDIR)/$(CONFIG)/memory_profile_test
message_compress_test: $(BINDIR)/$(CONFIG)/message_compress_test message_compress_test: $(BINDIR)/$(CONFIG)/message_compress_test
mlog_test: $(BINDIR)/$(CONFIG)/mlog_test mlog_test: $(BINDIR)/$(CONFIG)/mlog_test
multiple_server_queues_test: $(BINDIR)/$(CONFIG)/multiple_server_queues_test multiple_server_queues_test: $(BINDIR)/$(CONFIG)/multiple_server_queues_test
@ -1096,6 +1099,7 @@ grpc_tool_test: $(BINDIR)/$(CONFIG)/grpc_tool_test
grpclb_api_test: $(BINDIR)/$(CONFIG)/grpclb_api_test grpclb_api_test: $(BINDIR)/$(CONFIG)/grpclb_api_test
grpclb_test: $(BINDIR)/$(CONFIG)/grpclb_test grpclb_test: $(BINDIR)/$(CONFIG)/grpclb_test
health_service_end2end_test: $(BINDIR)/$(CONFIG)/health_service_end2end_test health_service_end2end_test: $(BINDIR)/$(CONFIG)/health_service_end2end_test
http2_client: $(BINDIR)/$(CONFIG)/http2_client
hybrid_end2end_test: $(BINDIR)/$(CONFIG)/hybrid_end2end_test hybrid_end2end_test: $(BINDIR)/$(CONFIG)/hybrid_end2end_test
interop_client: $(BINDIR)/$(CONFIG)/interop_client interop_client: $(BINDIR)/$(CONFIG)/interop_client
interop_server: $(BINDIR)/$(CONFIG)/interop_server interop_server: $(BINDIR)/$(CONFIG)/interop_server
@ -1271,9 +1275,9 @@ pc_cxx: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++.pc
pc_cxx_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc pc_cxx_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc++_unsecure.pc
ifeq ($(EMBED_OPENSSL),true) ifeq ($(EMBED_OPENSSL),true)
privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_asn1_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x509_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a $(LIBDIR)/$(CONFIG)/libbenchmark.a privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libboringssl_test_util.a $(LIBDIR)/$(CONFIG)/libboringssl_aes_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_asn1_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_base64_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bio_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bn_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_bytestring_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_aead_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cipher_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_cmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ed25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x25519_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_dh_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_digest_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ec_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ecdsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_err_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_extra_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_evp_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pbkdf_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_hmac_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs12_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_pkcs8_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_poly1305_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_rsa_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_x509_test_lib.a $(LIBDIR)/$(CONFIG)/libboringssl_ssl_test_lib.a $(LIBDIR)/$(CONFIG)/libbenchmark.a
else else
privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libbenchmark.a privatelibs_cxx: $(LIBDIR)/$(CONFIG)/libgrpc++_proto_reflection_desc_db.a $(LIBDIR)/$(CONFIG)/libgrpc++_test.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_cli_libs.a $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_client_helper.a $(LIBDIR)/$(CONFIG)/libinterop_client_main.a $(LIBDIR)/$(CONFIG)/libinterop_server_helper.a $(LIBDIR)/$(CONFIG)/libinterop_server_lib.a $(LIBDIR)/$(CONFIG)/libinterop_server_main.a $(LIBDIR)/$(CONFIG)/libqps.a $(LIBDIR)/$(CONFIG)/libbenchmark.a
endif endif
@ -1359,6 +1363,9 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/lame_client_test \ $(BINDIR)/$(CONFIG)/lame_client_test \
$(BINDIR)/$(CONFIG)/lb_policies_test \ $(BINDIR)/$(CONFIG)/lb_policies_test \
$(BINDIR)/$(CONFIG)/load_file_test \ $(BINDIR)/$(CONFIG)/load_file_test \
$(BINDIR)/$(CONFIG)/memory_profile_client \
$(BINDIR)/$(CONFIG)/memory_profile_server \
$(BINDIR)/$(CONFIG)/memory_profile_test \
$(BINDIR)/$(CONFIG)/message_compress_test \ $(BINDIR)/$(CONFIG)/message_compress_test \
$(BINDIR)/$(CONFIG)/mlog_test \ $(BINDIR)/$(CONFIG)/mlog_test \
$(BINDIR)/$(CONFIG)/multiple_server_queues_test \ $(BINDIR)/$(CONFIG)/multiple_server_queues_test \
@ -1479,6 +1486,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/grpclb_api_test \ $(BINDIR)/$(CONFIG)/grpclb_api_test \
$(BINDIR)/$(CONFIG)/grpclb_test \ $(BINDIR)/$(CONFIG)/grpclb_test \
$(BINDIR)/$(CONFIG)/health_service_end2end_test \ $(BINDIR)/$(CONFIG)/health_service_end2end_test \
$(BINDIR)/$(CONFIG)/http2_client \
$(BINDIR)/$(CONFIG)/hybrid_end2end_test \ $(BINDIR)/$(CONFIG)/hybrid_end2end_test \
$(BINDIR)/$(CONFIG)/interop_client \ $(BINDIR)/$(CONFIG)/interop_client \
$(BINDIR)/$(CONFIG)/interop_server \ $(BINDIR)/$(CONFIG)/interop_server \
@ -1573,6 +1581,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/grpclb_api_test \ $(BINDIR)/$(CONFIG)/grpclb_api_test \
$(BINDIR)/$(CONFIG)/grpclb_test \ $(BINDIR)/$(CONFIG)/grpclb_test \
$(BINDIR)/$(CONFIG)/health_service_end2end_test \ $(BINDIR)/$(CONFIG)/health_service_end2end_test \
$(BINDIR)/$(CONFIG)/http2_client \
$(BINDIR)/$(CONFIG)/hybrid_end2end_test \ $(BINDIR)/$(CONFIG)/hybrid_end2end_test \
$(BINDIR)/$(CONFIG)/interop_client \ $(BINDIR)/$(CONFIG)/interop_client \
$(BINDIR)/$(CONFIG)/interop_server \ $(BINDIR)/$(CONFIG)/interop_server \
@ -1752,6 +1761,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/lame_client_test || ( echo test lame_client_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/lame_client_test || ( echo test lame_client_test failed ; exit 1 )
$(E) "[RUN] Testing load_file_test" $(E) "[RUN] Testing load_file_test"
$(Q) $(BINDIR)/$(CONFIG)/load_file_test || ( echo test load_file_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/load_file_test || ( echo test load_file_test failed ; exit 1 )
$(E) "[RUN] Testing memory_profile_test"
$(Q) $(BINDIR)/$(CONFIG)/memory_profile_test || ( echo test memory_profile_test failed ; exit 1 )
$(E) "[RUN] Testing message_compress_test" $(E) "[RUN] Testing message_compress_test"
$(Q) $(BINDIR)/$(CONFIG)/message_compress_test || ( echo test message_compress_test failed ; exit 1 ) $(Q) $(BINDIR)/$(CONFIG)/message_compress_test || ( echo test message_compress_test failed ; exit 1 )
$(E) "[RUN] Testing multiple_server_queues_test" $(E) "[RUN] Testing multiple_server_queues_test"
@ -2357,36 +2368,36 @@ install-static_cxx: static_cxx strip-static_cxx install-pkg-config_cxx
install-shared_c: shared_c strip-shared_c install-pkg-config_c install-shared_c: shared_c strip-shared_c install-pkg-config_c
$(E) "[INSTALL] Installing $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/$(SHARED_PREFIX)gpr$(SHARED_VERSION).$(SHARED_EXT_CORE) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/$(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr-imp.a $(prefix)/lib/libgpr-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgpr.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.2 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so.2
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgpr.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/$(SHARED_PREFIX)grpc$(SHARED_VERSION).$(SHARED_EXT_CORE) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/$(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc-imp.a $(prefix)/lib/libgrpc-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so.2
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/$(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION).$(SHARED_EXT_CORE) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/$(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_cronet-imp.a $(prefix)/lib/libgrpc_cronet-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_cronet.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so.2
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_cronet.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/$(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION).$(SHARED_EXT_CORE) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/$(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure-imp.a $(prefix)/lib/libgrpc_unsecure-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE)-dll.a $(prefix)/lib/libgrpc_unsecure.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so.2
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(prefix)/lib/libgrpc_unsecure.so
@ -2401,36 +2412,36 @@ endif
install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-config_cxx install-shared_cxx: shared_cxx strip-shared_cxx install-shared_c install-pkg-config_cxx
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/$(SHARED_PREFIX)grpc++$(SHARED_VERSION).$(SHARED_EXT_CPP) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/$(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++-imp.a $(prefix)/lib/libgrpc++-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so.2
$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/$(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION).$(SHARED_EXT_CPP) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/$(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet-imp.a $(prefix)/lib/libgrpc++_cronet-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_cronet.a
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.2 $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_cronet.so.2
$(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 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
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT_CPP) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/$(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection-imp.a $(prefix)/lib/libgrpc++_reflection-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_reflection.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so.2
$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_reflection.so
endif endif
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT_CPP) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/$(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP)
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure-imp.a $(prefix)/lib/libgrpc++_unsecure-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP)-dll.a $(prefix)/lib/libgrpc++_unsecure.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so.2
$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(prefix)/lib/libgrpc++_unsecure.so
@ -2445,9 +2456,9 @@ endif
install-shared_csharp: shared_csharp strip-shared_csharp install-shared_csharp: shared_csharp strip-shared_csharp
$(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP)" $(E) "[INSTALL] Installing $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP)"
$(Q) $(INSTALL) -d $(prefix)/lib $(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/$(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION).$(SHARED_EXT_CSHARP) $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/$(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP)
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext-imp.a $(prefix)/lib/libgrpc_csharp_ext-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a $(prefix)/lib/libgrpc_csharp_ext.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so.2
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(prefix)/lib/libgrpc_csharp_ext.so
@ -2578,6 +2589,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \ include/grpc/impl/codegen/atm_gcc_sync.h \
include/grpc/impl/codegen/atm_windows.h \ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/gpr_slice.h \
include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/gpr_types.h \
include/grpc/impl/codegen/port_platform.h \ include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \ include/grpc/impl/codegen/slice.h \
@ -2610,11 +2622,11 @@ $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGPR_OB
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.2 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgpr.so.2 -o $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGPR_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS)
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.2 $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so.2
$(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgpr$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -2823,11 +2835,14 @@ LIBGRPC_SRC = \
src/core/ext/client_channel/connector.c \ src/core/ext/client_channel/connector.c \
src/core/ext/client_channel/default_initial_connect_string.c \ src/core/ext/client_channel/default_initial_connect_string.c \
src/core/ext/client_channel/http_connect_handshaker.c \ src/core/ext/client_channel/http_connect_handshaker.c \
src/core/ext/client_channel/http_proxy.c \
src/core/ext/client_channel/initial_connect_string.c \ src/core/ext/client_channel/initial_connect_string.c \
src/core/ext/client_channel/lb_policy.c \ src/core/ext/client_channel/lb_policy.c \
src/core/ext/client_channel/lb_policy_factory.c \ src/core/ext/client_channel/lb_policy_factory.c \
src/core/ext/client_channel/lb_policy_registry.c \ src/core/ext/client_channel/lb_policy_registry.c \
src/core/ext/client_channel/parse_address.c \ src/core/ext/client_channel/parse_address.c \
src/core/ext/client_channel/proxy_mapper.c \
src/core/ext/client_channel/proxy_mapper_registry.c \
src/core/ext/client_channel/resolver.c \ src/core/ext/client_channel/resolver.c \
src/core/ext/client_channel/resolver_factory.c \ src/core/ext/client_channel/resolver_factory.c \
src/core/ext/client_channel/resolver_registry.c \ src/core/ext/client_channel/resolver_registry.c \
@ -2888,6 +2903,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \ include/grpc/impl/codegen/atm_gcc_sync.h \
include/grpc/impl/codegen/atm_windows.h \ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/gpr_slice.h \
include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/gpr_types.h \
include/grpc/impl/codegen/port_platform.h \ include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \ include/grpc/impl/codegen/slice.h \
@ -2933,11 +2949,11 @@ $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(LIBGRPC_
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so.2
$(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -3099,11 +3115,14 @@ LIBGRPC_CRONET_SRC = \
src/core/ext/client_channel/connector.c \ src/core/ext/client_channel/connector.c \
src/core/ext/client_channel/default_initial_connect_string.c \ src/core/ext/client_channel/default_initial_connect_string.c \
src/core/ext/client_channel/http_connect_handshaker.c \ src/core/ext/client_channel/http_connect_handshaker.c \
src/core/ext/client_channel/http_proxy.c \
src/core/ext/client_channel/initial_connect_string.c \ src/core/ext/client_channel/initial_connect_string.c \
src/core/ext/client_channel/lb_policy.c \ src/core/ext/client_channel/lb_policy.c \
src/core/ext/client_channel/lb_policy_factory.c \ src/core/ext/client_channel/lb_policy_factory.c \
src/core/ext/client_channel/lb_policy_registry.c \ src/core/ext/client_channel/lb_policy_registry.c \
src/core/ext/client_channel/parse_address.c \ src/core/ext/client_channel/parse_address.c \
src/core/ext/client_channel/proxy_mapper.c \
src/core/ext/client_channel/proxy_mapper_registry.c \
src/core/ext/client_channel/resolver.c \ src/core/ext/client_channel/resolver.c \
src/core/ext/client_channel/resolver_factory.c \ src/core/ext/client_channel/resolver_factory.c \
src/core/ext/client_channel/resolver_registry.c \ src/core/ext/client_channel/resolver_registry.c \
@ -3161,6 +3180,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \ include/grpc/impl/codegen/atm_gcc_sync.h \
include/grpc/impl/codegen/atm_windows.h \ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/gpr_slice.h \
include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/gpr_types.h \
include/grpc/impl/codegen/port_platform.h \ include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \ include/grpc/impl/codegen/slice.h \
@ -3206,11 +3226,11 @@ $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $(L
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_cronet.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_CRONET_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so.2
$(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -3380,6 +3400,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \ include/grpc/impl/codegen/atm_gcc_sync.h \
include/grpc/impl/codegen/atm_windows.h \ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/gpr_slice.h \
include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/gpr_types.h \
include/grpc/impl/codegen/port_platform.h \ include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \ include/grpc/impl/codegen/slice.h \
@ -3613,11 +3634,14 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/client_channel/connector.c \ src/core/ext/client_channel/connector.c \
src/core/ext/client_channel/default_initial_connect_string.c \ src/core/ext/client_channel/default_initial_connect_string.c \
src/core/ext/client_channel/http_connect_handshaker.c \ src/core/ext/client_channel/http_connect_handshaker.c \
src/core/ext/client_channel/http_proxy.c \
src/core/ext/client_channel/initial_connect_string.c \ src/core/ext/client_channel/initial_connect_string.c \
src/core/ext/client_channel/lb_policy.c \ src/core/ext/client_channel/lb_policy.c \
src/core/ext/client_channel/lb_policy_factory.c \ src/core/ext/client_channel/lb_policy_factory.c \
src/core/ext/client_channel/lb_policy_registry.c \ src/core/ext/client_channel/lb_policy_registry.c \
src/core/ext/client_channel/parse_address.c \ src/core/ext/client_channel/parse_address.c \
src/core/ext/client_channel/proxy_mapper.c \
src/core/ext/client_channel/proxy_mapper_registry.c \
src/core/ext/client_channel/resolver.c \ src/core/ext/client_channel/resolver.c \
src/core/ext/client_channel/resolver_factory.c \ src/core/ext/client_channel/resolver_factory.c \
src/core/ext/client_channel/resolver_registry.c \ src/core/ext/client_channel/resolver_registry.c \
@ -3673,6 +3697,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \ include/grpc/impl/codegen/atm_gcc_sync.h \
include/grpc/impl/codegen/atm_windows.h \ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/gpr_slice.h \
include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/gpr_types.h \
include/grpc/impl/codegen/port_platform.h \ include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \ include/grpc/impl/codegen/slice.h \
@ -3706,11 +3731,11 @@ $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE): $
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS)
else else
$(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(Q) $(LD) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_unsecure.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBGRPC_UNSECURE_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.2 $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so.2
$(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so $(Q) ln -sf $(SHARED_PREFIX)grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure$(SHARED_VERSION_CORE).so
endif endif
endif endif
@ -3924,6 +3949,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \ include/grpc/impl/codegen/atm_gcc_sync.h \
include/grpc/impl/codegen/atm_windows.h \ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/gpr_slice.h \
include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/gpr_types.h \
include/grpc/impl/codegen/port_platform.h \ include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \ include/grpc/impl/codegen/slice.h \
@ -3967,20 +3993,20 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/grpc.$(SHARED_EXT_CORE) $(OPENSSL_DEP) $(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/grpc$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(OPENSSL_DEP)
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc-imp $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc$(SHARED_VERSION_CORE)-dll
else else
$(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgrpc.$(SHARED_EXT_CORE) $(OPENSSL_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgrpc.$(SHARED_EXT_CORE) $(OPENSSL_DEP)
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++$(SHARED_VERSION).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc
else else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc
$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP).so.1 $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP).so.1
$(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP).so $(Q) ln -sf $(SHARED_PREFIX)grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++$(SHARED_VERSION_CPP).so
endif endif
endif endif
@ -4179,11 +4205,14 @@ LIBGRPC++_CRONET_SRC = \
src/core/ext/client_channel/connector.c \ src/core/ext/client_channel/connector.c \
src/core/ext/client_channel/default_initial_connect_string.c \ src/core/ext/client_channel/default_initial_connect_string.c \
src/core/ext/client_channel/http_connect_handshaker.c \ src/core/ext/client_channel/http_connect_handshaker.c \
src/core/ext/client_channel/http_proxy.c \
src/core/ext/client_channel/initial_connect_string.c \ src/core/ext/client_channel/initial_connect_string.c \
src/core/ext/client_channel/lb_policy.c \ src/core/ext/client_channel/lb_policy.c \
src/core/ext/client_channel/lb_policy_factory.c \ src/core/ext/client_channel/lb_policy_factory.c \
src/core/ext/client_channel/lb_policy_registry.c \ src/core/ext/client_channel/lb_policy_registry.c \
src/core/ext/client_channel/parse_address.c \ src/core/ext/client_channel/parse_address.c \
src/core/ext/client_channel/proxy_mapper.c \
src/core/ext/client_channel/proxy_mapper_registry.c \
src/core/ext/client_channel/resolver.c \ src/core/ext/client_channel/resolver.c \
src/core/ext/client_channel/resolver_factory.c \ src/core/ext/client_channel/resolver_factory.c \
src/core/ext/client_channel/resolver_registry.c \ src/core/ext/client_channel/resolver_registry.c \
@ -4295,6 +4324,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \ include/grpc/impl/codegen/atm_gcc_sync.h \
include/grpc/impl/codegen/atm_windows.h \ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/gpr_slice.h \
include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/gpr_types.h \
include/grpc/impl/codegen/port_platform.h \ include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \ include/grpc/impl/codegen/slice.h \
@ -4348,20 +4378,20 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(LIBDIR)/$(CONFIG)/grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_CRONET_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/gpr.$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/grpc_cronet.$(SHARED_EXT_CORE) $(OPENSSL_DEP) $(LIBDIR)/$(CONFIG)/grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_CRONET_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/grpc_cronet$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(OPENSSL_DEP)
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_cronet$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_CRONET_OBJS) $(LDLIBS) $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr-imp -lgrpc_cronet-imp $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_cronet$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_CRONET_OBJS) $(LDLIBS) $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr$(SHARED_VERSION_CORE)-dll -lgrpc_cronet$(SHARED_VERSION_CORE)-dll
else else
$(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_CRONET_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgpr.$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet.$(SHARED_EXT_CORE) $(OPENSSL_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_CRONET_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgpr.$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_cronet.$(SHARED_EXT_CORE) $(OPENSSL_DEP)
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_CRONET_OBJS) $(LDLIBS) $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr -lgrpc_cronet $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_CRONET_OBJS) $(LDLIBS) $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr -lgrpc_cronet
else else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_cronet.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_CRONET_OBJS) $(LDLIBS) $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr -lgrpc_cronet $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_cronet.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_CRONET_OBJS) $(LDLIBS) $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr -lgrpc_cronet
$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP).so.1 $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP).so.1
$(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP).so $(Q) ln -sf $(SHARED_PREFIX)grpc++_cronet$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_cronet$(SHARED_VERSION_CPP).so
endif endif
endif endif
@ -4471,20 +4501,20 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/grpc++.$(SHARED_EXT_CPP) $(OPENSSL_DEP) $(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/grpc++$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(OPENSSL_DEP)
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc++-imp $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc++$(SHARED_VERSION_CPP)-dll
else else
$(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT_CPP) $(OPENSSL_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_REFLECTION_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgrpc++.$(SHARED_EXT_CPP) $(OPENSSL_DEP)
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc++ $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc++
else else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_reflection.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc++ $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_reflection.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_REFLECTION_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgrpc++
$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).so.1 $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).so.1
$(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).so $(Q) ln -sf $(SHARED_PREFIX)grpc++_reflection$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_reflection$(SHARED_VERSION_CPP).so
endif endif
endif endif
@ -4652,6 +4682,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \ include/grpc/impl/codegen/atm_gcc_sync.h \
include/grpc/impl/codegen/atm_windows.h \ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/gpr_slice.h \
include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/gpr_types.h \
include/grpc/impl/codegen/port_platform.h \ include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \ include/grpc/impl/codegen/slice.h \
@ -4837,6 +4868,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/impl/codegen/atm_gcc_atomic.h \ include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \ include/grpc/impl/codegen/atm_gcc_sync.h \
include/grpc/impl/codegen/atm_windows.h \ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/gpr_slice.h \
include/grpc/impl/codegen/gpr_types.h \ include/grpc/impl/codegen/gpr_types.h \
include/grpc/impl/codegen/port_platform.h \ include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \ include/grpc/impl/codegen/slice.h \
@ -4870,20 +4902,20 @@ endif
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(LIBDIR)/$(CONFIG)/grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_UNSECURE_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/gpr.$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/grpc_unsecure.$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_UNSECURE_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/gpr$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/grpc_unsecure$(SHARED_VERSION_CORE).$(SHARED_EXT_CORE)
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_unsecure$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_UNSECURE_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr-imp -lgrpc_unsecure-imp $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc++_unsecure$(SHARED_VERSION_CPP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_UNSECURE_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr$(SHARED_VERSION_CORE)-dll -lgrpc_unsecure$(SHARED_VERSION_CORE)-dll
else else
$(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_UNSECURE_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgpr.$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP): $(LIBGRPC++_UNSECURE_OBJS) $(ZLIB_DEP) $(PROTOBUF_DEP) $(LIBDIR)/$(CONFIG)/libgpr.$(SHARED_EXT_CORE) $(LIBDIR)/$(CONFIG)/libgrpc_unsecure.$(SHARED_EXT_CORE)
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_UNSECURE_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr -lgrpc_unsecure $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_UNSECURE_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr -lgrpc_unsecure
else else
$(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_unsecure.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_UNSECURE_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr -lgrpc_unsecure $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc++_unsecure.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBGRPC++_UNSECURE_OBJS) $(LDLIBS) $(ZLIB_MERGE_LIBS) $(LDLIBSXX) $(LDLIBS_PROTOBUF) -lgpr -lgrpc_unsecure
$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP).so.1 $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP).so.1
$(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP).so $(Q) ln -sf $(SHARED_PREFIX)grpc++_unsecure$(SHARED_VERSION_CPP).$(SHARED_EXT_CPP) $(LIBDIR)/$(CONFIG)/libgrpc++_unsecure$(SHARED_VERSION_CPP).so
endif endif
endif endif
@ -4997,6 +5029,59 @@ ifneq ($(NO_DEPS),true)
endif endif
LIBHTTP2_CLIENT_MAIN_SRC = \
$(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc \
$(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc \
$(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc \
test/cpp/interop/http2_client.cc \
PUBLIC_HEADERS_CXX += \
LIBHTTP2_CLIENT_MAIN_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBHTTP2_CLIENT_MAIN_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure libraries if you don't have OpenSSL.
$(LIBDIR)/$(CONFIG)/libhttp2_client_main.a: 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)/libhttp2_client_main.a: protobuf_dep_error
else
$(LIBDIR)/$(CONFIG)/libhttp2_client_main.a: $(ZLIB_DEP) $(OPENSSL_DEP) $(PROTOBUF_DEP) $(LIBHTTP2_CLIENT_MAIN_OBJS)
$(E) "[AR] Creating $@"
$(Q) mkdir -p `dirname $@`
$(Q) rm -f $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a
$(Q) $(AR) $(AROPTS) $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBHTTP2_CLIENT_MAIN_OBJS)
ifeq ($(SYSTEM),Darwin)
$(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a
endif
endif
endif
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(LIBHTTP2_CLIENT_MAIN_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/interop/http2_client.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc
LIBINTEROP_CLIENT_HELPER_SRC = \ LIBINTEROP_CLIENT_HELPER_SRC = \
$(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc \
test/cpp/interop/client_helper.cc \ test/cpp/interop/client_helper.cc \
@ -5263,7 +5348,6 @@ LIBQPS_SRC = \
test/cpp/qps/client_async.cc \ test/cpp/qps/client_async.cc \
test/cpp/qps/client_sync.cc \ test/cpp/qps/client_sync.cc \
test/cpp/qps/driver.cc \ test/cpp/qps/driver.cc \
test/cpp/qps/limit_cores.cc \
test/cpp/qps/parse_json.cc \ test/cpp/qps/parse_json.cc \
test/cpp/qps/qps_worker.cc \ test/cpp/qps/qps_worker.cc \
test/cpp/qps/report.cc \ test/cpp/qps/report.cc \
@ -5319,7 +5403,6 @@ endif
$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/qps/client_async.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/qps/client_sync.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/qps/driver.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/limit_cores.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/parse_json.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/qps/parse_json.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_worker.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/qps/qps_worker.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/qps/report.o: $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.pb.cc $(GENDIR)/src/proto/grpc/testing/payloads.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.pb.cc $(GENDIR)/src/proto/grpc/testing/stats.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/control.pb.cc $(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/services.pb.cc $(GENDIR)/src/proto/grpc/testing/services.grpc.pb.cc
@ -5369,11 +5452,11 @@ $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHA
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION).$(SHARED_EXT_CSHARP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS)
else else
$(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(Q) $(LD) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LDLIBS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS)
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so.1 $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so.1
$(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so
endif endif
endif endif
@ -7278,6 +7361,8 @@ LIBEND2END_TESTS_SRC = \
test/core/end2end/tests/simple_request.c \ test/core/end2end/tests/simple_request.c \
test/core/end2end/tests/streaming_error_response.c \ test/core/end2end/tests/streaming_error_response.c \
test/core/end2end/tests/trailing_metadata.c \ test/core/end2end/tests/trailing_metadata.c \
test/core/end2end/tests/write_buffering.c \
test/core/end2end/tests/write_buffering_at_end.c \
PUBLIC_HEADERS_C += \ PUBLIC_HEADERS_C += \
@ -7364,6 +7449,8 @@ LIBEND2END_NOSEC_TESTS_SRC = \
test/core/end2end/tests/simple_request.c \ test/core/end2end/tests/simple_request.c \
test/core/end2end/tests/streaming_error_response.c \ test/core/end2end/tests/streaming_error_response.c \
test/core/end2end/tests/trailing_metadata.c \ test/core/end2end/tests/trailing_metadata.c \
test/core/end2end/tests/write_buffering.c \
test/core/end2end/tests/write_buffering_at_end.c \
PUBLIC_HEADERS_C += \ PUBLIC_HEADERS_C += \
@ -10335,6 +10422,102 @@ endif
endif endif
MEMORY_PROFILE_CLIENT_SRC = \
test/core/memory_usage/client.c \
MEMORY_PROFILE_CLIENT_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MEMORY_PROFILE_CLIENT_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/memory_profile_client: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/memory_profile_client: $(MEMORY_PROFILE_CLIENT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(MEMORY_PROFILE_CLIENT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/memory_profile_client
endif
$(OBJDIR)/$(CONFIG)/test/core/memory_usage/client.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_memory_profile_client: $(MEMORY_PROFILE_CLIENT_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(MEMORY_PROFILE_CLIENT_OBJS:.o=.dep)
endif
endif
MEMORY_PROFILE_SERVER_SRC = \
test/core/memory_usage/server.c \
MEMORY_PROFILE_SERVER_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MEMORY_PROFILE_SERVER_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/memory_profile_server: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/memory_profile_server: $(MEMORY_PROFILE_SERVER_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(MEMORY_PROFILE_SERVER_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/memory_profile_server
endif
$(OBJDIR)/$(CONFIG)/test/core/memory_usage/server.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_memory_profile_server: $(MEMORY_PROFILE_SERVER_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(MEMORY_PROFILE_SERVER_OBJS:.o=.dep)
endif
endif
MEMORY_PROFILE_TEST_SRC = \
test/core/memory_usage/memory_usage_test.c \
MEMORY_PROFILE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MEMORY_PROFILE_TEST_SRC))))
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/memory_profile_test: openssl_dep_error
else
$(BINDIR)/$(CONFIG)/memory_profile_test: $(MEMORY_PROFILE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(MEMORY_PROFILE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/memory_profile_test
endif
$(OBJDIR)/$(CONFIG)/test/core/memory_usage/memory_usage_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_memory_profile_test: $(MEMORY_PROFILE_TEST_OBJS:.o=.dep)
ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(MEMORY_PROFILE_TEST_OBJS:.o=.dep)
endif
endif
MESSAGE_COMPRESS_TEST_SRC = \ MESSAGE_COMPRESS_TEST_SRC = \
test/core/compression/message_compress_test.c \ test/core/compression/message_compress_test.c \
@ -12928,18 +13111,18 @@ $(BINDIR)/$(CONFIG)/grpclb_test: protobuf_dep_error
else else
$(BINDIR)/$(CONFIG)/grpclb_test: $(PROTOBUF_DEP) $(GRPCLB_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(BINDIR)/$(CONFIG)/grpclb_test: $(PROTOBUF_DEP) $(GRPCLB_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(GRPCLB_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/grpclb_test $(Q) $(LDXX) $(LDFLAGS) $(GRPCLB_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/grpclb_test
endif endif
endif endif
$(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v1/load_balancer.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(OBJDIR)/$(CONFIG)/src/proto/grpc/lb/v1/load_balancer.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/grpclb/grpclb_test.o: $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(OBJDIR)/$(CONFIG)/test/cpp/grpclb/grpclb_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_grpclb_test: $(GRPCLB_TEST_OBJS:.o=.dep) deps_grpclb_test: $(GRPCLB_TEST_OBJS:.o=.dep)
@ -12994,6 +13177,37 @@ endif
endif endif
ifeq ($(NO_SECURE),true)
# You can't build secure targets if you don't have OpenSSL.
$(BINDIR)/$(CONFIG)/http2_client: 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)/http2_client: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/http2_client: $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(LIBDIR)/$(CONFIG)/libhttp2_client_main.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/http2_client
endif
endif
HYBRID_END2END_TEST_SRC = \ HYBRID_END2END_TEST_SRC = \
test/cpp/end2end/hybrid_end2end_test.cc \ test/cpp/end2end/hybrid_end2end_test.cc \
@ -14074,10 +14288,10 @@ STRESS_TEST_SRC = \
$(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc \
$(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc \
$(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc \ $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc \
test/cpp/interop/client_helper.cc \
test/cpp/interop/interop_client.cc \ test/cpp/interop/interop_client.cc \
test/cpp/interop/stress_interop_client.cc \ test/cpp/interop/stress_interop_client.cc \
test/cpp/interop/stress_test.cc \ test/cpp/interop/stress_test.cc \
test/cpp/util/create_test_channel.cc \
test/cpp/util/metrics_server.cc \ test/cpp/util/metrics_server.cc \
STRESS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(STRESS_TEST_SRC)))) STRESS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(STRESS_TEST_SRC))))
@ -14117,14 +14331,14 @@ $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/metrics.o: $(LIBDIR)/$(CONFIG)/libgr
$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(OBJDIR)/$(CONFIG)/test/cpp/interop/client_helper.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(OBJDIR)/$(CONFIG)/test/cpp/interop/interop_client.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/interop_client.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(OBJDIR)/$(CONFIG)/test/cpp/interop/stress_interop_client.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/stress_interop_client.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(OBJDIR)/$(CONFIG)/test/cpp/interop/stress_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/stress_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(OBJDIR)/$(CONFIG)/test/cpp/util/create_test_channel.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
$(OBJDIR)/$(CONFIG)/test/cpp/util/metrics_server.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a $(OBJDIR)/$(CONFIG)/test/cpp/util/metrics_server.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_config.a
deps_stress_test: $(STRESS_TEST_OBJS:.o=.dep) deps_stress_test: $(STRESS_TEST_OBJS:.o=.dep)
@ -14134,10 +14348,10 @@ ifneq ($(NO_DEPS),true)
-include $(STRESS_TEST_OBJS:.o=.dep) -include $(STRESS_TEST_OBJS:.o=.dep)
endif endif
endif endif
$(OBJDIR)/$(CONFIG)/test/cpp/interop/client_helper.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/interop/interop_client.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/interop/interop_client.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/interop/stress_interop_client.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/interop/stress_interop_client.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/interop/stress_test.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/interop/stress_test.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/util/create_test_channel.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc
$(OBJDIR)/$(CONFIG)/test/cpp/util/metrics_server.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc $(OBJDIR)/$(CONFIG)/test/cpp/util/metrics_server.o: $(GENDIR)/src/proto/grpc/testing/empty.pb.cc $(GENDIR)/src/proto/grpc/testing/empty.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.pb.cc $(GENDIR)/src/proto/grpc/testing/messages.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.pb.cc $(GENDIR)/src/proto/grpc/testing/metrics.grpc.pb.cc $(GENDIR)/src/proto/grpc/testing/test.pb.cc $(GENDIR)/src/proto/grpc/testing/test.grpc.pb.cc
@ -16911,6 +17125,7 @@ test/core/util/test_tcp_server.c: $(OPENSSL_DEP)
test/cpp/end2end/test_service_impl.cc: $(OPENSSL_DEP) test/cpp/end2end/test_service_impl.cc: $(OPENSSL_DEP)
test/cpp/interop/client.cc: $(OPENSSL_DEP) test/cpp/interop/client.cc: $(OPENSSL_DEP)
test/cpp/interop/client_helper.cc: $(OPENSSL_DEP) test/cpp/interop/client_helper.cc: $(OPENSSL_DEP)
test/cpp/interop/http2_client.cc: $(OPENSSL_DEP)
test/cpp/interop/interop_client.cc: $(OPENSSL_DEP) test/cpp/interop/interop_client.cc: $(OPENSSL_DEP)
test/cpp/interop/interop_server.cc: $(OPENSSL_DEP) test/cpp/interop/interop_server.cc: $(OPENSSL_DEP)
test/cpp/interop/interop_server_bootstrap.cc: $(OPENSSL_DEP) test/cpp/interop/interop_server_bootstrap.cc: $(OPENSSL_DEP)
@ -16918,7 +17133,6 @@ test/cpp/interop/server_helper.cc: $(OPENSSL_DEP)
test/cpp/qps/client_async.cc: $(OPENSSL_DEP) test/cpp/qps/client_async.cc: $(OPENSSL_DEP)
test/cpp/qps/client_sync.cc: $(OPENSSL_DEP) test/cpp/qps/client_sync.cc: $(OPENSSL_DEP)
test/cpp/qps/driver.cc: $(OPENSSL_DEP) test/cpp/qps/driver.cc: $(OPENSSL_DEP)
test/cpp/qps/limit_cores.cc: $(OPENSSL_DEP)
test/cpp/qps/parse_json.cc: $(OPENSSL_DEP) test/cpp/qps/parse_json.cc: $(OPENSSL_DEP)
test/cpp/qps/qps_worker.cc: $(OPENSSL_DEP) test/cpp/qps/qps_worker.cc: $(OPENSSL_DEP)
test/cpp/qps/report.cc: $(OPENSSL_DEP) test/cpp/qps/report.cc: $(OPENSSL_DEP)

@ -17,6 +17,8 @@ See [INSTALL](INSTALL.md) for installation instructions for various platforms.
See [tools/run_tests](tools/run_tests) for more guidance on how to run various test suites (e.g. unit tests, interop tests, benchmarks) See [tools/run_tests](tools/run_tests) for more guidance on how to run various test suites (e.g. unit tests, interop tests, benchmarks)
See [Performance dashboard](http://performance-dot-grpc-testing.appspot.com/explore?dashboard=5712453606309888) for the performance numbers for v1.0.x.
#Repository Structure & Status #Repository Structure & Status
This repository contains source code for gRPC libraries for multiple languages written on top of shared C core library [src/core] (src/core). This repository contains source code for gRPC libraries for multiple languages written on top of shared C core library [src/core] (src/core).

@ -5,6 +5,8 @@ require 'rubocop/rake_task'
require 'bundler/gem_tasks' require 'bundler/gem_tasks'
require 'fileutils' require 'fileutils'
require_relative 'build_config.rb'
load 'tools/distrib/docker_for_windows.rb' load 'tools/distrib/docker_for_windows.rb'
# Add rubocop style checking tasks # Add rubocop style checking tasks
@ -83,7 +85,7 @@ task 'dlls' do
env += 'EMBED_ZLIB=true ' env += 'EMBED_ZLIB=true '
env += 'BUILDDIR=/tmp ' env += 'BUILDDIR=/tmp '
env += "V=#{verbose} " env += "V=#{verbose} "
out = '/tmp/libs/opt/grpc-1.dll' out = GrpcBuildConfig::CORE_WINDOWS_DLL
w64 = { cross: 'x86_64-w64-mingw32', out: 'grpc_c.64.ruby' } w64 = { cross: 'x86_64-w64-mingw32', out: 'grpc_c.64.ruby' }
w32 = { cross: 'i686-w64-mingw32', out: 'grpc_c.32.ruby' } w32 = { cross: 'i686-w64-mingw32', out: 'grpc_c.32.ruby' }

@ -1,9 +1,46 @@
# 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 = ["//:__subpackages__"]) package(default_visibility = ["//:__subpackages__"])
load(":cc_grpc_library.bzl", "cc_grpc_library") load(":cc_grpc_library.bzl", "cc_grpc_library")
proto_library(
name = "well_known_protos_list",
srcs = ["@submodule_protobuf//:well_known_protos"],
)
cc_grpc_library( cc_grpc_library(
name = "well_known_protos", name = "well_known_protos",
srcs = "@submodule_protobuf//:well_known_protos", srcs = "well_known_protos_list",
deps = [],
proto_only = True, proto_only = True,
) )

@ -44,7 +44,6 @@ def cc_grpc_library(name, srcs, deps, proto_only, **kwargs):
**kwargs **kwargs
) )
if not proto_only:
native.cc_library( native.cc_library(
name = name, name = name,
srcs = [":" + codegen_grpc_target, ":" + codegen_target], srcs = [":" + codegen_grpc_target, ":" + codegen_target],

@ -24,13 +24,15 @@ def generate_cc_impl(ctx):
if ctx.executable.plugin: if ctx.executable.plugin:
arguments += ["--plugin=protoc-gen-PLUGIN=" + ctx.executable.plugin.path] arguments += ["--plugin=protoc-gen-PLUGIN=" + ctx.executable.plugin.path]
arguments += ["--PLUGIN_out=" + ",".join(ctx.attr.flags) + ":" + dir_out] arguments += ["--PLUGIN_out=" + ",".join(ctx.attr.flags) + ":" + dir_out]
additional_input = [ctx.executable.plugin]
else: else:
arguments += ["--cpp_out=" + ",".join(ctx.attr.flags) + ":" + dir_out] arguments += ["--cpp_out=" + ",".join(ctx.attr.flags) + ":" + dir_out]
additional_input = []
arguments += ["-I{0}={0}".format(include.path) for include in includes] arguments += ["-I{0}={0}".format(include.path) for include in includes]
arguments += [proto.path for proto in protos] arguments += [proto.path for proto in protos]
ctx.action( ctx.action(
inputs = protos + includes, inputs = protos + includes + additional_input,
outputs = out_files, outputs = out_files,
executable = ctx.executable._protoc, executable = ctx.executable._protoc,
arguments = arguments, arguments = arguments,

@ -37,18 +37,68 @@
# Some of this file is built with the help of # Some of this file is built with the help of
# https://n8.io/converting-a-c-library-to-gyp/ # https://n8.io/converting-a-c-library-to-gyp/
{ {
'variables': {
'runtime%': 'node'
},
'target_defaults': { 'target_defaults': {
'include_dirs': [ 'include_dirs': [
'.', '.',
'include' 'include'
], ],
'defines': [
'GPR_BACKWARDS_COMPATIBILITY_MODE'
],
'conditions': [
['runtime=="node"', {
'defines': [ 'defines': [
'GRPC_UV' 'GRPC_UV'
]
}],
['OS!="win" and runtime=="electron"', {
"defines": [
'OPENSSL_NO_THREADS'
]
}],
# This is the condition for using boringssl
['OS=="win" or runtime=="electron"', {
"include_dirs": [
"third_party/boringssl/include"
],
"defines": [
'OPENSSL_NO_ASM'
]
}, {
# Based on logic above, we know that this must be a non-Windows system
'variables': {
# The output of "node --version" is "v[version]". We use cut to
# remove the first character.
'target%': '<!(node --version | cut -c2-)'
},
# Empirically, Node only exports ALPN symbols if its major version is >0.
# io.js always reports versions >0 and always exports ALPN symbols.
# Therefore, Node's major version will be truthy if and only if it
# supports ALPN. The target is "[major].[minor].[patch]". We split by
# periods and take the first field to get the major version.
'defines': [
'TSI_OPENSSL_ALPN_SUPPORT=<!(echo <(target) | cut -d. -f1)'
],
'include_dirs': [
'<(node_root_dir)/deps/openssl/openssl/include',
], ],
'conditions': [ 'conditions': [
["target_arch=='ia32'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ]
}],
["target_arch=='x64'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ]
}],
["target_arch=='arm'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ]
}]
]
}],
['OS == "win"', { ['OS == "win"', {
"include_dirs": [ "include_dirs": [
"third_party/boringssl/include",
"third_party/zlib" "third_party/zlib"
], ],
"defines": [ "defines": [
@ -58,8 +108,6 @@
'UNICODE', 'UNICODE',
'_UNICODE', '_UNICODE',
'NOMINMAX', 'NOMINMAX',
'OPENSSL_NO_ASM',
'GPR_BACKWARDS_COMPATIBILITY_MODE'
], ],
"msvs_settings": { "msvs_settings": {
'VCCLCompilerTool': { 'VCCLCompilerTool': {
@ -72,21 +120,8 @@
}, { # OS != "win" }, { # OS != "win"
'variables': { 'variables': {
'config': '<!(echo $CONFIG)', 'config': '<!(echo $CONFIG)',
# The output of "node --version" is "v[version]". We use cut to
# remove the first character.
'target%': '<!(node --version | cut -c2-)'
}, },
# Empirically, Node only exports ALPN symbols if its major version is >0.
# io.js always reports versions >0 and always exports ALPN symbols.
# Therefore, Node's major version will be truthy if and only if it
# supports ALPN. The target is "[major].[minor].[patch]". We split by
# periods and take the first field to get the major version.
'defines': [
'TSI_OPENSSL_ALPN_SUPPORT=<!(echo <(target) | cut -d. -f1)',
'GPR_BACKWARDS_COMPATIBILITY_MODE'
],
'include_dirs': [ 'include_dirs': [
'<(node_root_dir)/deps/openssl/openssl/include',
'<(node_root_dir)/deps/zlib' '<(node_root_dir)/deps/zlib'
], ],
'conditions': [ 'conditions': [
@ -101,47 +136,14 @@
'-fprofile-arcs' '-fprofile-arcs'
] ]
} }
], ]
["target_arch=='ia32'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ]
}],
["target_arch=='x64'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ]
}],
["target_arch=='arm'", {
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ]
}]
] ]
}] }]
] ]
}, },
'conditions': [ 'conditions': [
['OS == "win"', { ['OS=="win" or runtime=="electron"', {
'targets': [ 'targets': [
{
# IMPORTANT WINDOWS BUILD INFORMATION
# This library does not build on Windows without modifying the Node
# development packages that node-gyp downloads in order to build.
# Due to https://github.com/nodejs/node/issues/4932, the headers for
# BoringSSL conflict with the OpenSSL headers included by default
# when including the Node headers. The remedy for this is to remove
# the OpenSSL headers, from the downloaded Node development package,
# which is typically located in `.node-gyp` in your home directory.
'target_name': 'WINDOWS_BUILD_WARNING',
'actions': [
{
'action_name': 'WINDOWS_BUILD_WARNING',
'inputs': [
'package.json'
],
'outputs': [
'ignore_this_part'
],
'action': ['echo', 'IMPORTANT: Due to https://github.com/nodejs/node/issues/4932, to build this library on Windows, you must first remove <(node_root_dir)/include/node/openssl/']
}
]
},
# Only want to compile BoringSSL and zlib under Windows
{ {
'cflags': [ 'cflags': [
'-std=c99', '-std=c99',
@ -453,6 +455,34 @@
'third_party/boringssl/ssl/tls_record.c', 'third_party/boringssl/ssl/tls_record.c',
] ]
}, },
]
}],
['OS == "win"', {
'targets': [
{
# IMPORTANT WINDOWS BUILD INFORMATION
# This library does not build on Windows without modifying the Node
# development packages that node-gyp downloads in order to build.
# Due to https://github.com/nodejs/node/issues/4932, the headers for
# BoringSSL conflict with the OpenSSL headers included by default
# when including the Node headers. The remedy for this is to remove
# the OpenSSL headers, from the downloaded Node development package,
# which is typically located in `.node-gyp` in your home directory.
'target_name': 'WINDOWS_BUILD_WARNING',
'actions': [
{
'action_name': 'WINDOWS_BUILD_WARNING',
'inputs': [
'package.json'
],
'outputs': [
'ignore_this_part'
],
'action': ['echo', 'IMPORTANT: Due to https://github.com/nodejs/node/issues/4932, to build this library on Windows, you must first remove <(node_root_dir)/include/node/openssl/']
}
]
},
# Only want to compile zlib under Windows
{ {
'cflags': [ 'cflags': [
'-std=c99', '-std=c99',
@ -738,11 +768,14 @@
'src/core/ext/client_channel/connector.c', 'src/core/ext/client_channel/connector.c',
'src/core/ext/client_channel/default_initial_connect_string.c', 'src/core/ext/client_channel/default_initial_connect_string.c',
'src/core/ext/client_channel/http_connect_handshaker.c', 'src/core/ext/client_channel/http_connect_handshaker.c',
'src/core/ext/client_channel/http_proxy.c',
'src/core/ext/client_channel/initial_connect_string.c', 'src/core/ext/client_channel/initial_connect_string.c',
'src/core/ext/client_channel/lb_policy.c', 'src/core/ext/client_channel/lb_policy.c',
'src/core/ext/client_channel/lb_policy_factory.c', 'src/core/ext/client_channel/lb_policy_factory.c',
'src/core/ext/client_channel/lb_policy_registry.c', 'src/core/ext/client_channel/lb_policy_registry.c',
'src/core/ext/client_channel/parse_address.c', 'src/core/ext/client_channel/parse_address.c',
'src/core/ext/client_channel/proxy_mapper.c',
'src/core/ext/client_channel/proxy_mapper_registry.c',
'src/core/ext/client_channel/resolver.c', 'src/core/ext/client_channel/resolver.c',
'src/core/ext/client_channel/resolver_factory.c', 'src/core/ext/client_channel/resolver_factory.c',
'src/core/ext/client_channel/resolver_registry.c', 'src/core/ext/client_channel/resolver_registry.c',
@ -807,6 +840,11 @@
'-g' '-g'
], ],
"conditions": [ "conditions": [
['OS=="win" or runtime=="electron"', {
'dependencies': [
"boringssl",
]
}],
['OS=="mac"', { ['OS=="mac"', {
'xcode_settings': { 'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.9', 'MACOSX_DEPLOYMENT_TARGET': '10.9',
@ -818,7 +856,6 @@
}], }],
['OS=="win"', { ['OS=="win"', {
'dependencies': [ 'dependencies': [
"boringssl",
"z", "z",
] ]
}], }],
@ -835,8 +872,8 @@
"src/node/ext/call_credentials.cc", "src/node/ext/call_credentials.cc",
"src/node/ext/channel.cc", "src/node/ext/channel.cc",
"src/node/ext/channel_credentials.cc", "src/node/ext/channel_credentials.cc",
"src/node/ext/completion_queue.cc", "src/node/ext/completion_queue_threadpool.cc",
"src/node/ext/completion_queue_async_worker.cc", "src/node/ext/completion_queue_uv.cc",
"src/node/ext/node_grpc.cc", "src/node/ext/node_grpc.cc",
"src/node/ext/server.cc", "src/node/ext/server.cc",
"src/node/ext/server_credentials.cc", "src/node/ext/server_credentials.cc",

@ -144,6 +144,7 @@ filegroups:
- include/grpc/impl/codegen/atm_gcc_atomic.h - include/grpc/impl/codegen/atm_gcc_atomic.h
- include/grpc/impl/codegen/atm_gcc_sync.h - include/grpc/impl/codegen/atm_gcc_sync.h
- include/grpc/impl/codegen/atm_windows.h - include/grpc/impl/codegen/atm_windows.h
- include/grpc/impl/codegen/gpr_slice.h
- include/grpc/impl/codegen/gpr_types.h - include/grpc/impl/codegen/gpr_types.h
- include/grpc/impl/codegen/port_platform.h - include/grpc/impl/codegen/port_platform.h
- include/grpc/impl/codegen/slice.h - include/grpc/impl/codegen/slice.h
@ -388,11 +389,14 @@ filegroups:
- src/core/ext/client_channel/client_channel_factory.h - src/core/ext/client_channel/client_channel_factory.h
- src/core/ext/client_channel/connector.h - src/core/ext/client_channel/connector.h
- src/core/ext/client_channel/http_connect_handshaker.h - src/core/ext/client_channel/http_connect_handshaker.h
- src/core/ext/client_channel/http_proxy.h
- src/core/ext/client_channel/initial_connect_string.h - src/core/ext/client_channel/initial_connect_string.h
- src/core/ext/client_channel/lb_policy.h - src/core/ext/client_channel/lb_policy.h
- src/core/ext/client_channel/lb_policy_factory.h - src/core/ext/client_channel/lb_policy_factory.h
- src/core/ext/client_channel/lb_policy_registry.h - src/core/ext/client_channel/lb_policy_registry.h
- src/core/ext/client_channel/parse_address.h - src/core/ext/client_channel/parse_address.h
- src/core/ext/client_channel/proxy_mapper.h
- src/core/ext/client_channel/proxy_mapper_registry.h
- src/core/ext/client_channel/resolver.h - src/core/ext/client_channel/resolver.h
- src/core/ext/client_channel/resolver_factory.h - src/core/ext/client_channel/resolver_factory.h
- src/core/ext/client_channel/resolver_registry.h - src/core/ext/client_channel/resolver_registry.h
@ -407,11 +411,14 @@ filegroups:
- src/core/ext/client_channel/connector.c - src/core/ext/client_channel/connector.c
- src/core/ext/client_channel/default_initial_connect_string.c - src/core/ext/client_channel/default_initial_connect_string.c
- src/core/ext/client_channel/http_connect_handshaker.c - src/core/ext/client_channel/http_connect_handshaker.c
- src/core/ext/client_channel/http_proxy.c
- src/core/ext/client_channel/initial_connect_string.c - src/core/ext/client_channel/initial_connect_string.c
- src/core/ext/client_channel/lb_policy.c - src/core/ext/client_channel/lb_policy.c
- src/core/ext/client_channel/lb_policy_factory.c - src/core/ext/client_channel/lb_policy_factory.c
- src/core/ext/client_channel/lb_policy_registry.c - src/core/ext/client_channel/lb_policy_registry.c
- src/core/ext/client_channel/parse_address.c - src/core/ext/client_channel/parse_address.c
- src/core/ext/client_channel/proxy_mapper.c
- src/core/ext/client_channel/proxy_mapper_registry.c
- src/core/ext/client_channel/resolver.c - src/core/ext/client_channel/resolver.c
- src/core/ext/client_channel/resolver_factory.c - src/core/ext/client_channel/resolver_factory.c
- src/core/ext/client_channel/resolver_registry.c - src/core/ext/client_channel/resolver_registry.c
@ -683,7 +690,7 @@ filegroups:
- include/grpc/grpc_security.h - include/grpc/grpc_security.h
- include/grpc/grpc_security_constants.h - include/grpc/grpc_security_constants.h
headers: headers:
- third_party/objective_c/Cronet/cronet_c_for_grpc.h - third_party/Cronet/bidirectional_stream_c.h
src: src:
- src/core/ext/transport/cronet/client/secure/cronet_channel_create.c - src/core/ext/transport/cronet/client/secure/cronet_channel_create.c
- src/core/ext/transport/cronet/transport/cronet_api_dummy.c - src/core/ext/transport/cronet/transport/cronet_api_dummy.c
@ -1226,6 +1233,22 @@ libs:
vs_project_guid: '{B6E81D84-2ACB-41B8-8781-493A944C7817}' vs_project_guid: '{B6E81D84-2ACB-41B8-8781-493A944C7817}'
vs_props: vs_props:
- protoc - protoc
- name: http2_client_main
build: private
language: c++
headers:
- test/cpp/interop/http2_client.h
src:
- src/proto/grpc/testing/empty.proto
- src/proto/grpc/testing/messages.proto
- src/proto/grpc/testing/test.proto
- test/cpp/interop/http2_client.cc
deps:
- grpc++_test_util
- grpc_test_util
- grpc++
- grpc
- grpc++_test_config
- name: interop_client_helper - name: interop_client_helper
build: private build: private
language: c++ language: c++
@ -1268,6 +1291,7 @@ libs:
src: src:
- test/cpp/interop/server_helper.cc - test/cpp/interop/server_helper.cc
deps: deps:
- grpc++_test_util
- grpc_test_util - grpc_test_util
- grpc++ - grpc++
- grpc - grpc
@ -1304,7 +1328,6 @@ libs:
- test/cpp/qps/driver.h - test/cpp/qps/driver.h
- test/cpp/qps/histogram.h - test/cpp/qps/histogram.h
- test/cpp/qps/interarrival.h - test/cpp/qps/interarrival.h
- test/cpp/qps/limit_cores.h
- test/cpp/qps/parse_json.h - test/cpp/qps/parse_json.h
- test/cpp/qps/qps_worker.h - test/cpp/qps/qps_worker.h
- test/cpp/qps/report.h - test/cpp/qps/report.h
@ -1321,7 +1344,6 @@ libs:
- test/cpp/qps/client_async.cc - test/cpp/qps/client_async.cc
- test/cpp/qps/client_sync.cc - test/cpp/qps/client_sync.cc
- test/cpp/qps/driver.cc - test/cpp/qps/driver.cc
- test/cpp/qps/limit_cores.cc
- test/cpp/qps/parse_json.cc - test/cpp/qps/parse_json.cc
- test/cpp/qps/qps_worker.cc - test/cpp/qps/qps_worker.cc
- test/cpp/qps/report.cc - test/cpp/qps/report.cc
@ -2331,6 +2353,43 @@ targets:
- mac - mac
- linux - linux
- posix - posix
- name: memory_profile_client
build: test
run: false
language: c
src:
- test/core/memory_usage/client.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: memory_profile_server
build: test
run: false
language: c
src:
- test/core/memory_usage/server.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
- name: memory_profile_test
cpu_cost: 1.5
build: test
language: c
src:
- test/core/memory_usage/memory_usage_test.c
deps:
- grpc_test_util
- grpc
- gpr_test_util
- gpr
platforms:
- mac
- linux
- posix
- name: message_compress_test - name: message_compress_test
build: test build: test
language: c language: c
@ -3194,12 +3253,12 @@ targets:
- src/proto/grpc/lb/v1/load_balancer.proto - src/proto/grpc/lb/v1/load_balancer.proto
- test/cpp/grpclb/grpclb_test.cc - test/cpp/grpclb/grpclb_test.cc
deps: deps:
- gpr
- gpr_test_util
- grpc
- grpc++
- grpc++_test_util - grpc++_test_util
- grpc_test_util - grpc_test_util
- grpc++
- grpc
- gpr_test_util
- gpr
- name: health_service_end2end_test - name: health_service_end2end_test
gtest: true gtest: true
build: test build: test
@ -3213,6 +3272,22 @@ targets:
- grpc - grpc
- gpr_test_util - gpr_test_util
- gpr - gpr
- name: http2_client
build: test
run: false
language: c++
src: []
deps:
- http2_client_main
- grpc++_test_util
- grpc_test_util
- grpc++
- grpc
- grpc++_test_config
platforms:
- mac
- linux
- posix
- name: hybrid_end2end_test - name: hybrid_end2end_test
gtest: true gtest: true
build: test build: test
@ -3599,16 +3674,17 @@ targets:
- test/cpp/interop/client_helper.h - test/cpp/interop/client_helper.h
- test/cpp/interop/interop_client.h - test/cpp/interop/interop_client.h
- test/cpp/interop/stress_interop_client.h - test/cpp/interop/stress_interop_client.h
- test/cpp/util/create_test_channel.h
- test/cpp/util/metrics_server.h - test/cpp/util/metrics_server.h
src: src:
- src/proto/grpc/testing/empty.proto - src/proto/grpc/testing/empty.proto
- src/proto/grpc/testing/messages.proto - src/proto/grpc/testing/messages.proto
- src/proto/grpc/testing/metrics.proto - src/proto/grpc/testing/metrics.proto
- src/proto/grpc/testing/test.proto - src/proto/grpc/testing/test.proto
- test/cpp/interop/client_helper.cc
- test/cpp/interop/interop_client.cc - test/cpp/interop/interop_client.cc
- test/cpp/interop/stress_interop_client.cc - test/cpp/interop/stress_interop_client.cc
- test/cpp/interop/stress_test.cc - test/cpp/interop/stress_test.cc
- test/cpp/util/create_test_channel.cc
- test/cpp/util/metrics_server.cc - test/cpp/util/metrics_server.cc
deps: deps:
- grpc++_test_util - grpc++_test_util
@ -3840,7 +3916,6 @@ node_modules:
- src/node/ext/channel.h - src/node/ext/channel.h
- src/node/ext/channel_credentials.h - src/node/ext/channel_credentials.h
- src/node/ext/completion_queue.h - src/node/ext/completion_queue.h
- src/node/ext/completion_queue_async_worker.h
- src/node/ext/server.h - src/node/ext/server.h
- src/node/ext/server_credentials.h - src/node/ext/server_credentials.h
- src/node/ext/timeval.h - src/node/ext/timeval.h
@ -3859,8 +3934,8 @@ node_modules:
- src/node/ext/call_credentials.cc - src/node/ext/call_credentials.cc
- src/node/ext/channel.cc - src/node/ext/channel.cc
- src/node/ext/channel_credentials.cc - src/node/ext/channel_credentials.cc
- src/node/ext/completion_queue.cc - src/node/ext/completion_queue_threadpool.cc
- src/node/ext/completion_queue_async_worker.cc - src/node/ext/completion_queue_uv.cc
- src/node/ext/node_grpc.cc - src/node/ext/node_grpc.cc
- src/node/ext/server.cc - src/node/ext/server.cc
- src/node/ext/server_credentials.cc - src/node/ext/server_credentials.cc

@ -0,0 +1,32 @@
# 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.
module GrpcBuildConfig
CORE_WINDOWS_DLL = '/tmp/libs/opt/grpc-2.dll'
end

@ -5,9 +5,9 @@ if test "$PHP_GRPC" != "no"; then
dnl Write more examples of tests here... dnl Write more examples of tests here...
dnl # --with-grpc -> add include path dnl # --with-grpc -> add include path
PHP_ADD_INCLUDE(../../grpc/include) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/include)
PHP_ADD_INCLUDE(../../grpc/src/php/ext/grpc) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/php/ext/grpc)
PHP_ADD_INCLUDE(../../grpc/third_party/boringssl/include) PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl/include)
LIBS="-lpthread $LIBS" LIBS="-lpthread $LIBS"
@ -254,11 +254,14 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/client_channel/connector.c \ src/core/ext/client_channel/connector.c \
src/core/ext/client_channel/default_initial_connect_string.c \ src/core/ext/client_channel/default_initial_connect_string.c \
src/core/ext/client_channel/http_connect_handshaker.c \ src/core/ext/client_channel/http_connect_handshaker.c \
src/core/ext/client_channel/http_proxy.c \
src/core/ext/client_channel/initial_connect_string.c \ src/core/ext/client_channel/initial_connect_string.c \
src/core/ext/client_channel/lb_policy.c \ src/core/ext/client_channel/lb_policy.c \
src/core/ext/client_channel/lb_policy_factory.c \ src/core/ext/client_channel/lb_policy_factory.c \
src/core/ext/client_channel/lb_policy_registry.c \ src/core/ext/client_channel/lb_policy_registry.c \
src/core/ext/client_channel/parse_address.c \ src/core/ext/client_channel/parse_address.c \
src/core/ext/client_channel/proxy_mapper.c \
src/core/ext/client_channel/proxy_mapper_registry.c \
src/core/ext/client_channel/resolver.c \ src/core/ext/client_channel/resolver.c \
src/core/ext/client_channel/resolver_factory.c \ src/core/ext/client_channel/resolver_factory.c \
src/core/ext/client_channel/resolver_registry.c \ src/core/ext/client_channel/resolver_registry.c \

@ -153,6 +153,7 @@ DATA (flags = END_STREAM)
HEADERS (flags = END_HEADERS) HEADERS (flags = END_HEADERS)
:status = 200 :status = 200
grpc-encoding = gzip grpc-encoding = gzip
content-type = application/grpc+proto
DATA DATA
<Length-Prefixed Message> <Length-Prefixed Message>

@ -55,8 +55,10 @@ some configuration as environment variables that can be set.
- secure_endpoint - traces bytes flowing through encrypted channels - secure_endpoint - traces bytes flowing through encrypted channels
- transport_security - traces metadata about secure channel establishment - transport_security - traces metadata about secure channel establishment
- tcp - traces bytes in and out of a channel - tcp - traces bytes in and out of a channel
'all' can additionally be used to turn all traces on. 'all' can additionally be used to turn all traces on.
Individual traces can be disabled by prefixing them with '-'. Individual traces can be disabled by prefixing them with '-'.
Example: Example:
export GRPC_TRACE=all,-pending_tags export GRPC_TRACE=all,-pending_tags

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

@ -1,13 +1,21 @@
Load Balancing in gRPC Load Balancing in gRPC
======================= ======================
# Objective # Scope
To design a load balancing API between a gRPC client and a Load Balancer to This document explains the design for load balancing within gRPC.
instruct the client how to send load to multiple backend servers.
# Background # Background
## Per-Call Load Balancing
It is worth noting that load-balancing within gRPC happens on a per-call
basis, not a per-connection basis. In other words, even if all requests
come from a single client, we still want them to be load-balanced across
all servers.
## Approaches to Load Balancing
Prior to any gRPC specifics, we explore some usual ways to approach load Prior to any gRPC specifics, we explore some usual ways to approach load
balancing. balancing.
@ -44,30 +52,31 @@ list of servers to the client.
### External Load Balancing Service ### External Load Balancing Service
The client load balancing code is kept simple and portable, implementing The client load balancing code is kept simple and portable, implementing
well-known algorithms (ie, Round Robin) for server selection. well-known algorithms (e.g., Round Robin) for server selection.
Complex load balancing algorithms are instead provided by the load balancer. The Complex load balancing algorithms are instead provided by the load
client relies on the load balancer to provide _load balancing configuration_ and balancer. The client relies on the load balancer to provide _load
_the list of servers_ to which the client should send requests. The balancer balancing configuration_ and _the list of servers_ to which the client
updates the server list as needed to balance the load as well as handle server should send requests. The balancer updates the server list as needed
to balance the load as well as handle server unavailability or health
issues. The load balancer will make any necessary complex decisions and
inform the client. The load balancer may communicate with the backend
servers to collect load and health information.
# Requirements
## Simple API and client
The gRPC client load balancing code must be simple and portable. The
client should only contain simple algorithms (e.g., Round Robin) for
server selection. For complex algorithms, the client should rely on
a load balancer to provide load balancing configuration and the list of
servers to which the client should send requests. The balancer will update
the server list as needed to balance the load as well as handle server
unavailability or health issues. The load balancer will make any necessary unavailability or health issues. The load balancer will make any necessary
complex decisions and inform the client. The load balancer may communicate with complex decisions and inform the client. The load balancer may communicate
the backend servers to collect load and health information. with the backend servers to collect load and health information.
## Requirements
#### Simple API and client
The gRPC client load balancing code must be simple and portable. The client
should only contain simple algorithms (ie Round Robin) for server selection. For
complex algorithms, the client should rely on a load balancer to provide load
balancing configuration and the list of servers to which the client should send
requests. The balancer will update the server list as needed to balance the load
as well as handle server unavailability or health issues. The load balancer will
make any necessary complex decisions and inform the client. The load balancer
may communicate with the backend servers to collect load and health information.
#### Security ## Security
The load balancer may be separate from the actual server backends and a The load balancer may be separate from the actual server backends and a
compromise of the load balancer should only lead to a compromise of the compromise of the load balancer should only lead to a compromise of the
@ -75,70 +84,64 @@ loadbalancing functionality. In other words, a compromised load balancer should
not be able to cause a client to trust a (potentially malicious) backend server not be able to cause a client to trust a (potentially malicious) backend server
any more than in a comparable situation without loadbalancing. any more than in a comparable situation without loadbalancing.
# Proposed Architecture # Architecture
The gRPC load balancing implements the external load balancing server approach: ## Overview
an external load balancer provides simple clients with an up-to-date list of
servers. The primary mechanism for load-balancing in gRPC is external
load-balancing, where an external load balancer provides simple clients
![image](images/load_balancing_design.png) with an up-to-date list of servers.
1. On startup, the gRPC client issues a name resolution request for the service. The gRPC client does support an API for built-in load balancing policies.
The name will resolve to one or more IP addresses to gRPC servers, a hint on However, there are only a small number of these (one of which is the
whether the IP address(es) point to a load balancer or not, and also return a `grpclb` policy, which implements external load balancing), and users
client config. are discouraged from trying to extend gRPC by adding more. Instead, new
2. The gRPC client connects to a gRPC Server. load balancing policies should be implemented in external load balancers.
1. If the name resolution has hinted that the endpoint is a load balancer,
the client's gRPC LB policy will attempt to open a stream to the load ## Workflow
balancer service. The server may respond in only one of the following
ways. Load-balancing policies fit into the gRPC client workflow in between
1. `status::UNIMPLEMENTED`. There is no loadbalancing in use. The client name resolution and the connection to the server. Here's how it all
call will fail. works:
2. "I am a Load Balancer and here is the server list." (Goto Step 4.)
3. "Please contact Load Balancer X" (See Step 3.) The client will close ![image](images/load-balancing.png)
this connection and cancel the stream.
4. If the server fails to respond, the client will wait for some timeout 1. On startup, the gRPC client issues a [name resolution](naming.md) request
and then re-resolve the name (process to Step 1 above). for the server name. The name will resolve to one or more IP addresses,
2. If the name resolution has not hinted that the endpoint is a load each of which will indicate whether it is a server address or
balancer, the client connects directly to the service it wants to talk to. a load balancer address, and a [service config](service_config.md)
3. The gRPC client's gRPC LB policy opens a separate connection to the Load that indicates which client-side load-balancing policy to use (e.g.,
Balancer. If this fails, it will go back to step 1 and try another address. `round_robin` or `grpclb`).
1. During channel initialization to the Load Balancer, the client will 2. The client instantiates the load balancing policy.
attempt to open a stream to the Load Balancer service. - Note: If all addresses returned by the resolver are balancer
2. The Load Balancer will return a server list to the gRPC client. If the addresses, then the client will use the `grpclb` policy, regardless
server list is empty, the call will wait until a non-empty one is of what load-balancing policy was requested by the service config.
received. Optional: The Load Balancer will also open channels to the gRPC Otherwise, the client will use the load-balancing policy requested
servers if load reporting is needed. by the service config. If no load-balancing policy is requested
4. The gRPC client will send RPCs to the gRPC servers contained in the server by the service config, then the client will default to a policy
list from the Load Balancer. that picks the first available server address.
5. Optional: The gRPC servers may periodically report load to the Load Balancer. 3. The load balancing policy creates a subchannel to each server address.
- For all policies *except* `grpclb`, this means one subchannel for each
## Client address returned by the resolver. Note that these policies
ignore any balancer addresses returned by the resolver.
When establishing a gRPC _stream_ to the balancer, the client will send an initial - In the case of the `grpclb` policy, the workflow is as follows:
request to the load balancer (via a regular gRPC message). The load balancer 1. The policy opens a stream to one of the balancer addresses returned
will respond with client config (including, for example, settings for flow by the resolver. It asks the balancer for the server addresses to
control, RPC deadlines, etc.) or a redirect to another load balancer. If the use for the server name originally requested by the client (i.e.,
balancer did not redirect the client, it will then send a list of servers to the the same one originally passed to the name resolver).
client. The client will contain simple load balancing logic for choosing the - Note: The `grpclb` policy currently ignores any non-balancer
next server when it needs to send a request. addresses returned by the resolver. However, in the future, it
may be changed to use these addresses as a fallback in case no
## Load Balancer balancers can be contacted.
2. The gRPC servers to which the load balancer is directing the client
The Load Balancer is responsible for providing the client with a list of servers may report load to the load balancers, if that information is needed
and client RPC parameters. The balancer chooses when to update the list of by the load balancer's configuration.
servers and can decide whether to provide a complete list, a subset, or a 3. The load balancer returns a server list to the gRPC client's `grpclb`
specific list of “picked” servers in a particular order. The balancer can policy. The `grpclb` policy will then create a subchannel to each of
optionally provide an expiration interval after which the server list should no server in the list.
longer be trusted and should be updated by the balancer. 4. For each RPC sent, the load balancing policy decides which
subchannel (i.e., which server) the RPC should be sent to.
The load balancer may open reporting streams to each server contained in the - In the case of the `grpclb` policy, the client will send requests
server list. These streams are primarily used for load reporting. For example, to the servers in the order in which they were returned by the load
Weighted Round Robin requires that the servers report utilization to the load balancer. If the server list is empty, the call will block until a
balancer in order to compute the next list of servers. non-empty one is received.
## Server
The gRPC Server is responsible for answering RPC requests and providing
responses to the client. The server will also report load to the load balancer
if a reporting stream was opened for this purpose.

@ -1,30 +1,65 @@
#gRPC Naming and Discovery Support # gRPC Name Resolution
## Overview ## Overview
gRPC supports DNS as the default name-system. A number of alternative name-systems are used in various deployments. We propose an API that is general enough to support a range of name-systems and the corresponding syntax for names. The gRPC client library in various languages will provide a plugin mechanism so resolvers for different name-systems can be plugged in. gRPC supports DNS as the default name-system. A number of alternative
name-systems are used in various deployments. We support an API that is
general enough to support a range of name-systems and the corresponding
syntax for names. The gRPC client library in various languages will
provide a plugin mechanism so resolvers for different name-systems can
be plugged in.
## Detailed Proposal ## Detailed Design
A fully qualified, self contained name used for gRPC channel construction uses the syntax: ### Name Syntax
A fully qualified, self contained name used for gRPC channel construction
uses the syntax:
``` ```
scheme://authority/endpoint_name scheme://authority/endpoint_name
``` ```
Here, scheme indicates the name-system to be used. Example schemes to be supported include: Here, `scheme` indicates the name-system to be used. Currently, we
support the following schemes:
- `dns`
- `ipv4` (IPv4 address)
- `ipv6` (IPv6 address)
- `unix` (path to unix domain socket -- unix systems only)
* `dns` In the future, additional schemes such as `etcd` could be added.
* `etcd` The `authority` indicates some scheme-specific bootstrap information, e.g.,
for DNS, the authority may include the IP[:port] of the DNS server to
use. Often, a DNS name may be used as the authority, since the ability to
resolve DNS names is already built into all gRPC client libraries.
Authority indicates some scheme-specific bootstrap information, e.g., for DNS, the authority may include the IP[:port] of the DNS server to use. Often, a DNS name may used as the authority, since the ability to resolve DNS names is already built into all gRPC client libraries. Finally, the `endpoint_name` indicates a concrete name to be looked up
in a given name-system identified by the scheme and the authority. The
syntax of the endpoint name is dictated by the scheme in use.
Finally, the endpoint_name indicates a concrete name to be looked up in a given name-system identified by the scheme and the authority. The syntax of endpoint name is dictated by the scheme in use. ### Resolver Plugins
### Plugins The gRPC client library will use the specified scheme to pick the right
resolver plugin and pass it the fully qualified name string.
The gRPC client library will switch on the scheme to pick the right resolver plugin and pass it the fully qualified name string. Resolvers should be able to contact the authority and get a resolution
that they return back to the gRPC client library. The returned contents
include:
Resolvers should be able to contact the authority and get a resolution that they return back to the gRPC client library. The returned contents include a list of IP:port, an optional config and optional auth config data to be used for channel authentication. The plugin API allows the resolvers to continuously watch an endpoint_name and return updated resolutions as needed. - A list of resolved addresses, each of which has three attributes:
- The address itself, including both IP address and port.
- A boolean indicating whether the address is a backend address (i.e.,
the address to use to contact the server directly) or a balancer
address (for cases where [external load balancing](load-balancing.md)
is in use).
- The name of the balancer, if the address is a balancer address.
This will be used to perform peer authorization.
- A [service config](service_config.md).
The plugin API allows the resolvers to continuously watch an endpoint
and return updated resolutions as needed.

@ -49,7 +49,8 @@ server. The client should handle the goaway by switching to a new stream without
the user application having to do a thing. the user application having to do a thing.
Client Procedure: Client Procedure:
1. Client sends two UnaryCall requests with: 1. Client sends two UnaryCall requests (and sleeps for 1 second in-between).
TODO: resolve [9300](https://github.com/grpc/grpc/issues/9300) and remove the 1 second sleep
``` ```
{ {
@ -61,14 +62,14 @@ Client Procedure:
``` ```
Client asserts: Client asserts:
* Call was successful. * Both calls are successful.
* Response payload body is 314159 bytes in size. * Response payload body is 314159 bytes in size.
Server Procedure: Server Procedure:
1. Server sends a GOAWAY after receiving the first UnaryCall. 1. Server sends a GOAWAY after receiving the first UnaryCall.
Server asserts: Server asserts:
* The second UnaryCall has a different stream_id than the first one. * Two different connections were used from the client.
### rst_after_header ### rst_after_header

@ -0,0 +1,147 @@
Service Config in gRPC
======================
# Objective
The service config is a mechanism that allows service owners to publish
parameters to be automatically used by all clients of their service.
# Format
The service config is a JSON string of the following form:
```
{
# Load balancing policy name.
# Supported values are 'round_robin' and 'grpclb'.
# Optional; if unset, the default behavior is pick the first available
# backend.
# Note that if the resolver returns only balancer addresses and no
# backend addresses, gRPC will always use the 'grpclb' policy,
# regardless of what this field is set to.
'loadBalancingPolicy': string,
# Per-method configuration. Optional.
'methodConfig': [
{
# The names of the methods to which this method config applies. There
# must be at least one name. Each name entry must be unique across the
# entire service config. If the 'method' field is empty, then this
# method config specifies the defaults for all methods for the specified
# service.
#
# For example, let's say that the service config contains the following
# method config entries:
#
# 'methodConfig': [
# { 'name': [ { 'service': 'MyService' } ] ... },
# { 'name': [ { 'service': 'MyService', 'method': 'Foo' } ] ... }
# ]
#
# For a request for MyService/Foo, we will use the second entry, because
# it exactly matches the service and method name.
# For a request for MyService/Bar, we will use the first entry, because
# it provides the default for all methods of MyService.
'name': [
{
# RPC service name. Required.
# If using gRPC with protobuf as the IDL, then this will be of
# the form "pkg.service_name", where "pkg" is the package name
# defined in the proto file.
'service': string,
# RPC method name. Optional (see above).
'method': string,
}
],
# Whether RPCs sent to this method should wait until the connection is
# ready by default. If false, the RPC will abort immediately if there
# is a transient failure connecting to the server. Otherwise, gRPC will
# attempt to connect until the deadline is exceeded.
#
# The value specified via the gRPC client API will override the value
# set here. However, note that setting the value in the client API will
# also affect transient errors encountered during name resolution,
# which cannot be caught by the value here, since the service config
# is obtained by the gRPC client via name resolution.
'waitForReady': bool,
# The default timeout in seconds for RPCs sent to this method. This can
# be overridden in code. If no reply is received in the specified amount
# of time, the request is aborted and a deadline-exceeded error status
# is returned to the caller.
#
# The actual deadline used will be the minimum of the value specified
# here and the value set by the application via the gRPC client API.
# If either one is not set, then the other will be used.
# If neither is set, then the request has no deadline.
#
# The format of the value is that of the 'Duration' type defined here:
# https://developers.google.com/protocol-buffers/docs/proto3#json
'timeout': string,
# The maximum allowed payload size for an individual request or object
# in a stream (client->server) in bytes. The size which is measured is
# the serialized, uncompressed payload in bytes. This applies both
# to streaming and non-streaming requests.
#
# The actual value used is the minimum of the value specified here and
# the value set by the application via the gRPC client API.
# If either one is not set, then the other will be used.
# If neither is set, then the built-in default is used.
#
# If a client attempts to send an object larger than this value, it
# will not be sent and the client will see an error.
# Note that 0 is a valid value, meaning that the request message must
# be empty.
#
# The format of the value is that of the 'uint64' type defined here:
# https://developers.google.com/protocol-buffers/docs/proto3#json
'maxRequestMessageBytes': string,
# The maximum allowed payload size for an individual response or object
# in a stream (server->client) in bytes. The size which is measured is
# the serialized, uncompressed payload in bytes. This applies both
# to streaming and non-streaming requests.
#
# The actual value used is the minimum of the value specified here and
# the value set by the application via the gRPC client API.
# If either one is not set, then the other will be used.
# If neither is set, then the built-in default is used.
#
# If a server attempts to send an object larger than this value, it
# will not be sent, and the client will see an error.
# Note that 0 is a valid value, meaning that the response message must
# be empty.
#
# The format of the value is that of the 'uint64' type defined here:
# https://developers.google.com/protocol-buffers/docs/proto3#json
'maxResponseMessageBytes': string
}
]
}
```
Note that new per-method parameters may be added in the future as new
functionality is introduced.
# Architecture
A service config is associated with a server name. The [name
resolver](naming.md) plugin, when asked to resolve a particular server
name, will return both the resolved addresses and the service config.
TODO(roth): Design how the service config will be encoded in DNS.
# APIs
The service config is used in the following APIs:
- In the resolver API, used by resolver plugins to return the service
config to the gRPC client.
- In the gRPC client API, where users can query the channel to obtain
the service config associated with the channel (for debugging
purposes).
- In the gRPC client API, where users can set the service config
explicitly. This is intended for use in unit tests.

@ -0,0 +1,42 @@
# 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.
cc_binary(
name = "greeter_client",
srcs = ["greeter_client.cc"],
deps = ["//examples/protos:helloworld"],
defines = ["BAZEL_BUILD"],
)
cc_binary(
name = "greeter_server",
srcs = ["greeter_server.cc"],
deps = ["//examples/protos:helloworld"],
defines = ["BAZEL_BUILD"],
)

@ -37,7 +37,11 @@
#include <grpc++/grpc++.h> #include <grpc++/grpc++.h>
#ifdef BAZEL_BUILD
#include "examples/protos/helloworld.grpc.pb.h"
#else
#include "helloworld.grpc.pb.h" #include "helloworld.grpc.pb.h"
#endif
using grpc::Channel; using grpc::Channel;
using grpc::ClientContext; using grpc::ClientContext;

@ -37,7 +37,11 @@
#include <grpc++/grpc++.h> #include <grpc++/grpc++.h>
#ifdef BAZEL_BUILD
#include "examples/protos/helloworld.grpc.pb.h"
#else
#include "helloworld.grpc.pb.h" #include "helloworld.grpc.pb.h"
#endif
using grpc::Server; using grpc::Server;
using grpc::ServerBuilder; using grpc::ServerBuilder;

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

@ -148,6 +148,7 @@ Pod::Spec.new do |s|
'include/grpc/impl/codegen/atm_gcc_atomic.h', 'include/grpc/impl/codegen/atm_gcc_atomic.h',
'include/grpc/impl/codegen/atm_gcc_sync.h', 'include/grpc/impl/codegen/atm_gcc_sync.h',
'include/grpc/impl/codegen/atm_windows.h', 'include/grpc/impl/codegen/atm_windows.h',
'include/grpc/impl/codegen/gpr_slice.h',
'include/grpc/impl/codegen/gpr_types.h', 'include/grpc/impl/codegen/gpr_types.h',
'include/grpc/impl/codegen/port_platform.h', 'include/grpc/impl/codegen/port_platform.h',
'include/grpc/impl/codegen/slice.h', 'include/grpc/impl/codegen/slice.h',
@ -175,6 +176,7 @@ Pod::Spec.new do |s|
'include/grpc/impl/codegen/atm_gcc_atomic.h', 'include/grpc/impl/codegen/atm_gcc_atomic.h',
'include/grpc/impl/codegen/atm_gcc_sync.h', 'include/grpc/impl/codegen/atm_gcc_sync.h',
'include/grpc/impl/codegen/atm_windows.h', 'include/grpc/impl/codegen/atm_windows.h',
'include/grpc/impl/codegen/gpr_slice.h',
'include/grpc/impl/codegen/gpr_types.h', 'include/grpc/impl/codegen/gpr_types.h',
'include/grpc/impl/codegen/port_platform.h', 'include/grpc/impl/codegen/port_platform.h',
'include/grpc/impl/codegen/slice.h', 'include/grpc/impl/codegen/slice.h',
@ -398,11 +400,14 @@ Pod::Spec.new do |s|
'src/core/ext/client_channel/client_channel_factory.h', 'src/core/ext/client_channel/client_channel_factory.h',
'src/core/ext/client_channel/connector.h', 'src/core/ext/client_channel/connector.h',
'src/core/ext/client_channel/http_connect_handshaker.h', 'src/core/ext/client_channel/http_connect_handshaker.h',
'src/core/ext/client_channel/http_proxy.h',
'src/core/ext/client_channel/initial_connect_string.h', 'src/core/ext/client_channel/initial_connect_string.h',
'src/core/ext/client_channel/lb_policy.h', 'src/core/ext/client_channel/lb_policy.h',
'src/core/ext/client_channel/lb_policy_factory.h', 'src/core/ext/client_channel/lb_policy_factory.h',
'src/core/ext/client_channel/lb_policy_registry.h', 'src/core/ext/client_channel/lb_policy_registry.h',
'src/core/ext/client_channel/parse_address.h', 'src/core/ext/client_channel/parse_address.h',
'src/core/ext/client_channel/proxy_mapper.h',
'src/core/ext/client_channel/proxy_mapper_registry.h',
'src/core/ext/client_channel/resolver.h', 'src/core/ext/client_channel/resolver.h',
'src/core/ext/client_channel/resolver_factory.h', 'src/core/ext/client_channel/resolver_factory.h',
'src/core/ext/client_channel/resolver_registry.h', 'src/core/ext/client_channel/resolver_registry.h',
@ -604,11 +609,14 @@ Pod::Spec.new do |s|
'src/core/ext/client_channel/connector.c', 'src/core/ext/client_channel/connector.c',
'src/core/ext/client_channel/default_initial_connect_string.c', 'src/core/ext/client_channel/default_initial_connect_string.c',
'src/core/ext/client_channel/http_connect_handshaker.c', 'src/core/ext/client_channel/http_connect_handshaker.c',
'src/core/ext/client_channel/http_proxy.c',
'src/core/ext/client_channel/initial_connect_string.c', 'src/core/ext/client_channel/initial_connect_string.c',
'src/core/ext/client_channel/lb_policy.c', 'src/core/ext/client_channel/lb_policy.c',
'src/core/ext/client_channel/lb_policy_factory.c', 'src/core/ext/client_channel/lb_policy_factory.c',
'src/core/ext/client_channel/lb_policy_registry.c', 'src/core/ext/client_channel/lb_policy_registry.c',
'src/core/ext/client_channel/parse_address.c', 'src/core/ext/client_channel/parse_address.c',
'src/core/ext/client_channel/proxy_mapper.c',
'src/core/ext/client_channel/proxy_mapper_registry.c',
'src/core/ext/client_channel/resolver.c', 'src/core/ext/client_channel/resolver.c',
'src/core/ext/client_channel/resolver_factory.c', 'src/core/ext/client_channel/resolver_factory.c',
'src/core/ext/client_channel/resolver_registry.c', 'src/core/ext/client_channel/resolver_registry.c',
@ -810,11 +818,14 @@ Pod::Spec.new do |s|
'src/core/ext/client_channel/client_channel_factory.h', 'src/core/ext/client_channel/client_channel_factory.h',
'src/core/ext/client_channel/connector.h', 'src/core/ext/client_channel/connector.h',
'src/core/ext/client_channel/http_connect_handshaker.h', 'src/core/ext/client_channel/http_connect_handshaker.h',
'src/core/ext/client_channel/http_proxy.h',
'src/core/ext/client_channel/initial_connect_string.h', 'src/core/ext/client_channel/initial_connect_string.h',
'src/core/ext/client_channel/lb_policy.h', 'src/core/ext/client_channel/lb_policy.h',
'src/core/ext/client_channel/lb_policy_factory.h', 'src/core/ext/client_channel/lb_policy_factory.h',
'src/core/ext/client_channel/lb_policy_registry.h', 'src/core/ext/client_channel/lb_policy_registry.h',
'src/core/ext/client_channel/parse_address.h', 'src/core/ext/client_channel/parse_address.h',
'src/core/ext/client_channel/proxy_mapper.h',
'src/core/ext/client_channel/proxy_mapper_registry.h',
'src/core/ext/client_channel/resolver.h', 'src/core/ext/client_channel/resolver.h',
'src/core/ext/client_channel/resolver_factory.h', 'src/core/ext/client_channel/resolver_factory.h',
'src/core/ext/client_channel/resolver_registry.h', 'src/core/ext/client_channel/resolver_registry.h',

@ -164,7 +164,9 @@ EXPORTS
grpc_slice_buffer_move_into grpc_slice_buffer_move_into
grpc_slice_buffer_trim_end grpc_slice_buffer_trim_end
grpc_slice_buffer_move_first grpc_slice_buffer_move_first
grpc_slice_buffer_move_first_into_buffer
grpc_slice_buffer_take_first grpc_slice_buffer_take_first
grpc_slice_buffer_undo_take_first
gpr_malloc gpr_malloc
gpr_free gpr_free
gpr_realloc gpr_realloc

@ -73,6 +73,7 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h ) s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_sync.h ) s.files += %w( include/grpc/impl/codegen/atm_gcc_sync.h )
s.files += %w( include/grpc/impl/codegen/atm_windows.h ) s.files += %w( include/grpc/impl/codegen/atm_windows.h )
s.files += %w( include/grpc/impl/codegen/gpr_slice.h )
s.files += %w( include/grpc/impl/codegen/gpr_types.h ) s.files += %w( include/grpc/impl/codegen/gpr_types.h )
s.files += %w( include/grpc/impl/codegen/port_platform.h ) s.files += %w( include/grpc/impl/codegen/port_platform.h )
s.files += %w( include/grpc/impl/codegen/slice.h ) s.files += %w( include/grpc/impl/codegen/slice.h )
@ -156,6 +157,7 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h ) s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_sync.h ) s.files += %w( include/grpc/impl/codegen/atm_gcc_sync.h )
s.files += %w( include/grpc/impl/codegen/atm_windows.h ) s.files += %w( include/grpc/impl/codegen/atm_windows.h )
s.files += %w( include/grpc/impl/codegen/gpr_slice.h )
s.files += %w( include/grpc/impl/codegen/gpr_types.h ) s.files += %w( include/grpc/impl/codegen/gpr_types.h )
s.files += %w( include/grpc/impl/codegen/port_platform.h ) s.files += %w( include/grpc/impl/codegen/port_platform.h )
s.files += %w( include/grpc/impl/codegen/slice.h ) s.files += %w( include/grpc/impl/codegen/slice.h )
@ -315,11 +317,14 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/client_channel/client_channel_factory.h ) s.files += %w( src/core/ext/client_channel/client_channel_factory.h )
s.files += %w( src/core/ext/client_channel/connector.h ) s.files += %w( src/core/ext/client_channel/connector.h )
s.files += %w( src/core/ext/client_channel/http_connect_handshaker.h ) s.files += %w( src/core/ext/client_channel/http_connect_handshaker.h )
s.files += %w( src/core/ext/client_channel/http_proxy.h )
s.files += %w( src/core/ext/client_channel/initial_connect_string.h ) s.files += %w( src/core/ext/client_channel/initial_connect_string.h )
s.files += %w( src/core/ext/client_channel/lb_policy.h ) s.files += %w( src/core/ext/client_channel/lb_policy.h )
s.files += %w( src/core/ext/client_channel/lb_policy_factory.h ) s.files += %w( src/core/ext/client_channel/lb_policy_factory.h )
s.files += %w( src/core/ext/client_channel/lb_policy_registry.h ) s.files += %w( src/core/ext/client_channel/lb_policy_registry.h )
s.files += %w( src/core/ext/client_channel/parse_address.h ) s.files += %w( src/core/ext/client_channel/parse_address.h )
s.files += %w( src/core/ext/client_channel/proxy_mapper.h )
s.files += %w( src/core/ext/client_channel/proxy_mapper_registry.h )
s.files += %w( src/core/ext/client_channel/resolver.h ) s.files += %w( src/core/ext/client_channel/resolver.h )
s.files += %w( src/core/ext/client_channel/resolver_factory.h ) s.files += %w( src/core/ext/client_channel/resolver_factory.h )
s.files += %w( src/core/ext/client_channel/resolver_registry.h ) s.files += %w( src/core/ext/client_channel/resolver_registry.h )
@ -521,11 +526,14 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/client_channel/connector.c ) s.files += %w( src/core/ext/client_channel/connector.c )
s.files += %w( src/core/ext/client_channel/default_initial_connect_string.c ) s.files += %w( src/core/ext/client_channel/default_initial_connect_string.c )
s.files += %w( src/core/ext/client_channel/http_connect_handshaker.c ) s.files += %w( src/core/ext/client_channel/http_connect_handshaker.c )
s.files += %w( src/core/ext/client_channel/http_proxy.c )
s.files += %w( src/core/ext/client_channel/initial_connect_string.c ) s.files += %w( src/core/ext/client_channel/initial_connect_string.c )
s.files += %w( src/core/ext/client_channel/lb_policy.c ) s.files += %w( src/core/ext/client_channel/lb_policy.c )
s.files += %w( src/core/ext/client_channel/lb_policy_factory.c ) s.files += %w( src/core/ext/client_channel/lb_policy_factory.c )
s.files += %w( src/core/ext/client_channel/lb_policy_registry.c ) s.files += %w( src/core/ext/client_channel/lb_policy_registry.c )
s.files += %w( src/core/ext/client_channel/parse_address.c ) s.files += %w( src/core/ext/client_channel/parse_address.c )
s.files += %w( src/core/ext/client_channel/proxy_mapper.c )
s.files += %w( src/core/ext/client_channel/proxy_mapper_registry.c )
s.files += %w( src/core/ext/client_channel/resolver.c ) s.files += %w( src/core/ext/client_channel/resolver.c )
s.files += %w( src/core/ext/client_channel/resolver_factory.c ) s.files += %w( src/core/ext/client_channel/resolver_factory.c )
s.files += %w( src/core/ext/client_channel/resolver_registry.c ) s.files += %w( src/core/ext/client_channel/resolver_registry.c )

@ -249,7 +249,7 @@ class CallOpSendMessage {
op->op = GRPC_OP_SEND_MESSAGE; op->op = GRPC_OP_SEND_MESSAGE;
op->flags = write_options_.flags(); op->flags = write_options_.flags();
op->reserved = NULL; op->reserved = NULL;
op->data.send_message = send_buf_; op->data.send_message.send_message = send_buf_;
// Flags are per-message: clear them after use. // Flags are per-message: clear them after use.
write_options_.Clear(); write_options_.Clear();
} }
@ -298,7 +298,7 @@ class CallOpRecvMessage {
op->op = GRPC_OP_RECV_MESSAGE; op->op = GRPC_OP_RECV_MESSAGE;
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
op->data.recv_message = &recv_buf_; op->data.recv_message.recv_message = &recv_buf_;
} }
void FinishOp(bool* status, int max_receive_message_size) { void FinishOp(bool* status, int max_receive_message_size) {
@ -379,7 +379,7 @@ class CallOpGenericRecvMessage {
op->op = GRPC_OP_RECV_MESSAGE; op->op = GRPC_OP_RECV_MESSAGE;
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
op->data.recv_message = &recv_buf_; op->data.recv_message.recv_message = &recv_buf_;
} }
void FinishOp(bool* status, int max_receive_message_size) { void FinishOp(bool* status, int max_receive_message_size) {
@ -486,7 +486,8 @@ class CallOpRecvInitialMetadata {
memset(&recv_initial_metadata_arr_, 0, sizeof(recv_initial_metadata_arr_)); memset(&recv_initial_metadata_arr_, 0, sizeof(recv_initial_metadata_arr_));
grpc_op* op = &ops[(*nops)++]; grpc_op* op = &ops[(*nops)++];
op->op = GRPC_OP_RECV_INITIAL_METADATA; op->op = GRPC_OP_RECV_INITIAL_METADATA;
op->data.recv_initial_metadata = &recv_initial_metadata_arr_; op->data.recv_initial_metadata.recv_initial_metadata =
&recv_initial_metadata_arr_;
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
} }

@ -39,6 +39,12 @@
#define GRPC_CUSTOM_STRING std::string #define GRPC_CUSTOM_STRING std::string
#endif #endif
// The following macros are deprecated and appear only for users
// with PB files generated using gRPC 1.0.x plugins. They should
// not be used in new code
#define GRPC_OVERRIDE override // deprecated
#define GRPC_FINAL final // deprecated
namespace grpc { namespace grpc {
typedef GRPC_CUSTOM_STRING string; typedef GRPC_CUSTOM_STRING string;

@ -88,6 +88,10 @@ class ChannelArguments {
/// The given buffer pool will be attached to the constructed channel /// The given buffer pool will be attached to the constructed channel
void SetResourceQuota(const ResourceQuota& resource_quota); void SetResourceQuota(const ResourceQuota& resource_quota);
/// Sets the max receive and send message sizes.
void SetMaxReceiveMessageSize(int size);
void SetMaxSendMessageSize(int size);
/// Set LB policy name. /// Set LB policy name.
/// Note that if the name resolver returns only balancer addresses, the /// Note that if the name resolver returns only balancer addresses, the
/// grpclb LB policy will be used, regardless of what is specified here. /// grpclb LB policy will be used, regardless of what is specified here.

@ -0,0 +1,84 @@
/*
*
* Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GRPC_IMPL_CODEGEN_GPR_SLICE_H
#define GRPC_IMPL_CODEGEN_GPR_SLICE_H
/* WARNING: Please do not use this header. This was added as a temporary measure
* to not break some of the external projects that depend on gpr_slice_*
* functions. We are actively working on moving all the gpr_slice_* references
* to grpc_slice_* and this file will be removed
* */
/* TODO (sreek) - Allowed by default but will be very soon turned off */
#define GRPC_ALLOW_GPR_SLICE_FUNCTIONS 1
#ifdef GRPC_ALLOW_GPR_SLICE_FUNCTIONS
#define gpr_slice_refcount grpc_slice_refcount
#define gpr_slice grpc_slice
#define gpr_slice_buffer grpc_slice_buffer
#define gpr_slice_ref grpc_slice_ref
#define gpr_slice_unref grpc_slice_unref
#define gpr_slice_new grpc_slice_new
#define gpr_slice_new_with_user_data grpc_slice_new_with_user_data
#define gpr_slice_new_with_len grpc_slice_new_with_len
#define gpr_slice_malloc grpc_slice_malloc
#define gpr_slice_from_copied_string grpc_slice_from_copied_string
#define gpr_slice_from_copied_buffer grpc_slice_from_copied_buffer
#define gpr_slice_from_static_string grpc_slice_from_static_string
#define gpr_slice_sub grpc_slice_sub
#define gpr_slice_sub_no_ref grpc_slice_sub_no_ref
#define gpr_slice_split_tail grpc_slice_split_tail
#define gpr_slice_split_head grpc_slice_split_head
#define gpr_slice_cmp grpc_slice_cmp
#define gpr_slice_str_cmp grpc_slice_str_cmp
#define gpr_slice_buffer grpc_slice_buffer
#define gpr_slice_buffer_init grpc_slice_buffer_init
#define gpr_slice_buffer_destroy grpc_slice_buffer_destroy
#define gpr_slice_buffer_add grpc_slice_buffer_add
#define gpr_slice_buffer_add_indexed grpc_slice_buffer_add_indexed
#define gpr_slice_buffer_addn grpc_slice_buffer_addn
#define gpr_slice_buffer_tiny_add grpc_slice_buffer_tiny_add
#define gpr_slice_buffer_pop grpc_slice_buffer_pop
#define gpr_slice_buffer_reset_and_unref grpc_slice_buffer_reset_and_unref
#define gpr_slice_buffer_swap grpc_slice_buffer_swap
#define gpr_slice_buffer_move_into grpc_slice_buffer_move_into
#define gpr_slice_buffer_trim_end grpc_slice_buffer_trim_end
#define gpr_slice_buffer_move_first grpc_slice_buffer_move_first
#define gpr_slice_buffer_take_first grpc_slice_buffer_take_first
#endif /* GRPC_ALLOW_GPR_SLICE_FUNCTIONS */
#endif /* GRPC_IMPL_CODEGEN_GPR_SLICE_H */

@ -179,6 +179,9 @@ typedef struct {
Larger values give lower CPU usage for large messages, but more head of line Larger values give lower CPU usage for large messages, but more head of line
blocking for small messages. */ blocking for small messages. */
#define GRPC_ARG_HTTP2_MAX_FRAME_SIZE "grpc.http2.max_frame_size" #define GRPC_ARG_HTTP2_MAX_FRAME_SIZE "grpc.http2.max_frame_size"
/** How much data are we willing to queue up per stream if
GRPC_WRITE_BUFFER_HINT is set? This is an upper bound */
#define GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE "grpc.http2.write_buffer_size"
/** Default authority to pass if none specified on call construction. A string. /** Default authority to pass if none specified on call construction. A string.
* */ * */
#define GRPC_ARG_DEFAULT_AUTHORITY "grpc.default_authority" #define GRPC_ARG_DEFAULT_AUTHORITY "grpc.default_authority"
@ -415,7 +418,9 @@ typedef struct grpc_op {
grpc_compression_level level; grpc_compression_level level;
} maybe_compression_level; } maybe_compression_level;
} send_initial_metadata; } send_initial_metadata;
struct {
struct grpc_byte_buffer *send_message; struct grpc_byte_buffer *send_message;
} send_message;
struct { struct {
size_t trailing_metadata_count; size_t trailing_metadata_count;
grpc_metadata *trailing_metadata; grpc_metadata *trailing_metadata;
@ -427,11 +432,15 @@ typedef struct grpc_op {
object, recv_initial_metadata->array is owned by the caller). object, recv_initial_metadata->array is owned by the caller).
After the operation completes, call grpc_metadata_array_destroy on this After the operation completes, call grpc_metadata_array_destroy on this
value, or reuse it in a future op. */ value, or reuse it in a future op. */
struct {
grpc_metadata_array *recv_initial_metadata; grpc_metadata_array *recv_initial_metadata;
} recv_initial_metadata;
/** ownership of the byte buffer is moved to the caller; the caller must /** ownership of the byte buffer is moved to the caller; the caller must
call grpc_byte_buffer_destroy on this value, or reuse it in a future op. call grpc_byte_buffer_destroy on this value, or reuse it in a future op.
*/ */
struct {
struct grpc_byte_buffer **recv_message; struct grpc_byte_buffer **recv_message;
} recv_message;
struct { struct {
/** ownership of the array is with the caller, but ownership of the /** ownership of the array is with the caller, but ownership of the
elements stays with the call object (ie key, value members are owned elements stays with the call object (ie key, value members are owned

@ -38,6 +38,7 @@
#include <stdint.h> #include <stdint.h>
#include <grpc/impl/codegen/exec_ctx_fwd.h> #include <grpc/impl/codegen/exec_ctx_fwd.h>
#include <grpc/impl/codegen/gpr_slice.h>
/* Slice API /* Slice API
@ -92,11 +93,16 @@ typedef struct grpc_slice {
/* Represents an expandable array of slices, to be interpreted as a /* Represents an expandable array of slices, to be interpreted as a
single item. */ single item. */
typedef struct { typedef struct {
/* slices in the array */ /* This is for internal use only. External users (i.e any code outside grpc
* core) MUST NOT use this field */
grpc_slice *base_slices;
/* slices in the array (Points to the first valid grpc_slice in the array) */
grpc_slice *slices; grpc_slice *slices;
/* the number of slices in the array */ /* the number of slices in the array */
size_t count; size_t count;
/* the number of slices allocated in the array */ /* the number of slices allocated in the array. External users (i.e any code
* outside grpc core) MUST NOT use this field */
size_t capacity; size_t capacity;
/* the combined length of all slices in the array */ /* the combined length of all slices in the array */
size_t length; size_t length;
@ -117,4 +123,22 @@ typedef struct {
GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(slice) GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(slice)
#define GRPC_SLICE_IS_EMPTY(slice) (GRPC_SLICE_LENGTH(slice) == 0) #define GRPC_SLICE_IS_EMPTY(slice) (GRPC_SLICE_LENGTH(slice) == 0)
#ifdef GRPC_ALLOW_GPR_SLICE_FUNCTIONS
/* Duplicate GPR_* definitions */
#define GPR_SLICE_START_PTR(slice) \
((slice).refcount ? (slice).data.refcounted.bytes \
: (slice).data.inlined.bytes)
#define GPR_SLICE_LENGTH(slice) \
((slice).refcount ? (slice).data.refcounted.length \
: (slice).data.inlined.length)
#define GPR_SLICE_SET_LENGTH(slice, newlen) \
((slice).refcount ? ((slice).data.refcounted.length = (size_t)(newlen)) \
: ((slice).data.inlined.length = (uint8_t)(newlen)))
#define GPR_SLICE_END_PTR(slice) \
GRPC_SLICE_START_PTR(slice) + GRPC_SLICE_LENGTH(slice)
#define GPR_SLICE_IS_EMPTY(slice) (GRPC_SLICE_LENGTH(slice) == 0)
#endif /* GRPC_ALLOW_GPR_SLICE_FUNCTIONS */
#endif /* GRPC_IMPL_CODEGEN_SLICE_H */ #endif /* GRPC_IMPL_CODEGEN_SLICE_H */

@ -77,8 +77,15 @@ GPRAPI void grpc_slice_buffer_trim_end(grpc_slice_buffer *src, size_t n,
/* move the first n bytes of src into dst */ /* move the first n bytes of src into dst */
GPRAPI void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n, GPRAPI void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n,
grpc_slice_buffer *dst); grpc_slice_buffer *dst);
/* move the first n bytes of src into dst (copying them) */
GPRAPI void grpc_slice_buffer_move_first_into_buffer(grpc_exec_ctx *exec_ctx,
grpc_slice_buffer *src,
size_t n, void *dst);
/* take the first slice in the slice buffer */ /* take the first slice in the slice buffer */
GPRAPI grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer *src); GPRAPI grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer *src);
/* undo the above with (a possibly different) \a slice */
GPRAPI void grpc_slice_buffer_undo_take_first(grpc_slice_buffer *src,
grpc_slice slice);
#ifdef __cplusplus #ifdef __cplusplus
} }

@ -34,6 +34,8 @@
#ifndef GRPC_SUPPORT_LOG_WINDOWS_H #ifndef GRPC_SUPPORT_LOG_WINDOWS_H
#define GRPC_SUPPORT_LOG_WINDOWS_H #define GRPC_SUPPORT_LOG_WINDOWS_H
#include <grpc/impl/codegen/port_platform.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

@ -21,6 +21,7 @@
"scripts": { "scripts": {
"lint": "node ./node_modules/jshint/bin/jshint src/node/src src/node/test src/node/interop src/node/index.js --exclude-path=src/node/.jshintignore", "lint": "node ./node_modules/jshint/bin/jshint src/node/src src/node/test src/node/interop src/node/index.js --exclude-path=src/node/.jshintignore",
"test": "./node_modules/.bin/mocha src/node/test && npm run-script lint", "test": "./node_modules/.bin/mocha src/node/test && npm run-script lint",
"electron-build": "./node_modules/.bin/node-pre-gyp configure build --runtime=electron --disturl=https://atom.io/download/atom-shell",
"gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json", "gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test", "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test",
"install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build" "install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build"
@ -38,6 +39,7 @@
"devDependencies": { "devDependencies": {
"async": "^2.0.1", "async": "^2.0.1",
"body-parser": "^1.15.2", "body-parser": "^1.15.2",
"electron-mocha": "^3.1.1",
"express": "^4.14.0", "express": "^4.14.0",
"google-auth-library": "^0.9.2", "google-auth-library": "^0.9.2",
"google-protobuf": "^3.0.0", "google-protobuf": "^3.0.0",
@ -50,7 +52,7 @@
"poisson-process": "^0.2.1" "poisson-process": "^0.2.1"
}, },
"engines": { "engines": {
"node": ">=0.12.0" "node": ">=1.1.0"
}, },
"binary": { "binary": {
"module_name": "grpc_node", "module_name": "grpc_node",

@ -10,19 +10,20 @@
<email>grpc-packages@google.com</email> <email>grpc-packages@google.com</email>
<active>yes</active> <active>yes</active>
</lead> </lead>
<date>2016-08-22</date> <date>2017-01-13</date>
<time>16:06:07</time> <time>16:06:07</time>
<version> <version>
<release>1.1.0dev</release> <release>1.1.0dev</release>
<api>1.1.0dev</api> <api>1.1.0dev</api>
</version> </version>
<stability> <stability>
<release>stable</release> <release>beta</release>
<api>stable</api> <api>beta</api>
</stability> </stability>
<license>BSD</license> <license>BSD</license>
<notes> <notes>
- Reject metadata keys which are not legal #7881 - PHP Proto3 adoption #8179
- Various bug fixes
</notes> </notes>
<contents> <contents>
<dir baseinstalldir="/" name="/"> <dir baseinstalldir="/" name="/">
@ -81,6 +82,7 @@
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_atomic.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_atomic.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_sync.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_sync.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm_windows.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_windows.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/gpr_slice.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/gpr_types.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/gpr_types.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/port_platform.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/port_platform.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/slice.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/slice.h" role="src" />
@ -164,6 +166,7 @@
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_atomic.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_atomic.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_sync.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_gcc_sync.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/atm_windows.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/atm_windows.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/gpr_slice.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/gpr_types.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/gpr_types.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/port_platform.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/port_platform.h" role="src" />
<file baseinstalldir="/" name="include/grpc/impl/codegen/slice.h" role="src" /> <file baseinstalldir="/" name="include/grpc/impl/codegen/slice.h" role="src" />
@ -323,11 +326,14 @@
<file baseinstalldir="/" name="src/core/ext/client_channel/client_channel_factory.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/client_channel_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/connector.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/connector.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/http_connect_handshaker.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/http_connect_handshaker.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/http_proxy.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/initial_connect_string.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/initial_connect_string.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_factory.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_registry.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_registry.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/parse_address.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/parse_address.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/proxy_mapper.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/proxy_mapper_registry.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/resolver.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/resolver.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/resolver_factory.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/resolver_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/resolver_registry.h" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/resolver_registry.h" role="src" />
@ -529,11 +535,14 @@
<file baseinstalldir="/" name="src/core/ext/client_channel/connector.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/connector.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/default_initial_connect_string.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/default_initial_connect_string.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/http_connect_handshaker.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/http_connect_handshaker.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/http_proxy.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/initial_connect_string.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/initial_connect_string.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_factory.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_registry.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/lb_policy_registry.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/parse_address.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/parse_address.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/proxy_mapper.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/proxy_mapper_registry.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/resolver.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/resolver_factory.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/resolver_factory.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/client_channel/resolver_registry.c" role="src" /> <file baseinstalldir="/" name="src/core/ext/client_channel/resolver_registry.c" role="src" />
@ -1215,18 +1224,49 @@ Update to wrap gRPC C Core version 0.10.0
</release> </release>
<release> <release>
<version> <version>
<release>1.1.0dev</release> <release>1.0.1RC1</release>
<api>1.1.0dev</api> <api>1.0.1RC1</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2016-10-06</date>
<license>BSD</license>
<notes>
- Reject metadata keys which are not legal #7881
</notes>
</release>
<release>
<version>
<release>1.0.1</release>
<api>1.0.1</api>
</version> </version>
<stability> <stability>
<release>stable</release> <release>stable</release>
<api>stable</api> <api>stable</api>
</stability> </stability>
<date>2016-08-22</date> <date>2016-10-27</date>
<license>BSD</license> <license>BSD</license>
<notes> <notes>
- Reject metadata keys which are not legal #7881 - Reject metadata keys which are not legal #7881
</notes> </notes>
</release> </release>
<release>
<version>
<release>1.1.0dev</release>
<api>1.1.0dev</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2017-01-13</date>
<license>BSD</license>
<notes>
- PHP Proto3 adoption #8179
- Various bug fixes
</notes>
</release>
</changelog> </changelog>
</package> </package>

@ -11,3 +11,7 @@ inplace=1
[build_package_protos] [build_package_protos]
exclude=.*protoc_plugin/protoc_plugin_test\.proto$ exclude=.*protoc_plugin/protoc_plugin_test\.proto$
# Style settings
[yapf]
based_on_style = google

@ -1218,6 +1218,7 @@ void PrintSourceService(Printer *printer, const Service *service,
std::map<grpc::string, grpc::string> *vars) { std::map<grpc::string, grpc::string> *vars) {
(*vars)["Service"] = service->name(); (*vars)["Service"] = service->name();
if (service->method_count() > 0) {
printer->Print(*vars, printer->Print(*vars,
"static const char* $prefix$$Service$_method_names[] = {\n"); "static const char* $prefix$$Service$_method_names[] = {\n");
for (int i = 0; i < service->method_count(); ++i) { for (int i = 0; i < service->method_count(); ++i) {
@ -1225,6 +1226,7 @@ void PrintSourceService(Printer *printer, const Service *service,
printer->Print(*vars, " \"/$Package$$Service$/$Method$\",\n"); printer->Print(*vars, " \"/$Package$$Service$/$Method$\",\n");
} }
printer->Print(*vars, "};\n\n"); printer->Print(*vars, "};\n\n");
}
printer->Print(*vars, printer->Print(*vars,
"std::unique_ptr< $ns$$Service$::Stub> $ns$$Service$::NewStub(" "std::unique_ptr< $ns$$Service$::Stub> $ns$$Service$::NewStub("
@ -1272,7 +1274,6 @@ void PrintSourceService(Printer *printer, const Service *service,
printer->Print(*vars, "$ns$$Service$::Service::Service() {\n"); printer->Print(*vars, "$ns$$Service$::Service::Service() {\n");
printer->Indent(); printer->Indent();
printer->Print(*vars, "(void)$prefix$$Service$_method_names;\n");
for (int i = 0; i < service->method_count(); ++i) { for (int i = 0; i < service->method_count(); ++i) {
auto method = service->method(i); auto method = service->method(i);
(*vars)["Idx"] = as_string(i); (*vars)["Idx"] = as_string(i);

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

@ -43,6 +43,8 @@
#include <grpc/support/sync.h> #include <grpc/support/sync.h>
#include <grpc/support/useful.h> #include <grpc/support/useful.h>
#include "src/core/ext/client_channel/http_connect_handshaker.h"
#include "src/core/ext/client_channel/http_proxy.h"
#include "src/core/ext/client_channel/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/ext/client_channel/resolver_registry.h" #include "src/core/ext/client_channel/resolver_registry.h"
#include "src/core/ext/client_channel/subchannel.h" #include "src/core/ext/client_channel/subchannel.h"
@ -150,6 +152,10 @@ static void *method_parameters_create_from_json(const grpc_json *json) {
*/ */
typedef struct client_channel_channel_data { typedef struct client_channel_channel_data {
/** server name */
char *server_name;
/** HTTP CONNECT proxy to use, if any */
char *proxy_name;
/** resolver for this channel */ /** resolver for this channel */
grpc_resolver *resolver; grpc_resolver *resolver;
/** have we started resolving this channel */ /** have we started resolving this channel */
@ -310,6 +316,17 @@ static void on_resolver_result_changed(grpc_exec_ctx *exec_ctx, void *arg,
// Use pick_first if nothing was specified and we didn't select grpclb // Use pick_first if nothing was specified and we didn't select grpclb
// above. // above.
if (lb_policy_name == NULL) lb_policy_name = "pick_first"; if (lb_policy_name == NULL) lb_policy_name = "pick_first";
// If using a proxy, add channel arg for server in HTTP CONNECT request.
if (chand->proxy_name != NULL) {
grpc_arg new_arg;
new_arg.key = GRPC_ARG_HTTP_CONNECT_SERVER;
new_arg.type = GRPC_ARG_STRING;
new_arg.value.string = chand->server_name;
grpc_channel_args *tmp_args = chand->resolver_result;
chand->resolver_result =
grpc_channel_args_copy_and_add(chand->resolver_result, &new_arg, 1);
grpc_channel_args_destroy(exec_ctx, tmp_args);
}
// Instantiate LB policy. // Instantiate LB policy.
grpc_lb_policy_args lb_policy_args; grpc_lb_policy_args lb_policy_args;
lb_policy_args.args = chand->resolver_result; lb_policy_args.args = chand->resolver_result;
@ -528,9 +545,12 @@ static grpc_error *cc_init_channel_elem(grpc_exec_ctx *exec_ctx,
arg = grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVER_URI); arg = grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVER_URI);
GPR_ASSERT(arg != NULL); GPR_ASSERT(arg != NULL);
GPR_ASSERT(arg->type == GRPC_ARG_STRING); GPR_ASSERT(arg->type == GRPC_ARG_STRING);
chand->resolver = chand->server_name = gpr_strdup(arg->value.string);
grpc_resolver_create(exec_ctx, arg->value.string, args->channel_args, chand->proxy_name = grpc_get_http_proxy_server();
chand->interested_parties); char *name_to_resolve =
chand->proxy_name == NULL ? chand->server_name : chand->proxy_name;
chand->resolver = grpc_resolver_create(
exec_ctx, name_to_resolve, args->channel_args, chand->interested_parties);
if (chand->resolver == NULL) { if (chand->resolver == NULL) {
return GRPC_ERROR_CREATE("resolver creation failed"); return GRPC_ERROR_CREATE("resolver creation failed");
} }
@ -541,7 +561,8 @@ static grpc_error *cc_init_channel_elem(grpc_exec_ctx *exec_ctx,
static void cc_destroy_channel_elem(grpc_exec_ctx *exec_ctx, static void cc_destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) { grpc_channel_element *elem) {
channel_data *chand = elem->channel_data; channel_data *chand = elem->channel_data;
gpr_free(chand->server_name);
gpr_free(chand->proxy_name);
if (chand->resolver != NULL) { if (chand->resolver != NULL) {
grpc_resolver_shutdown(exec_ctx, chand->resolver); grpc_resolver_shutdown(exec_ctx, chand->resolver);
GRPC_RESOLVER_UNREF(exec_ctx, chand->resolver, "channel"); GRPC_RESOLVER_UNREF(exec_ctx, chand->resolver, "channel");

@ -40,6 +40,7 @@
#include "src/core/ext/client_channel/client_channel.h" #include "src/core/ext/client_channel/client_channel.h"
#include "src/core/ext/client_channel/http_connect_handshaker.h" #include "src/core/ext/client_channel/http_connect_handshaker.h"
#include "src/core/ext/client_channel/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/ext/client_channel/proxy_mapper_registry.h"
#include "src/core/ext/client_channel/resolver_registry.h" #include "src/core/ext/client_channel/resolver_registry.h"
#include "src/core/ext/client_channel/subchannel_index.h" #include "src/core/ext/client_channel/subchannel_index.h"
#include "src/core/lib/surface/channel_init.h" #include "src/core/lib/surface/channel_init.h"
@ -80,6 +81,7 @@ static bool set_default_host_if_unset(grpc_exec_ctx *exec_ctx,
void grpc_client_channel_init(void) { void grpc_client_channel_init(void) {
grpc_lb_policy_registry_init(); grpc_lb_policy_registry_init();
grpc_resolver_registry_init(); grpc_resolver_registry_init();
grpc_proxy_mapper_registry_init();
grpc_subchannel_index_init(); grpc_subchannel_index_init();
grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MIN, grpc_channel_init_register_stage(GRPC_CLIENT_CHANNEL, INT_MIN,
set_default_host_if_unset, NULL); set_default_host_if_unset, NULL);
@ -91,6 +93,7 @@ void grpc_client_channel_init(void) {
void grpc_client_channel_shutdown(void) { void grpc_client_channel_shutdown(void) {
grpc_subchannel_index_shutdown(); grpc_subchannel_index_shutdown();
grpc_channel_init_shutdown(); grpc_channel_init_shutdown();
grpc_proxy_mapper_registry_shutdown();
grpc_resolver_registry_shutdown(); grpc_resolver_registry_shutdown();
grpc_lb_policy_registry_shutdown(); grpc_lb_policy_registry_shutdown();
} }

@ -48,9 +48,6 @@ struct grpc_connector {
typedef struct { typedef struct {
/** set of pollsets interested in this connection */ /** set of pollsets interested in this connection */
grpc_pollset_set *interested_parties; grpc_pollset_set *interested_parties;
/** address to connect to */
const grpc_resolved_address *addr;
size_t addr_len;
/** initial connect string to send */ /** initial connect string to send */
grpc_slice initial_connect_string; grpc_slice initial_connect_string;
/** deadline for connection */ /** deadline for connection */

@ -49,15 +49,12 @@
#include "src/core/lib/http/parser.h" #include "src/core/lib/http/parser.h"
#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/support/env.h" #include "src/core/lib/support/env.h"
#include "src/core/lib/support/string.h"
typedef struct http_connect_handshaker { typedef struct http_connect_handshaker {
// Base class. Must be first. // Base class. Must be first.
grpc_handshaker base; grpc_handshaker base;
char* proxy_server;
grpc_http_header* headers;
size_t num_headers;
gpr_refcount refcount; gpr_refcount refcount;
gpr_mu mu; gpr_mu mu;
@ -91,12 +88,6 @@ static void http_connect_handshaker_unref(grpc_exec_ctx* exec_ctx,
handshaker->read_buffer_to_destroy); handshaker->read_buffer_to_destroy);
gpr_free(handshaker->read_buffer_to_destroy); gpr_free(handshaker->read_buffer_to_destroy);
} }
gpr_free(handshaker->proxy_server);
for (size_t i = 0; i < handshaker->num_headers; ++i) {
gpr_free(handshaker->headers[i].key);
gpr_free(handshaker->headers[i].value);
}
gpr_free(handshaker->headers);
grpc_slice_buffer_destroy_internal(exec_ctx, &handshaker->write_buffer); grpc_slice_buffer_destroy_internal(exec_ctx, &handshaker->write_buffer);
grpc_http_parser_destroy(&handshaker->http_parser); grpc_http_parser_destroy(&handshaker->http_parser);
grpc_http_response_destroy(&handshaker->http_response); grpc_http_response_destroy(&handshaker->http_response);
@ -276,64 +267,88 @@ static void http_connect_handshaker_do_handshake(
grpc_tcp_server_acceptor* acceptor, grpc_closure* on_handshake_done, grpc_tcp_server_acceptor* acceptor, grpc_closure* on_handshake_done,
grpc_handshaker_args* args) { grpc_handshaker_args* args) {
http_connect_handshaker* handshaker = (http_connect_handshaker*)handshaker_in; http_connect_handshaker* handshaker = (http_connect_handshaker*)handshaker_in;
// Get server name from channel args. // Check for HTTP CONNECT channel arg.
const grpc_arg* arg = grpc_channel_args_find(args->args, GRPC_ARG_SERVER_URI); // If not found, invoke on_handshake_done without doing anything.
GPR_ASSERT(arg != NULL); const grpc_arg* arg =
grpc_channel_args_find(args->args, GRPC_ARG_HTTP_CONNECT_SERVER);
if (arg == NULL) {
// Set shutdown to true so that subsequent calls to
// http_connect_handshaker_shutdown() do nothing.
gpr_mu_lock(&handshaker->mu);
handshaker->shutdown = true;
gpr_mu_unlock(&handshaker->mu);
grpc_closure_sched(exec_ctx, on_handshake_done, GRPC_ERROR_NONE);
return;
}
GPR_ASSERT(arg->type == GRPC_ARG_STRING);
char* server_name = arg->value.string;
// Get headers from channel args.
arg = grpc_channel_args_find(args->args, GRPC_ARG_HTTP_CONNECT_HEADERS);
grpc_http_header* headers = NULL;
size_t num_headers = 0;
char** header_strings = NULL;
size_t num_header_strings = 0;
if (arg != NULL) {
GPR_ASSERT(arg->type == GRPC_ARG_STRING); GPR_ASSERT(arg->type == GRPC_ARG_STRING);
char* canonical_uri = gpr_string_split(arg->value.string, "\n", &header_strings,
grpc_resolver_factory_add_default_prefix_if_needed(arg->value.string); &num_header_strings);
grpc_uri* uri = grpc_uri_parse(canonical_uri, 1); headers = gpr_malloc(sizeof(grpc_http_header) * num_header_strings);
char* server_name = uri->path; for (size_t i = 0; i < num_header_strings; ++i) {
if (server_name[0] == '/') ++server_name; char* sep = strchr(header_strings[i], ':');
if (sep == NULL) {
gpr_log(GPR_ERROR, "skipping unparseable HTTP CONNECT header: %s",
header_strings[i]);
continue;
}
*sep = '\0';
headers[num_headers].key = header_strings[i];
headers[num_headers].value = sep + 1;
++num_headers;
}
}
// Save state in the handshaker object. // Save state in the handshaker object.
gpr_mu_lock(&handshaker->mu); gpr_mu_lock(&handshaker->mu);
handshaker->args = args; handshaker->args = args;
handshaker->on_handshake_done = on_handshake_done; handshaker->on_handshake_done = on_handshake_done;
// Send HTTP CONNECT request. // Log connection via proxy.
char* proxy_name = grpc_endpoint_get_peer(args->endpoint);
gpr_log(GPR_INFO, "Connecting to server %s via HTTP proxy %s", server_name, gpr_log(GPR_INFO, "Connecting to server %s via HTTP proxy %s", server_name,
handshaker->proxy_server); proxy_name);
gpr_free(proxy_name);
// Construct HTTP CONNECT request.
grpc_httpcli_request request; grpc_httpcli_request request;
memset(&request, 0, sizeof(request)); memset(&request, 0, sizeof(request));
request.host = server_name; request.host = server_name;
request.http.method = "CONNECT"; request.http.method = "CONNECT";
request.http.path = server_name; request.http.path = server_name;
request.http.hdrs = handshaker->headers; request.http.hdrs = headers;
request.http.hdr_count = handshaker->num_headers; request.http.hdr_count = num_headers;
request.handshaker = &grpc_httpcli_plaintext; request.handshaker = &grpc_httpcli_plaintext;
grpc_slice request_slice = grpc_httpcli_format_connect_request(&request); grpc_slice request_slice = grpc_httpcli_format_connect_request(&request);
grpc_slice_buffer_add(&handshaker->write_buffer, request_slice); grpc_slice_buffer_add(&handshaker->write_buffer, request_slice);
// Clean up.
gpr_free(headers);
for (size_t i = 0; i < num_header_strings; ++i) {
gpr_free(header_strings[i]);
}
gpr_free(header_strings);
// Take a new ref to be held by the write callback. // Take a new ref to be held by the write callback.
gpr_ref(&handshaker->refcount); gpr_ref(&handshaker->refcount);
grpc_endpoint_write(exec_ctx, args->endpoint, &handshaker->write_buffer, grpc_endpoint_write(exec_ctx, args->endpoint, &handshaker->write_buffer,
&handshaker->request_done_closure); &handshaker->request_done_closure);
gpr_mu_unlock(&handshaker->mu); gpr_mu_unlock(&handshaker->mu);
// Clean up.
gpr_free(canonical_uri);
grpc_uri_destroy(uri);
} }
static const grpc_handshaker_vtable http_connect_handshaker_vtable = { static const grpc_handshaker_vtable http_connect_handshaker_vtable = {
http_connect_handshaker_destroy, http_connect_handshaker_shutdown, http_connect_handshaker_destroy, http_connect_handshaker_shutdown,
http_connect_handshaker_do_handshake}; http_connect_handshaker_do_handshake};
grpc_handshaker* grpc_http_connect_handshaker_create(const char* proxy_server, static grpc_handshaker* grpc_http_connect_handshaker_create() {
grpc_http_header* headers,
size_t num_headers) {
GPR_ASSERT(proxy_server != NULL);
http_connect_handshaker* handshaker = gpr_malloc(sizeof(*handshaker)); http_connect_handshaker* handshaker = gpr_malloc(sizeof(*handshaker));
memset(handshaker, 0, sizeof(*handshaker)); memset(handshaker, 0, sizeof(*handshaker));
grpc_handshaker_init(&http_connect_handshaker_vtable, &handshaker->base); grpc_handshaker_init(&http_connect_handshaker_vtable, &handshaker->base);
gpr_mu_init(&handshaker->mu); gpr_mu_init(&handshaker->mu);
gpr_ref_init(&handshaker->refcount, 1); gpr_ref_init(&handshaker->refcount, 1);
handshaker->proxy_server = gpr_strdup(proxy_server);
if (num_headers > 0) {
handshaker->headers = gpr_malloc(sizeof(grpc_http_header) * num_headers);
for (size_t i = 0; i < num_headers; ++i) {
handshaker->headers[i].key = gpr_strdup(headers[i].key);
handshaker->headers[i].value = gpr_strdup(headers[i].value);
}
handshaker->num_headers = num_headers;
}
grpc_slice_buffer_init(&handshaker->write_buffer); grpc_slice_buffer_init(&handshaker->write_buffer);
grpc_closure_init(&handshaker->request_done_closure, on_write_done, grpc_closure_init(&handshaker->request_done_closure, on_write_done,
handshaker, grpc_schedule_on_exec_ctx); handshaker, grpc_schedule_on_exec_ctx);
@ -344,30 +359,6 @@ grpc_handshaker* grpc_http_connect_handshaker_create(const char* proxy_server,
return &handshaker->base; return &handshaker->base;
} }
char* grpc_get_http_proxy_server() {
char* uri_str = gpr_getenv("http_proxy");
if (uri_str == NULL) return NULL;
grpc_uri* uri = grpc_uri_parse(uri_str, false /* suppress_errors */);
char* proxy_name = NULL;
if (uri == NULL || uri->authority == NULL) {
gpr_log(GPR_ERROR, "cannot parse value of 'http_proxy' env var");
goto done;
}
if (strcmp(uri->scheme, "http") != 0) {
gpr_log(GPR_ERROR, "'%s' scheme not supported in proxy URI", uri->scheme);
goto done;
}
if (strchr(uri->authority, '@') != NULL) {
gpr_log(GPR_ERROR, "userinfo not supported in proxy URI");
goto done;
}
proxy_name = gpr_strdup(uri->authority);
done:
gpr_free(uri_str);
grpc_uri_destroy(uri);
return proxy_name;
}
// //
// handshaker factory // handshaker factory
// //
@ -375,13 +366,8 @@ done:
static void handshaker_factory_add_handshakers( static void handshaker_factory_add_handshakers(
grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* factory, grpc_exec_ctx* exec_ctx, grpc_handshaker_factory* factory,
const grpc_channel_args* args, grpc_handshake_manager* handshake_mgr) { const grpc_channel_args* args, grpc_handshake_manager* handshake_mgr) {
char* proxy_name = grpc_get_http_proxy_server(); grpc_handshake_manager_add(handshake_mgr,
if (proxy_name != NULL) { grpc_http_connect_handshaker_create());
grpc_handshake_manager_add(
handshake_mgr,
grpc_http_connect_handshaker_create(proxy_name, NULL, 0));
gpr_free(proxy_name);
}
} }
static void handshaker_factory_destroy(grpc_exec_ctx* exec_ctx, static void handshaker_factory_destroy(grpc_exec_ctx* exec_ctx,

@ -34,17 +34,14 @@
#ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H
#define GRPC_CORE_EXT_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H
#include "src/core/lib/channel/handshaker.h" /// Channel arg indicating the server in HTTP CONNECT request (string).
#include "src/core/lib/http/parser.h" /// The presence of this arg triggers the use of HTTP CONNECT.
#define GRPC_ARG_HTTP_CONNECT_SERVER "grpc.http_connect_server"
/// Creates a new HTTP CONNECT handshaker. /// Channel arg indicating HTTP CONNECT headers (string).
grpc_handshaker* grpc_http_connect_handshaker_create(const char* proxy_server, /// Multiple headers are separated by newlines. Key/value pairs are
grpc_http_header* headers, /// seperated by colons.
size_t num_headers); #define GRPC_ARG_HTTP_CONNECT_HEADERS "grpc.http_connect_headers"
/// Returns the name of the proxy to use, or NULL if no proxy is configured.
/// Caller takes ownership of result.
char* grpc_get_http_proxy_server();
/// Registers handshaker factory. /// Registers handshaker factory.
void grpc_http_connect_register_handshaker_factory(); void grpc_http_connect_register_handshaker_factory();

@ -0,0 +1,68 @@
/*
*
* Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "src/core/ext/client_channel/http_proxy.h"
#include <stdbool.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/client_channel/uri_parser.h"
#include "src/core/lib/support/env.h"
char* grpc_get_http_proxy_server() {
char* uri_str = gpr_getenv("http_proxy");
if (uri_str == NULL) return NULL;
grpc_uri* uri = grpc_uri_parse(uri_str, false /* suppress_errors */);
char* proxy_name = NULL;
if (uri == NULL || uri->authority == NULL) {
gpr_log(GPR_ERROR, "cannot parse value of 'http_proxy' env var");
goto done;
}
if (strcmp(uri->scheme, "http") != 0) {
gpr_log(GPR_ERROR, "'%s' scheme not supported in proxy URI", uri->scheme);
goto done;
}
if (strchr(uri->authority, '@') != NULL) {
gpr_log(GPR_ERROR, "userinfo not supported in proxy URI");
goto done;
}
proxy_name = gpr_strdup(uri->authority);
done:
gpr_free(uri_str);
grpc_uri_destroy(uri);
return proxy_name;
}

@ -31,19 +31,11 @@
* *
*/ */
#ifndef TEST_QPS_LIMIT_CORES_H #ifndef GRPC_CORE_EXT_CLIENT_CHANNEL_HTTP_PROXY_H
#define TEST_QPS_LIMIT_CORES_H #define GRPC_CORE_EXT_CLIENT_CHANNEL_HTTP_PROXY_H
namespace grpc { /// Returns the name of the proxy to use, or NULL if no proxy is configured.
namespace testing { /// Caller takes ownership of result.
/// LimitCores: allow this worker to only run on the cores specified in the char* grpc_get_http_proxy_server();
/// array \a cores, which is of length \a cores_size.
///
/// LimitCores takes array and size arguments (instead of vector) for direct
/// conversion from repeated field of protobuf. Use a cores_size of 0 to remove
/// existing limits (from an empty repeated field)
int LimitCores(const int *cores, int cores_size);
} // namespace testing
} // namespace grpc
#endif // TEST_QPS_LIMIT_CORES_H #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_HTTP_PROXY_H */

@ -0,0 +1,52 @@
/*
*
* Copyright 2017, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "src/core/ext/client_channel/proxy_mapper.h"
void grpc_proxy_mapper_init(const grpc_proxy_mapper_vtable* vtable,
grpc_proxy_mapper* mapper) {
mapper->vtable = vtable;
}
bool grpc_proxy_mapper_map(grpc_exec_ctx* exec_ctx, grpc_proxy_mapper* mapper,
const grpc_resolved_address* address,
const grpc_channel_args* args,
grpc_resolved_address** new_address,
grpc_channel_args** new_args) {
return mapper->vtable->map(exec_ctx, mapper, address, args, new_address,
new_args);
}
void grpc_proxy_mapper_destroy(grpc_proxy_mapper* mapper) {
mapper->vtable->destroy(mapper);
}

@ -0,0 +1,73 @@
/*
*
* 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 GRPC_CORE_EXT_CLIENT_CHANNEL_PROXY_MAPPER_H
#define GRPC_CORE_EXT_CLIENT_CHANNEL_PROXY_MAPPER_H
#include <stdbool.h>
#include <grpc/impl/codegen/grpc_types.h>
#include "src/core/lib/iomgr/resolve_address.h"
typedef struct grpc_proxy_mapper grpc_proxy_mapper;
typedef struct {
/// Determines the proxy address to use to contact \a address.
/// If no proxy is needed, returns false.
/// Otherwise, sets \a new_address, optionally sets \a new_args, and
/// returns true.
bool (*map)(grpc_exec_ctx* exec_ctx, grpc_proxy_mapper* mapper,
const grpc_resolved_address* address,
const grpc_channel_args* args,
grpc_resolved_address** new_address,
grpc_channel_args** new_args);
/// Destroys \a mapper.
void (*destroy)(grpc_proxy_mapper* mapper);
} grpc_proxy_mapper_vtable;
struct grpc_proxy_mapper {
const grpc_proxy_mapper_vtable* vtable;
};
void grpc_proxy_mapper_init(const grpc_proxy_mapper_vtable* vtable,
grpc_proxy_mapper* mapper);
bool grpc_proxy_mapper_map(grpc_exec_ctx* exec_ctx, grpc_proxy_mapper* mapper,
const grpc_resolved_address* address,
const grpc_channel_args* args,
grpc_resolved_address** new_address,
grpc_channel_args** new_args);
void grpc_proxy_mapper_destroy(grpc_proxy_mapper* mapper);
#endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_PROXY_MAPPER_H */

@ -0,0 +1,111 @@
/*
*
* 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 "src/core/ext/client_channel/proxy_mapper_registry.h"
#include <string.h>
#include <grpc/support/alloc.h>
//
// grpc_proxy_mapper_list
//
typedef struct {
grpc_proxy_mapper** list;
size_t num_mappers;
} grpc_proxy_mapper_list;
static void grpc_proxy_mapper_list_register(grpc_proxy_mapper_list* list,
bool at_start,
grpc_proxy_mapper* mapper) {
list->list = gpr_realloc(
list->list, (list->num_mappers + 1) * sizeof(grpc_proxy_mapper*));
if (at_start) {
memmove(list->list + 1, list->list,
sizeof(grpc_proxy_mapper*) * list->num_mappers);
list->list[0] = mapper;
} else {
list->list[list->num_mappers] = mapper;
}
++list->num_mappers;
}
static bool grpc_proxy_mapper_list_map(grpc_exec_ctx* exec_ctx,
grpc_proxy_mapper_list* list,
const grpc_resolved_address* address,
const grpc_channel_args* args,
grpc_resolved_address** new_address,
grpc_channel_args** new_args) {
for (size_t i = 0; i < list->num_mappers; ++i) {
if (grpc_proxy_mapper_map(exec_ctx, list->list[i], address, args,
new_address, new_args)) {
return true;
}
}
return false;
}
static void grpc_proxy_mapper_list_destroy(grpc_proxy_mapper_list* list) {
for (size_t i = 0; i < list->num_mappers; ++i) {
grpc_proxy_mapper_destroy(list->list[i]);
}
gpr_free(list->list);
}
//
// plugin
//
static grpc_proxy_mapper_list g_proxy_mapper_list;
void grpc_proxy_mapper_registry_init() {
memset(&g_proxy_mapper_list, 0, sizeof(g_proxy_mapper_list));
}
void grpc_proxy_mapper_registry_shutdown() {
grpc_proxy_mapper_list_destroy(&g_proxy_mapper_list);
}
void grpc_proxy_mapper_register(bool at_start, grpc_proxy_mapper* mapper) {
grpc_proxy_mapper_list_register(&g_proxy_mapper_list, at_start, mapper);
}
bool grpc_proxy_mappers_map(grpc_exec_ctx* exec_ctx,
const grpc_resolved_address* address,
const grpc_channel_args* args,
grpc_resolved_address** new_address,
grpc_channel_args** new_args) {
return grpc_proxy_mapper_list_map(exec_ctx, &g_proxy_mapper_list, address,
args, new_address, new_args);
}

@ -0,0 +1,53 @@
/*
*
* 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 GRPC_CORE_EXT_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H
#define GRPC_CORE_EXT_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H
#include "src/core/ext/client_channel/proxy_mapper.h"
void grpc_proxy_mapper_registry_init();
void grpc_proxy_mapper_registry_shutdown();
/// Registers a new proxy mapper. Takes ownership.
/// If \a at_start is true, the new mapper will be at the beginning of
/// the list. Otherwise, it will be added to the end.
void grpc_proxy_mapper_register(bool at_start, grpc_proxy_mapper* mapper);
bool grpc_proxy_mappers_map(grpc_exec_ctx* exec_ctx,
const grpc_resolved_address* address,
const grpc_channel_args* args,
grpc_resolved_address** new_address,
grpc_channel_args** new_args);
#endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_PROXY_MAPPER_REGISTRY_H */

@ -60,7 +60,9 @@ void grpc_register_resolver_type(grpc_resolver_factory *factory);
return it. return it.
If a resolver factory was not found, return NULL. If a resolver factory was not found, return NULL.
\a args is a set of channel arguments to be included in the result \a args is a set of channel arguments to be included in the result
(typically the set of arguments passed in from the client API). */ (typically the set of arguments passed in from the client API).
\a pollset_set is used to drive IO in the name resolution process, it
should not be NULL. */
grpc_resolver *grpc_resolver_create(grpc_exec_ctx *exec_ctx, const char *target, grpc_resolver *grpc_resolver_create(grpc_exec_ctx *exec_ctx, const char *target,
const grpc_channel_args *args, const grpc_channel_args *args,
grpc_pollset_set *pollset_set); grpc_pollset_set *pollset_set);

@ -38,12 +38,17 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/avl.h> #include <grpc/support/avl.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/client_channel/client_channel.h" #include "src/core/ext/client_channel/client_channel.h"
#include "src/core/ext/client_channel/initial_connect_string.h" #include "src/core/ext/client_channel/initial_connect_string.h"
#include "src/core/ext/client_channel/parse_address.h"
#include "src/core/ext/client_channel/proxy_mapper_registry.h"
#include "src/core/ext/client_channel/subchannel_index.h" #include "src/core/ext/client_channel/subchannel_index.h"
#include "src/core/ext/client_channel/uri_parser.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h" #include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/timer.h" #include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/profiling/timers.h" #include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/slice/slice_internal.h"
@ -95,8 +100,6 @@ struct grpc_subchannel {
size_t num_filters; size_t num_filters;
/** channel arguments */ /** channel arguments */
grpc_channel_args *args; grpc_channel_args *args;
/** address to connect to */
grpc_resolved_address *addr;
grpc_subchannel_key *key; grpc_subchannel_key *key;
@ -211,7 +214,6 @@ static void subchannel_destroy(grpc_exec_ctx *exec_ctx, void *arg,
grpc_subchannel *c = arg; grpc_subchannel *c = arg;
gpr_free((void *)c->filters); gpr_free((void *)c->filters);
grpc_channel_args_destroy(exec_ctx, c->args); grpc_channel_args_destroy(exec_ctx, c->args);
gpr_free(c->addr);
grpc_slice_unref_internal(exec_ctx, c->initial_connect_string); grpc_slice_unref_internal(exec_ctx, c->initial_connect_string);
grpc_connectivity_state_destroy(exec_ctx, &c->state_tracker); grpc_connectivity_state_destroy(exec_ctx, &c->state_tracker);
grpc_connector_unref(exec_ctx, c->connector); grpc_connector_unref(exec_ctx, c->connector);
@ -327,12 +329,28 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
} else { } else {
c->filters = NULL; c->filters = NULL;
} }
c->addr = gpr_malloc(sizeof(grpc_resolved_address));
if (args->addr->len)
memcpy(c->addr, args->addr, sizeof(grpc_resolved_address));
c->pollset_set = grpc_pollset_set_create(); c->pollset_set = grpc_pollset_set_create();
grpc_set_initial_connect_string(&c->addr, &c->initial_connect_string); grpc_resolved_address *addr = gpr_malloc(sizeof(*addr));
c->args = grpc_channel_args_copy(args->args); grpc_get_subchannel_address_arg(args->args, addr);
grpc_set_initial_connect_string(&addr, &c->initial_connect_string);
grpc_resolved_address *new_address = NULL;
grpc_channel_args *new_args = NULL;
if (grpc_proxy_mappers_map(exec_ctx, addr, args->args, &new_address,
&new_args)) {
GPR_ASSERT(new_address != NULL);
gpr_free(addr);
addr = new_address;
if (new_args != NULL) c->args = new_args;
}
if (c->args == NULL) {
static const char *keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS};
grpc_arg new_arg = grpc_create_subchannel_address_arg(addr);
c->args = grpc_channel_args_copy_and_add_and_remove(
args->args, keys_to_remove, GPR_ARRAY_SIZE(keys_to_remove), &new_arg,
1);
gpr_free(new_arg.value.string);
}
gpr_free(addr);
c->root_external_state_watcher.next = c->root_external_state_watcher.prev = c->root_external_state_watcher.next = c->root_external_state_watcher.prev =
&c->root_external_state_watcher; &c->root_external_state_watcher;
grpc_closure_init(&c->connected, subchannel_connected, c, grpc_closure_init(&c->connected, subchannel_connected, c,
@ -385,7 +403,6 @@ static void continue_connect_locked(grpc_exec_ctx *exec_ctx,
grpc_connect_in_args args; grpc_connect_in_args args;
args.interested_parties = c->pollset_set; args.interested_parties = c->pollset_set;
args.addr = c->addr;
args.deadline = c->next_attempt; args.deadline = c->next_attempt;
args.channel_args = c->args; args.channel_args = c->args;
args.initial_connect_string = c->initial_connect_string; args.initial_connect_string = c->initial_connect_string;
@ -771,3 +788,37 @@ grpc_call_stack *grpc_subchannel_call_get_call_stack(
grpc_subchannel_call *subchannel_call) { grpc_subchannel_call *subchannel_call) {
return SUBCHANNEL_CALL_TO_CALL_STACK(subchannel_call); return SUBCHANNEL_CALL_TO_CALL_STACK(subchannel_call);
} }
static void grpc_uri_to_sockaddr(char *uri_str, grpc_resolved_address *addr) {
grpc_uri *uri = grpc_uri_parse(uri_str, 0 /* suppress_errors */);
GPR_ASSERT(uri != NULL);
if (strcmp(uri->scheme, "ipv4") == 0) {
GPR_ASSERT(parse_ipv4(uri, addr));
} else if (strcmp(uri->scheme, "ipv6") == 0) {
GPR_ASSERT(parse_ipv6(uri, addr));
} else {
GPR_ASSERT(parse_unix(uri, addr));
}
grpc_uri_destroy(uri);
}
void grpc_get_subchannel_address_arg(const grpc_channel_args *args,
grpc_resolved_address *addr) {
const grpc_arg *addr_arg =
grpc_channel_args_find(args, GRPC_ARG_SUBCHANNEL_ADDRESS);
GPR_ASSERT(addr_arg != NULL); // Should have been set by LB policy.
GPR_ASSERT(addr_arg->type == GRPC_ARG_STRING);
memset(addr, 0, sizeof(*addr));
if (*addr_arg->value.string != '\0') {
grpc_uri_to_sockaddr(addr_arg->value.string, addr);
}
}
grpc_arg grpc_create_subchannel_address_arg(const grpc_resolved_address *addr) {
grpc_arg new_arg;
new_arg.key = GRPC_ARG_SUBCHANNEL_ADDRESS;
new_arg.type = GRPC_ARG_STRING;
new_arg.value.string =
addr->len > 0 ? grpc_sockaddr_to_uri(addr) : gpr_strdup("");
return new_arg;
}

@ -40,6 +40,9 @@
#include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/metadata.h" #include "src/core/lib/transport/metadata.h"
// Channel arg containing a grpc_resolved_address to connect to.
#define GRPC_ARG_SUBCHANNEL_ADDRESS "grpc.subchannel_address"
/** A (sub-)channel that knows how to connect to exactly one target /** A (sub-)channel that knows how to connect to exactly one target
address. Provides a target for load balancing. */ address. Provides a target for load balancing. */
typedef struct grpc_subchannel grpc_subchannel; typedef struct grpc_subchannel grpc_subchannel;
@ -164,8 +167,6 @@ struct grpc_subchannel_args {
size_t filter_count; size_t filter_count;
/** Channel arguments to be supplied to the newly created channel */ /** Channel arguments to be supplied to the newly created channel */
const grpc_channel_args *args; const grpc_channel_args *args;
/** Address to connect to */
grpc_resolved_address *addr;
}; };
/** create a subchannel given a connector */ /** create a subchannel given a connector */
@ -173,4 +174,12 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
grpc_connector *connector, grpc_connector *connector,
const grpc_subchannel_args *args); const grpc_subchannel_args *args);
/// Sets \a addr from \a args.
void grpc_get_subchannel_address_arg(const grpc_channel_args *args,
grpc_resolved_address *addr);
/// Returns a new channel arg encoding the subchannel address as a string.
/// Caller is responsible for freeing the string.
grpc_arg grpc_create_subchannel_address_arg(const grpc_resolved_address *addr);
#endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_H */ #endif /* GRPC_CORE_EXT_CLIENT_CHANNEL_SUBCHANNEL_H */

@ -86,11 +86,6 @@ static grpc_subchannel_key *create_key(
} else { } else {
k->args.filters = NULL; k->args.filters = NULL;
} }
k->args.addr = gpr_malloc(sizeof(grpc_resolved_address));
k->args.addr->len = args->addr->len;
if (k->args.addr->len > 0) {
memcpy(k->args.addr, args->addr, sizeof(grpc_resolved_address));
}
k->args.args = copy_channel_args(args->args); k->args.args = copy_channel_args(args->args);
return k; return k;
} }
@ -108,14 +103,8 @@ static int subchannel_key_compare(grpc_subchannel_key *a,
grpc_subchannel_key *b) { grpc_subchannel_key *b) {
int c = GPR_ICMP(a->connector, b->connector); int c = GPR_ICMP(a->connector, b->connector);
if (c != 0) return c; if (c != 0) return c;
c = GPR_ICMP(a->args.addr->len, b->args.addr->len);
if (c != 0) return c;
c = GPR_ICMP(a->args.filter_count, b->args.filter_count); c = GPR_ICMP(a->args.filter_count, b->args.filter_count);
if (c != 0) return c; if (c != 0) return c;
if (a->args.addr->len) {
c = memcmp(a->args.addr->addr, b->args.addr->addr, a->args.addr->len);
if (c != 0) return c;
}
if (a->args.filter_count > 0) { if (a->args.filter_count > 0) {
c = memcmp(a->args.filters, b->args.filters, c = memcmp(a->args.filters, b->args.filters,
a->args.filter_count * sizeof(*a->args.filters)); a->args.filter_count * sizeof(*a->args.filters));
@ -129,7 +118,6 @@ void grpc_subchannel_key_destroy(grpc_exec_ctx *exec_ctx,
grpc_connector_unref(exec_ctx, k->connector); grpc_connector_unref(exec_ctx, k->connector);
gpr_free((grpc_channel_args *)k->args.filters); gpr_free((grpc_channel_args *)k->args.filters);
grpc_channel_args_destroy(exec_ctx, (grpc_channel_args *)k->args.args); grpc_channel_args_destroy(exec_ctx, (grpc_channel_args *)k->args.args);
gpr_free(k->args.addr);
gpr_free(k); gpr_free(k);
} }

@ -1178,14 +1178,15 @@ static void query_for_backends_locked(grpc_exec_ctx *exec_ctx,
op++; op++;
op->op = GRPC_OP_RECV_INITIAL_METADATA; op->op = GRPC_OP_RECV_INITIAL_METADATA;
op->data.recv_initial_metadata = &glb_policy->lb_initial_metadata_recv; op->data.recv_initial_metadata.recv_initial_metadata =
&glb_policy->lb_initial_metadata_recv;
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
op++; op++;
GPR_ASSERT(glb_policy->lb_request_payload != NULL); GPR_ASSERT(glb_policy->lb_request_payload != NULL);
op->op = GRPC_OP_SEND_MESSAGE; op->op = GRPC_OP_SEND_MESSAGE;
op->data.send_message = glb_policy->lb_request_payload; op->data.send_message.send_message = glb_policy->lb_request_payload;
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
op++; op++;
@ -1211,7 +1212,7 @@ static void query_for_backends_locked(grpc_exec_ctx *exec_ctx,
op = ops; op = ops;
op->op = GRPC_OP_RECV_MESSAGE; op->op = GRPC_OP_RECV_MESSAGE;
op->data.recv_message = &glb_policy->lb_response_payload; op->data.recv_message.recv_message = &glb_policy->lb_response_payload;
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
op++; op++;
@ -1293,7 +1294,7 @@ static void lb_on_response_received(grpc_exec_ctx *exec_ctx, void *arg,
if (!glb_policy->shutting_down) { if (!glb_policy->shutting_down) {
/* keep listening for serverlist updates */ /* keep listening for serverlist updates */
op->op = GRPC_OP_RECV_MESSAGE; op->op = GRPC_OP_RECV_MESSAGE;
op->data.recv_message = &glb_policy->lb_response_payload; op->data.recv_message.recv_message = &glb_policy->lb_response_payload;
op->flags = 0; op->flags = 0;
op->reserved = NULL; op->reserved = NULL;
op++; op++;

@ -36,7 +36,9 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include "src/core/ext/client_channel/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/ext/client_channel/subchannel.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/connectivity_state.h"
typedef struct pending_pick { typedef struct pending_pick {
@ -466,11 +468,15 @@ static grpc_lb_policy *create_pick_first(grpc_exec_ctx *exec_ctx,
} }
memset(&sc_args, 0, sizeof(grpc_subchannel_args)); memset(&sc_args, 0, sizeof(grpc_subchannel_args));
sc_args.addr = &addresses->addresses[i].address; grpc_arg addr_arg =
sc_args.args = args->args; grpc_create_subchannel_address_arg(&addresses->addresses[i].address);
grpc_channel_args *new_args =
grpc_channel_args_copy_and_add(args->args, &addr_arg, 1);
gpr_free(addr_arg.value.string);
sc_args.args = new_args;
grpc_subchannel *subchannel = grpc_client_channel_factory_create_subchannel( grpc_subchannel *subchannel = grpc_client_channel_factory_create_subchannel(
exec_ctx, args->client_channel_factory, &sc_args); exec_ctx, args->client_channel_factory, &sc_args);
grpc_channel_args_destroy(exec_ctx, new_args);
if (subchannel != NULL) { if (subchannel != NULL) {
p->subchannels[subchannel_idx++] = subchannel; p->subchannels[subchannel_idx++] = subchannel;

@ -64,8 +64,10 @@
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include "src/core/ext/client_channel/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/ext/client_channel/subchannel.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h" #include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/static_metadata.h" #include "src/core/lib/transport/static_metadata.h"
@ -729,11 +731,15 @@ static grpc_lb_policy *round_robin_create(grpc_exec_ctx *exec_ctx,
if (addresses->addresses[i].is_balancer) continue; if (addresses->addresses[i].is_balancer) continue;
memset(&sc_args, 0, sizeof(grpc_subchannel_args)); memset(&sc_args, 0, sizeof(grpc_subchannel_args));
sc_args.addr = &addresses->addresses[i].address; grpc_arg addr_arg =
sc_args.args = args->args; grpc_create_subchannel_address_arg(&addresses->addresses[i].address);
grpc_channel_args *new_args =
grpc_channel_args_copy_and_add(args->args, &addr_arg, 1);
gpr_free(addr_arg.value.string);
sc_args.args = new_args;
grpc_subchannel *subchannel = grpc_client_channel_factory_create_subchannel( grpc_subchannel *subchannel = grpc_client_channel_factory_create_subchannel(
exec_ctx, args->client_channel_factory, &sc_args); exec_ctx, args->client_channel_factory, &sc_args);
grpc_channel_args_destroy(exec_ctx, new_args);
if (subchannel != NULL) { if (subchannel != NULL) {
subchannel_data *sd = gpr_malloc(sizeof(*sd)); subchannel_data *sd = gpr_malloc(sizeof(*sd));

@ -37,7 +37,6 @@
#include <grpc/support/host_port.h> #include <grpc/support/host_port.h>
#include <grpc/support/string_util.h> #include <grpc/support/string_util.h>
#include "src/core/ext/client_channel/http_connect_handshaker.h"
#include "src/core/ext/client_channel/lb_policy_registry.h" #include "src/core/ext/client_channel/lb_policy_registry.h"
#include "src/core/ext/client_channel/resolver_registry.h" #include "src/core/ext/client_channel/resolver_registry.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
@ -189,7 +188,7 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg,
gpr_timespec next_try = gpr_backoff_step(&r->backoff_state, now); gpr_timespec next_try = gpr_backoff_step(&r->backoff_state, now);
gpr_timespec timeout = gpr_time_sub(next_try, now); gpr_timespec timeout = gpr_time_sub(next_try, now);
const char *msg = grpc_error_string(error); const char *msg = grpc_error_string(error);
gpr_log(GPR_DEBUG, "dns resolution failed: %s", msg); gpr_log(GPR_INFO, "dns resolution failed (will retry): %s", msg);
grpc_error_free_string(msg); grpc_error_free_string(msg);
GPR_ASSERT(!r->have_retry_timer); GPR_ASSERT(!r->have_retry_timer);
r->have_retry_timer = true; r->have_retry_timer = true;
@ -261,16 +260,14 @@ static grpc_resolver *dns_create(grpc_exec_ctx *exec_ctx,
return NULL; return NULL;
} }
// Get name from args. // Get name from args.
const char *path = args->uri->path; char *path = args->uri->path;
if (path[0] == '/') ++path; if (path[0] == '/') ++path;
// Get proxy name, if any.
char *proxy_name = grpc_get_http_proxy_server();
// Create resolver. // Create resolver.
dns_resolver *r = gpr_malloc(sizeof(dns_resolver)); dns_resolver *r = gpr_malloc(sizeof(dns_resolver));
memset(r, 0, sizeof(*r)); memset(r, 0, sizeof(*r));
gpr_mu_init(&r->mu); gpr_mu_init(&r->mu);
grpc_resolver_init(&r->base, &dns_resolver_vtable); grpc_resolver_init(&r->base, &dns_resolver_vtable);
r->name_to_resolve = proxy_name == NULL ? gpr_strdup(path) : proxy_name; r->name_to_resolve = gpr_strdup(path);
r->default_port = gpr_strdup(default_port); r->default_port = gpr_strdup(default_port);
r->channel_args = grpc_channel_args_copy(args->args); r->channel_args = grpc_channel_args_copy(args->args);
r->interested_parties = grpc_pollset_set_create(); r->interested_parties = grpc_pollset_set_create();

@ -43,6 +43,7 @@
#include "src/core/ext/client_channel/connector.h" #include "src/core/ext/client_channel/connector.h"
#include "src/core/ext/client_channel/http_connect_handshaker.h" #include "src/core/ext/client_channel/http_connect_handshaker.h"
#include "src/core/ext/client_channel/subchannel.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/handshaker.h" #include "src/core/lib/channel/handshaker.h"
@ -220,6 +221,8 @@ static void chttp2_connector_connect(grpc_exec_ctx *exec_ctx,
grpc_connect_out_args *result, grpc_connect_out_args *result,
grpc_closure *notify) { grpc_closure *notify) {
chttp2_connector *c = (chttp2_connector *)con; chttp2_connector *c = (chttp2_connector *)con;
grpc_resolved_address addr;
grpc_get_subchannel_address_arg(args->channel_args, &addr);
gpr_mu_lock(&c->mu); gpr_mu_lock(&c->mu);
GPR_ASSERT(c->notify == NULL); GPR_ASSERT(c->notify == NULL);
c->notify = notify; c->notify = notify;
@ -231,8 +234,8 @@ static void chttp2_connector_connect(grpc_exec_ctx *exec_ctx,
GPR_ASSERT(!c->connecting); GPR_ASSERT(!c->connecting);
c->connecting = true; c->connecting = true;
grpc_tcp_client_connect(exec_ctx, &c->connected, &c->endpoint, grpc_tcp_client_connect(exec_ctx, &c->connected, &c->endpoint,
args->interested_parties, args->channel_args, args->interested_parties, args->channel_args, &addr,
args->addr, args->deadline); args->deadline);
gpr_mu_unlock(&c->mu); gpr_mu_unlock(&c->mu);
} }

@ -62,7 +62,7 @@
#define DEFAULT_WINDOW 65535 #define DEFAULT_WINDOW 65535
#define DEFAULT_CONNECTION_WINDOW_TARGET (1024 * 1024) #define DEFAULT_CONNECTION_WINDOW_TARGET (1024 * 1024)
#define MAX_WINDOW 0x7fffffffu #define MAX_WINDOW 0x7fffffffu
#define MAX_WRITE_BUFFER_SIZE (64 * 1024 * 1024)
#define DEFAULT_MAX_HEADER_LIST_SIZE (16 * 1024) #define DEFAULT_MAX_HEADER_LIST_SIZE (16 * 1024)
#define MAX_CLIENT_STREAM_ID 0x7fffffffu #define MAX_CLIENT_STREAM_ID 0x7fffffffu
@ -271,6 +271,7 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
window -- this should by rights be 0 */ window -- this should by rights be 0 */
t->force_send_settings = 1 << GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE; t->force_send_settings = 1 << GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
t->sent_local_settings = 0; t->sent_local_settings = 0;
t->write_buffer_size = DEFAULT_WINDOW;
if (is_client) { if (is_client) {
grpc_slice_buffer_add(&t->outbuf, grpc_slice_from_copied_string( grpc_slice_buffer_add(&t->outbuf, grpc_slice_from_copied_string(
@ -321,6 +322,11 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
grpc_chttp2_hpack_compressor_set_max_usable_size(&t->hpack_compressor, grpc_chttp2_hpack_compressor_set_max_usable_size(&t->hpack_compressor,
(uint32_t)value); (uint32_t)value);
} }
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE)) {
t->write_buffer_size = (uint32_t)grpc_channel_arg_get_integer(
&channel_args->args[i],
(grpc_integer_options){0, 0, MAX_WRITE_BUFFER_SIZE});
} else { } else {
static const struct { static const struct {
const char *channel_arg_name; const char *channel_arg_name;
@ -899,15 +905,22 @@ static bool contains_non_ok_status(grpc_metadata_batch *batch) {
return false; return false;
} }
static void maybe_become_writable_due_to_send_msg(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t,
grpc_chttp2_stream *s) {
if (s->id != 0 && (!s->write_buffering ||
s->flow_controlled_buffer.length > t->write_buffer_size)) {
grpc_chttp2_become_writable(exec_ctx, t, s, true, "op.send_message");
}
}
static void add_fetched_slice_locked(grpc_exec_ctx *exec_ctx, static void add_fetched_slice_locked(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t, grpc_chttp2_transport *t,
grpc_chttp2_stream *s) { grpc_chttp2_stream *s) {
s->fetched_send_message_length += s->fetched_send_message_length +=
(uint32_t)GRPC_SLICE_LENGTH(s->fetching_slice); (uint32_t)GRPC_SLICE_LENGTH(s->fetching_slice);
grpc_slice_buffer_add(&s->flow_controlled_buffer, s->fetching_slice); grpc_slice_buffer_add(&s->flow_controlled_buffer, s->fetching_slice);
if (s->id != 0) { maybe_become_writable_due_to_send_msg(exec_ctx, t, s);
grpc_chttp2_become_writable(exec_ctx, t, s, true, "op.send_message");
}
} }
static void continue_fetching_send_locked(grpc_exec_ctx *exec_ctx, static void continue_fetching_send_locked(grpc_exec_ctx *exec_ctx,
@ -1100,14 +1113,13 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, void *stream_op,
(int64_t)len; (int64_t)len;
s->complete_fetch_covered_by_poller = op->covered_by_poller; s->complete_fetch_covered_by_poller = op->covered_by_poller;
if (flags & GRPC_WRITE_BUFFER_HINT) { if (flags & GRPC_WRITE_BUFFER_HINT) {
/* allow up to 64kb to be buffered */ s->next_message_end_offset -= t->write_buffer_size;
/* TODO(ctiller): make this configurable */ s->write_buffering = true;
s->next_message_end_offset -= 65536; } else {
s->write_buffering = false;
} }
continue_fetching_send_locked(exec_ctx, t, s); continue_fetching_send_locked(exec_ctx, t, s);
if (s->id != 0) { maybe_become_writable_due_to_send_msg(exec_ctx, t, s);
grpc_chttp2_become_writable(exec_ctx, t, s, true, "op.send_message");
}
} }
} }
@ -1116,6 +1128,7 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, void *stream_op,
on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE; on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
s->send_trailing_metadata_finished = add_closure_barrier(on_complete); s->send_trailing_metadata_finished = add_closure_barrier(on_complete);
s->send_trailing_metadata = op->send_trailing_metadata; s->send_trailing_metadata = op->send_trailing_metadata;
s->write_buffering = false;
const size_t metadata_size = const size_t metadata_size =
grpc_metadata_batch_size(op->send_trailing_metadata); grpc_metadata_batch_size(op->send_trailing_metadata);
const size_t metadata_peer_limit = const size_t metadata_peer_limit =

@ -109,7 +109,7 @@ grpc_error *grpc_chttp2_rst_stream_parser_parse(grpc_exec_ctx *exec_ctx,
(((uint32_t)p->reason_bytes[2]) << 8) | (((uint32_t)p->reason_bytes[2]) << 8) |
(((uint32_t)p->reason_bytes[3])); (((uint32_t)p->reason_bytes[3]));
grpc_error *error = GRPC_ERROR_NONE; grpc_error *error = GRPC_ERROR_NONE;
if (reason != GRPC_CHTTP2_NO_ERROR) { if (reason != GRPC_CHTTP2_NO_ERROR || s->header_frames_received < 2) {
error = grpc_error_set_int(GRPC_ERROR_CREATE("RST_STREAM"), error = grpc_error_set_int(GRPC_ERROR_CREATE("RST_STREAM"),
GRPC_ERROR_INT_HTTP2_ERROR, (intptr_t)reason); GRPC_ERROR_INT_HTTP2_ERROR, (intptr_t)reason);
grpc_status_code status_code = grpc_chttp2_http2_error_to_grpc_status( grpc_status_code status_code = grpc_chttp2_http2_error_to_grpc_status(

@ -249,6 +249,9 @@ struct grpc_chttp2_transport {
int64_t announce_incoming_window; int64_t announce_incoming_window;
/** how much window would we like to have for incoming_window */ /** how much window would we like to have for incoming_window */
uint32_t connection_window_target; uint32_t connection_window_target;
/** how much data are we willing to buffer when the WRITE_BUFFER_HINT is set?
*/
uint32_t write_buffer_size;
/** have we seen a goaway */ /** have we seen a goaway */
uint8_t seen_goaway; uint8_t seen_goaway;
@ -403,6 +406,9 @@ struct grpc_chttp2_stream {
/** Has this stream seen an error. /** Has this stream seen an error.
If true, then pending incoming frames can be thrown away. */ If true, then pending incoming frames can be thrown away. */
bool seen_error; bool seen_error;
/** Are we buffering writes on this stream? If yes, we won't become writable
until there's enough queued up in the flow_controlled_buffer */
bool write_buffering;
/** the error that resulted in this stream being read-closed */ /** the error that resulted in this stream being read-closed */
grpc_error *read_closed_error; grpc_error *read_closed_error;

@ -74,6 +74,15 @@ static void update_list(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
GRPC_ERROR_UNREF(error); GRPC_ERROR_UNREF(error);
} }
static bool stream_ref_if_not_destroyed(gpr_refcount *r) {
gpr_atm count;
do {
count = gpr_atm_acq_load(&r->count);
if (count == 0) return false;
} while (!gpr_atm_rel_cas(&r->count, count, count + 1));
return true;
}
bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport *t) { grpc_chttp2_transport *t) {
grpc_chttp2_stream *s; grpc_chttp2_stream *s;
@ -101,10 +110,13 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx,
if (t->outgoing_window > 0) { if (t->outgoing_window > 0) {
while (grpc_chttp2_list_pop_stalled_by_transport(t, &s)) { while (grpc_chttp2_list_pop_stalled_by_transport(t, &s)) {
grpc_chttp2_become_writable(exec_ctx, t, s, false, if (!t->closed && grpc_chttp2_list_add_writable_stream(t, s) &&
stream_ref_if_not_destroyed(&s->refcount->refs)) {
grpc_chttp2_initiate_write(exec_ctx, t, false,
"transport.read_flow_control"); "transport.read_flow_control");
} }
} }
}
/* for each grpc_chttp2_stream that's become writable, frame it's data /* for each grpc_chttp2_stream that's become writable, frame it's data
(according to available window sizes) and add to the output buffer */ (according to available window sizes) and add to the output buffer */

@ -60,7 +60,7 @@ GRPCAPI grpc_channel *grpc_cronet_secure_channel_create(
ct->host = gpr_malloc(strlen(target) + 1); ct->host = gpr_malloc(strlen(target) + 1);
strcpy(ct->host, target); strcpy(ct->host, target);
gpr_log(GPR_DEBUG, gpr_log(GPR_DEBUG,
"grpc_create_cronet_transport: cronet_engine = %p, target=%s", engine, "grpc_create_cronet_transport: stream_engine = %p, target=%s", engine,
ct->host); ct->host);
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;

@ -38,48 +38,46 @@ library, so we can build it in all environments */
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "third_party/objective_c/Cronet/cronet_c_for_grpc.h" #include "third_party/Cronet/bidirectional_stream_c.h"
#ifdef GRPC_COMPILE_WITH_CRONET #ifdef GRPC_COMPILE_WITH_CRONET
/* link with the real CRONET library in the build system */ /* link with the real CRONET library in the build system */
#else #else
/* Dummy implementation of cronet API just to test for build-ability */ /* Dummy implementation of cronet API just to test for build-ability */
cronet_bidirectional_stream* cronet_bidirectional_stream_create( bidirectional_stream* bidirectional_stream_create(
cronet_engine* engine, void* annotation, stream_engine* engine, void* annotation,
cronet_bidirectional_stream_callback* callback) { bidirectional_stream_callback* callback) {
GPR_ASSERT(0); GPR_ASSERT(0);
return NULL; return NULL;
} }
int cronet_bidirectional_stream_destroy(cronet_bidirectional_stream* stream) { int bidirectional_stream_destroy(bidirectional_stream* stream) {
GPR_ASSERT(0); GPR_ASSERT(0);
return 0; return 0;
} }
int cronet_bidirectional_stream_start( int bidirectional_stream_start(bidirectional_stream* stream, const char* url,
cronet_bidirectional_stream* stream, const char* url, int priority, int priority, const char* method,
const char* method, const cronet_bidirectional_stream_header_array* headers, const bidirectional_stream_header_array* headers,
bool end_of_stream) { bool end_of_stream) {
GPR_ASSERT(0); GPR_ASSERT(0);
return 0; return 0;
} }
int cronet_bidirectional_stream_read(cronet_bidirectional_stream* stream, int bidirectional_stream_read(bidirectional_stream* stream, char* buffer,
char* buffer, int capacity) { int capacity) {
GPR_ASSERT(0); GPR_ASSERT(0);
return 0; return 0;
} }
int cronet_bidirectional_stream_write(cronet_bidirectional_stream* stream, int bidirectional_stream_write(bidirectional_stream* stream, const char* buffer,
const char* buffer, int count, int count, bool end_of_stream) {
bool end_of_stream) {
GPR_ASSERT(0); GPR_ASSERT(0);
return 0; return 0;
} }
int cronet_bidirectional_stream_cancel(cronet_bidirectional_stream* stream) { void bidirectional_stream_cancel(bidirectional_stream* stream) {
GPR_ASSERT(0); GPR_ASSERT(0);
return 0;
} }
#endif /* GRPC_COMPILE_WITH_CRONET */ #endif /* GRPC_COMPILE_WITH_CRONET */

@ -49,7 +49,7 @@
#include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/static_metadata.h" #include "src/core/lib/transport/static_metadata.h"
#include "src/core/lib/transport/transport_impl.h" #include "src/core/lib/transport/transport_impl.h"
#include "third_party/objective_c/Cronet/cronet_c_for_grpc.h" #include "third_party/Cronet/bidirectional_stream_c.h"
#define GRPC_HEADER_SIZE_IN_BYTES 5 #define GRPC_HEADER_SIZE_IN_BYTES 5
@ -86,19 +86,18 @@ enum e_op_id {
/* Cronet callbacks. See cronet_c_for_grpc.h for documentation for each. */ /* Cronet callbacks. See cronet_c_for_grpc.h for documentation for each. */
static void on_request_headers_sent(cronet_bidirectional_stream *); static void on_request_headers_sent(bidirectional_stream *);
static void on_response_headers_received( static void on_response_headers_received(
cronet_bidirectional_stream *, bidirectional_stream *, const bidirectional_stream_header_array *,
const cronet_bidirectional_stream_header_array *, const char *); const char *);
static void on_write_completed(cronet_bidirectional_stream *, const char *); static void on_write_completed(bidirectional_stream *, const char *);
static void on_read_completed(cronet_bidirectional_stream *, char *, int); static void on_read_completed(bidirectional_stream *, char *, int);
static void on_response_trailers_received( static void on_response_trailers_received(
cronet_bidirectional_stream *, bidirectional_stream *, const bidirectional_stream_header_array *);
const cronet_bidirectional_stream_header_array *); static void on_succeeded(bidirectional_stream *);
static void on_succeeded(cronet_bidirectional_stream *); static void on_failed(bidirectional_stream *, int);
static void on_failed(cronet_bidirectional_stream *, int); static void on_canceled(bidirectional_stream *);
static void on_canceled(cronet_bidirectional_stream *); static bidirectional_stream_callback cronet_callbacks = {
static cronet_bidirectional_stream_callback cronet_callbacks = {
on_request_headers_sent, on_request_headers_sent,
on_response_headers_received, on_response_headers_received,
on_read_completed, on_read_completed,
@ -111,7 +110,7 @@ static cronet_bidirectional_stream_callback cronet_callbacks = {
/* Cronet transport object */ /* Cronet transport object */
struct grpc_cronet_transport { struct grpc_cronet_transport {
grpc_transport base; /* must be first element in this structure */ grpc_transport base; /* must be first element in this structure */
cronet_engine *engine; stream_engine *engine;
char *host; char *host;
}; };
typedef struct grpc_cronet_transport grpc_cronet_transport; typedef struct grpc_cronet_transport grpc_cronet_transport;
@ -176,8 +175,8 @@ struct stream_obj {
grpc_transport_stream_op *curr_op; grpc_transport_stream_op *curr_op;
grpc_cronet_transport curr_ct; grpc_cronet_transport curr_ct;
grpc_stream *curr_gs; grpc_stream *curr_gs;
cronet_bidirectional_stream *cbs; bidirectional_stream *cbs;
cronet_bidirectional_stream_header_array header_array; bidirectional_stream_header_array header_array;
/* Stream level state. Some state will be tracked both at stream and stream_op /* Stream level state. Some state will be tracked both at stream and stream_op
* level */ * level */
@ -344,11 +343,11 @@ static void execute_from_storage(stream_obj *s) {
/* /*
Cronet callback Cronet callback
*/ */
static void on_failed(cronet_bidirectional_stream *stream, int net_error) { static void on_failed(bidirectional_stream *stream, int net_error) {
CRONET_LOG(GPR_DEBUG, "on_failed(%p, %d)", stream, net_error); CRONET_LOG(GPR_DEBUG, "on_failed(%p, %d)", stream, net_error);
stream_obj *s = (stream_obj *)stream->annotation; stream_obj *s = (stream_obj *)stream->annotation;
gpr_mu_lock(&s->mu); gpr_mu_lock(&s->mu);
cronet_bidirectional_stream_destroy(s->cbs); bidirectional_stream_destroy(s->cbs);
s->state.state_callback_received[OP_FAILED] = true; s->state.state_callback_received[OP_FAILED] = true;
s->cbs = NULL; s->cbs = NULL;
if (s->header_array.headers) { if (s->header_array.headers) {
@ -367,11 +366,11 @@ static void on_failed(cronet_bidirectional_stream *stream, int net_error) {
/* /*
Cronet callback Cronet callback
*/ */
static void on_canceled(cronet_bidirectional_stream *stream) { static void on_canceled(bidirectional_stream *stream) {
CRONET_LOG(GPR_DEBUG, "on_canceled(%p)", stream); CRONET_LOG(GPR_DEBUG, "on_canceled(%p)", stream);
stream_obj *s = (stream_obj *)stream->annotation; stream_obj *s = (stream_obj *)stream->annotation;
gpr_mu_lock(&s->mu); gpr_mu_lock(&s->mu);
cronet_bidirectional_stream_destroy(s->cbs); bidirectional_stream_destroy(s->cbs);
s->state.state_callback_received[OP_CANCELED] = true; s->state.state_callback_received[OP_CANCELED] = true;
s->cbs = NULL; s->cbs = NULL;
if (s->header_array.headers) { if (s->header_array.headers) {
@ -390,11 +389,11 @@ static void on_canceled(cronet_bidirectional_stream *stream) {
/* /*
Cronet callback Cronet callback
*/ */
static void on_succeeded(cronet_bidirectional_stream *stream) { static void on_succeeded(bidirectional_stream *stream) {
CRONET_LOG(GPR_DEBUG, "on_succeeded(%p)", stream); CRONET_LOG(GPR_DEBUG, "on_succeeded(%p)", stream);
stream_obj *s = (stream_obj *)stream->annotation; stream_obj *s = (stream_obj *)stream->annotation;
gpr_mu_lock(&s->mu); gpr_mu_lock(&s->mu);
cronet_bidirectional_stream_destroy(s->cbs); bidirectional_stream_destroy(s->cbs);
s->state.state_callback_received[OP_SUCCEEDED] = true; s->state.state_callback_received[OP_SUCCEEDED] = true;
s->cbs = NULL; s->cbs = NULL;
free_read_buffer(s); free_read_buffer(s);
@ -405,7 +404,7 @@ static void on_succeeded(cronet_bidirectional_stream *stream) {
/* /*
Cronet callback Cronet callback
*/ */
static void on_request_headers_sent(cronet_bidirectional_stream *stream) { static void on_request_headers_sent(bidirectional_stream *stream) {
CRONET_LOG(GPR_DEBUG, "W: on_request_headers_sent(%p)", stream); CRONET_LOG(GPR_DEBUG, "W: on_request_headers_sent(%p)", stream);
stream_obj *s = (stream_obj *)stream->annotation; stream_obj *s = (stream_obj *)stream->annotation;
gpr_mu_lock(&s->mu); gpr_mu_lock(&s->mu);
@ -424,8 +423,8 @@ static void on_request_headers_sent(cronet_bidirectional_stream *stream) {
Cronet callback Cronet callback
*/ */
static void on_response_headers_received( static void on_response_headers_received(
cronet_bidirectional_stream *stream, bidirectional_stream *stream,
const cronet_bidirectional_stream_header_array *headers, const bidirectional_stream_header_array *headers,
const char *negotiated_protocol) { const char *negotiated_protocol) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
CRONET_LOG(GPR_DEBUG, "R: on_response_headers_received(%p, %p, %s)", stream, CRONET_LOG(GPR_DEBUG, "R: on_response_headers_received(%p, %p, %s)", stream,
@ -451,8 +450,8 @@ static void on_response_headers_received(
s->state.rs.read_buffer = s->state.rs.grpc_header_bytes; s->state.rs.read_buffer = s->state.rs.grpc_header_bytes;
s->state.rs.received_bytes = 0; s->state.rs.received_bytes = 0;
s->state.rs.remaining_bytes = GRPC_HEADER_SIZE_IN_BYTES; s->state.rs.remaining_bytes = GRPC_HEADER_SIZE_IN_BYTES;
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_read(%p)", s->cbs); CRONET_LOG(GPR_DEBUG, "bidirectional_stream_read(%p)", s->cbs);
cronet_bidirectional_stream_read(s->cbs, s->state.rs.read_buffer, bidirectional_stream_read(s->cbs, s->state.rs.read_buffer,
s->state.rs.remaining_bytes); s->state.rs.remaining_bytes);
} }
gpr_mu_unlock(&s->mu); gpr_mu_unlock(&s->mu);
@ -463,8 +462,7 @@ static void on_response_headers_received(
/* /*
Cronet callback Cronet callback
*/ */
static void on_write_completed(cronet_bidirectional_stream *stream, static void on_write_completed(bidirectional_stream *stream, const char *data) {
const char *data) {
stream_obj *s = (stream_obj *)stream->annotation; stream_obj *s = (stream_obj *)stream->annotation;
CRONET_LOG(GPR_DEBUG, "W: on_write_completed(%p, %s)", stream, data); CRONET_LOG(GPR_DEBUG, "W: on_write_completed(%p, %s)", stream, data);
gpr_mu_lock(&s->mu); gpr_mu_lock(&s->mu);
@ -480,7 +478,7 @@ static void on_write_completed(cronet_bidirectional_stream *stream,
/* /*
Cronet callback Cronet callback
*/ */
static void on_read_completed(cronet_bidirectional_stream *stream, char *data, static void on_read_completed(bidirectional_stream *stream, char *data,
int count) { int count) {
stream_obj *s = (stream_obj *)stream->annotation; stream_obj *s = (stream_obj *)stream->annotation;
CRONET_LOG(GPR_DEBUG, "R: on_read_completed(%p, %p, %d)", stream, data, CRONET_LOG(GPR_DEBUG, "R: on_read_completed(%p, %p, %d)", stream, data,
@ -488,16 +486,16 @@ static void on_read_completed(cronet_bidirectional_stream *stream, char *data,
gpr_mu_lock(&s->mu); gpr_mu_lock(&s->mu);
s->state.state_callback_received[OP_RECV_MESSAGE] = true; s->state.state_callback_received[OP_RECV_MESSAGE] = true;
if (count > 0 && s->state.flush_read) { if (count > 0 && s->state.flush_read) {
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_read(%p)", s->cbs); CRONET_LOG(GPR_DEBUG, "bidirectional_stream_read(%p)", s->cbs);
cronet_bidirectional_stream_read(s->cbs, s->state.rs.read_buffer, 4096); bidirectional_stream_read(s->cbs, s->state.rs.read_buffer, 4096);
gpr_mu_unlock(&s->mu); gpr_mu_unlock(&s->mu);
} else if (count > 0) { } else if (count > 0) {
s->state.rs.received_bytes += count; s->state.rs.received_bytes += count;
s->state.rs.remaining_bytes -= count; s->state.rs.remaining_bytes -= count;
if (s->state.rs.remaining_bytes > 0) { if (s->state.rs.remaining_bytes > 0) {
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_read(%p)", s->cbs); CRONET_LOG(GPR_DEBUG, "bidirectional_stream_read(%p)", s->cbs);
s->state.state_op_done[OP_READ_REQ_MADE] = true; s->state.state_op_done[OP_READ_REQ_MADE] = true;
cronet_bidirectional_stream_read( bidirectional_stream_read(
s->cbs, s->state.rs.read_buffer + s->state.rs.received_bytes, s->cbs, s->state.rs.read_buffer + s->state.rs.received_bytes,
s->state.rs.remaining_bytes); s->state.rs.remaining_bytes);
gpr_mu_unlock(&s->mu); gpr_mu_unlock(&s->mu);
@ -520,8 +518,8 @@ static void on_read_completed(cronet_bidirectional_stream *stream, char *data,
Cronet callback Cronet callback
*/ */
static void on_response_trailers_received( static void on_response_trailers_received(
cronet_bidirectional_stream *stream, bidirectional_stream *stream,
const cronet_bidirectional_stream_header_array *trailers) { const bidirectional_stream_header_array *trailers) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
CRONET_LOG(GPR_DEBUG, "R: on_response_trailers_received(%p,%p)", stream, CRONET_LOG(GPR_DEBUG, "R: on_response_trailers_received(%p,%p)", stream,
trailers); trailers);
@ -551,9 +549,9 @@ static void on_response_trailers_received(
if (!s->state.state_op_done[OP_SEND_TRAILING_METADATA] && if (!s->state.state_op_done[OP_SEND_TRAILING_METADATA] &&
!(s->state.state_op_done[OP_CANCEL_ERROR] || !(s->state.state_op_done[OP_CANCEL_ERROR] ||
s->state.state_callback_received[OP_FAILED])) { s->state.state_callback_received[OP_FAILED])) {
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_write (%p, 0)", s->cbs); CRONET_LOG(GPR_DEBUG, "bidirectional_stream_write (%p, 0)", s->cbs);
s->state.state_callback_received[OP_SEND_MESSAGE] = false; s->state.state_callback_received[OP_SEND_MESSAGE] = false;
cronet_bidirectional_stream_write(s->cbs, "", 0, true); bidirectional_stream_write(s->cbs, "", 0, true);
s->state.state_op_done[OP_SEND_TRAILING_METADATA] = true; s->state.state_op_done[OP_SEND_TRAILING_METADATA] = true;
gpr_mu_unlock(&s->mu); gpr_mu_unlock(&s->mu);
@ -594,7 +592,7 @@ static void create_grpc_frame(grpc_slice_buffer *write_slice_buffer,
*/ */
static void convert_metadata_to_cronet_headers( static void convert_metadata_to_cronet_headers(
grpc_linked_mdelem *head, const char *host, char **pp_url, grpc_linked_mdelem *head, const char *host, char **pp_url,
cronet_bidirectional_stream_header **pp_headers, size_t *p_num_headers, bidirectional_stream_header **pp_headers, size_t *p_num_headers,
const char **method) { const char **method) {
grpc_linked_mdelem *curr = head; grpc_linked_mdelem *curr = head;
/* Walk the linked list and get number of header fields */ /* Walk the linked list and get number of header fields */
@ -605,9 +603,9 @@ static void convert_metadata_to_cronet_headers(
} }
/* Allocate enough memory. It is freed in the on_request_headers_sent callback /* Allocate enough memory. It is freed in the on_request_headers_sent callback
*/ */
cronet_bidirectional_stream_header *headers = bidirectional_stream_header *headers =
(cronet_bidirectional_stream_header *)gpr_malloc( (bidirectional_stream_header *)gpr_malloc(
sizeof(cronet_bidirectional_stream_header) * num_headers_available); sizeof(bidirectional_stream_header) * num_headers_available);
*pp_headers = headers; *pp_headers = headers;
/* Walk the linked list again, this time copying the header fields. /* Walk the linked list again, this time copying the header fields.
@ -833,9 +831,9 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
* on_failed */ * on_failed */
GPR_ASSERT(s->cbs == NULL); GPR_ASSERT(s->cbs == NULL);
GPR_ASSERT(!stream_state->state_op_done[OP_SEND_INITIAL_METADATA]); GPR_ASSERT(!stream_state->state_op_done[OP_SEND_INITIAL_METADATA]);
s->cbs = cronet_bidirectional_stream_create(s->curr_ct.engine, s->curr_gs, s->cbs = bidirectional_stream_create(s->curr_ct.engine, s->curr_gs,
&cronet_callbacks); &cronet_callbacks);
CRONET_LOG(GPR_DEBUG, "%p = cronet_bidirectional_stream_create()", s->cbs); CRONET_LOG(GPR_DEBUG, "%p = bidirectional_stream_create()", s->cbs);
char *url = NULL; char *url = NULL;
const char *method = "POST"; const char *method = "POST";
s->header_array.headers = NULL; s->header_array.headers = NULL;
@ -843,10 +841,8 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
stream_op->send_initial_metadata->list.head, s->curr_ct.host, &url, stream_op->send_initial_metadata->list.head, s->curr_ct.host, &url,
&s->header_array.headers, &s->header_array.count, &method); &s->header_array.headers, &s->header_array.count, &method);
s->header_array.capacity = s->header_array.count; s->header_array.capacity = s->header_array.count;
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_start(%p, %s)", s->cbs, CRONET_LOG(GPR_DEBUG, "bidirectional_stream_start(%p, %s)", s->cbs, url);
url); bidirectional_stream_start(s->cbs, url, 0, method, &s->header_array, false);
cronet_bidirectional_stream_start(s->cbs, url, 0, method, &s->header_array,
false);
stream_state->state_op_done[OP_SEND_INITIAL_METADATA] = true; stream_state->state_op_done[OP_SEND_INITIAL_METADATA] = true;
result = ACTION_TAKEN_WITH_CALLBACK; result = ACTION_TAKEN_WITH_CALLBACK;
} else if (stream_op->recv_initial_metadata && } else if (stream_op->recv_initial_metadata &&
@ -855,11 +851,10 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
CRONET_LOG(GPR_DEBUG, "running: %p OP_RECV_INITIAL_METADATA", oas); CRONET_LOG(GPR_DEBUG, "running: %p OP_RECV_INITIAL_METADATA", oas);
if (stream_state->state_op_done[OP_CANCEL_ERROR]) { if (stream_state->state_op_done[OP_CANCEL_ERROR]) {
grpc_closure_sched(exec_ctx, stream_op->recv_initial_metadata_ready, grpc_closure_sched(exec_ctx, stream_op->recv_initial_metadata_ready,
GRPC_ERROR_CANCELLED); GRPC_ERROR_NONE);
} else if (stream_state->state_callback_received[OP_FAILED]) { } else if (stream_state->state_callback_received[OP_FAILED]) {
grpc_closure_sched( grpc_closure_sched(exec_ctx, stream_op->recv_initial_metadata_ready,
exec_ctx, stream_op->recv_initial_metadata_ready, GRPC_ERROR_NONE);
make_error_with_desc(GRPC_STATUS_UNAVAILABLE, "Unavailable."));
} else { } else {
grpc_chttp2_incoming_metadata_buffer_publish( grpc_chttp2_incoming_metadata_buffer_publish(
&oas->s->state.rs.initial_metadata, stream_op->recv_initial_metadata); &oas->s->state.rs.initial_metadata, stream_op->recv_initial_metadata);
@ -897,10 +892,10 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
size_t write_buffer_size; size_t write_buffer_size;
create_grpc_frame(&write_slice_buffer, &stream_state->ws.write_buffer, create_grpc_frame(&write_slice_buffer, &stream_state->ws.write_buffer,
&write_buffer_size); &write_buffer_size);
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_write (%p, %p)", CRONET_LOG(GPR_DEBUG, "bidirectional_stream_write (%p, %p)", s->cbs,
s->cbs, stream_state->ws.write_buffer); stream_state->ws.write_buffer);
stream_state->state_callback_received[OP_SEND_MESSAGE] = false; stream_state->state_callback_received[OP_SEND_MESSAGE] = false;
cronet_bidirectional_stream_write(s->cbs, stream_state->ws.write_buffer, bidirectional_stream_write(s->cbs, stream_state->ws.write_buffer,
(int)write_buffer_size, false); (int)write_buffer_size, false);
result = ACTION_TAKEN_WITH_CALLBACK; result = ACTION_TAKEN_WITH_CALLBACK;
} else { } else {
@ -916,14 +911,13 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
if (stream_state->state_op_done[OP_CANCEL_ERROR]) { if (stream_state->state_op_done[OP_CANCEL_ERROR]) {
CRONET_LOG(GPR_DEBUG, "Stream is cancelled."); CRONET_LOG(GPR_DEBUG, "Stream is cancelled.");
grpc_closure_sched(exec_ctx, stream_op->recv_message_ready, grpc_closure_sched(exec_ctx, stream_op->recv_message_ready,
GRPC_ERROR_CANCELLED); GRPC_ERROR_NONE);
stream_state->state_op_done[OP_RECV_MESSAGE] = true; stream_state->state_op_done[OP_RECV_MESSAGE] = true;
result = ACTION_TAKEN_NO_CALLBACK; result = ACTION_TAKEN_NO_CALLBACK;
} else if (stream_state->state_callback_received[OP_FAILED]) { } else if (stream_state->state_callback_received[OP_FAILED]) {
CRONET_LOG(GPR_DEBUG, "Stream failed."); CRONET_LOG(GPR_DEBUG, "Stream failed.");
grpc_closure_sched( grpc_closure_sched(exec_ctx, stream_op->recv_message_ready,
exec_ctx, stream_op->recv_message_ready, GRPC_ERROR_NONE);
make_error_with_desc(GRPC_STATUS_UNAVAILABLE, "Unavailable."));
stream_state->state_op_done[OP_RECV_MESSAGE] = true; stream_state->state_op_done[OP_RECV_MESSAGE] = true;
result = ACTION_TAKEN_NO_CALLBACK; result = ACTION_TAKEN_NO_CALLBACK;
} else if (stream_state->rs.read_stream_closed == true) { } else if (stream_state->rs.read_stream_closed == true) {
@ -949,10 +943,10 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
GPR_ASSERT(stream_state->rs.read_buffer); GPR_ASSERT(stream_state->rs.read_buffer);
stream_state->rs.remaining_bytes = stream_state->rs.length_field; stream_state->rs.remaining_bytes = stream_state->rs.length_field;
stream_state->rs.received_bytes = 0; stream_state->rs.received_bytes = 0;
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_read(%p)", s->cbs); CRONET_LOG(GPR_DEBUG, "bidirectional_stream_read(%p)", s->cbs);
stream_state->state_op_done[OP_READ_REQ_MADE] = stream_state->state_op_done[OP_READ_REQ_MADE] =
true; /* Indicates that at least one read request has been made */ true; /* Indicates that at least one read request has been made */
cronet_bidirectional_stream_read(s->cbs, stream_state->rs.read_buffer, bidirectional_stream_read(s->cbs, stream_state->rs.read_buffer,
stream_state->rs.remaining_bytes); stream_state->rs.remaining_bytes);
result = ACTION_TAKEN_WITH_CALLBACK; result = ACTION_TAKEN_WITH_CALLBACK;
} else { } else {
@ -974,10 +968,10 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
stream_state->rs.read_buffer = stream_state->rs.grpc_header_bytes; stream_state->rs.read_buffer = stream_state->rs.grpc_header_bytes;
stream_state->rs.remaining_bytes = GRPC_HEADER_SIZE_IN_BYTES; stream_state->rs.remaining_bytes = GRPC_HEADER_SIZE_IN_BYTES;
stream_state->rs.received_bytes = 0; stream_state->rs.received_bytes = 0;
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_read(%p)", s->cbs); CRONET_LOG(GPR_DEBUG, "bidirectional_stream_read(%p)", s->cbs);
stream_state->state_op_done[OP_READ_REQ_MADE] = stream_state->state_op_done[OP_READ_REQ_MADE] =
true; /* Indicates that at least one read request has been made */ true; /* Indicates that at least one read request has been made */
cronet_bidirectional_stream_read(s->cbs, stream_state->rs.read_buffer, bidirectional_stream_read(s->cbs, stream_state->rs.read_buffer,
stream_state->rs.remaining_bytes); stream_state->rs.remaining_bytes);
result = ACTION_TAKEN_WITH_CALLBACK; result = ACTION_TAKEN_WITH_CALLBACK;
} else { } else {
@ -1008,8 +1002,8 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
stream_state->rs.received_bytes = 0; stream_state->rs.received_bytes = 0;
stream_state->rs.remaining_bytes = GRPC_HEADER_SIZE_IN_BYTES; stream_state->rs.remaining_bytes = GRPC_HEADER_SIZE_IN_BYTES;
stream_state->rs.length_field_received = false; stream_state->rs.length_field_received = false;
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_read(%p)", s->cbs); CRONET_LOG(GPR_DEBUG, "bidirectional_stream_read(%p)", s->cbs);
cronet_bidirectional_stream_read(s->cbs, stream_state->rs.read_buffer, bidirectional_stream_read(s->cbs, stream_state->rs.read_buffer,
stream_state->rs.remaining_bytes); stream_state->rs.remaining_bytes);
result = ACTION_TAKEN_NO_CALLBACK; result = ACTION_TAKEN_NO_CALLBACK;
} }
@ -1033,10 +1027,9 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
result = NO_ACTION_POSSIBLE; result = NO_ACTION_POSSIBLE;
CRONET_LOG(GPR_DEBUG, "Stream is either cancelled or failed."); CRONET_LOG(GPR_DEBUG, "Stream is either cancelled or failed.");
} else { } else {
CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_write (%p, 0)", CRONET_LOG(GPR_DEBUG, "bidirectional_stream_write (%p, 0)", s->cbs);
s->cbs);
stream_state->state_callback_received[OP_SEND_MESSAGE] = false; stream_state->state_callback_received[OP_SEND_MESSAGE] = false;
cronet_bidirectional_stream_write(s->cbs, "", 0, true); bidirectional_stream_write(s->cbs, "", 0, true);
result = ACTION_TAKEN_WITH_CALLBACK; result = ACTION_TAKEN_WITH_CALLBACK;
} }
stream_state->state_op_done[OP_SEND_TRAILING_METADATA] = true; stream_state->state_op_done[OP_SEND_TRAILING_METADATA] = true;
@ -1044,9 +1037,9 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx,
op_can_be_run(stream_op, stream_state, &oas->state, op_can_be_run(stream_op, stream_state, &oas->state,
OP_CANCEL_ERROR)) { OP_CANCEL_ERROR)) {
CRONET_LOG(GPR_DEBUG, "running: %p OP_CANCEL_ERROR", oas); CRONET_LOG(GPR_DEBUG, "running: %p OP_CANCEL_ERROR", oas);
CRONET_LOG(GPR_DEBUG, "W: cronet_bidirectional_stream_cancel(%p)", s->cbs); CRONET_LOG(GPR_DEBUG, "W: bidirectional_stream_cancel(%p)", s->cbs);
if (s->cbs) { if (s->cbs) {
cronet_bidirectional_stream_cancel(s->cbs); bidirectional_stream_cancel(s->cbs);
result = ACTION_TAKEN_WITH_CALLBACK; result = ACTION_TAKEN_WITH_CALLBACK;
} else { } else {
result = ACTION_TAKEN_NO_CALLBACK; result = ACTION_TAKEN_NO_CALLBACK;
@ -1143,18 +1136,17 @@ static void perform_stream_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
header_has_authority(op->send_initial_metadata->list.head)) { header_has_authority(op->send_initial_metadata->list.head)) {
/* Cronet does not support :authority header field. We cancel the call when /* Cronet does not support :authority header field. We cancel the call when
this field is present in metadata */ this field is present in metadata */
cronet_bidirectional_stream_header_array header_array; bidirectional_stream_header_array header_array;
cronet_bidirectional_stream_header *header; bidirectional_stream_header *header;
cronet_bidirectional_stream cbs; bidirectional_stream cbs;
CRONET_LOG(GPR_DEBUG, CRONET_LOG(GPR_DEBUG,
":authority header is provided but not supported;" ":authority header is provided but not supported;"
" cancel operations"); " cancel operations");
/* Notify application that operation is cancelled by forging trailers */ /* Notify application that operation is cancelled by forging trailers */
header_array.count = 1; header_array.count = 1;
header_array.capacity = 1; header_array.capacity = 1;
header_array.headers = header_array.headers = gpr_malloc(sizeof(bidirectional_stream_header));
gpr_malloc(sizeof(cronet_bidirectional_stream_header)); header = (bidirectional_stream_header *)header_array.headers;
header = (cronet_bidirectional_stream_header *)header_array.headers;
header->key = "grpc-status"; header->key = "grpc-status";
header->value = "1"; /* Return status GRPC_STATUS_CANCELLED */ header->value = "1"; /* Return status GRPC_STATUS_CANCELLED */
cbs.annotation = (void *)s; cbs.annotation = (void *)s;

@ -796,7 +796,7 @@ static polling_island *polling_island_merge(polling_island *p,
gpr_atm_rel_store(&p->merged_to, (gpr_atm)q); gpr_atm_rel_store(&p->merged_to, (gpr_atm)q);
PI_ADD_REF(q, "pi_merge"); /* To account for the new incoming ref from p */ PI_ADD_REF(q, "pi_merge"); /* To account for the new incoming ref from p */
workqueue_move_items_to_parent(q); workqueue_move_items_to_parent(p);
} }
/* else if p == q, nothing needs to be done */ /* else if p == q, nothing needs to be done */
@ -1527,7 +1527,8 @@ static void pollset_work_and_unlock(grpc_exec_ctx *exec_ctx,
append_error(error, grpc_wakeup_fd_consume_wakeup(&global_wakeup_fd), append_error(error, grpc_wakeup_fd_consume_wakeup(&global_wakeup_fd),
err_desc); err_desc);
} else if (data_ptr == &pi->workqueue_wakeup_fd) { } else if (data_ptr == &pi->workqueue_wakeup_fd) {
append_error(error, grpc_wakeup_fd_consume_wakeup(&global_wakeup_fd), append_error(error,
grpc_wakeup_fd_consume_wakeup(&pi->workqueue_wakeup_fd),
err_desc); err_desc);
maybe_do_workqueue_work(exec_ctx, pi); maybe_do_workqueue_work(exec_ctx, pi);
} else if (data_ptr == &polling_island_wakeup_fd) { } else if (data_ptr == &polling_island_wakeup_fd) {

@ -413,9 +413,7 @@ static void fd_orphan(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
const char *reason) { const char *reason) {
fd->on_done_closure = on_done; fd->on_done_closure = on_done;
fd->released = release_fd != NULL; fd->released = release_fd != NULL;
if (!fd->released) { if (fd->released) {
shutdown(fd->fd, SHUT_RDWR);
} else {
*release_fd = fd->fd; *release_fd = fd->fd;
} }
gpr_mu_lock(&fd->mu); gpr_mu_lock(&fd->mu);

@ -691,6 +691,11 @@ grpc_resource_user *grpc_resource_user_create(
return resource_user; return resource_user;
} }
grpc_resource_quota *grpc_resource_user_quota(
grpc_resource_user *resource_user) {
return resource_user->resource_quota;
}
static void ru_ref_by(grpc_resource_user *resource_user, gpr_atm amount) { static void ru_ref_by(grpc_resource_user *resource_user, gpr_atm amount) {
GPR_ASSERT(amount > 0); GPR_ASSERT(amount > 0);
GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&resource_user->refs, amount) != 0); GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&resource_user->refs, amount) != 0);

@ -88,6 +88,12 @@ typedef struct grpc_resource_user grpc_resource_user;
grpc_resource_user *grpc_resource_user_create( grpc_resource_user *grpc_resource_user_create(
grpc_resource_quota *resource_quota, const char *name); grpc_resource_quota *resource_quota, const char *name);
/* Returns a borrowed reference to the underlying resource quota for this
resource user. */
grpc_resource_quota *grpc_resource_user_quota(
grpc_resource_user *resource_user);
void grpc_resource_user_ref(grpc_resource_user *resource_user); void grpc_resource_user_ref(grpc_resource_user *resource_user);
void grpc_resource_user_unref(grpc_exec_ctx *exec_ctx, void grpc_resource_user_unref(grpc_exec_ctx *exec_ctx,
grpc_resource_user *resource_user); grpc_resource_user *resource_user);

@ -46,15 +46,27 @@
#define GROW(x) (3 * (x) / 2) #define GROW(x) (3 * (x) / 2)
static void maybe_embiggen(grpc_slice_buffer *sb) { static void maybe_embiggen(grpc_slice_buffer *sb) {
if (sb->count == sb->capacity) { if (sb->base_slices != sb->slices) {
memmove(sb->base_slices, sb->slices, sb->count * sizeof(grpc_slice));
sb->slices = sb->base_slices;
}
/* How far away from sb->base_slices is sb->slices pointer */
size_t slice_offset = (size_t)(sb->slices - sb->base_slices);
size_t slice_count = sb->count + slice_offset;
if (slice_count == sb->capacity) {
sb->capacity = GROW(sb->capacity); sb->capacity = GROW(sb->capacity);
GPR_ASSERT(sb->capacity > sb->count); GPR_ASSERT(sb->capacity > slice_count);
if (sb->slices == sb->inlined) { if (sb->base_slices == sb->inlined) {
sb->slices = gpr_malloc(sb->capacity * sizeof(grpc_slice)); sb->base_slices = gpr_malloc(sb->capacity * sizeof(grpc_slice));
memcpy(sb->slices, sb->inlined, sb->count * sizeof(grpc_slice)); memcpy(sb->base_slices, sb->inlined, slice_count * sizeof(grpc_slice));
} else { } else {
sb->slices = gpr_realloc(sb->slices, sb->capacity * sizeof(grpc_slice)); sb->base_slices =
gpr_realloc(sb->base_slices, sb->capacity * sizeof(grpc_slice));
} }
sb->slices = sb->base_slices + slice_offset;
} }
} }
@ -62,14 +74,14 @@ void grpc_slice_buffer_init(grpc_slice_buffer *sb) {
sb->count = 0; sb->count = 0;
sb->length = 0; sb->length = 0;
sb->capacity = GRPC_SLICE_BUFFER_INLINE_ELEMENTS; sb->capacity = GRPC_SLICE_BUFFER_INLINE_ELEMENTS;
sb->slices = sb->inlined; sb->base_slices = sb->slices = sb->inlined;
} }
void grpc_slice_buffer_destroy_internal(grpc_exec_ctx *exec_ctx, void grpc_slice_buffer_destroy_internal(grpc_exec_ctx *exec_ctx,
grpc_slice_buffer *sb) { grpc_slice_buffer *sb) {
grpc_slice_buffer_reset_and_unref_internal(exec_ctx, sb); grpc_slice_buffer_reset_and_unref_internal(exec_ctx, sb);
if (sb->slices != sb->inlined) { if (sb->base_slices != sb->inlined) {
gpr_free(sb->slices); gpr_free(sb->base_slices);
} }
} }
@ -166,7 +178,6 @@ void grpc_slice_buffer_pop(grpc_slice_buffer *sb) {
void grpc_slice_buffer_reset_and_unref_internal(grpc_exec_ctx *exec_ctx, void grpc_slice_buffer_reset_and_unref_internal(grpc_exec_ctx *exec_ctx,
grpc_slice_buffer *sb) { grpc_slice_buffer *sb) {
size_t i; size_t i;
for (i = 0; i < sb->count; i++) { for (i = 0; i < sb->count; i++) {
grpc_slice_unref_internal(exec_ctx, sb->slices[i]); grpc_slice_unref_internal(exec_ctx, sb->slices[i]);
} }
@ -182,32 +193,45 @@ void grpc_slice_buffer_reset_and_unref(grpc_slice_buffer *sb) {
} }
void grpc_slice_buffer_swap(grpc_slice_buffer *a, grpc_slice_buffer *b) { void grpc_slice_buffer_swap(grpc_slice_buffer *a, grpc_slice_buffer *b) {
GPR_SWAP(size_t, a->count, b->count); size_t a_offset = (size_t)(a->slices - a->base_slices);
GPR_SWAP(size_t, a->capacity, b->capacity); size_t b_offset = (size_t)(b->slices - b->base_slices);
GPR_SWAP(size_t, a->length, b->length);
if (a->slices == a->inlined) { size_t a_count = a->count + a_offset;
if (b->slices == b->inlined) { size_t b_count = b->count + b_offset;
if (a->base_slices == a->inlined) {
if (b->base_slices == b->inlined) {
/* swap contents of inlined buffer */ /* swap contents of inlined buffer */
grpc_slice temp[GRPC_SLICE_BUFFER_INLINE_ELEMENTS]; grpc_slice temp[GRPC_SLICE_BUFFER_INLINE_ELEMENTS];
memcpy(temp, a->slices, b->count * sizeof(grpc_slice)); memcpy(temp, a->base_slices, a_count * sizeof(grpc_slice));
memcpy(a->slices, b->slices, a->count * sizeof(grpc_slice)); memcpy(a->base_slices, b->base_slices, b_count * sizeof(grpc_slice));
memcpy(b->slices, temp, b->count * sizeof(grpc_slice)); memcpy(b->base_slices, temp, a_count * sizeof(grpc_slice));
} else { } else {
/* a is inlined, b is not - copy a inlined into b, fix pointers */ /* a is inlined, b is not - copy a inlined into b, fix pointers */
a->slices = b->slices; a->base_slices = b->base_slices;
b->slices = b->inlined; b->base_slices = b->inlined;
memcpy(b->slices, a->inlined, b->count * sizeof(grpc_slice)); memcpy(b->base_slices, a->inlined, a_count * sizeof(grpc_slice));
} }
} else if (b->slices == b->inlined) { } else if (b->base_slices == b->inlined) {
/* b is inlined, a is not - copy b inlined int a, fix pointers */ /* b is inlined, a is not - copy b inlined int a, fix pointers */
b->slices = a->slices; b->base_slices = a->base_slices;
a->slices = a->inlined; a->base_slices = a->inlined;
memcpy(a->slices, b->inlined, a->count * sizeof(grpc_slice)); memcpy(a->base_slices, b->inlined, b_count * sizeof(grpc_slice));
} else { } else {
/* no inlining: easy swap */ /* no inlining: easy swap */
GPR_SWAP(grpc_slice *, a->slices, b->slices); GPR_SWAP(grpc_slice *, a->base_slices, b->base_slices);
} }
/* Update the slices pointers (cannot do a GPR_SWAP on slices fields here).
* Also note that since the base_slices pointers are already swapped we need
* use 'b_offset' for 'a->base_slices' and vice versa */
a->slices = a->base_slices + b_offset;
b->slices = b->base_slices + a_offset;
/* base_slices and slices fields are correctly set. Swap all other fields */
GPR_SWAP(size_t, a->count, b->count);
GPR_SWAP(size_t, a->capacity, b->capacity);
GPR_SWAP(size_t, a->length, b->length);
} }
void grpc_slice_buffer_move_into(grpc_slice_buffer *src, void grpc_slice_buffer_move_into(grpc_slice_buffer *src,
@ -229,7 +253,6 @@ void grpc_slice_buffer_move_into(grpc_slice_buffer *src,
void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n, void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n,
grpc_slice_buffer *dst) { grpc_slice_buffer *dst) {
size_t src_idx;
size_t output_len = dst->length + n; size_t output_len = dst->length + n;
size_t new_input_len = src->length - n; size_t new_input_len = src->length - n;
GPR_ASSERT(src->length >= n); GPR_ASSERT(src->length >= n);
@ -237,34 +260,55 @@ void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n,
grpc_slice_buffer_move_into(src, dst); grpc_slice_buffer_move_into(src, dst);
return; return;
} }
src_idx = 0;
while (src_idx < src->capacity) { while (src->count > 0) {
grpc_slice slice = src->slices[src_idx]; grpc_slice slice = grpc_slice_buffer_take_first(src);
size_t slice_len = GRPC_SLICE_LENGTH(slice); size_t slice_len = GRPC_SLICE_LENGTH(slice);
if (n > slice_len) { if (n > slice_len) {
grpc_slice_buffer_add(dst, slice); grpc_slice_buffer_add(dst, slice);
n -= slice_len; n -= slice_len;
src_idx++;
} else if (n == slice_len) { } else if (n == slice_len) {
grpc_slice_buffer_add(dst, slice); grpc_slice_buffer_add(dst, slice);
src_idx++;
break; break;
} else { /* n < slice_len */ } else { /* n < slice_len */
src->slices[src_idx] = grpc_slice_split_tail(&slice, n); grpc_slice_buffer_undo_take_first(src, grpc_slice_split_tail(&slice, n));
GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == n); GPR_ASSERT(GRPC_SLICE_LENGTH(slice) == n);
GPR_ASSERT(GRPC_SLICE_LENGTH(src->slices[src_idx]) == slice_len - n);
grpc_slice_buffer_add(dst, slice); grpc_slice_buffer_add(dst, slice);
break; break;
} }
} }
GPR_ASSERT(dst->length == output_len); GPR_ASSERT(dst->length == output_len);
memmove(src->slices, src->slices + src_idx, GPR_ASSERT(src->length == new_input_len);
sizeof(grpc_slice) * (src->count - src_idx));
src->count -= src_idx;
src->length = new_input_len;
GPR_ASSERT(src->count > 0); GPR_ASSERT(src->count > 0);
} }
void grpc_slice_buffer_move_first_into_buffer(grpc_exec_ctx *exec_ctx,
grpc_slice_buffer *src, size_t n,
void *dst) {
char *dstp = dst;
GPR_ASSERT(src->length >= n);
while (n > 0) {
grpc_slice slice = grpc_slice_buffer_take_first(src);
size_t slice_len = GRPC_SLICE_LENGTH(slice);
if (slice_len > n) {
memcpy(dstp, GRPC_SLICE_START_PTR(slice), n);
grpc_slice_buffer_undo_take_first(
src, grpc_slice_sub_no_ref(slice, n, slice_len));
n = 0;
} else if (slice_len == n) {
memcpy(dstp, GRPC_SLICE_START_PTR(slice), n);
grpc_slice_unref_internal(exec_ctx, slice);
n = 0;
} else {
memcpy(dstp, GRPC_SLICE_START_PTR(slice), slice_len);
dstp += slice_len;
n -= slice_len;
grpc_slice_unref_internal(exec_ctx, slice);
}
}
}
void grpc_slice_buffer_trim_end(grpc_slice_buffer *sb, size_t n, void grpc_slice_buffer_trim_end(grpc_slice_buffer *sb, size_t n,
grpc_slice_buffer *garbage) { grpc_slice_buffer *garbage) {
GPR_ASSERT(n <= sb->length); GPR_ASSERT(n <= sb->length);
@ -293,8 +337,17 @@ grpc_slice grpc_slice_buffer_take_first(grpc_slice_buffer *sb) {
grpc_slice slice; grpc_slice slice;
GPR_ASSERT(sb->count > 0); GPR_ASSERT(sb->count > 0);
slice = sb->slices[0]; slice = sb->slices[0];
memmove(&sb->slices[0], &sb->slices[1], (sb->count - 1) * sizeof(grpc_slice)); sb->slices++;
sb->count--; sb->count--;
sb->length -= GRPC_SLICE_LENGTH(slice); sb->length -= GRPC_SLICE_LENGTH(slice);
return slice; return slice;
} }
void grpc_slice_buffer_undo_take_first(grpc_slice_buffer *sb,
grpc_slice slice) {
sb->slices--;
sb->slices[0] = slice;
sb->count++;
sb->length += GRPC_SLICE_LENGTH(slice);
}

@ -1461,7 +1461,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
error = GRPC_CALL_ERROR_INVALID_FLAGS; error = GRPC_CALL_ERROR_INVALID_FLAGS;
goto done_with_error; goto done_with_error;
} }
if (op->data.send_message == NULL) { if (op->data.send_message.send_message == NULL) {
error = GRPC_CALL_ERROR_INVALID_MESSAGE; error = GRPC_CALL_ERROR_INVALID_MESSAGE;
goto done_with_error; goto done_with_error;
} }
@ -1473,11 +1473,13 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
call->sending_message = 1; call->sending_message = 1;
grpc_slice_buffer_stream_init( grpc_slice_buffer_stream_init(
&call->sending_stream, &call->sending_stream,
&op->data.send_message->data.raw.slice_buffer, op->flags); &op->data.send_message.send_message->data.raw.slice_buffer,
op->flags);
/* If the outgoing buffer is already compressed, mark it as so in the /* If the outgoing buffer is already compressed, mark it as so in the
flags. These will be picked up by the compression filter and further flags. These will be picked up by the compression filter and further
(wasteful) attempts at compression skipped. */ (wasteful) attempts at compression skipped. */
if (op->data.send_message->data.raw.compression > GRPC_COMPRESS_NONE) { if (op->data.send_message.send_message->data.raw.compression >
GRPC_COMPRESS_NONE) {
call->sending_stream.base.flags |= GRPC_WRITE_INTERNAL_COMPRESS; call->sending_stream.base.flags |= GRPC_WRITE_INTERNAL_COMPRESS;
} }
stream_op->send_message = &call->sending_stream.base; stream_op->send_message = &call->sending_stream.base;
@ -1565,7 +1567,8 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
that case we're not necessarily covered by a poller. */ that case we're not necessarily covered by a poller. */
stream_op->covered_by_poller = call->is_client; stream_op->covered_by_poller = call->is_client;
call->received_initial_metadata = 1; call->received_initial_metadata = 1;
call->buffered_metadata[0] = op->data.recv_initial_metadata; call->buffered_metadata[0] =
op->data.recv_initial_metadata.recv_initial_metadata;
grpc_closure_init(&call->receiving_initial_metadata_ready, grpc_closure_init(&call->receiving_initial_metadata_ready,
receiving_initial_metadata_ready, bctl, receiving_initial_metadata_ready, bctl,
grpc_schedule_on_exec_ctx); grpc_schedule_on_exec_ctx);
@ -1588,7 +1591,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
} }
call->receiving_message = 1; call->receiving_message = 1;
bctl->recv_message = 1; bctl->recv_message = 1;
call->receiving_buffer = op->data.recv_message; call->receiving_buffer = op->data.recv_message.recv_message;
stream_op->recv_message = &call->receiving_stream; stream_op->recv_message = &call->receiving_stream;
grpc_closure_init(&call->receiving_stream_ready, receiving_stream_ready, grpc_closure_init(&call->receiving_stream_ready, receiving_stream_ready,
bctl, grpc_schedule_on_exec_ctx); bctl, grpc_schedule_on_exec_ctx);

@ -63,7 +63,8 @@ char *grpc_op_string(const grpc_op *op) {
op->data.send_initial_metadata.count); op->data.send_initial_metadata.count);
break; break;
case GRPC_OP_SEND_MESSAGE: case GRPC_OP_SEND_MESSAGE:
gpr_asprintf(&tmp, "SEND_MESSAGE ptr=%p", op->data.send_message); gpr_asprintf(&tmp, "SEND_MESSAGE ptr=%p",
op->data.send_message.send_message);
gpr_strvec_add(&b, tmp); gpr_strvec_add(&b, tmp);
break; break;
case GRPC_OP_SEND_CLOSE_FROM_CLIENT: case GRPC_OP_SEND_CLOSE_FROM_CLIENT:
@ -79,11 +80,12 @@ char *grpc_op_string(const grpc_op *op) {
break; break;
case GRPC_OP_RECV_INITIAL_METADATA: case GRPC_OP_RECV_INITIAL_METADATA:
gpr_asprintf(&tmp, "RECV_INITIAL_METADATA ptr=%p", gpr_asprintf(&tmp, "RECV_INITIAL_METADATA ptr=%p",
op->data.recv_initial_metadata); op->data.recv_initial_metadata.recv_initial_metadata);
gpr_strvec_add(&b, tmp); gpr_strvec_add(&b, tmp);
break; break;
case GRPC_OP_RECV_MESSAGE: case GRPC_OP_RECV_MESSAGE:
gpr_asprintf(&tmp, "RECV_MESSAGE ptr=%p", op->data.recv_message); gpr_asprintf(&tmp, "RECV_MESSAGE ptr=%p",
op->data.recv_message.recv_message);
gpr_strvec_add(&b, tmp); gpr_strvec_add(&b, tmp);
break; break;
case GRPC_OP_RECV_STATUS_ON_CLIENT: case GRPC_OP_RECV_STATUS_ON_CLIENT:

@ -609,7 +609,7 @@ static void finish_start_new_rpc(
grpc_op op; grpc_op op;
memset(&op, 0, sizeof(op)); memset(&op, 0, sizeof(op));
op.op = GRPC_OP_RECV_MESSAGE; op.op = GRPC_OP_RECV_MESSAGE;
op.data.recv_message = &calld->payload; op.data.recv_message.recv_message = &calld->payload;
grpc_closure_init(&calld->publish, publish_new_rpc, elem, grpc_closure_init(&calld->publish, publish_new_rpc, elem,
grpc_schedule_on_exec_ctx); grpc_schedule_on_exec_ctx);
grpc_call_start_batch_and_execute(exec_ctx, calld->call, &op, 1, grpc_call_start_batch_and_execute(exec_ctx, calld->call, &op, 1,
@ -857,7 +857,8 @@ static void accept_stream(grpc_exec_ctx *exec_ctx, void *cd,
grpc_op op; grpc_op op;
memset(&op, 0, sizeof(op)); memset(&op, 0, sizeof(op));
op.op = GRPC_OP_RECV_INITIAL_METADATA; op.op = GRPC_OP_RECV_INITIAL_METADATA;
op.data.recv_initial_metadata = &calld->initial_metadata; op.data.recv_initial_metadata.recv_initial_metadata =
&calld->initial_metadata;
grpc_closure_init(&calld->got_initial_metadata, got_initial_metadata, elem, grpc_closure_init(&calld->got_initial_metadata, got_initial_metadata, elem,
grpc_schedule_on_exec_ctx); grpc_schedule_on_exec_ctx);
grpc_call_start_batch_and_execute(exec_ctx, call, &op, 1, grpc_call_start_batch_and_execute(exec_ctx, call, &op, 1,

@ -143,6 +143,14 @@ void ChannelArguments::SetResourceQuota(
grpc_resource_quota_arg_vtable()); grpc_resource_quota_arg_vtable());
} }
void ChannelArguments::SetMaxReceiveMessageSize(int size) {
SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, size);
}
void ChannelArguments::SetMaxSendMessageSize(int size) {
SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, size);
}
void ChannelArguments::SetLoadBalancingPolicyName( void ChannelArguments::SetLoadBalancingPolicyName(
const grpc::string& lb_policy_name) { const grpc::string& lb_policy_name) {
SetString(GRPC_ARG_LB_POLICY_NAME, lb_policy_name); SetString(GRPC_ARG_LB_POLICY_NAME, lb_policy_name);

@ -537,7 +537,7 @@ grpcsharp_call_start_unary(grpc_call *call, grpcsharp_batch_context *ctx,
ops[1].op = GRPC_OP_SEND_MESSAGE; ops[1].op = GRPC_OP_SEND_MESSAGE;
ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len); ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len);
ops[1].data.send_message = ctx->send_message; ops[1].data.send_message.send_message = ctx->send_message;
ops[1].flags = write_flags; ops[1].flags = write_flags;
ops[1].reserved = NULL; ops[1].reserved = NULL;
@ -546,12 +546,13 @@ grpcsharp_call_start_unary(grpc_call *call, grpcsharp_batch_context *ctx,
ops[2].reserved = NULL; ops[2].reserved = NULL;
ops[3].op = GRPC_OP_RECV_INITIAL_METADATA; ops[3].op = GRPC_OP_RECV_INITIAL_METADATA;
ops[3].data.recv_initial_metadata = &(ctx->recv_initial_metadata); ops[3].data.recv_initial_metadata.recv_initial_metadata =
&(ctx->recv_initial_metadata);
ops[3].flags = 0; ops[3].flags = 0;
ops[3].reserved = NULL; ops[3].reserved = NULL;
ops[4].op = GRPC_OP_RECV_MESSAGE; ops[4].op = GRPC_OP_RECV_MESSAGE;
ops[4].data.recv_message = &(ctx->recv_message); ops[4].data.recv_message.recv_message = &(ctx->recv_message);
ops[4].flags = 0; ops[4].flags = 0;
ops[4].reserved = NULL; ops[4].reserved = NULL;
@ -590,12 +591,13 @@ grpcsharp_call_start_client_streaming(grpc_call *call,
ops[0].reserved = NULL; ops[0].reserved = NULL;
ops[1].op = GRPC_OP_RECV_INITIAL_METADATA; ops[1].op = GRPC_OP_RECV_INITIAL_METADATA;
ops[1].data.recv_initial_metadata = &(ctx->recv_initial_metadata); ops[1].data.recv_initial_metadata.recv_initial_metadata =
&(ctx->recv_initial_metadata);
ops[1].flags = 0; ops[1].flags = 0;
ops[1].reserved = NULL; ops[1].reserved = NULL;
ops[2].op = GRPC_OP_RECV_MESSAGE; ops[2].op = GRPC_OP_RECV_MESSAGE;
ops[2].data.recv_message = &(ctx->recv_message); ops[2].data.recv_message.recv_message = &(ctx->recv_message);
ops[2].flags = 0; ops[2].flags = 0;
ops[2].reserved = NULL; ops[2].reserved = NULL;
@ -634,7 +636,7 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_start_server_streaming(
ops[1].op = GRPC_OP_SEND_MESSAGE; ops[1].op = GRPC_OP_SEND_MESSAGE;
ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len); ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len);
ops[1].data.send_message = ctx->send_message; ops[1].data.send_message.send_message = ctx->send_message;
ops[1].flags = write_flags; ops[1].flags = write_flags;
ops[1].reserved = NULL; ops[1].reserved = NULL;
@ -698,7 +700,8 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_recv_initial_metadata(
/* TODO: don't use magic number */ /* TODO: don't use magic number */
grpc_op ops[1]; grpc_op ops[1];
ops[0].op = GRPC_OP_RECV_INITIAL_METADATA; ops[0].op = GRPC_OP_RECV_INITIAL_METADATA;
ops[0].data.recv_initial_metadata = &(ctx->recv_initial_metadata); ops[0].data.recv_initial_metadata.recv_initial_metadata =
&(ctx->recv_initial_metadata);
ops[0].flags = 0; ops[0].flags = 0;
ops[0].reserved = NULL; ops[0].reserved = NULL;
@ -717,7 +720,7 @@ grpcsharp_call_send_message(grpc_call *call, grpcsharp_batch_context *ctx,
size_t nops = send_empty_initial_metadata ? 2 : 1; size_t nops = send_empty_initial_metadata ? 2 : 1;
ops[0].op = GRPC_OP_SEND_MESSAGE; ops[0].op = GRPC_OP_SEND_MESSAGE;
ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len); ctx->send_message = string_to_byte_buffer(send_buffer, send_buffer_len);
ops[0].data.send_message = ctx->send_message; ops[0].data.send_message.send_message = ctx->send_message;
ops[0].flags = write_flags; ops[0].flags = write_flags;
ops[0].reserved = NULL; ops[0].reserved = NULL;
ops[1].op = GRPC_OP_SEND_INITIAL_METADATA; ops[1].op = GRPC_OP_SEND_INITIAL_METADATA;
@ -765,7 +768,7 @@ GPR_EXPORT grpc_call_error GPR_CALLTYPE grpcsharp_call_send_status_from_server(
ops[nops].op = GRPC_OP_SEND_MESSAGE; ops[nops].op = GRPC_OP_SEND_MESSAGE;
ctx->send_message = string_to_byte_buffer(optional_send_buffer, ctx->send_message = string_to_byte_buffer(optional_send_buffer,
optional_send_buffer_len); optional_send_buffer_len);
ops[nops].data.send_message = ctx->send_message; ops[nops].data.send_message.send_message = ctx->send_message;
ops[nops].flags = write_flags; ops[nops].flags = write_flags;
ops[nops].reserved = NULL; ops[nops].reserved = NULL;
nops ++; nops ++;
@ -784,7 +787,7 @@ grpcsharp_call_recv_message(grpc_call *call, grpcsharp_batch_context *ctx) {
/* TODO: don't use magic number */ /* TODO: don't use magic number */
grpc_op ops[1]; grpc_op ops[1];
ops[0].op = GRPC_OP_RECV_MESSAGE; ops[0].op = GRPC_OP_RECV_MESSAGE;
ops[0].data.recv_message = &(ctx->recv_message); ops[0].data.recv_message.recv_message = &(ctx->recv_message);
ops[0].flags = 0; ops[0].flags = 0;
ops[0].reserved = NULL; ops[0].reserved = NULL;
return grpc_call_start_batch(call, ops, sizeof(ops) / sizeof(ops[0]), ctx, return grpc_call_start_batch(call, ops, sizeof(ops) / sizeof(ops[0]), ctx,

@ -262,7 +262,7 @@ class SendMessageOp : public Op {
} }
} }
send_message = BufferToByteBuffer(value); send_message = BufferToByteBuffer(value);
out->data.send_message = send_message; out->data.send_message.send_message = send_message;
PersistentValue *handle = new PersistentValue(value); PersistentValue *handle = new PersistentValue(value);
resources->handles.push_back(unique_ptr<PersistentValue>(handle)); resources->handles.push_back(unique_ptr<PersistentValue>(handle));
return true; return true;
@ -377,7 +377,7 @@ class GetMetadataOp : public Op {
bool ParseOp(Local<Value> value, grpc_op *out, bool ParseOp(Local<Value> value, grpc_op *out,
shared_ptr<Resources> resources) { shared_ptr<Resources> resources) {
out->data.recv_initial_metadata = &recv_metadata; out->data.recv_initial_metadata.recv_initial_metadata = &recv_metadata;
return true; return true;
} }
bool IsFinalOp() { bool IsFinalOp() {
@ -410,7 +410,7 @@ class ReadMessageOp : public Op {
bool ParseOp(Local<Value> value, grpc_op *out, bool ParseOp(Local<Value> value, grpc_op *out,
shared_ptr<Resources> resources) { shared_ptr<Resources> resources) {
out->data.recv_message = &recv_message; out->data.recv_message.recv_message = &recv_message;
return true; return true;
} }
bool IsFinalOp() { bool IsFinalOp() {

@ -35,7 +35,7 @@
#include <nan.h> #include <nan.h>
#include <uv.h> #include <uv.h>
#include <list> #include <queue>
#include "grpc/grpc.h" #include "grpc/grpc.h"
#include "grpc/grpc_security.h" #include "grpc/grpc_security.h"
@ -170,7 +170,7 @@ NAN_METHOD(CallCredentials::CreateFromPlugin) {
grpc_metadata_credentials_plugin plugin; grpc_metadata_credentials_plugin plugin;
plugin_state *state = new plugin_state; plugin_state *state = new plugin_state;
state->callback = new Nan::Callback(info[0].As<Function>()); state->callback = new Nan::Callback(info[0].As<Function>());
state->pending_callbacks = new std::list<plugin_callback_data*>(); state->pending_callbacks = new std::queue<plugin_callback_data*>();
uv_mutex_init(&state->plugin_mutex); uv_mutex_init(&state->plugin_mutex);
uv_async_init(uv_default_loop(), uv_async_init(uv_default_loop(),
&state->plugin_async, &state->plugin_async,
@ -232,13 +232,13 @@ NAN_METHOD(PluginCallback) {
NAUV_WORK_CB(SendPluginCallback) { NAUV_WORK_CB(SendPluginCallback) {
Nan::HandleScope scope; Nan::HandleScope scope;
plugin_state *state = reinterpret_cast<plugin_state*>(async->data); plugin_state *state = reinterpret_cast<plugin_state*>(async->data);
std::list<plugin_callback_data*> callbacks; std::queue<plugin_callback_data*> callbacks;
uv_mutex_lock(&state->plugin_mutex); uv_mutex_lock(&state->plugin_mutex);
callbacks.splice(callbacks.begin(), *state->pending_callbacks); state->pending_callbacks->swap(callbacks);
uv_mutex_unlock(&state->plugin_mutex); uv_mutex_unlock(&state->plugin_mutex);
while (!callbacks.empty()) { while (!callbacks.empty()) {
plugin_callback_data *data = callbacks.front(); plugin_callback_data *data = callbacks.front();
callbacks.pop_front(); callbacks.pop();
Local<Object> callback_data = Nan::New<Object>(); Local<Object> callback_data = Nan::New<Object>();
Nan::Set(callback_data, Nan::New("cb").ToLocalChecked(), Nan::Set(callback_data, Nan::New("cb").ToLocalChecked(),
Nan::New<v8::External>(reinterpret_cast<void*>(data->cb))); Nan::New<v8::External>(reinterpret_cast<void*>(data->cb)));
@ -267,7 +267,7 @@ void plugin_get_metadata(void *state, grpc_auth_metadata_context context,
data->user_data = user_data; data->user_data = user_data;
uv_mutex_lock(&p_state->plugin_mutex); uv_mutex_lock(&p_state->plugin_mutex);
p_state->pending_callbacks->push_back(data); p_state->pending_callbacks->push(data);
uv_mutex_unlock(&p_state->plugin_mutex); uv_mutex_unlock(&p_state->plugin_mutex);
uv_async_send(&p_state->plugin_async); uv_async_send(&p_state->plugin_async);

@ -34,7 +34,7 @@
#ifndef GRPC_NODE_CALL_CREDENTIALS_H_ #ifndef GRPC_NODE_CALL_CREDENTIALS_H_
#define GRPC_NODE_CALL_CREDENTIALS_H_ #define GRPC_NODE_CALL_CREDENTIALS_H_
#include <list> #include <queue>
#include <node.h> #include <node.h>
#include <nan.h> #include <nan.h>
@ -84,7 +84,7 @@ typedef struct plugin_callback_data {
typedef struct plugin_state { typedef struct plugin_state {
Nan::Callback *callback; Nan::Callback *callback;
std::list<plugin_callback_data*> *pending_callbacks; std::queue<plugin_callback_data*> *pending_callbacks;
uv_mutex_t plugin_mutex; uv_mutex_t plugin_mutex;
// async.data == this // async.data == this
uv_async_t plugin_async; uv_async_t plugin_async;

@ -32,6 +32,7 @@
*/ */
#include <v8.h> #include <v8.h>
#include <grpc/grpc.h>
namespace grpc { namespace grpc {
namespace node { namespace node {

@ -31,18 +31,63 @@
* *
*/ */
/* I don't like using #ifndef, but I don't see a better way to do this */
#ifndef GRPC_UV
#include <node.h> #include <node.h>
#include <nan.h> #include <nan.h>
#include "grpc/grpc.h" #include "grpc/grpc.h"
#include "grpc/support/log.h" #include "grpc/support/log.h"
#include "grpc/support/time.h" #include "grpc/support/time.h"
#include "completion_queue_async_worker.h" #include "completion_queue.h"
#include "call.h" #include "call.h"
namespace grpc { namespace grpc {
namespace node { namespace node {
namespace {
/* A worker that asynchronously calls completion_queue_next, and queues onto the
node event loop a call to the function stored in the event's tag. */
class CompletionQueueAsyncWorker : public Nan::AsyncWorker {
public:
CompletionQueueAsyncWorker();
~CompletionQueueAsyncWorker();
/* Calls completion_queue_next with the provided deadline, and stores the
event if there was one or sets an error message if there was not */
void Execute();
/* Returns the completion queue attached to this class */
static grpc_completion_queue *GetQueue();
/* Convenience function to create a worker with the given arguments and queue
it to run asynchronously */
static void Next();
/* Initialize the CompletionQueueAsyncWorker class */
static void Init(v8::Local<v8::Object> exports);
protected:
/* Called when Execute has succeeded (completed without setting an error
message). Calls the saved callback with the event that came from
completion_queue_next */
void HandleOKCallback();
void HandleErrorCallback();
private:
grpc_event result;
static grpc_completion_queue *queue;
// Number of grpc_completion_queue_next calls in the thread pool
static int current_threads;
// Number of grpc_completion_queue_next calls waiting to enter the thread pool
static int waiting_next_calls;
};
const int max_queue_threads = 2; const int max_queue_threads = 2;
using v8::Function; using v8::Function;
@ -137,5 +182,21 @@ void CompletionQueueAsyncWorker::HandleErrorCallback() {
DestroyTag(result.tag); DestroyTag(result.tag);
} }
} // namespace
grpc_completion_queue *GetCompletionQueue() {
return CompletionQueueAsyncWorker::GetQueue();
}
void CompletionQueueNext() {
CompletionQueueAsyncWorker::Next();
}
void CompletionQueueInit(Local<Object> exports) {
CompletionQueueAsyncWorker::Init(exports);
}
} // namespace node } // namespace node
} // namespace grpc } // namespace grpc
#endif /* GRPC_UV */

@ -31,6 +31,8 @@
* *
*/ */
#ifdef GRPC_UV
#include <uv.h> #include <uv.h>
#include <node.h> #include <node.h>
#include <v8.h> #include <v8.h>
@ -38,7 +40,6 @@
#include "call.h" #include "call.h"
#include "completion_queue.h" #include "completion_queue.h"
#include "completion_queue_async_worker.h"
namespace grpc { namespace grpc {
namespace node { namespace node {
@ -81,34 +82,24 @@ void drain_completion_queue(uv_prepare_t *handle) {
} }
grpc_completion_queue *GetCompletionQueue() { grpc_completion_queue *GetCompletionQueue() {
#ifdef GRPC_UV
return queue; return queue;
#else
return CompletionQueueAsyncWorker::GetQueue();
#endif
} }
void CompletionQueueNext() { void CompletionQueueNext() {
#ifdef GRPC_UV
if (pending_batches == 0) { if (pending_batches == 0) {
GPR_ASSERT(!uv_is_active((uv_handle_t *)&prepare)); GPR_ASSERT(!uv_is_active((uv_handle_t *)&prepare));
uv_prepare_start(&prepare, drain_completion_queue); uv_prepare_start(&prepare, drain_completion_queue);
} }
pending_batches++; pending_batches++;
#else
CompletionQueueAsyncWorker::Next();
#endif
} }
void CompletionQueueInit(Local<Object> exports) { void CompletionQueueInit(Local<Object> exports) {
#ifdef GRPC_UV
queue = grpc_completion_queue_create(NULL); queue = grpc_completion_queue_create(NULL);
uv_prepare_init(uv_default_loop(), &prepare); uv_prepare_init(uv_default_loop(), &prepare);
pending_batches = 0; pending_batches = 0;
#else
CompletionQueueAsyncWorker::Init(exports);
#endif
} }
} // namespace node } // namespace node
} // namespace grpc } // namespace grpc
#endif /* GRPC_UV */

@ -31,7 +31,7 @@
* *
*/ */
#include <list> #include <queue>
#include <node.h> #include <node.h>
#include <nan.h> #include <nan.h>
@ -74,7 +74,7 @@ typedef struct log_args {
typedef struct logger_state { typedef struct logger_state {
Nan::Callback *callback; Nan::Callback *callback;
std::list<log_args *> *pending_args; std::queue<log_args *> *pending_args;
uv_mutex_t mutex; uv_mutex_t mutex;
uv_async_t async; uv_async_t async;
// Indicates that a logger has been set // Indicates that a logger has been set
@ -342,14 +342,14 @@ NAN_METHOD(SetDefaultRootsPem) {
NAUV_WORK_CB(LogMessagesCallback) { NAUV_WORK_CB(LogMessagesCallback) {
Nan::HandleScope scope; Nan::HandleScope scope;
std::list<log_args *> args; std::queue<log_args *> args;
uv_mutex_lock(&grpc_logger_state.mutex); uv_mutex_lock(&grpc_logger_state.mutex);
args.splice(args.begin(), *grpc_logger_state.pending_args); grpc_logger_state.pending_args->swap(args);
uv_mutex_unlock(&grpc_logger_state.mutex); uv_mutex_unlock(&grpc_logger_state.mutex);
/* Call the callback with each log message */ /* Call the callback with each log message */
while (!args.empty()) { while (!args.empty()) {
log_args *arg = args.front(); log_args *arg = args.front();
args.pop_front(); args.pop();
Local<Value> file = Nan::New(arg->core_args.file).ToLocalChecked(); Local<Value> file = Nan::New(arg->core_args.file).ToLocalChecked();
Local<Value> line = Nan::New<Uint32, uint32_t>(arg->core_args.line); Local<Value> line = Nan::New<Uint32, uint32_t>(arg->core_args.line);
Local<Value> severity = Nan::New( Local<Value> severity = Nan::New(
@ -376,7 +376,7 @@ void node_log_func(gpr_log_func_args *args) {
args_copy->timestamp = gpr_now(GPR_CLOCK_REALTIME); args_copy->timestamp = gpr_now(GPR_CLOCK_REALTIME);
uv_mutex_lock(&grpc_logger_state.mutex); uv_mutex_lock(&grpc_logger_state.mutex);
grpc_logger_state.pending_args->push_back(args_copy); grpc_logger_state.pending_args->push(args_copy);
uv_mutex_unlock(&grpc_logger_state.mutex); uv_mutex_unlock(&grpc_logger_state.mutex);
uv_async_send(&grpc_logger_state.async); uv_async_send(&grpc_logger_state.async);
@ -384,7 +384,7 @@ void node_log_func(gpr_log_func_args *args) {
void init_logger() { void init_logger() {
memset(&grpc_logger_state, 0, sizeof(logger_state)); memset(&grpc_logger_state, 0, sizeof(logger_state));
grpc_logger_state.pending_args = new std::list<log_args *>(); grpc_logger_state.pending_args = new std::queue<log_args *>();
uv_mutex_init(&grpc_logger_state.mutex); uv_mutex_init(&grpc_logger_state.mutex);
uv_async_init(uv_default_loop(), uv_async_init(uv_default_loop(),
&grpc_logger_state.async, &grpc_logger_state.async,

@ -183,6 +183,7 @@ describe('Server.prototype.addProtoService', function() {
assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED); assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED);
done(); done();
}); });
call.on('error', function(status) { /* Do nothing */ });
}); });
it('should respond to a bidi call with UNIMPLEMENTED', function(done) { it('should respond to a bidi call with UNIMPLEMENTED', function(done) {
var call = client.divMany(); var call = client.divMany();
@ -193,6 +194,7 @@ describe('Server.prototype.addProtoService', function() {
assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED); assert.strictEqual(err.code, grpc.status.UNIMPLEMENTED);
done(); done();
}); });
call.on('error', function(status) { /* Do nothing */ });
call.end(); call.end();
}); });
}); });

@ -30,7 +30,8 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = "CronetFramework" s.name = "CronetFramework"
s.version = "0.0.3" v = '0.0.4'
s.version = v
s.summary = "Cronet, precompiled and used as a framework." s.summary = "Cronet, precompiled and used as a framework."
s.homepage = "http://chromium.org" s.homepage = "http://chromium.org"
s.license = { s.license = {
@ -69,7 +70,7 @@ Pod::Spec.new do |s|
s.vendored_framework = "Cronet.framework" s.vendored_framework = "Cronet.framework"
s.author = "The Chromium Authors" s.author = "The Chromium Authors"
s.ios.deployment_target = "8.0" s.ios.deployment_target = "8.0"
s.source = { :http => 'https://storage.googleapis.com/grpc-precompiled-binaries/cronet/Cronet.framework.zip' } s.source = { :http => "https://storage.googleapis.com/grpc-precompiled-binaries/cronet/Cronet.framework-v#{v}.zip"}
s.preserve_paths = "Cronet.framework" s.preserve_paths = "Cronet.framework"
s.public_header_files = "Cronet.framework/Headers/**/*{.h}" s.public_header_files = "Cronet.framework/Headers/**/*{.h}"
s.source_files = "Cronet.framework/Headers/**/*{.h}" s.source_files = "Cronet.framework/Headers/**/*{.h}"

@ -43,13 +43,13 @@
/** /**
* This method should be called before issuing the first RPC. It should be * This method should be called before issuing the first RPC. It should be
* called only once. Create an instance of Cronet engine in your app elsewhere * called only once. Create an instance of Cronet engine in your app elsewhere
* and pass the instance pointer in the cronet_engine parameter. Once set, * and pass the instance pointer in the stream_engine parameter. Once set,
* all subsequent RPCs will use Cronet transport. The method is not thread * all subsequent RPCs will use Cronet transport. The method is not thread
* safe. * safe.
*/ */
+(void)useCronetWithEngine:(cronet_engine *)engine; +(void)useCronetWithEngine:(stream_engine *)engine;
+(cronet_engine *)cronetEngine; +(stream_engine *)cronetEngine;
+(BOOL)isUsingCronet; +(BOOL)isUsingCronet;

@ -35,16 +35,16 @@
#ifdef GRPC_COMPILE_WITH_CRONET #ifdef GRPC_COMPILE_WITH_CRONET
static BOOL useCronet = NO; static BOOL useCronet = NO;
static cronet_engine *globalCronetEngine; static stream_engine *globalCronetEngine;
@implementation GRPCCall (Cronet) @implementation GRPCCall (Cronet)
+ (void)useCronetWithEngine:(cronet_engine *)engine { + (void)useCronetWithEngine:(stream_engine *)engine {
useCronet = YES; useCronet = YES;
globalCronetEngine = engine; globalCronetEngine = engine;
} }
+ (cronet_engine *)cronetEngine { + (stream_engine *)cronetEngine {
return globalCronetEngine; return globalCronetEngine;
} }

@ -108,7 +108,7 @@ static grpc_channel_args *BuildChannelArgs(NSDictionary *dictionary) {
#ifdef GRPC_COMPILE_WITH_CRONET #ifdef GRPC_COMPILE_WITH_CRONET
- (instancetype)initWithHost:(NSString *)host - (instancetype)initWithHost:(NSString *)host
cronetEngine:(cronet_engine *)cronetEngine cronetEngine:(stream_engine *)cronetEngine
channelArgs:(NSDictionary *)channelArgs { channelArgs:(NSDictionary *)channelArgs {
if (!host) { if (!host) {
[NSException raise:NSInvalidArgumentException format:@"host argument missing"]; [NSException raise:NSInvalidArgumentException format:@"host argument missing"];
@ -163,7 +163,7 @@ static grpc_channel_args *BuildChannelArgs(NSDictionary *dictionary) {
#ifdef GRPC_COMPILE_WITH_CRONET #ifdef GRPC_COMPILE_WITH_CRONET
+ (GRPCChannel *)secureCronetChannelWithHost:(NSString *)host + (GRPCChannel *)secureCronetChannelWithHost:(NSString *)host
channelArgs:(NSDictionary *)channelArgs { channelArgs:(NSDictionary *)channelArgs {
cronet_engine *engine = [GRPCCall cronetEngine]; stream_engine *engine = [GRPCCall cronetEngine];
if (!engine) { if (!engine) {
[NSException raise:NSInvalidArgumentException [NSException raise:NSInvalidArgumentException
format:@"cronet_engine is NULL. Set it first."]; format:@"cronet_engine is NULL. Set it first."];

@ -105,14 +105,14 @@
} }
if (self = [super init]) { if (self = [super init]) {
_op.op = GRPC_OP_SEND_MESSAGE; _op.op = GRPC_OP_SEND_MESSAGE;
_op.data.send_message = message.grpc_byteBuffer; _op.data.send_message.send_message = message.grpc_byteBuffer;
_handler = handler; _handler = handler;
} }
return self; return self;
} }
- (void)dealloc { - (void)dealloc {
grpc_byte_buffer_destroy(_op.data.send_message); grpc_byte_buffer_destroy(_op.data.send_message.send_message);
} }
@end @end
@ -145,7 +145,7 @@
if (self = [super init]) { if (self = [super init]) {
_op.op = GRPC_OP_RECV_INITIAL_METADATA; _op.op = GRPC_OP_RECV_INITIAL_METADATA;
grpc_metadata_array_init(&_headers); grpc_metadata_array_init(&_headers);
_op.data.recv_initial_metadata = &_headers; _op.data.recv_initial_metadata.recv_initial_metadata = &_headers;
if (handler) { if (handler) {
// Prevent reference cycle with _handler // Prevent reference cycle with _handler
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
@ -177,7 +177,7 @@
- (instancetype)initWithHandler:(void (^)(grpc_byte_buffer *))handler { - (instancetype)initWithHandler:(void (^)(grpc_byte_buffer *))handler {
if (self = [super init]) { if (self = [super init]) {
_op.op = GRPC_OP_RECV_MESSAGE; _op.op = GRPC_OP_RECV_MESSAGE;
_op.data.recv_message = &_receivedMessage; _op.data.recv_message.recv_message = &_receivedMessage;
if (handler) { if (handler) {
// Prevent reference cycle with _handler // Prevent reference cycle with _handler
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;

@ -94,7 +94,7 @@ static void process_auth_failure(void *state, grpc_auth_context *ctx,
static void cronet_init_client_secure_fullstack(grpc_end2end_test_fixture *f, static void cronet_init_client_secure_fullstack(grpc_end2end_test_fixture *f,
grpc_channel_args *client_args, grpc_channel_args *client_args,
cronet_engine *cronetEngine) { stream_engine *cronetEngine) {
fullstack_secure_fixture_data *ffd = f->fixture_data; fullstack_secure_fixture_data *ffd = f->fixture_data;
f->client = grpc_cronet_secure_channel_create(cronetEngine, ffd->localaddr, f->client = grpc_cronet_secure_channel_create(cronetEngine, ffd->localaddr,
client_args, NULL); client_args, NULL);
@ -124,11 +124,13 @@ static void chttp2_tear_down_secure_fullstack(grpc_end2end_test_fixture *f) {
static void cronet_init_client_simple_ssl_secure_fullstack( static void cronet_init_client_simple_ssl_secure_fullstack(
grpc_end2end_test_fixture *f, grpc_channel_args *client_args) { grpc_end2end_test_fixture *f, grpc_channel_args *client_args) {
cronet_engine *cronetEngine = [Cronet getGlobalEngine]; grpc_exec_ctx ctx = GRPC_EXEC_CTX_INIT;
stream_engine *cronetEngine = [Cronet getGlobalEngine];
grpc_channel_args *new_client_args = grpc_channel_args_copy(client_args); grpc_channel_args *new_client_args = grpc_channel_args_copy(client_args);
cronet_init_client_secure_fullstack(f, new_client_args, cronetEngine); cronet_init_client_secure_fullstack(f, new_client_args, cronetEngine);
grpc_channel_args_destroy(new_client_args); grpc_channel_args_destroy(&ctx, new_client_args);
grpc_exec_ctx_finish(&ctx);
} }
static int fail_server_auth_check(grpc_channel_args *server_args) { static int fail_server_auth_check(grpc_channel_args *server_args) {

@ -0,0 +1,214 @@
/*
*
* Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#import <XCTest/XCTest.h>
#import <sys/socket.h>
#import <netinet/in.h>
#import <Cronet/Cronet.h>
#import <grpc/support/host_port.h>
#import <grpc/grpc_cronet.h>
#import <grpc/grpc.h>
#import "test/core/end2end/cq_verifier.h"
#import "test/core/util/port.h"
#import <grpc/support/alloc.h>
#import <grpc/support/log.h>
#import "src/core/lib/channel/channel_args.h"
#import "src/core/lib/support/env.h"
#import "src/core/lib/support/string.h"
#import "src/core/lib/support/tmpfile.h"
#import "test/core/util/test_config.h"
static void drain_cq(grpc_completion_queue *cq) {
grpc_event ev;
do {
ev = grpc_completion_queue_next(cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL);
} while (ev.type != GRPC_QUEUE_SHUTDOWN);
}
@interface CronetUnitTests : XCTestCase
@end
@implementation CronetUnitTests
+ (void)setUp {
[super setUp];
/*** FILE *roots_file;
size_t roots_size = strlen(test_root_cert);*/
char *argv[] = {"CoreCronetEnd2EndTests"};
grpc_test_init(1, argv);
grpc_init();
[Cronet setHttp2Enabled:YES];
NSURL *url = [[[NSFileManager defaultManager]
URLsForDirectory:NSDocumentDirectory
inDomains:NSUserDomainMask] lastObject];
NSLog(@"Documents directory: %@", url);
[Cronet start];
[Cronet startNetLogToFile:@"Documents/cronet_netlog.json" logBytes:YES];
}
+ (void)tearDown {
grpc_shutdown();
[super tearDown];
}
- (void)testInternalError {
grpc_call *c;
grpc_slice request_payload_slice =
grpc_slice_from_copied_string("hello world");
grpc_byte_buffer *request_payload =
grpc_raw_byte_buffer_create(&request_payload_slice, 1);
gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5);
grpc_metadata meta_c[2] = {
{"key1", "val1", 4, 0, {{NULL, NULL, NULL, NULL}}},
{"key2", "val2", 4, 0, {{NULL, NULL, NULL, NULL}}}};
int port = grpc_pick_unused_port_or_die();
char *addr;
gpr_join_host_port(&addr, "127.0.0.1", port);
grpc_completion_queue *cq = grpc_completion_queue_create(NULL);
cronet_engine *cronetEngine = [Cronet getGlobalEngine];
grpc_channel *client = grpc_cronet_secure_channel_create(cronetEngine, addr,
NULL, NULL);
cq_verifier *cqv = cq_verifier_create(cq);
grpc_op ops[6];
grpc_op *op;
grpc_metadata_array initial_metadata_recv;
grpc_metadata_array trailing_metadata_recv;
grpc_metadata_array request_metadata_recv;
grpc_byte_buffer *response_payload_recv = NULL;
grpc_call_details call_details;
grpc_status_code status;
grpc_call_error error;
char *details = NULL;
size_t details_capacity = 0;
c = grpc_channel_create_call(
client, NULL, GRPC_PROPAGATE_DEFAULTS, cq, "/foo",
NULL, deadline, NULL);
GPR_ASSERT(c);
grpc_metadata_array_init(&initial_metadata_recv);
grpc_metadata_array_init(&trailing_metadata_recv);
grpc_metadata_array_init(&request_metadata_recv);
grpc_call_details_init(&call_details);
memset(ops, 0, sizeof(ops));
op = ops;
op->op = GRPC_OP_SEND_INITIAL_METADATA;
op->data.send_initial_metadata.count = 2;
op->data.send_initial_metadata.metadata = meta_c;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_MESSAGE;
op->data.send_message.send_message = request_payload;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_INITIAL_METADATA;
op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_MESSAGE;
op->data.recv_message.recv_message = &response_payload_recv;
op->flags = 0;
op->reserved = NULL;
op++;
op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv;
op->data.recv_status_on_client.status = &status;
op->data.recv_status_on_client.status_details = &details;
op->data.recv_status_on_client.status_details_capacity = &details_capacity;
op->flags = 0;
op->reserved = NULL;
op++;
error = grpc_call_start_batch(c, ops, (size_t)(op - ops), (void*)1, NULL);
GPR_ASSERT(GRPC_CALL_OK == error);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
int sl = socket(AF_INET, SOCK_STREAM, 0);
GPR_ASSERT(sl >= 0);
struct sockaddr_in s_addr;
memset(&s_addr, 0, sizeof(s_addr));
s_addr.sin_family = AF_INET;
s_addr.sin_addr.s_addr = htonl(INADDR_ANY);
s_addr.sin_port = htons(port);
bind(sl, (struct sockaddr*)&s_addr, sizeof(s_addr));
listen(sl, 5);
int s = accept(sl, NULL, NULL);
sleep(1);
close(s);
close(sl);
});
CQ_EXPECT_COMPLETION(cqv, (void*)1, 1);
cq_verify(cqv);
GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE);
gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
grpc_metadata_array_destroy(&trailing_metadata_recv);
grpc_metadata_array_destroy(&request_metadata_recv);
grpc_call_details_destroy(&call_details);
grpc_call_destroy(c);
cq_verifier_destroy(cqv);
grpc_byte_buffer_destroy(request_payload);
grpc_byte_buffer_destroy(response_payload_recv);
grpc_channel_destroy(client);
grpc_completion_queue_shutdown(cq);
drain_cq(cq);
grpc_completion_queue_destroy(cq);
}
@end

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

@ -37,13 +37,18 @@ GRPC_LOCAL_SRC = '../../..'
end end
end end
target 'CoreCronetEnd2EndTests' do %w(
CoreCronetEnd2EndTests
CronetUnitTests
).each do |target_name|
target target_name do
pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true pod 'BoringSSL', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true
pod 'CronetFramework', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" pod 'CronetFramework', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c"
pod 'gRPC-Core', :path => GRPC_LOCAL_SRC pod 'gRPC-Core', :path => GRPC_LOCAL_SRC
pod 'gRPC-Core/Cronet-Interface', :path => GRPC_LOCAL_SRC pod 'gRPC-Core/Cronet-Interface', :path => GRPC_LOCAL_SRC
pod 'gRPC-Core/Cronet-Implementation', :path => GRPC_LOCAL_SRC pod 'gRPC-Core/Cronet-Implementation', :path => GRPC_LOCAL_SRC
pod 'gRPC-Core/Tests', :path => GRPC_LOCAL_SRC pod 'gRPC-Core/Tests', :path => GRPC_LOCAL_SRC
end
end end
# gRPC-Core.podspec needs to be modified to be successfully used for local development. A Podfile's # gRPC-Core.podspec needs to be modified to be successfully used for local development. A Podfile's

@ -7,6 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
06467F3A8D01EC493D12ADA2 /* libPods-CronetUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C6134277D2EB8B380862A03F /* libPods-CronetUnitTests.a */; };
09B76D9585ACE7403804D9DC /* libPods-InteropTestsRemoteWithCronet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E9444C764F0FFF64A7EB58E /* libPods-InteropTestsRemoteWithCronet.a */; }; 09B76D9585ACE7403804D9DC /* libPods-InteropTestsRemoteWithCronet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E9444C764F0FFF64A7EB58E /* libPods-InteropTestsRemoteWithCronet.a */; };
0F9232F984C08643FD40C34F /* libPods-InteropTestsRemote.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DBE059B4AC7A51919467EEC0 /* libPods-InteropTestsRemote.a */; }; 0F9232F984C08643FD40C34F /* libPods-InteropTestsRemote.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DBE059B4AC7A51919467EEC0 /* libPods-InteropTestsRemote.a */; };
16A9E77B6E336B3C0B9BA6E0 /* libPods-InteropTestsLocalSSL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DBEDE45BDA60DF1E1C8950C0 /* libPods-InteropTestsLocalSSL.a */; }; 16A9E77B6E336B3C0B9BA6E0 /* libPods-InteropTestsLocalSSL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DBEDE45BDA60DF1E1C8950C0 /* libPods-InteropTestsLocalSSL.a */; };
@ -15,6 +16,8 @@
3D7C85F6AA68C4A205E3BA16 /* libPods-Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 20DFF2F3C97EF098FE5A3171 /* libPods-Tests.a */; }; 3D7C85F6AA68C4A205E3BA16 /* libPods-Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 20DFF2F3C97EF098FE5A3171 /* libPods-Tests.a */; };
5E8A5DA71D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m */; }; 5E8A5DA71D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m */; };
5E8A5DA91D3840B4000F8BC4 /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; }; 5E8A5DA91D3840B4000F8BC4 /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; };
5EAD6D271E27047400002378 /* CronetUnitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EAD6D261E27047400002378 /* CronetUnitTests.m */; };
5EAD6D291E27047400002378 /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; };
5EE84BF41D4717E40050C6CC /* InteropTestsRemoteWithCronet.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE84BF31D4717E40050C6CC /* InteropTestsRemoteWithCronet.m */; }; 5EE84BF41D4717E40050C6CC /* InteropTestsRemoteWithCronet.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EE84BF31D4717E40050C6CC /* InteropTestsRemoteWithCronet.m */; };
5EE84BF61D4717E40050C6CC /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; }; 5EE84BF61D4717E40050C6CC /* libTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 635697C71B14FC11007A7283 /* libTests.a */; };
5EE84BFE1D471D400050C6CC /* InteropTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 635ED2EB1B1A3BC400FDE5C3 /* InteropTests.m */; }; 5EE84BFE1D471D400050C6CC /* InteropTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 635ED2EB1B1A3BC400FDE5C3 /* InteropTests.m */; };
@ -52,6 +55,13 @@
remoteGlobalIDString = 635697C61B14FC11007A7283; remoteGlobalIDString = 635697C61B14FC11007A7283;
remoteInfo = Tests; remoteInfo = Tests;
}; };
5EAD6D2A1E27047400002378 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 635697BF1B14FC11007A7283 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 635697C61B14FC11007A7283;
remoteInfo = Tests;
};
5EE84BF71D4717E40050C6CC /* PBXContainerItemProxy */ = { 5EE84BF71D4717E40050C6CC /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 635697BF1B14FC11007A7283 /* Project object */; containerPortal = 635697BF1B14FC11007A7283 /* Project object */;
@ -109,6 +119,7 @@
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
02192CF1FF9534E3D18C65FC /* Pods-CronetUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetUnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests.release.xcconfig"; sourceTree = "<group>"; };
060EF32D7EC0DF67ED617507 /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = "<group>"; }; 060EF32D7EC0DF67ED617507 /* Pods-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig"; sourceTree = "<group>"; };
07D10A965323BEA7FE59A74B /* Pods-RxLibraryUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.debug.xcconfig"; sourceTree = "<group>"; }; 07D10A965323BEA7FE59A74B /* Pods-RxLibraryUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.debug.xcconfig"; sourceTree = "<group>"; };
0A4F89D9C90E9C30990218F0 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; }; 0A4F89D9C90E9C30990218F0 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
@ -117,6 +128,7 @@
17F60BF2871F6AF85FB3FA12 /* Pods-InteropTestsRemoteWithCronet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.debug.xcconfig"; sourceTree = "<group>"; }; 17F60BF2871F6AF85FB3FA12 /* Pods-InteropTestsRemoteWithCronet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.debug.xcconfig"; sourceTree = "<group>"; };
20DFF2F3C97EF098FE5A3171 /* libPods-Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 20DFF2F3C97EF098FE5A3171 /* libPods-Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
35F2B6BF3BAE8F0DC4AFD76E /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 35F2B6BF3BAE8F0DC4AFD76E /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
386712AEACF7C2190C4B8B3F /* Pods-CronetUnitTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetUnitTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests.cronet.xcconfig"; sourceTree = "<group>"; };
3B0861FC805389C52DB260D4 /* Pods-RxLibraryUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.release.xcconfig"; sourceTree = "<group>"; }; 3B0861FC805389C52DB260D4 /* Pods-RxLibraryUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.release.xcconfig"; sourceTree = "<group>"; };
3F27B2E744482771EB93C394 /* Pods-InteropTestsRemoteWithCronet.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.cronet.xcconfig"; sourceTree = "<group>"; }; 3F27B2E744482771EB93C394 /* Pods-InteropTestsRemoteWithCronet.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.cronet.xcconfig"; sourceTree = "<group>"; };
4AD97096D13D7416DC91A72A /* Pods-CoreCronetEnd2EndTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreCronetEnd2EndTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CoreCronetEnd2EndTests/Pods-CoreCronetEnd2EndTests.release.xcconfig"; sourceTree = "<group>"; }; 4AD97096D13D7416DC91A72A /* Pods-CoreCronetEnd2EndTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreCronetEnd2EndTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-CoreCronetEnd2EndTests/Pods-CoreCronetEnd2EndTests.release.xcconfig"; sourceTree = "<group>"; };
@ -127,6 +139,9 @@
5761E98978DDDF136A58CB7E /* Pods-AllTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AllTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AllTests/Pods-AllTests.release.xcconfig"; sourceTree = "<group>"; }; 5761E98978DDDF136A58CB7E /* Pods-AllTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AllTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AllTests/Pods-AllTests.release.xcconfig"; sourceTree = "<group>"; };
5E8A5DA41D3840B4000F8BC4 /* CoreCronetEnd2EndTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreCronetEnd2EndTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 5E8A5DA41D3840B4000F8BC4 /* CoreCronetEnd2EndTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreCronetEnd2EndTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CoreCronetEnd2EndTests.m; sourceTree = "<group>"; }; 5E8A5DA61D3840B4000F8BC4 /* CoreCronetEnd2EndTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CoreCronetEnd2EndTests.m; sourceTree = "<group>"; };
5EAD6D241E27047400002378 /* CronetUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CronetUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5EAD6D261E27047400002378 /* CronetUnitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CronetUnitTests.m; sourceTree = "<group>"; };
5EAD6D281E27047400002378 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5EE84BF11D4717E40050C6CC /* InteropTestsRemoteWithCronet.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InteropTestsRemoteWithCronet.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 5EE84BF11D4717E40050C6CC /* InteropTestsRemoteWithCronet.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InteropTestsRemoteWithCronet.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5EE84BF31D4717E40050C6CC /* InteropTestsRemoteWithCronet.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InteropTestsRemoteWithCronet.m; sourceTree = "<group>"; }; 5EE84BF31D4717E40050C6CC /* InteropTestsRemoteWithCronet.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InteropTestsRemoteWithCronet.m; sourceTree = "<group>"; };
5EE84BF51D4717E40050C6CC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 5EE84BF51D4717E40050C6CC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@ -146,6 +161,7 @@
63E240CC1B6C4D3A005F3B0E /* InteropTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InteropTests.h; sourceTree = "<group>"; }; 63E240CC1B6C4D3A005F3B0E /* InteropTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InteropTests.h; sourceTree = "<group>"; };
63E240CD1B6C4E2B005F3B0E /* InteropTestsLocalSSL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InteropTestsLocalSSL.m; sourceTree = "<group>"; }; 63E240CD1B6C4E2B005F3B0E /* InteropTestsLocalSSL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InteropTestsLocalSSL.m; sourceTree = "<group>"; };
63E240CF1B6C63DC005F3B0E /* TestCertificates.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TestCertificates.bundle; sourceTree = "<group>"; }; 63E240CF1B6C63DC005F3B0E /* TestCertificates.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TestCertificates.bundle; sourceTree = "<group>"; };
64F68A9A6A63CC930DD30A6E /* Pods-CronetUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CronetUnitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests.debug.xcconfig"; sourceTree = "<group>"; };
79C68EFFCB5533475D810B79 /* Pods-RxLibraryUnitTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.cronet.xcconfig"; sourceTree = "<group>"; }; 79C68EFFCB5533475D810B79 /* Pods-RxLibraryUnitTests.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RxLibraryUnitTests.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-RxLibraryUnitTests/Pods-RxLibraryUnitTests.cronet.xcconfig"; sourceTree = "<group>"; };
7A2E97E3F469CC2A758D77DE /* Pods-InteropTestsLocalSSL.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSL.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL.release.xcconfig"; sourceTree = "<group>"; }; 7A2E97E3F469CC2A758D77DE /* Pods-InteropTestsLocalSSL.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalSSL.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalSSL/Pods-InteropTestsLocalSSL.release.xcconfig"; sourceTree = "<group>"; };
9E9444C764F0FFF64A7EB58E /* libPods-InteropTestsRemoteWithCronet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsRemoteWithCronet.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 9E9444C764F0FFF64A7EB58E /* libPods-InteropTestsRemoteWithCronet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsRemoteWithCronet.a"; sourceTree = BUILT_PRODUCTS_DIR; };
@ -153,6 +169,7 @@
AA7CB64B4DD9915AE7C03163 /* Pods-InteropTestsLocalCleartext.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartext.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartext/Pods-InteropTestsLocalCleartext.cronet.xcconfig"; sourceTree = "<group>"; }; AA7CB64B4DD9915AE7C03163 /* Pods-InteropTestsLocalCleartext.cronet.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsLocalCleartext.cronet.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsLocalCleartext/Pods-InteropTestsLocalCleartext.cronet.xcconfig"; sourceTree = "<group>"; };
AC414EF7A6BF76ED02B6E480 /* Pods-InteropTestsRemoteWithCronet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.release.xcconfig"; sourceTree = "<group>"; }; AC414EF7A6BF76ED02B6E480 /* Pods-InteropTestsRemoteWithCronet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InteropTestsRemoteWithCronet.release.xcconfig"; path = "Pods/Target Support Files/Pods-InteropTestsRemoteWithCronet/Pods-InteropTestsRemoteWithCronet.release.xcconfig"; sourceTree = "<group>"; };
B94C27C06733CF98CE1B2757 /* Pods-AllTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AllTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AllTests/Pods-AllTests.debug.xcconfig"; sourceTree = "<group>"; }; B94C27C06733CF98CE1B2757 /* Pods-AllTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AllTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AllTests/Pods-AllTests.debug.xcconfig"; sourceTree = "<group>"; };
C6134277D2EB8B380862A03F /* libPods-CronetUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-CronetUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
CAE086D5B470DA367D415AB0 /* libPods-AllTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AllTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; CAE086D5B470DA367D415AB0 /* libPods-AllTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AllTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
DBE059B4AC7A51919467EEC0 /* libPods-InteropTestsRemote.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsRemote.a"; sourceTree = BUILT_PRODUCTS_DIR; }; DBE059B4AC7A51919467EEC0 /* libPods-InteropTestsRemote.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsRemote.a"; sourceTree = BUILT_PRODUCTS_DIR; };
DBEDE45BDA60DF1E1C8950C0 /* libPods-InteropTestsLocalSSL.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsLocalSSL.a"; sourceTree = BUILT_PRODUCTS_DIR; }; DBEDE45BDA60DF1E1C8950C0 /* libPods-InteropTestsLocalSSL.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InteropTestsLocalSSL.a"; sourceTree = BUILT_PRODUCTS_DIR; };
@ -177,6 +194,15 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
5EAD6D211E27047400002378 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5EAD6D291E27047400002378 /* libTests.a in Frameworks */,
06467F3A8D01EC493D12ADA2 /* libPods-CronetUnitTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
5EE84BEE1D4717E40050C6CC /* Frameworks */ = { 5EE84BEE1D4717E40050C6CC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -254,6 +280,7 @@
20DFF2F3C97EF098FE5A3171 /* libPods-Tests.a */, 20DFF2F3C97EF098FE5A3171 /* libPods-Tests.a */,
FBD98AC417B9882D32B19F28 /* libPods-CoreCronetEnd2EndTests.a */, FBD98AC417B9882D32B19F28 /* libPods-CoreCronetEnd2EndTests.a */,
9E9444C764F0FFF64A7EB58E /* libPods-InteropTestsRemoteWithCronet.a */, 9E9444C764F0FFF64A7EB58E /* libPods-InteropTestsRemoteWithCronet.a */,
C6134277D2EB8B380862A03F /* libPods-CronetUnitTests.a */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
@ -287,6 +314,9 @@
3F27B2E744482771EB93C394 /* Pods-InteropTestsRemoteWithCronet.cronet.xcconfig */, 3F27B2E744482771EB93C394 /* Pods-InteropTestsRemoteWithCronet.cronet.xcconfig */,
79C68EFFCB5533475D810B79 /* Pods-RxLibraryUnitTests.cronet.xcconfig */, 79C68EFFCB5533475D810B79 /* Pods-RxLibraryUnitTests.cronet.xcconfig */,
F671D4CAD2864FB203B920B4 /* Pods-Tests.cronet.xcconfig */, F671D4CAD2864FB203B920B4 /* Pods-Tests.cronet.xcconfig */,
64F68A9A6A63CC930DD30A6E /* Pods-CronetUnitTests.debug.xcconfig */,
386712AEACF7C2190C4B8B3F /* Pods-CronetUnitTests.cronet.xcconfig */,
02192CF1FF9534E3D18C65FC /* Pods-CronetUnitTests.release.xcconfig */,
); );
name = Pods; name = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
@ -299,6 +329,15 @@
path = CoreCronetEnd2EndTests; path = CoreCronetEnd2EndTests;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
5EAD6D251E27047400002378 /* CronetUnitTests */ = {
isa = PBXGroup;
children = (
5EAD6D261E27047400002378 /* CronetUnitTests.m */,
5EAD6D281E27047400002378 /* Info.plist */,
);
path = CronetUnitTests;
sourceTree = "<group>";
};
5EE84BF21D4717E40050C6CC /* InteropTestsRemoteWithCronet */ = { 5EE84BF21D4717E40050C6CC /* InteropTestsRemoteWithCronet */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -315,6 +354,7 @@
63E240CF1B6C63DC005F3B0E /* TestCertificates.bundle */, 63E240CF1B6C63DC005F3B0E /* TestCertificates.bundle */,
5E8A5DA51D3840B4000F8BC4 /* CoreCronetEnd2EndTests */, 5E8A5DA51D3840B4000F8BC4 /* CoreCronetEnd2EndTests */,
5EE84BF21D4717E40050C6CC /* InteropTestsRemoteWithCronet */, 5EE84BF21D4717E40050C6CC /* InteropTestsRemoteWithCronet */,
5EAD6D251E27047400002378 /* CronetUnitTests */,
635697C81B14FC11007A7283 /* Products */, 635697C81B14FC11007A7283 /* Products */,
51E4650F34F854F41FF053B3 /* Pods */, 51E4650F34F854F41FF053B3 /* Pods */,
136D535E19727099B941D7B1 /* Frameworks */, 136D535E19727099B941D7B1 /* Frameworks */,
@ -332,6 +372,7 @@
63DC84431BE152B5000708E8 /* InteropTestsLocalCleartext.xctest */, 63DC84431BE152B5000708E8 /* InteropTestsLocalCleartext.xctest */,
5E8A5DA41D3840B4000F8BC4 /* CoreCronetEnd2EndTests.xctest */, 5E8A5DA41D3840B4000F8BC4 /* CoreCronetEnd2EndTests.xctest */,
5EE84BF11D4717E40050C6CC /* InteropTestsRemoteWithCronet.xctest */, 5EE84BF11D4717E40050C6CC /* InteropTestsRemoteWithCronet.xctest */,
5EAD6D241E27047400002378 /* CronetUnitTests.xctest */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
@ -384,6 +425,27 @@
productReference = 5E8A5DA41D3840B4000F8BC4 /* CoreCronetEnd2EndTests.xctest */; productReference = 5E8A5DA41D3840B4000F8BC4 /* CoreCronetEnd2EndTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test"; productType = "com.apple.product-type.bundle.unit-test";
}; };
5EAD6D231E27047400002378 /* CronetUnitTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 5EAD6D2F1E27047400002378 /* Build configuration list for PBXNativeTarget "CronetUnitTests" */;
buildPhases = (
80E2DDD2EC04A4009F45E933 /* [CP] Check Pods Manifest.lock */,
5EAD6D201E27047400002378 /* Sources */,
5EAD6D211E27047400002378 /* Frameworks */,
5EAD6D221E27047400002378 /* Resources */,
A686B9967BB4CB81B1CBF8F8 /* [CP] Embed Pods Frameworks */,
051806D6A59B19C8A0B76BED /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
5EAD6D2B1E27047400002378 /* PBXTargetDependency */,
);
name = CronetUnitTests;
productName = CronetUnitTests;
productReference = 5EAD6D241E27047400002378 /* CronetUnitTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
5EE84BF01D4717E40050C6CC /* InteropTestsRemoteWithCronet */ = { 5EE84BF01D4717E40050C6CC /* InteropTestsRemoteWithCronet */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 5EE84BFB1D4717E40050C6CC /* Build configuration list for PBXNativeTarget "InteropTestsRemoteWithCronet" */; buildConfigurationList = 5EE84BFB1D4717E40050C6CC /* Build configuration list for PBXNativeTarget "InteropTestsRemoteWithCronet" */;
@ -541,6 +603,9 @@
5E8A5DA31D3840B4000F8BC4 = { 5E8A5DA31D3840B4000F8BC4 = {
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
}; };
5EAD6D231E27047400002378 = {
CreatedOnToolsVersion = 7.3.1;
};
5EE84BF01D4717E40050C6CC = { 5EE84BF01D4717E40050C6CC = {
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
}; };
@ -584,6 +649,7 @@
63DC84421BE152B5000708E8 /* InteropTestsLocalCleartext */, 63DC84421BE152B5000708E8 /* InteropTestsLocalCleartext */,
5E8A5DA31D3840B4000F8BC4 /* CoreCronetEnd2EndTests */, 5E8A5DA31D3840B4000F8BC4 /* CoreCronetEnd2EndTests */,
5EE84BF01D4717E40050C6CC /* InteropTestsRemoteWithCronet */, 5EE84BF01D4717E40050C6CC /* InteropTestsRemoteWithCronet */,
5EAD6D231E27047400002378 /* CronetUnitTests */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
@ -596,6 +662,13 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
5EAD6D221E27047400002378 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
5EE84BEF1D4717E40050C6CC /* Resources */ = { 5EE84BEF1D4717E40050C6CC /* Resources */ = {
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -643,6 +716,21 @@
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
051806D6A59B19C8A0B76BED /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
31F8D1C407195CBF0C02929B /* [CP] Embed Pods Frameworks */ = { 31F8D1C407195CBF0C02929B /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -670,7 +758,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
4F5690DC0E6AD6663FE78B8B /* [CP] Embed Pods Frameworks */ = { 4F5690DC0E6AD6663FE78B8B /* [CP] Embed Pods Frameworks */ = {
@ -700,7 +788,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
5F14F59509E10C2852014F9E /* [CP] Embed Pods Frameworks */ = { 5F14F59509E10C2852014F9E /* [CP] Embed Pods Frameworks */ = {
@ -760,7 +848,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
796680C7599CB4ED736DD62A /* [CP] Check Pods Manifest.lock */ = { 796680C7599CB4ED736DD62A /* [CP] Check Pods Manifest.lock */ = {
@ -775,7 +863,22 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
80E2DDD2EC04A4009F45E933 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
8AD3130D3C58A0FB32FF2A36 /* [CP] Copy Pods Resources */ = { 8AD3130D3C58A0FB32FF2A36 /* [CP] Copy Pods Resources */ = {
@ -820,7 +923,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
A441F71824DCB9D0CA297748 /* [CP] Copy Pods Resources */ = { A441F71824DCB9D0CA297748 /* [CP] Copy Pods Resources */ = {
@ -838,6 +941,21 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AllTests/Pods-AllTests-resources.sh\"\n"; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AllTests/Pods-AllTests-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
A686B9967BB4CB81B1CBF8F8 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-CronetUnitTests/Pods-CronetUnitTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
A8E3AC66DF770B774114A30E /* [CP] Embed Pods Frameworks */ = { A8E3AC66DF770B774114A30E /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -880,7 +998,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
C0F7B1FF6F88CC5FBF362F4C /* [CP] Check Pods Manifest.lock */ = { C0F7B1FF6F88CC5FBF362F4C /* [CP] Check Pods Manifest.lock */ = {
@ -895,7 +1013,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
C2E09DC4BD239F71160F0CC1 /* [CP] Copy Pods Resources */ = { C2E09DC4BD239F71160F0CC1 /* [CP] Copy Pods Resources */ = {
@ -985,7 +1103,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
@ -999,6 +1117,14 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
5EAD6D201E27047400002378 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5EAD6D271E27047400002378 /* CronetUnitTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
5EE84BED1D4717E40050C6CC /* Sources */ = { 5EE84BED1D4717E40050C6CC /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -1073,6 +1199,11 @@
target = 635697C61B14FC11007A7283 /* Tests */; target = 635697C61B14FC11007A7283 /* Tests */;
targetProxy = 5E8A5DAA1D3840B4000F8BC4 /* PBXContainerItemProxy */; targetProxy = 5E8A5DAA1D3840B4000F8BC4 /* PBXContainerItemProxy */;
}; };
5EAD6D2B1E27047400002378 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 635697C61B14FC11007A7283 /* Tests */;
targetProxy = 5EAD6D2A1E27047400002378 /* PBXContainerItemProxy */;
};
5EE84BF81D4717E40050C6CC /* PBXTargetDependency */ = { 5EE84BF81D4717E40050C6CC /* PBXTargetDependency */ = {
isa = PBXTargetDependency; isa = PBXTargetDependency;
target = 635697C61B14FC11007A7283 /* Tests */; target = 635697C61B14FC11007A7283 /* Tests */;
@ -1138,6 +1269,53 @@
}; };
name = Release; name = Release;
}; };
5EAD6D2C1E27047400002378 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 64F68A9A6A63CC930DD30A6E /* Pods-CronetUnitTests.debug.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_TESTABILITY = YES;
INFOPLIST_FILE = CronetUnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.grpc.CronetUnitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "\"${PODS_ROOT}/../../../..\" $(inherited)";
};
name = Debug;
};
5EAD6D2D1E27047400002378 /* Cronet */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 386712AEACF7C2190C4B8B3F /* Pods-CronetUnitTests.cronet.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = CronetUnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.grpc.CronetUnitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "\"${PODS_ROOT}/../../../..\" $(inherited)";
};
name = Cronet;
};
5EAD6D2E1E27047400002378 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 02192CF1FF9534E3D18C65FC /* Pods-CronetUnitTests.release.xcconfig */;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = CronetUnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.grpc.CronetUnitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "\"${PODS_ROOT}/../../../..\" $(inherited)";
};
name = Release;
};
5EC3C7A01D4FC18C000330E2 /* Cronet */ = { 5EC3C7A01D4FC18C000330E2 /* Cronet */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
@ -1597,6 +1775,16 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
5EAD6D2F1E27047400002378 /* Build configuration list for PBXNativeTarget "CronetUnitTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5EAD6D2C1E27047400002378 /* Debug */,
5EAD6D2D1E27047400002378 /* Cronet */,
5EAD6D2E1E27047400002378 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
5EE84BFB1D4717E40050C6CC /* Build configuration list for PBXNativeTarget "InteropTestsRemoteWithCronet" */ = { 5EE84BFB1D4717E40050C6CC /* Build configuration list for PBXNativeTarget "InteropTestsRemoteWithCronet" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5EAD6D231E27047400002378"
BuildableName = "CronetUnitTests.xctest"
BlueprintName = "CronetUnitTests"
ReferencedContainer = "container:Tests.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

@ -163,6 +163,13 @@ of this repo. The plugin can be found in the `bins/opt` directory. We are
planning to provide a better way to download and install the plugin planning to provide a better way to download and install the plugin
in the future. in the future.
You can also just build the gRPC PHP protoc plugin by running:
```sh
$ cd grpc
$ make grpc_php_plugin
```
### Client Stub ### Client Stub

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

Loading…
Cancel
Save