Merge github.com:grpc/grpc into compatibility_mode

pull/5078/head
Craig Tiller 9 years ago
commit b718c8af70
  1. 575
      BUILD
  2. 1570
      Makefile
  3. 1
      PYTHON-MANIFEST.in
  4. 22
      Rakefile
  5. 109
      binding.gyp
  6. 402
      build.yaml
  7. 4
      examples/node/greeter_client.js
  8. 4
      examples/node/greeter_server.js
  9. 7
      examples/node/package.json
  10. 6
      examples/node/route_guide/route_guide_client.js
  11. 6
      examples/node/route_guide/route_guide_server.js
  12. 4
      examples/objective-c/helloworld/main.m
  13. 6
      examples/protos/helloworld.proto
  14. 6
      examples/protos/route_guide.proto
  15. 224
      gRPC.podspec
  16. 135
      grpc.gemspec
  17. 46
      include/grpc++/impl/codegen/async_unary_call.h
  18. 18
      include/grpc++/impl/codegen/call.h
  19. 1
      include/grpc++/impl/codegen/rpc_service_method.h
  20. 3
      include/grpc++/impl/codegen/server_interface.h
  21. 2
      include/grpc++/security/credentials.h
  22. 2
      include/grpc/impl/codegen/compression_types.h
  23. 2
      include/grpc/impl/codegen/propagation_bits.h
  24. 3
      include/grpc/impl/codegen/sync.h
  25. 18
      include/grpc/impl/codegen/time.h
  26. 178
      package.json
  27. 1
      requirements.txt
  28. 11
      setup.py
  29. 2
      src/boringssl/gen_build_yaml.py
  30. 1
      src/compiler/cpp_generator.cc
  31. 2
      src/core/iomgr/iocp_windows.c
  32. 2
      src/core/iomgr/pollset_posix.c
  33. 6
      src/core/iomgr/pollset_windows.c
  34. 11
      src/core/iomgr/tcp_server.h
  35. 12
      src/core/support/stack_lockfree.c
  36. 1
      src/core/support/sync_win32.c
  37. 38
      src/core/support/time.c
  38. 2
      src/core/surface/version.c
  39. 7
      src/core/transport/chttp2/writing.c
  40. 34
      src/core/transport/static_metadata.c
  41. 6
      src/core/transport/static_metadata.h
  42. 4
      src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs
  43. 2
      src/csharp/Grpc.Core/Internal/NativeExtension.cs
  44. 4
      src/csharp/Grpc.Core/Profiling/Profilers.cs
  45. 4
      src/csharp/Grpc.Core/Version.cs
  46. 7
      src/csharp/Grpc.Core/VersionInfo.cs
  47. 2
      src/csharp/build_packages.bat
  48. 6
      src/node/ext/byte_buffer.cc
  49. 5
      src/node/ext/timeval.cc
  50. 10
      src/node/performance/worker_service_impl.js
  51. 16
      src/objective-c/GRPCClient/GRPCCall+ChannelArg.h
  52. 23
      src/objective-c/GRPCClient/GRPCCall+ChannelArg.m
  53. 47
      src/objective-c/GRPCClient/private/GRPCChannel.h
  54. 168
      src/objective-c/GRPCClient/private/GRPCChannel.m
  55. 3
      src/objective-c/GRPCClient/private/GRPCHost.h
  56. 33
      src/objective-c/GRPCClient/private/GRPCHost.m
  57. 118
      src/objective-c/GRPCClient/private/GRPCSecureChannel.m
  58. 11
      src/php/ext/grpc/config.m4
  59. 3
      src/proto/grpc/testing/control.proto
  60. 3
      src/proto/grpc/testing/services.proto
  61. 2
      src/python/grpcio/.gitignore
  62. 49
      src/python/grpcio/commands.py
  63. 5
      src/python/grpcio/grpc/_adapter/_low.py
  64. 11
      src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
  65. 2
      src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
  66. 32
      src/python/grpcio/grpc/_cython/_cygrpc/security.pxd.pxi
  67. 44
      src/python/grpcio/grpc/_cython/_cygrpc/security.pyx.pxi
  68. 1
      src/python/grpcio/grpc/_cython/cygrpc.pxd
  69. 5
      src/python/grpcio/grpc/_cython/cygrpc.pyx
  70. 12
      src/python/grpcio/grpc/_cython/imports.generated.h
  71. 86
      src/python/grpcio/grpc_core_dependencies.py
  72. 32
      src/python/grpcio/grpc_version.py
  73. 54
      src/python/grpcio/tests/unit/beta/_implementations_test.py
  74. 3
      src/ruby/ext/grpc/extconf.rb
  75. 2
      src/ruby/ext/grpc/rb_channel.c
  76. 12
      src/ruby/ext/grpc/rb_grpc_imports.generated.h
  77. 2
      src/ruby/ext/grpc/rb_server_credentials.c
  78. 2
      src/ruby/lib/grpc/version.rb
  79. 2
      templates/BUILD.template
  80. 34
      templates/Makefile.template
  81. 4
      templates/gRPC.podspec.template
  82. 5
      templates/grpc.gemspec.template
  83. 2
      templates/package.json.template
  84. 3
      templates/src/core/surface/version.c.template
  85. 7
      templates/src/csharp/Grpc.Core/VersionInfo.cs.template
  86. 2
      templates/src/csharp/build_packages.bat.template
  87. 34
      templates/src/python/grpcio/grpc_version.py.template
  88. 35
      templates/src/ruby/lib/grpc/version.rb.template
  89. 33
      templates/tools/dockerfile/apt_get_basic.include
  90. 7
      templates/tools/dockerfile/ccache_setup.include
  91. 16
      templates/tools/dockerfile/csharp_deps.include
  92. 3
      templates/tools/dockerfile/cxx_deps.include
  93. 7
      templates/tools/dockerfile/node_deps.include
  94. 13
      templates/tools/dockerfile/php_deps.include
  95. 14
      templates/tools/dockerfile/python_deps.include
  96. 14
      templates/tools/dockerfile/ruby_deps.include
  97. 7
      templates/tools/dockerfile/run_tests_addons.include
  98. 39
      templates/tools/dockerfile/test/csharp_jessie_x64/Dockerfile.template
  99. 39
      templates/tools/dockerfile/test/cxx_jessie_x64/Dockerfile.template
  100. 39
      templates/tools/dockerfile/test/cxx_jessie_x86/Dockerfile.template
  101. Some files were not shown because too many files have changed in this diff Show More

575
BUILD

@ -41,6 +41,116 @@ package(default_visibility = ["//visibility:public"])
cc_library(
name = "gpr",
srcs = [
"src/core/profiling/timers.h",
"src/core/support/block_annotate.h",
"src/core/support/env.h",
"src/core/support/file.h",
"src/core/support/murmur_hash.h",
"src/core/support/stack_lockfree.h",
"src/core/support/string.h",
"src/core/support/string_win32.h",
"src/core/support/thd_internal.h",
"src/core/support/time_precise.h",
"src/core/profiling/basic_timers.c",
"src/core/profiling/stap_timers.c",
"src/core/support/alloc.c",
"src/core/support/avl.c",
"src/core/support/cmdline.c",
"src/core/support/cpu_iphone.c",
"src/core/support/cpu_linux.c",
"src/core/support/cpu_posix.c",
"src/core/support/cpu_windows.c",
"src/core/support/env_linux.c",
"src/core/support/env_posix.c",
"src/core/support/env_win32.c",
"src/core/support/file.c",
"src/core/support/file_posix.c",
"src/core/support/file_win32.c",
"src/core/support/histogram.c",
"src/core/support/host_port.c",
"src/core/support/log.c",
"src/core/support/log_android.c",
"src/core/support/log_linux.c",
"src/core/support/log_posix.c",
"src/core/support/log_win32.c",
"src/core/support/murmur_hash.c",
"src/core/support/slice.c",
"src/core/support/slice_buffer.c",
"src/core/support/stack_lockfree.c",
"src/core/support/string.c",
"src/core/support/string_posix.c",
"src/core/support/string_win32.c",
"src/core/support/subprocess_posix.c",
"src/core/support/subprocess_windows.c",
"src/core/support/sync.c",
"src/core/support/sync_posix.c",
"src/core/support/sync_win32.c",
"src/core/support/thd.c",
"src/core/support/thd_posix.c",
"src/core/support/thd_win32.c",
"src/core/support/time.c",
"src/core/support/time_posix.c",
"src/core/support/time_precise.c",
"src/core/support/time_win32.c",
"src/core/support/tls_pthread.c",
"src/core/support/wrap_memcpy.c",
],
hdrs = [
"include/grpc/support/alloc.h",
"include/grpc/support/atm.h",
"include/grpc/support/atm_gcc_atomic.h",
"include/grpc/support/atm_gcc_sync.h",
"include/grpc/support/atm_win32.h",
"include/grpc/support/avl.h",
"include/grpc/support/cmdline.h",
"include/grpc/support/cpu.h",
"include/grpc/support/histogram.h",
"include/grpc/support/host_port.h",
"include/grpc/support/log.h",
"include/grpc/support/log_win32.h",
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
"include/grpc/support/string_util.h",
"include/grpc/support/subprocess.h",
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
"include/grpc/support/sync_posix.h",
"include/grpc/support/sync_win32.h",
"include/grpc/support/thd.h",
"include/grpc/support/time.h",
"include/grpc/support/tls.h",
"include/grpc/support/tls_gcc.h",
"include/grpc/support/tls_msvc.h",
"include/grpc/support/tls_pthread.h",
"include/grpc/support/useful.h",
"include/grpc/impl/codegen/alloc.h",
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
"include/grpc/impl/codegen/atm_win32.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
"include/grpc/impl/codegen/slice_buffer.h",
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
"include/grpc/impl/codegen/sync_win32.h",
"include/grpc/impl/codegen/time.h",
],
includes = [
"include",
".",
],
deps = [
],
)
cc_library( cc_library(
name = "grpc", name = "grpc",
srcs = [ srcs = [
@ -171,16 +281,6 @@ cc_library(
"src/core/transport/static_metadata.h", "src/core/transport/static_metadata.h",
"src/core/transport/transport.h", "src/core/transport/transport.h",
"src/core/transport/transport_impl.h", "src/core/transport/transport_impl.h",
"src/core/profiling/timers.h",
"src/core/support/block_annotate.h",
"src/core/support/env.h",
"src/core/support/file.h",
"src/core/support/murmur_hash.h",
"src/core/support/stack_lockfree.h",
"src/core/support/string.h",
"src/core/support/string_win32.h",
"src/core/support/thd_internal.h",
"src/core/support/time_precise.h",
"src/core/census/aggregation.h", "src/core/census/aggregation.h",
"src/core/census/rpc_metric_id.h", "src/core/census/rpc_metric_id.h",
"src/core/httpcli/httpcli_security_connector.c", "src/core/httpcli/httpcli_security_connector.c",
@ -331,49 +431,6 @@ cc_library(
"src/core/transport/static_metadata.c", "src/core/transport/static_metadata.c",
"src/core/transport/transport.c", "src/core/transport/transport.c",
"src/core/transport/transport_op_string.c", "src/core/transport/transport_op_string.c",
"src/core/profiling/basic_timers.c",
"src/core/profiling/stap_timers.c",
"src/core/support/alloc.c",
"src/core/support/avl.c",
"src/core/support/cmdline.c",
"src/core/support/cpu_iphone.c",
"src/core/support/cpu_linux.c",
"src/core/support/cpu_posix.c",
"src/core/support/cpu_windows.c",
"src/core/support/env_linux.c",
"src/core/support/env_posix.c",
"src/core/support/env_win32.c",
"src/core/support/file.c",
"src/core/support/file_posix.c",
"src/core/support/file_win32.c",
"src/core/support/histogram.c",
"src/core/support/host_port.c",
"src/core/support/log.c",
"src/core/support/log_android.c",
"src/core/support/log_linux.c",
"src/core/support/log_posix.c",
"src/core/support/log_win32.c",
"src/core/support/murmur_hash.c",
"src/core/support/slice.c",
"src/core/support/slice_buffer.c",
"src/core/support/stack_lockfree.c",
"src/core/support/string.c",
"src/core/support/string_posix.c",
"src/core/support/string_win32.c",
"src/core/support/subprocess_posix.c",
"src/core/support/subprocess_windows.c",
"src/core/support/sync.c",
"src/core/support/sync_posix.c",
"src/core/support/sync_win32.c",
"src/core/support/thd.c",
"src/core/support/thd_posix.c",
"src/core/support/thd_win32.c",
"src/core/support/time.c",
"src/core/support/time_posix.c",
"src/core/support/time_precise.c",
"src/core/support/time_win32.c",
"src/core/support/tls_pthread.c",
"src/core/support/wrap_memcpy.c",
"src/core/census/context.c", "src/core/census/context.c",
"src/core/census/initialize.c", "src/core/census/initialize.c",
"src/core/census/operation.c", "src/core/census/operation.c",
@ -382,59 +439,17 @@ cc_library(
], ],
hdrs = [ hdrs = [
"include/grpc/grpc_security.h", "include/grpc/grpc_security.h",
"include/grpc/byte_buffer.h",
"include/grpc/byte_buffer_reader.h",
"include/grpc/compression.h",
"include/grpc/grpc.h",
"include/grpc/status.h",
"include/grpc/support/alloc.h",
"include/grpc/support/atm.h",
"include/grpc/support/atm_gcc_atomic.h",
"include/grpc/support/atm_gcc_sync.h",
"include/grpc/support/atm_win32.h",
"include/grpc/support/avl.h",
"include/grpc/support/cmdline.h",
"include/grpc/support/cpu.h",
"include/grpc/support/histogram.h",
"include/grpc/support/host_port.h",
"include/grpc/support/log.h",
"include/grpc/support/log_win32.h",
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
"include/grpc/support/string_util.h",
"include/grpc/support/subprocess.h",
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
"include/grpc/support/sync_posix.h",
"include/grpc/support/sync_win32.h",
"include/grpc/support/thd.h",
"include/grpc/support/time.h",
"include/grpc/support/tls.h",
"include/grpc/support/tls_gcc.h",
"include/grpc/support/tls_msvc.h",
"include/grpc/support/tls_pthread.h",
"include/grpc/support/useful.h",
"include/grpc/impl/codegen/alloc.h",
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
"include/grpc/impl/codegen/atm_win32.h",
"include/grpc/impl/codegen/byte_buffer.h", "include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/compression_types.h", "include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h", "include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h", "include/grpc/impl/codegen/grpc_types.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/slice.h",
"include/grpc/impl/codegen/slice_buffer.h",
"include/grpc/impl/codegen/status.h", "include/grpc/impl/codegen/status.h",
"include/grpc/impl/codegen/sync.h", "include/grpc/byte_buffer.h",
"include/grpc/impl/codegen/sync_generic.h", "include/grpc/byte_buffer_reader.h",
"include/grpc/impl/codegen/sync_posix.h", "include/grpc/compression.h",
"include/grpc/impl/codegen/sync_win32.h", "include/grpc/grpc.h",
"include/grpc/impl/codegen/time.h", "include/grpc/status.h",
"include/grpc/census.h", "include/grpc/census.h",
], ],
includes = [ includes = [
@ -444,6 +459,7 @@ cc_library(
deps = [ deps = [
"//external:libssl", "//external:libssl",
"//external:zlib", "//external:zlib",
":gpr",
], ],
copts = [ copts = [
"-std=gnu99", "-std=gnu99",
@ -454,16 +470,6 @@ cc_library(
cc_library( cc_library(
name = "grpc_unsecure", name = "grpc_unsecure",
srcs = [ srcs = [
"src/core/profiling/timers.h",
"src/core/support/block_annotate.h",
"src/core/support/env.h",
"src/core/support/file.h",
"src/core/support/murmur_hash.h",
"src/core/support/stack_lockfree.h",
"src/core/support/string.h",
"src/core/support/string_win32.h",
"src/core/support/thd_internal.h",
"src/core/support/time_precise.h",
"src/core/census/grpc_filter.h", "src/core/census/grpc_filter.h",
"src/core/channel/channel_args.h", "src/core/channel/channel_args.h",
"src/core/channel/channel_stack.h", "src/core/channel/channel_stack.h",
@ -580,49 +586,6 @@ cc_library(
"src/core/census/aggregation.h", "src/core/census/aggregation.h",
"src/core/census/rpc_metric_id.h", "src/core/census/rpc_metric_id.h",
"src/core/surface/init_unsecure.c", "src/core/surface/init_unsecure.c",
"src/core/profiling/basic_timers.c",
"src/core/profiling/stap_timers.c",
"src/core/support/alloc.c",
"src/core/support/avl.c",
"src/core/support/cmdline.c",
"src/core/support/cpu_iphone.c",
"src/core/support/cpu_linux.c",
"src/core/support/cpu_posix.c",
"src/core/support/cpu_windows.c",
"src/core/support/env_linux.c",
"src/core/support/env_posix.c",
"src/core/support/env_win32.c",
"src/core/support/file.c",
"src/core/support/file_posix.c",
"src/core/support/file_win32.c",
"src/core/support/histogram.c",
"src/core/support/host_port.c",
"src/core/support/log.c",
"src/core/support/log_android.c",
"src/core/support/log_linux.c",
"src/core/support/log_posix.c",
"src/core/support/log_win32.c",
"src/core/support/murmur_hash.c",
"src/core/support/slice.c",
"src/core/support/slice_buffer.c",
"src/core/support/stack_lockfree.c",
"src/core/support/string.c",
"src/core/support/string_posix.c",
"src/core/support/string_win32.c",
"src/core/support/subprocess_posix.c",
"src/core/support/subprocess_windows.c",
"src/core/support/sync.c",
"src/core/support/sync_posix.c",
"src/core/support/sync_win32.c",
"src/core/support/thd.c",
"src/core/support/thd_posix.c",
"src/core/support/thd_win32.c",
"src/core/support/time.c",
"src/core/support/time_posix.c",
"src/core/support/time_precise.c",
"src/core/support/time_win32.c",
"src/core/support/tls_pthread.c",
"src/core/support/wrap_memcpy.c",
"src/core/census/grpc_context.c", "src/core/census/grpc_context.c",
"src/core/census/grpc_filter.c", "src/core/census/grpc_filter.c",
"src/core/channel/channel_args.c", "src/core/channel/channel_args.c",
@ -746,70 +709,28 @@ cc_library(
"src/core/transport/chttp2_transport.c", "src/core/transport/chttp2_transport.c",
"src/core/transport/connectivity_state.c", "src/core/transport/connectivity_state.c",
"src/core/transport/metadata.c", "src/core/transport/metadata.c",
"src/core/transport/metadata_batch.c", "src/core/transport/metadata_batch.c",
"src/core/transport/static_metadata.c", "src/core/transport/static_metadata.c",
"src/core/transport/transport.c", "src/core/transport/transport.c",
"src/core/transport/transport_op_string.c", "src/core/transport/transport_op_string.c",
"src/core/census/context.c", "src/core/census/context.c",
"src/core/census/initialize.c", "src/core/census/initialize.c",
"src/core/census/operation.c", "src/core/census/operation.c",
"src/core/census/placeholders.c", "src/core/census/placeholders.c",
"src/core/census/tracing.c", "src/core/census/tracing.c",
], ],
hdrs = [ hdrs = [
"include/grpc/support/alloc.h", "include/grpc/byte_buffer.h",
"include/grpc/support/atm.h", "include/grpc/byte_buffer_reader.h",
"include/grpc/support/atm_gcc_atomic.h", "include/grpc/compression.h",
"include/grpc/support/atm_gcc_sync.h", "include/grpc/grpc.h",
"include/grpc/support/atm_win32.h", "include/grpc/status.h",
"include/grpc/support/avl.h",
"include/grpc/support/cmdline.h",
"include/grpc/support/cpu.h",
"include/grpc/support/histogram.h",
"include/grpc/support/host_port.h",
"include/grpc/support/log.h",
"include/grpc/support/log_win32.h",
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
"include/grpc/support/string_util.h",
"include/grpc/support/subprocess.h",
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
"include/grpc/support/sync_posix.h",
"include/grpc/support/sync_win32.h",
"include/grpc/support/thd.h",
"include/grpc/support/time.h",
"include/grpc/support/tls.h",
"include/grpc/support/tls_gcc.h",
"include/grpc/support/tls_msvc.h",
"include/grpc/support/tls_pthread.h",
"include/grpc/support/useful.h",
"include/grpc/impl/codegen/alloc.h",
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
"include/grpc/impl/codegen/atm_win32.h",
"include/grpc/impl/codegen/byte_buffer.h", "include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/compression_types.h", "include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h", "include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h", "include/grpc/impl/codegen/grpc_types.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/slice.h",
"include/grpc/impl/codegen/slice_buffer.h",
"include/grpc/impl/codegen/status.h", "include/grpc/impl/codegen/status.h",
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
"include/grpc/impl/codegen/sync_win32.h",
"include/grpc/impl/codegen/time.h",
"include/grpc/byte_buffer.h",
"include/grpc/byte_buffer_reader.h",
"include/grpc/compression.h",
"include/grpc/grpc.h",
"include/grpc/status.h",
"include/grpc/census.h", "include/grpc/census.h",
], ],
includes = [ includes = [
@ -817,6 +738,7 @@ cc_library(
".", ".",
], ],
deps = [ deps = [
":gpr",
], ],
copts = [ copts = [
"-std=gnu99", "-std=gnu99",
@ -838,6 +760,7 @@ cc_library(
".", ".",
], ],
deps = [ deps = [
":gpr",
":grpc", ":grpc",
], ],
) )
@ -1093,6 +1016,7 @@ cc_library(
], ],
deps = [ deps = [
"//external:protobuf_clib", "//external:protobuf_clib",
":gpr",
":grpc_unsecure", ":grpc_unsecure",
], ],
) )
@ -1154,21 +1078,21 @@ cc_library(
"include/grpc++/impl/codegen/sync_no_cxx11.h", "include/grpc++/impl/codegen/sync_no_cxx11.h",
"include/grpc++/impl/codegen/sync_stream.h", "include/grpc++/impl/codegen/sync_stream.h",
"include/grpc++/impl/codegen/time.h", "include/grpc++/impl/codegen/time.h",
"include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h",
"include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/status.h",
"include/grpc/impl/codegen/alloc.h", "include/grpc/impl/codegen/alloc.h",
"include/grpc/impl/codegen/atm.h", "include/grpc/impl/codegen/atm.h",
"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_win32.h", "include/grpc/impl/codegen/atm_win32.h",
"include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h",
"include/grpc/impl/codegen/log.h", "include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h", "include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/slice.h", "include/grpc/impl/codegen/slice.h",
"include/grpc/impl/codegen/slice_buffer.h", "include/grpc/impl/codegen/slice_buffer.h",
"include/grpc/impl/codegen/status.h",
"include/grpc/impl/codegen/sync.h", "include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h", "include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h", "include/grpc/impl/codegen/sync_posix.h",
@ -1198,11 +1122,122 @@ cc_library(
], ],
deps = [ deps = [
":grpc", ":grpc",
":gpr",
], ],
) )
objc_library(
name = "gpr_objc",
srcs = [
"src/core/profiling/basic_timers.c",
"src/core/profiling/stap_timers.c",
"src/core/support/alloc.c",
"src/core/support/avl.c",
"src/core/support/cmdline.c",
"src/core/support/cpu_iphone.c",
"src/core/support/cpu_linux.c",
"src/core/support/cpu_posix.c",
"src/core/support/cpu_windows.c",
"src/core/support/env_linux.c",
"src/core/support/env_posix.c",
"src/core/support/env_win32.c",
"src/core/support/file.c",
"src/core/support/file_posix.c",
"src/core/support/file_win32.c",
"src/core/support/histogram.c",
"src/core/support/host_port.c",
"src/core/support/log.c",
"src/core/support/log_android.c",
"src/core/support/log_linux.c",
"src/core/support/log_posix.c",
"src/core/support/log_win32.c",
"src/core/support/murmur_hash.c",
"src/core/support/slice.c",
"src/core/support/slice_buffer.c",
"src/core/support/stack_lockfree.c",
"src/core/support/string.c",
"src/core/support/string_posix.c",
"src/core/support/string_win32.c",
"src/core/support/subprocess_posix.c",
"src/core/support/subprocess_windows.c",
"src/core/support/sync.c",
"src/core/support/sync_posix.c",
"src/core/support/sync_win32.c",
"src/core/support/thd.c",
"src/core/support/thd_posix.c",
"src/core/support/thd_win32.c",
"src/core/support/time.c",
"src/core/support/time_posix.c",
"src/core/support/time_precise.c",
"src/core/support/time_win32.c",
"src/core/support/tls_pthread.c",
"src/core/support/wrap_memcpy.c",
],
hdrs = [
"include/grpc/support/alloc.h",
"include/grpc/support/atm.h",
"include/grpc/support/atm_gcc_atomic.h",
"include/grpc/support/atm_gcc_sync.h",
"include/grpc/support/atm_win32.h",
"include/grpc/support/avl.h",
"include/grpc/support/cmdline.h",
"include/grpc/support/cpu.h",
"include/grpc/support/histogram.h",
"include/grpc/support/host_port.h",
"include/grpc/support/log.h",
"include/grpc/support/log_win32.h",
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
"include/grpc/support/string_util.h",
"include/grpc/support/subprocess.h",
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
"include/grpc/support/sync_posix.h",
"include/grpc/support/sync_win32.h",
"include/grpc/support/thd.h",
"include/grpc/support/time.h",
"include/grpc/support/tls.h",
"include/grpc/support/tls_gcc.h",
"include/grpc/support/tls_msvc.h",
"include/grpc/support/tls_pthread.h",
"include/grpc/support/useful.h",
"include/grpc/impl/codegen/alloc.h",
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
"include/grpc/impl/codegen/atm_win32.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
"include/grpc/impl/codegen/slice_buffer.h",
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
"include/grpc/impl/codegen/sync_win32.h",
"include/grpc/impl/codegen/time.h",
"src/core/profiling/timers.h",
"src/core/support/block_annotate.h",
"src/core/support/env.h",
"src/core/support/file.h",
"src/core/support/murmur_hash.h",
"src/core/support/stack_lockfree.h",
"src/core/support/string.h",
"src/core/support/string_win32.h",
"src/core/support/thd_internal.h",
"src/core/support/time_precise.h",
],
includes = [
"include",
".",
],
deps = [
],
)
objc_library( objc_library(
name = "grpc_objc", name = "grpc_objc",
srcs = [ srcs = [
@ -1354,49 +1389,6 @@ objc_library(
"src/core/transport/static_metadata.c", "src/core/transport/static_metadata.c",
"src/core/transport/transport.c", "src/core/transport/transport.c",
"src/core/transport/transport_op_string.c", "src/core/transport/transport_op_string.c",
"src/core/profiling/basic_timers.c",
"src/core/profiling/stap_timers.c",
"src/core/support/alloc.c",
"src/core/support/avl.c",
"src/core/support/cmdline.c",
"src/core/support/cpu_iphone.c",
"src/core/support/cpu_linux.c",
"src/core/support/cpu_posix.c",
"src/core/support/cpu_windows.c",
"src/core/support/env_linux.c",
"src/core/support/env_posix.c",
"src/core/support/env_win32.c",
"src/core/support/file.c",
"src/core/support/file_posix.c",
"src/core/support/file_win32.c",
"src/core/support/histogram.c",
"src/core/support/host_port.c",
"src/core/support/log.c",
"src/core/support/log_android.c",
"src/core/support/log_linux.c",
"src/core/support/log_posix.c",
"src/core/support/log_win32.c",
"src/core/support/murmur_hash.c",
"src/core/support/slice.c",
"src/core/support/slice_buffer.c",
"src/core/support/stack_lockfree.c",
"src/core/support/string.c",
"src/core/support/string_posix.c",
"src/core/support/string_win32.c",
"src/core/support/subprocess_posix.c",
"src/core/support/subprocess_windows.c",
"src/core/support/sync.c",
"src/core/support/sync_posix.c",
"src/core/support/sync_win32.c",
"src/core/support/thd.c",
"src/core/support/thd_posix.c",
"src/core/support/thd_win32.c",
"src/core/support/time.c",
"src/core/support/time_posix.c",
"src/core/support/time_precise.c",
"src/core/support/time_win32.c",
"src/core/support/tls_pthread.c",
"src/core/support/wrap_memcpy.c",
"src/core/census/context.c", "src/core/census/context.c",
"src/core/census/initialize.c", "src/core/census/initialize.c",
"src/core/census/operation.c", "src/core/census/operation.c",
@ -1405,59 +1397,17 @@ objc_library(
], ],
hdrs = [ hdrs = [
"include/grpc/grpc_security.h", "include/grpc/grpc_security.h",
"include/grpc/byte_buffer.h",
"include/grpc/byte_buffer_reader.h",
"include/grpc/compression.h",
"include/grpc/grpc.h",
"include/grpc/status.h",
"include/grpc/support/alloc.h",
"include/grpc/support/atm.h",
"include/grpc/support/atm_gcc_atomic.h",
"include/grpc/support/atm_gcc_sync.h",
"include/grpc/support/atm_win32.h",
"include/grpc/support/avl.h",
"include/grpc/support/cmdline.h",
"include/grpc/support/cpu.h",
"include/grpc/support/histogram.h",
"include/grpc/support/host_port.h",
"include/grpc/support/log.h",
"include/grpc/support/log_win32.h",
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
"include/grpc/support/string_util.h",
"include/grpc/support/subprocess.h",
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
"include/grpc/support/sync_posix.h",
"include/grpc/support/sync_win32.h",
"include/grpc/support/thd.h",
"include/grpc/support/time.h",
"include/grpc/support/tls.h",
"include/grpc/support/tls_gcc.h",
"include/grpc/support/tls_msvc.h",
"include/grpc/support/tls_pthread.h",
"include/grpc/support/useful.h",
"include/grpc/impl/codegen/alloc.h",
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
"include/grpc/impl/codegen/atm_win32.h",
"include/grpc/impl/codegen/byte_buffer.h", "include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/compression_types.h", "include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h", "include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h", "include/grpc/impl/codegen/grpc_types.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/slice.h",
"include/grpc/impl/codegen/slice_buffer.h",
"include/grpc/impl/codegen/status.h", "include/grpc/impl/codegen/status.h",
"include/grpc/impl/codegen/sync.h", "include/grpc/byte_buffer.h",
"include/grpc/impl/codegen/sync_generic.h", "include/grpc/byte_buffer_reader.h",
"include/grpc/impl/codegen/sync_posix.h", "include/grpc/compression.h",
"include/grpc/impl/codegen/sync_win32.h", "include/grpc/grpc.h",
"include/grpc/impl/codegen/time.h", "include/grpc/status.h",
"include/grpc/census.h", "include/grpc/census.h",
"src/core/security/auth_filters.h", "src/core/security/auth_filters.h",
"src/core/security/base64.h", "src/core/security/base64.h",
@ -1586,16 +1536,6 @@ objc_library(
"src/core/transport/static_metadata.h", "src/core/transport/static_metadata.h",
"src/core/transport/transport.h", "src/core/transport/transport.h",
"src/core/transport/transport_impl.h", "src/core/transport/transport_impl.h",
"src/core/profiling/timers.h",
"src/core/support/block_annotate.h",
"src/core/support/env.h",
"src/core/support/file.h",
"src/core/support/murmur_hash.h",
"src/core/support/stack_lockfree.h",
"src/core/support/string.h",
"src/core/support/string_win32.h",
"src/core/support/thd_internal.h",
"src/core/support/time_precise.h",
"src/core/census/aggregation.h", "src/core/census/aggregation.h",
"src/core/census/rpc_metric_id.h", "src/core/census/rpc_metric_id.h",
], ],
@ -1604,6 +1544,7 @@ objc_library(
".", ".",
], ],
deps = [ deps = [
":gpr_objc",
"//external:libssl_objc", "//external:libssl_objc",
], ],
sdk_dylibs = ["libz"], sdk_dylibs = ["libz"],

1570
Makefile

File diff suppressed because it is too large Load Diff

@ -5,6 +5,7 @@ graft include/grpc
graft third_party/boringssl graft third_party/boringssl
graft third_party/zlib graft third_party/zlib
include src/python/grpcio/commands.py include src/python/grpcio/commands.py
include src/python/grpcio/grpc_version.py
include src/python/grpcio/grpc_core_dependencies.py include src/python/grpcio/grpc_core_dependencies.py
include src/python/grpcio/support.py include src/python/grpcio/support.py
include src/python/grpcio/README.rst include src/python/grpcio/README.rst

@ -3,6 +3,7 @@ require 'rake/extensiontask'
require 'rspec/core/rake_task' require 'rspec/core/rake_task'
require 'rubocop/rake_task' require 'rubocop/rake_task'
require 'bundler/gem_tasks' require 'bundler/gem_tasks'
require 'fileutils'
load 'tools/distrib/docker_for_windows.rb' load 'tools/distrib/docker_for_windows.rb'
@ -23,7 +24,11 @@ Rake::ExtensionTask.new('grpc_c', spec) do |ext|
ext.ext_dir = File.join('src', 'ruby', 'ext', 'grpc') ext.ext_dir = File.join('src', 'ruby', 'ext', 'grpc')
ext.lib_dir = File.join('src', 'ruby', 'lib', 'grpc') ext.lib_dir = File.join('src', 'ruby', 'lib', 'grpc')
ext.cross_compile = true ext.cross_compile = true
ext.cross_platform = ['x86-mingw32', 'x64-mingw32'] ext.cross_platform = [
'x86-mingw32', 'x64-mingw32',
'x86_64-linux', 'x86-linux',
'universal-darwin'
]
ext.cross_compiling do |spec| ext.cross_compiling do |spec|
spec.files = %w( etc/roots.pem grpc_c.32.ruby grpc_c.64.ruby ) spec.files = %w( etc/roots.pem grpc_c.32.ruby grpc_c.64.ruby )
spec.files += Dir.glob('src/ruby/bin/**/*') spec.files += Dir.glob('src/ruby/bin/**/*')
@ -91,11 +96,18 @@ task 'dlls' do
end end
desc 'Build the gem file under rake_compiler_dock' desc 'Build the native gem file under rake_compiler_dock'
task 'gem:windows' do task 'gem:native' do
verbose = ENV['V'] || '0' verbose = ENV['V'] || '0'
docker_for_windows "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.6:2.0.0 V=#{verbose}" if RUBY_PLATFORM =~ /darwin/
FileUtils.touch 'grpc_c.32.ruby'
FileUtils.touch 'grpc_c.64.ruby'
system "rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.5:2.0.0 V=#{verbose}"
else
Rake::Task['dlls'].execute
docker_for_windows "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.5:2.0.0 V=#{verbose}"
end
end end
# Define dependencies between the suites. # Define dependencies between the suites.
@ -105,8 +117,6 @@ task 'suite:bidi' => 'suite:wrapper'
task 'suite:server' => 'suite:wrapper' task 'suite:server' => 'suite:wrapper'
task 'suite:pb' => 'suite:server' task 'suite:pb' => 'suite:server'
task 'gem:windows' => 'dlls'
desc 'Compiles the gRPC extension then runs all the tests' desc 'Compiles the gRPC extension then runs all the tests'
task all: ['suite:idiomatic', 'suite:bidi', 'suite:pb', 'suite:server'] task all: ['suite:idiomatic', 'suite:bidi', 'suite:pb', 'suite:server']
task default: :all task default: :all

@ -480,6 +480,70 @@
}] }]
], ],
'targets': [ 'targets': [
{
'cflags': [
'-std=c99',
'-Wall',
'-Werror'
],
'target_name': 'gpr',
'product_prefix': 'lib',
'type': 'static_library',
'dependencies': [
],
'sources': [
'src/core/profiling/basic_timers.c',
'src/core/profiling/stap_timers.c',
'src/core/support/alloc.c',
'src/core/support/avl.c',
'src/core/support/cmdline.c',
'src/core/support/cpu_iphone.c',
'src/core/support/cpu_linux.c',
'src/core/support/cpu_posix.c',
'src/core/support/cpu_windows.c',
'src/core/support/env_linux.c',
'src/core/support/env_posix.c',
'src/core/support/env_win32.c',
'src/core/support/file.c',
'src/core/support/file_posix.c',
'src/core/support/file_win32.c',
'src/core/support/histogram.c',
'src/core/support/host_port.c',
'src/core/support/log.c',
'src/core/support/log_android.c',
'src/core/support/log_linux.c',
'src/core/support/log_posix.c',
'src/core/support/log_win32.c',
'src/core/support/murmur_hash.c',
'src/core/support/slice.c',
'src/core/support/slice_buffer.c',
'src/core/support/stack_lockfree.c',
'src/core/support/string.c',
'src/core/support/string_posix.c',
'src/core/support/string_win32.c',
'src/core/support/subprocess_posix.c',
'src/core/support/subprocess_windows.c',
'src/core/support/sync.c',
'src/core/support/sync_posix.c',
'src/core/support/sync_win32.c',
'src/core/support/thd.c',
'src/core/support/thd_posix.c',
'src/core/support/thd_win32.c',
'src/core/support/time.c',
'src/core/support/time_posix.c',
'src/core/support/time_precise.c',
'src/core/support/time_win32.c',
'src/core/support/tls_pthread.c',
'src/core/support/wrap_memcpy.c',
],
"conditions": [
['OS == "mac"', {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.9'
}
}]
]
},
{ {
'cflags': [ 'cflags': [
'-std=c99', '-std=c99',
@ -490,6 +554,7 @@
'product_prefix': 'lib', 'product_prefix': 'lib',
'type': 'static_library', 'type': 'static_library',
'dependencies': [ 'dependencies': [
'gpr',
], ],
'sources': [ 'sources': [
'src/core/httpcli/httpcli_security_connector.c', 'src/core/httpcli/httpcli_security_connector.c',
@ -640,49 +705,6 @@
'src/core/transport/static_metadata.c', 'src/core/transport/static_metadata.c',
'src/core/transport/transport.c', 'src/core/transport/transport.c',
'src/core/transport/transport_op_string.c', 'src/core/transport/transport_op_string.c',
'src/core/profiling/basic_timers.c',
'src/core/profiling/stap_timers.c',
'src/core/support/alloc.c',
'src/core/support/avl.c',
'src/core/support/cmdline.c',
'src/core/support/cpu_iphone.c',
'src/core/support/cpu_linux.c',
'src/core/support/cpu_posix.c',
'src/core/support/cpu_windows.c',
'src/core/support/env_linux.c',
'src/core/support/env_posix.c',
'src/core/support/env_win32.c',
'src/core/support/file.c',
'src/core/support/file_posix.c',
'src/core/support/file_win32.c',
'src/core/support/histogram.c',
'src/core/support/host_port.c',
'src/core/support/log.c',
'src/core/support/log_android.c',
'src/core/support/log_linux.c',
'src/core/support/log_posix.c',
'src/core/support/log_win32.c',
'src/core/support/murmur_hash.c',
'src/core/support/slice.c',
'src/core/support/slice_buffer.c',
'src/core/support/stack_lockfree.c',
'src/core/support/string.c',
'src/core/support/string_posix.c',
'src/core/support/string_win32.c',
'src/core/support/subprocess_posix.c',
'src/core/support/subprocess_windows.c',
'src/core/support/sync.c',
'src/core/support/sync_posix.c',
'src/core/support/sync_win32.c',
'src/core/support/thd.c',
'src/core/support/thd_posix.c',
'src/core/support/thd_win32.c',
'src/core/support/time.c',
'src/core/support/time_posix.c',
'src/core/support/time_precise.c',
'src/core/support/time_win32.c',
'src/core/support/tls_pthread.c',
'src/core/support/wrap_memcpy.c',
'src/core/census/context.c', 'src/core/census/context.c',
'src/core/census/initialize.c', 'src/core/census/initialize.c',
'src/core/census/operation.c', 'src/core/census/operation.c',
@ -750,6 +772,7 @@
], ],
"dependencies": [ "dependencies": [
"grpc", "grpc",
"gpr",
] ]
}, },
{ {

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -33,7 +33,7 @@
var PROTO_PATH = __dirname + '/helloworld.proto'; var PROTO_PATH = __dirname + '/helloworld.proto';
var grpc = require('../../'); var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld; var hello_proto = grpc.load(PROTO_PATH).helloworld;
function main() { function main() {

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -33,7 +33,7 @@
var PROTO_PATH = __dirname + '/helloworld.proto'; var PROTO_PATH = __dirname + '/helloworld.proto';
var grpc = require('../../'); var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld; var hello_proto = grpc.load(PROTO_PATH).helloworld;
/** /**

@ -0,0 +1,7 @@
{
"name": "grpc-examples",
"version": "0.1.0",
"dependencies": {
"grpc": "0.12.0"
}
}

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -30,13 +30,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
var async = require('async'); var async = require('async');
var fs = require('fs'); var fs = require('fs');
var parseArgs = require('minimist'); var parseArgs = require('minimist');
var path = require('path'); var path = require('path');
var _ = require('lodash'); var _ = require('lodash');
var grpc = require('../../../'); var grpc = require('grpc');
var routeguide = grpc.load(__dirname + '/route_guide.proto').routeguide; var routeguide = grpc.load(__dirname + '/route_guide.proto').routeguide;
var client = new routeguide.RouteGuide('localhost:50051', var client = new routeguide.RouteGuide('localhost:50051',
grpc.Credentials.createInsecure()); grpc.Credentials.createInsecure());

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -30,12 +30,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
var fs = require('fs'); var fs = require('fs');
var parseArgs = require('minimist'); var parseArgs = require('minimist');
var path = require('path'); var path = require('path');
var _ = require('lodash'); var _ = require('lodash');
var grpc = require('../../../'); var grpc = require('grpc');
var routeguide = grpc.load(__dirname + '/route_guide.proto').routeguide; var routeguide = grpc.load(__dirname + '/route_guide.proto').routeguide;
var COORD_FACTOR = 1e7; var COORD_FACTOR = 1e7;

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -34,6 +34,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "AppDelegate.h" #import "AppDelegate.h"
#import <GRPCClient/GRPCCall+ChannelArg.h>
#import <GRPCClient/GRPCCall+Tests.h> #import <GRPCClient/GRPCCall+Tests.h>
#import <HelloWorld/Helloworld.pbrpc.h> #import <HelloWorld/Helloworld.pbrpc.h>
@ -42,6 +43,7 @@ static NSString * const kHostAddress = @"localhost:50051";
int main(int argc, char * argv[]) { int main(int argc, char * argv[]) {
@autoreleasepool { @autoreleasepool {
[GRPCCall useInsecureConnectionsForHost:kHostAddress]; [GRPCCall useInsecureConnectionsForHost:kHostAddress];
[GRPCCall setUserAgentPrefix:@"HelloWorld/1.0" forHost:kHostAddress];
HLWGreeter *client = [[HLWGreeter alloc] initWithHost:kHostAddress]; HLWGreeter *client = [[HLWGreeter alloc] initWithHost:kHostAddress];

@ -1,4 +1,4 @@
// Copyright 2015, Google Inc. // Copyright 2015-2016, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -29,7 +29,9 @@
syntax = "proto3"; syntax = "proto3";
option java_package = "io.grpc.examples"; option java_multiple_files = true;
option java_package = "io.grpc.examples.helloworld";
option java_outer_classname = "HelloWorldProto";
option objc_class_prefix = "HLW"; option objc_class_prefix = "HLW";
package helloworld; package helloworld;

@ -1,4 +1,4 @@
// Copyright 2015, Google Inc. // Copyright 2015-2016, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -29,7 +29,9 @@
syntax = "proto3"; syntax = "proto3";
option java_package = "ex.grpc"; option java_multiple_files = true;
option java_package = "io.grpc.examples.routeguide";
option java_outer_classname = "RouteGuideProto";
option objc_class_prefix = "RTG"; option objc_class_prefix = "RTG";
package routeguide; package routeguide;

@ -63,7 +63,102 @@ Pod::Spec.new do |s|
# Core cross-platform gRPC library, written in C. # Core cross-platform gRPC library, written in C.
s.subspec 'C-Core' do |ss| s.subspec 'C-Core' do |ss|
ss.source_files = 'src/core/security/auth_filters.h', ss.source_files = 'src/core/profiling/timers.h',
'src/core/support/block_annotate.h',
'src/core/support/env.h',
'src/core/support/file.h',
'src/core/support/murmur_hash.h',
'src/core/support/stack_lockfree.h',
'src/core/support/string.h',
'src/core/support/string_win32.h',
'src/core/support/thd_internal.h',
'src/core/support/time_precise.h',
'include/grpc/support/alloc.h',
'include/grpc/support/atm.h',
'include/grpc/support/atm_gcc_atomic.h',
'include/grpc/support/atm_gcc_sync.h',
'include/grpc/support/atm_win32.h',
'include/grpc/support/avl.h',
'include/grpc/support/cmdline.h',
'include/grpc/support/cpu.h',
'include/grpc/support/histogram.h',
'include/grpc/support/host_port.h',
'include/grpc/support/log.h',
'include/grpc/support/log_win32.h',
'include/grpc/support/port_platform.h',
'include/grpc/support/slice.h',
'include/grpc/support/slice_buffer.h',
'include/grpc/support/string_util.h',
'include/grpc/support/subprocess.h',
'include/grpc/support/sync.h',
'include/grpc/support/sync_generic.h',
'include/grpc/support/sync_posix.h',
'include/grpc/support/sync_win32.h',
'include/grpc/support/thd.h',
'include/grpc/support/time.h',
'include/grpc/support/tls.h',
'include/grpc/support/tls_gcc.h',
'include/grpc/support/tls_msvc.h',
'include/grpc/support/tls_pthread.h',
'include/grpc/support/useful.h',
'include/grpc/impl/codegen/alloc.h',
'include/grpc/impl/codegen/atm.h',
'include/grpc/impl/codegen/atm_gcc_atomic.h',
'include/grpc/impl/codegen/atm_gcc_sync.h',
'include/grpc/impl/codegen/atm_win32.h',
'include/grpc/impl/codegen/log.h',
'include/grpc/impl/codegen/port_platform.h',
'include/grpc/impl/codegen/slice.h',
'include/grpc/impl/codegen/slice_buffer.h',
'include/grpc/impl/codegen/sync.h',
'include/grpc/impl/codegen/sync_generic.h',
'include/grpc/impl/codegen/sync_posix.h',
'include/grpc/impl/codegen/sync_win32.h',
'include/grpc/impl/codegen/time.h',
'src/core/profiling/basic_timers.c',
'src/core/profiling/stap_timers.c',
'src/core/support/alloc.c',
'src/core/support/avl.c',
'src/core/support/cmdline.c',
'src/core/support/cpu_iphone.c',
'src/core/support/cpu_linux.c',
'src/core/support/cpu_posix.c',
'src/core/support/cpu_windows.c',
'src/core/support/env_linux.c',
'src/core/support/env_posix.c',
'src/core/support/env_win32.c',
'src/core/support/file.c',
'src/core/support/file_posix.c',
'src/core/support/file_win32.c',
'src/core/support/histogram.c',
'src/core/support/host_port.c',
'src/core/support/log.c',
'src/core/support/log_android.c',
'src/core/support/log_linux.c',
'src/core/support/log_posix.c',
'src/core/support/log_win32.c',
'src/core/support/murmur_hash.c',
'src/core/support/slice.c',
'src/core/support/slice_buffer.c',
'src/core/support/stack_lockfree.c',
'src/core/support/string.c',
'src/core/support/string_posix.c',
'src/core/support/string_win32.c',
'src/core/support/subprocess_posix.c',
'src/core/support/subprocess_windows.c',
'src/core/support/sync.c',
'src/core/support/sync_posix.c',
'src/core/support/sync_win32.c',
'src/core/support/thd.c',
'src/core/support/thd_posix.c',
'src/core/support/thd_win32.c',
'src/core/support/time.c',
'src/core/support/time_posix.c',
'src/core/support/time_precise.c',
'src/core/support/time_win32.c',
'src/core/support/tls_pthread.c',
'src/core/support/wrap_memcpy.c',
'src/core/security/auth_filters.h',
'src/core/security/base64.h', 'src/core/security/base64.h',
'src/core/security/credentials.h', 'src/core/security/credentials.h',
'src/core/security/handshake.h', 'src/core/security/handshake.h',
@ -190,72 +285,20 @@ Pod::Spec.new do |s|
'src/core/transport/static_metadata.h', 'src/core/transport/static_metadata.h',
'src/core/transport/transport.h', 'src/core/transport/transport.h',
'src/core/transport/transport_impl.h', 'src/core/transport/transport_impl.h',
'src/core/profiling/timers.h',
'src/core/support/block_annotate.h',
'src/core/support/env.h',
'src/core/support/file.h',
'src/core/support/murmur_hash.h',
'src/core/support/stack_lockfree.h',
'src/core/support/string.h',
'src/core/support/string_win32.h',
'src/core/support/thd_internal.h',
'src/core/support/time_precise.h',
'src/core/census/aggregation.h', 'src/core/census/aggregation.h',
'src/core/census/rpc_metric_id.h', 'src/core/census/rpc_metric_id.h',
'include/grpc/grpc_security.h', 'include/grpc/grpc_security.h',
'include/grpc/byte_buffer.h',
'include/grpc/byte_buffer_reader.h',
'include/grpc/compression.h',
'include/grpc/grpc.h',
'include/grpc/status.h',
'include/grpc/support/alloc.h',
'include/grpc/support/atm.h',
'include/grpc/support/atm_gcc_atomic.h',
'include/grpc/support/atm_gcc_sync.h',
'include/grpc/support/atm_win32.h',
'include/grpc/support/avl.h',
'include/grpc/support/cmdline.h',
'include/grpc/support/cpu.h',
'include/grpc/support/histogram.h',
'include/grpc/support/host_port.h',
'include/grpc/support/log.h',
'include/grpc/support/log_win32.h',
'include/grpc/support/port_platform.h',
'include/grpc/support/slice.h',
'include/grpc/support/slice_buffer.h',
'include/grpc/support/string_util.h',
'include/grpc/support/subprocess.h',
'include/grpc/support/sync.h',
'include/grpc/support/sync_generic.h',
'include/grpc/support/sync_posix.h',
'include/grpc/support/sync_win32.h',
'include/grpc/support/thd.h',
'include/grpc/support/time.h',
'include/grpc/support/tls.h',
'include/grpc/support/tls_gcc.h',
'include/grpc/support/tls_msvc.h',
'include/grpc/support/tls_pthread.h',
'include/grpc/support/useful.h',
'include/grpc/impl/codegen/alloc.h',
'include/grpc/impl/codegen/atm.h',
'include/grpc/impl/codegen/atm_gcc_atomic.h',
'include/grpc/impl/codegen/atm_gcc_sync.h',
'include/grpc/impl/codegen/atm_win32.h',
'include/grpc/impl/codegen/byte_buffer.h', 'include/grpc/impl/codegen/byte_buffer.h',
'include/grpc/impl/codegen/compression_types.h', 'include/grpc/impl/codegen/compression_types.h',
'include/grpc/impl/codegen/connectivity_state.h', 'include/grpc/impl/codegen/connectivity_state.h',
'include/grpc/impl/codegen/grpc_types.h', 'include/grpc/impl/codegen/grpc_types.h',
'include/grpc/impl/codegen/log.h',
'include/grpc/impl/codegen/port_platform.h',
'include/grpc/impl/codegen/propagation_bits.h', 'include/grpc/impl/codegen/propagation_bits.h',
'include/grpc/impl/codegen/slice.h',
'include/grpc/impl/codegen/slice_buffer.h',
'include/grpc/impl/codegen/status.h', 'include/grpc/impl/codegen/status.h',
'include/grpc/impl/codegen/sync.h', 'include/grpc/byte_buffer.h',
'include/grpc/impl/codegen/sync_generic.h', 'include/grpc/byte_buffer_reader.h',
'include/grpc/impl/codegen/sync_posix.h', 'include/grpc/compression.h',
'include/grpc/impl/codegen/sync_win32.h', 'include/grpc/grpc.h',
'include/grpc/impl/codegen/time.h', 'include/grpc/status.h',
'include/grpc/census.h', 'include/grpc/census.h',
'src/core/httpcli/httpcli_security_connector.c', 'src/core/httpcli/httpcli_security_connector.c',
'src/core/security/base64.c', 'src/core/security/base64.c',
@ -405,56 +448,23 @@ Pod::Spec.new do |s|
'src/core/transport/static_metadata.c', 'src/core/transport/static_metadata.c',
'src/core/transport/transport.c', 'src/core/transport/transport.c',
'src/core/transport/transport_op_string.c', 'src/core/transport/transport_op_string.c',
'src/core/profiling/basic_timers.c',
'src/core/profiling/stap_timers.c',
'src/core/support/alloc.c',
'src/core/support/avl.c',
'src/core/support/cmdline.c',
'src/core/support/cpu_iphone.c',
'src/core/support/cpu_linux.c',
'src/core/support/cpu_posix.c',
'src/core/support/cpu_windows.c',
'src/core/support/env_linux.c',
'src/core/support/env_posix.c',
'src/core/support/env_win32.c',
'src/core/support/file.c',
'src/core/support/file_posix.c',
'src/core/support/file_win32.c',
'src/core/support/histogram.c',
'src/core/support/host_port.c',
'src/core/support/log.c',
'src/core/support/log_android.c',
'src/core/support/log_linux.c',
'src/core/support/log_posix.c',
'src/core/support/log_win32.c',
'src/core/support/murmur_hash.c',
'src/core/support/slice.c',
'src/core/support/slice_buffer.c',
'src/core/support/stack_lockfree.c',
'src/core/support/string.c',
'src/core/support/string_posix.c',
'src/core/support/string_win32.c',
'src/core/support/subprocess_posix.c',
'src/core/support/subprocess_windows.c',
'src/core/support/sync.c',
'src/core/support/sync_posix.c',
'src/core/support/sync_win32.c',
'src/core/support/thd.c',
'src/core/support/thd_posix.c',
'src/core/support/thd_win32.c',
'src/core/support/time.c',
'src/core/support/time_posix.c',
'src/core/support/time_precise.c',
'src/core/support/time_win32.c',
'src/core/support/tls_pthread.c',
'src/core/support/wrap_memcpy.c',
'src/core/census/context.c', 'src/core/census/context.c',
'src/core/census/initialize.c', 'src/core/census/initialize.c',
'src/core/census/operation.c', 'src/core/census/operation.c',
'src/core/census/placeholders.c', 'src/core/census/placeholders.c',
'src/core/census/tracing.c' 'src/core/census/tracing.c'
ss.private_header_files = 'src/core/security/auth_filters.h', ss.private_header_files = 'src/core/profiling/timers.h',
'src/core/support/block_annotate.h',
'src/core/support/env.h',
'src/core/support/file.h',
'src/core/support/murmur_hash.h',
'src/core/support/stack_lockfree.h',
'src/core/support/string.h',
'src/core/support/string_win32.h',
'src/core/support/thd_internal.h',
'src/core/support/time_precise.h',
'src/core/security/auth_filters.h',
'src/core/security/base64.h', 'src/core/security/base64.h',
'src/core/security/credentials.h', 'src/core/security/credentials.h',
'src/core/security/handshake.h', 'src/core/security/handshake.h',
@ -581,16 +591,6 @@ Pod::Spec.new do |s|
'src/core/transport/static_metadata.h', 'src/core/transport/static_metadata.h',
'src/core/transport/transport.h', 'src/core/transport/transport.h',
'src/core/transport/transport_impl.h', 'src/core/transport/transport_impl.h',
'src/core/profiling/timers.h',
'src/core/support/block_annotate.h',
'src/core/support/env.h',
'src/core/support/file.h',
'src/core/support/murmur_hash.h',
'src/core/support/stack_lockfree.h',
'src/core/support/string.h',
'src/core/support/string_win32.h',
'src/core/support/thd_internal.h',
'src/core/support/time_precise.h',
'src/core/census/aggregation.h', 'src/core/census/aggregation.h',
'src/core/census/rpc_metric_id.h' 'src/core/census/rpc_metric_id.h'

@ -14,7 +14,6 @@ Gem::Specification.new do |s|
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'
s.required_ruby_version = '>= 2.0.0' s.required_ruby_version = '>= 2.0.0'
s.requirements << 'libgrpc ~> 0.11.0 needs to be installed'
s.files = %w( Makefile ) s.files = %w( Makefile )
s.files += %w( etc/roots.pem ) s.files += %w( etc/roots.pem )
@ -32,7 +31,7 @@ Gem::Specification.new do |s|
s.require_paths = %w( src/ruby/bin src/ruby/lib src/ruby/pb ) s.require_paths = %w( src/ruby/bin src/ruby/lib src/ruby/pb )
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
s.add_dependency 'google-protobuf', '~> 3.0.0alpha.1.1' s.add_dependency 'google-protobuf', '~> 3.0.0.alpha.5.0.2'
s.add_dependency 'googleauth', '~> 0.5.1' s.add_dependency 'googleauth', '~> 0.5.1'
s.add_development_dependency 'bundler', '~> 1.9' s.add_development_dependency 'bundler', '~> 1.9'
@ -40,19 +39,13 @@ Gem::Specification.new do |s|
s.add_development_dependency 'simplecov', '~> 0.9' s.add_development_dependency 'simplecov', '~> 0.9'
s.add_development_dependency 'rake', '~> 10.4' s.add_development_dependency 'rake', '~> 10.4'
s.add_development_dependency 'rake-compiler', '~> 0.9' s.add_development_dependency 'rake-compiler', '~> 0.9'
s.add_development_dependency 'rake-compiler-dock', '~> 0.5' s.add_development_dependency 'rake-compiler-dock', '~> 0.5.1'
s.add_development_dependency 'rspec', '~> 3.2' s.add_development_dependency 'rspec', '~> 3.2'
s.add_development_dependency 'rubocop', '~> 0.30.0' s.add_development_dependency 'rubocop', '~> 0.30.0'
s.add_development_dependency 'signet', '~> 0.7.0' s.add_development_dependency 'signet', '~> 0.7.0'
s.extensions = %w(src/ruby/ext/grpc/extconf.rb) s.extensions = %w(src/ruby/ext/grpc/extconf.rb)
s.files += %w( include/grpc/grpc_security.h )
s.files += %w( include/grpc/byte_buffer.h )
s.files += %w( include/grpc/byte_buffer_reader.h )
s.files += %w( include/grpc/compression.h )
s.files += %w( include/grpc/grpc.h )
s.files += %w( include/grpc/status.h )
s.files += %w( include/grpc/support/alloc.h ) s.files += %w( include/grpc/support/alloc.h )
s.files += %w( include/grpc/support/atm.h ) s.files += %w( include/grpc/support/atm.h )
s.files += %w( include/grpc/support/atm_gcc_atomic.h ) s.files += %w( include/grpc/support/atm_gcc_atomic.h )
@ -86,21 +79,80 @@ 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_win32.h ) s.files += %w( include/grpc/impl/codegen/atm_win32.h )
s.files += %w( include/grpc/impl/codegen/byte_buffer.h )
s.files += %w( include/grpc/impl/codegen/compression_types.h )
s.files += %w( include/grpc/impl/codegen/connectivity_state.h )
s.files += %w( include/grpc/impl/codegen/grpc_types.h )
s.files += %w( include/grpc/impl/codegen/log.h ) s.files += %w( include/grpc/impl/codegen/log.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/propagation_bits.h )
s.files += %w( include/grpc/impl/codegen/slice.h ) s.files += %w( include/grpc/impl/codegen/slice.h )
s.files += %w( include/grpc/impl/codegen/slice_buffer.h ) s.files += %w( include/grpc/impl/codegen/slice_buffer.h )
s.files += %w( include/grpc/impl/codegen/status.h )
s.files += %w( include/grpc/impl/codegen/sync.h ) s.files += %w( include/grpc/impl/codegen/sync.h )
s.files += %w( include/grpc/impl/codegen/sync_generic.h ) s.files += %w( include/grpc/impl/codegen/sync_generic.h )
s.files += %w( include/grpc/impl/codegen/sync_posix.h ) s.files += %w( include/grpc/impl/codegen/sync_posix.h )
s.files += %w( include/grpc/impl/codegen/sync_win32.h ) s.files += %w( include/grpc/impl/codegen/sync_win32.h )
s.files += %w( include/grpc/impl/codegen/time.h ) s.files += %w( include/grpc/impl/codegen/time.h )
s.files += %w( src/core/profiling/timers.h )
s.files += %w( src/core/support/block_annotate.h )
s.files += %w( src/core/support/env.h )
s.files += %w( src/core/support/file.h )
s.files += %w( src/core/support/murmur_hash.h )
s.files += %w( src/core/support/stack_lockfree.h )
s.files += %w( src/core/support/string.h )
s.files += %w( src/core/support/string_win32.h )
s.files += %w( src/core/support/thd_internal.h )
s.files += %w( src/core/support/time_precise.h )
s.files += %w( src/core/profiling/basic_timers.c )
s.files += %w( src/core/profiling/stap_timers.c )
s.files += %w( src/core/support/alloc.c )
s.files += %w( src/core/support/avl.c )
s.files += %w( src/core/support/cmdline.c )
s.files += %w( src/core/support/cpu_iphone.c )
s.files += %w( src/core/support/cpu_linux.c )
s.files += %w( src/core/support/cpu_posix.c )
s.files += %w( src/core/support/cpu_windows.c )
s.files += %w( src/core/support/env_linux.c )
s.files += %w( src/core/support/env_posix.c )
s.files += %w( src/core/support/env_win32.c )
s.files += %w( src/core/support/file.c )
s.files += %w( src/core/support/file_posix.c )
s.files += %w( src/core/support/file_win32.c )
s.files += %w( src/core/support/histogram.c )
s.files += %w( src/core/support/host_port.c )
s.files += %w( src/core/support/log.c )
s.files += %w( src/core/support/log_android.c )
s.files += %w( src/core/support/log_linux.c )
s.files += %w( src/core/support/log_posix.c )
s.files += %w( src/core/support/log_win32.c )
s.files += %w( src/core/support/murmur_hash.c )
s.files += %w( src/core/support/slice.c )
s.files += %w( src/core/support/slice_buffer.c )
s.files += %w( src/core/support/stack_lockfree.c )
s.files += %w( src/core/support/string.c )
s.files += %w( src/core/support/string_posix.c )
s.files += %w( src/core/support/string_win32.c )
s.files += %w( src/core/support/subprocess_posix.c )
s.files += %w( src/core/support/subprocess_windows.c )
s.files += %w( src/core/support/sync.c )
s.files += %w( src/core/support/sync_posix.c )
s.files += %w( src/core/support/sync_win32.c )
s.files += %w( src/core/support/thd.c )
s.files += %w( src/core/support/thd_posix.c )
s.files += %w( src/core/support/thd_win32.c )
s.files += %w( src/core/support/time.c )
s.files += %w( src/core/support/time_posix.c )
s.files += %w( src/core/support/time_precise.c )
s.files += %w( src/core/support/time_win32.c )
s.files += %w( src/core/support/tls_pthread.c )
s.files += %w( src/core/support/wrap_memcpy.c )
s.files += %w( include/grpc/grpc_security.h )
s.files += %w( include/grpc/impl/codegen/byte_buffer.h )
s.files += %w( include/grpc/impl/codegen/compression_types.h )
s.files += %w( include/grpc/impl/codegen/connectivity_state.h )
s.files += %w( include/grpc/impl/codegen/grpc_types.h )
s.files += %w( include/grpc/impl/codegen/propagation_bits.h )
s.files += %w( include/grpc/impl/codegen/status.h )
s.files += %w( include/grpc/byte_buffer.h )
s.files += %w( include/grpc/byte_buffer_reader.h )
s.files += %w( include/grpc/compression.h )
s.files += %w( include/grpc/grpc.h )
s.files += %w( include/grpc/status.h )
s.files += %w( include/grpc/census.h ) s.files += %w( include/grpc/census.h )
s.files += %w( src/core/security/auth_filters.h ) s.files += %w( src/core/security/auth_filters.h )
s.files += %w( src/core/security/base64.h ) s.files += %w( src/core/security/base64.h )
@ -229,16 +281,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/transport/static_metadata.h ) s.files += %w( src/core/transport/static_metadata.h )
s.files += %w( src/core/transport/transport.h ) s.files += %w( src/core/transport/transport.h )
s.files += %w( src/core/transport/transport_impl.h ) s.files += %w( src/core/transport/transport_impl.h )
s.files += %w( src/core/profiling/timers.h )
s.files += %w( src/core/support/block_annotate.h )
s.files += %w( src/core/support/env.h )
s.files += %w( src/core/support/file.h )
s.files += %w( src/core/support/murmur_hash.h )
s.files += %w( src/core/support/stack_lockfree.h )
s.files += %w( src/core/support/string.h )
s.files += %w( src/core/support/string_win32.h )
s.files += %w( src/core/support/thd_internal.h )
s.files += %w( src/core/support/time_precise.h )
s.files += %w( src/core/census/aggregation.h ) s.files += %w( src/core/census/aggregation.h )
s.files += %w( src/core/census/rpc_metric_id.h ) s.files += %w( src/core/census/rpc_metric_id.h )
s.files += %w( src/core/httpcli/httpcli_security_connector.c ) s.files += %w( src/core/httpcli/httpcli_security_connector.c )
@ -389,49 +431,6 @@ Gem::Specification.new do |s|
s.files += %w( src/core/transport/static_metadata.c ) s.files += %w( src/core/transport/static_metadata.c )
s.files += %w( src/core/transport/transport.c ) s.files += %w( src/core/transport/transport.c )
s.files += %w( src/core/transport/transport_op_string.c ) s.files += %w( src/core/transport/transport_op_string.c )
s.files += %w( src/core/profiling/basic_timers.c )
s.files += %w( src/core/profiling/stap_timers.c )
s.files += %w( src/core/support/alloc.c )
s.files += %w( src/core/support/avl.c )
s.files += %w( src/core/support/cmdline.c )
s.files += %w( src/core/support/cpu_iphone.c )
s.files += %w( src/core/support/cpu_linux.c )
s.files += %w( src/core/support/cpu_posix.c )
s.files += %w( src/core/support/cpu_windows.c )
s.files += %w( src/core/support/env_linux.c )
s.files += %w( src/core/support/env_posix.c )
s.files += %w( src/core/support/env_win32.c )
s.files += %w( src/core/support/file.c )
s.files += %w( src/core/support/file_posix.c )
s.files += %w( src/core/support/file_win32.c )
s.files += %w( src/core/support/histogram.c )
s.files += %w( src/core/support/host_port.c )
s.files += %w( src/core/support/log.c )
s.files += %w( src/core/support/log_android.c )
s.files += %w( src/core/support/log_linux.c )
s.files += %w( src/core/support/log_posix.c )
s.files += %w( src/core/support/log_win32.c )
s.files += %w( src/core/support/murmur_hash.c )
s.files += %w( src/core/support/slice.c )
s.files += %w( src/core/support/slice_buffer.c )
s.files += %w( src/core/support/stack_lockfree.c )
s.files += %w( src/core/support/string.c )
s.files += %w( src/core/support/string_posix.c )
s.files += %w( src/core/support/string_win32.c )
s.files += %w( src/core/support/subprocess_posix.c )
s.files += %w( src/core/support/subprocess_windows.c )
s.files += %w( src/core/support/sync.c )
s.files += %w( src/core/support/sync_posix.c )
s.files += %w( src/core/support/sync_win32.c )
s.files += %w( src/core/support/thd.c )
s.files += %w( src/core/support/thd_posix.c )
s.files += %w( src/core/support/thd_win32.c )
s.files += %w( src/core/support/time.c )
s.files += %w( src/core/support/time_posix.c )
s.files += %w( src/core/support/time_precise.c )
s.files += %w( src/core/support/time_win32.c )
s.files += %w( src/core/support/tls_pthread.c )
s.files += %w( src/core/support/wrap_memcpy.c )
s.files += %w( src/core/census/context.c ) s.files += %w( src/core/census/context.c )
s.files += %w( src/core/census/initialize.c ) s.files += %w( src/core/census/initialize.c )
s.files += %w( src/core/census/operation.c ) s.files += %w( src/core/census/operation.c )

@ -62,40 +62,50 @@ class ClientAsyncResponseReader GRPC_FINAL
ClientAsyncResponseReader(ChannelInterface* channel, CompletionQueue* cq, ClientAsyncResponseReader(ChannelInterface* channel, CompletionQueue* cq,
const RpcMethod& method, ClientContext* context, const RpcMethod& method, ClientContext* context,
const W& request) const W& request)
: context_(context), call_(channel->CreateCall(method, context, cq)) { : context_(context),
init_buf_.SendInitialMetadata(context->send_initial_metadata_); call_(channel->CreateCall(method, context, cq)),
collection_(new CallOpSetCollection) {
collection_->init_buf_.SetCollection(collection_);
collection_->init_buf_.SendInitialMetadata(context->send_initial_metadata_);
// TODO(ctiller): don't assert // TODO(ctiller): don't assert
GPR_ASSERT(init_buf_.SendMessage(request).ok()); GPR_ASSERT(collection_->init_buf_.SendMessage(request).ok());
init_buf_.ClientSendClose(); collection_->init_buf_.ClientSendClose();
call_.PerformOps(&init_buf_); call_.PerformOps(&collection_->init_buf_);
} }
void ReadInitialMetadata(void* tag) { void ReadInitialMetadata(void* tag) {
GPR_ASSERT(!context_->initial_metadata_received_); GPR_ASSERT(!context_->initial_metadata_received_);
meta_buf_.set_output_tag(tag); collection_->meta_buf_.SetCollection(collection_);
meta_buf_.RecvInitialMetadata(context_); collection_->meta_buf_.set_output_tag(tag);
call_.PerformOps(&meta_buf_); collection_->meta_buf_.RecvInitialMetadata(context_);
call_.PerformOps(&collection_->meta_buf_);
} }
void Finish(R* msg, Status* status, void* tag) { void Finish(R* msg, Status* status, void* tag) {
finish_buf_.set_output_tag(tag); collection_->finish_buf_.SetCollection(collection_);
collection_->finish_buf_.set_output_tag(tag);
if (!context_->initial_metadata_received_) { if (!context_->initial_metadata_received_) {
finish_buf_.RecvInitialMetadata(context_); collection_->finish_buf_.RecvInitialMetadata(context_);
} }
finish_buf_.RecvMessage(msg); collection_->finish_buf_.RecvMessage(msg);
finish_buf_.ClientRecvStatus(context_, status); collection_->finish_buf_.ClientRecvStatus(context_, status);
call_.PerformOps(&finish_buf_); call_.PerformOps(&collection_->finish_buf_);
} }
private: private:
ClientContext* context_; ClientContext* context_;
Call call_; Call call_;
SneakyCallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientSendClose> init_buf_; class CallOpSetCollection : public CallOpSetCollectionInterface {
CallOpSet<CallOpRecvInitialMetadata> meta_buf_; public:
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>, SneakyCallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
CallOpClientRecvStatus> finish_buf_; CallOpClientSendClose> init_buf_;
CallOpSet<CallOpRecvInitialMetadata> meta_buf_;
CallOpSet<CallOpRecvInitialMetadata, CallOpRecvMessage<R>,
CallOpClientRecvStatus> finish_buf_;
};
std::shared_ptr<CallOpSetCollection> collection_;
}; };
template <class W> template <class W>

@ -472,6 +472,17 @@ class CallOpClientRecvStatus {
size_t status_details_capacity_; size_t status_details_capacity_;
}; };
/// An abstract collection of CallOpSet's, to be used whenever
/// CallOpSet objects must be thought of as a group. Each member
/// of the group should have a shared_ptr back to the collection,
/// as will the object that instantiates the collection, allowing
/// for automatic ref-counting. In practice, any actual use should
/// derive from this base class. This is specifically necessary if
/// some of the CallOpSet's in the collection are "Sneaky" and don't
/// report back to the C++ layer CQ operations
class CallOpSetCollectionInterface
: public std::enable_shared_from_this<CallOpSetCollectionInterface> {};
/// An abstract collection of call ops, used to generate the /// An abstract collection of call ops, used to generate the
/// grpc_call_op structure to pass down to the lower layers, /// grpc_call_op structure to pass down to the lower layers,
/// and as it is-a CompletionQueueTag, also massages the final /// and as it is-a CompletionQueueTag, also massages the final
@ -488,8 +499,14 @@ class CallOpSetInterface : public CompletionQueueTag {
max_message_size_ = max_message_size; max_message_size_ = max_message_size;
} }
/// Mark this as belonging to a collection if needed
void SetCollection(std::shared_ptr<CallOpSetCollectionInterface> collection) {
collection_ = collection;
}
protected: protected:
int max_message_size_; int max_message_size_;
std::shared_ptr<CallOpSetCollectionInterface> collection_;
}; };
/// Primary implementaiton of CallOpSetInterface. /// Primary implementaiton of CallOpSetInterface.
@ -527,6 +544,7 @@ class CallOpSet : public CallOpSetInterface,
this->Op5::FinishOp(status, max_message_size_); this->Op5::FinishOp(status, max_message_size_);
this->Op6::FinishOp(status, max_message_size_); this->Op6::FinishOp(status, max_message_size_);
*tag = return_tag_; *tag = return_tag_;
collection_.reset(); // drop the ref at this point
return true; return true;
} }

@ -40,6 +40,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <grpc/impl/codegen/byte_buffer.h>
#include <grpc++/impl/codegen/config.h> #include <grpc++/impl/codegen/config.h>
#include <grpc++/impl/codegen/rpc_method.h> #include <grpc++/impl/codegen/rpc_method.h>
#include <grpc++/impl/codegen/status.h> #include <grpc++/impl/codegen/status.h>

@ -34,6 +34,7 @@
#ifndef GRPCXX_IMPL_CODEGEN_SERVER_INTERFACE_H #ifndef GRPCXX_IMPL_CODEGEN_SERVER_INTERFACE_H
#define GRPCXX_IMPL_CODEGEN_SERVER_INTERFACE_H #define GRPCXX_IMPL_CODEGEN_SERVER_INTERFACE_H
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc++/impl/codegen/call_hook.h> #include <grpc++/impl/codegen/call_hook.h>
#include <grpc++/impl/codegen/completion_queue_tag.h> #include <grpc++/impl/codegen/completion_queue_tag.h>
#include <grpc++/impl/codegen/rpc_service_method.h> #include <grpc++/impl/codegen/rpc_service_method.h>
@ -41,7 +42,6 @@
namespace grpc { namespace grpc {
class AsyncGenericService; class AsyncGenericService;
class AsynchronousService;
class GenericServerContext; class GenericServerContext;
class RpcService; class RpcService;
class ServerAsyncStreamingInterface; class ServerAsyncStreamingInterface;
@ -78,7 +78,6 @@ class ServerInterface : public CallHook {
virtual void Wait() = 0; virtual void Wait() = 0;
protected: protected:
friend class AsynchronousService;
friend class Service; friend class Service;
/// Register a service. This call does not take ownership of the service. /// Register a service. This call does not take ownership of the service.

@ -83,7 +83,7 @@ class ChannelCredentials : private GrpcLibrary {
/// authenticate with a server for a given call on a channel. /// authenticate with a server for a given call on a channel.
/// ///
/// \see http://www.grpc.io/docs/guides/auth.html /// \see http://www.grpc.io/docs/guides/auth.html
class CallCredentials { class CallCredentials : private GrpcLibrary {
public: public:
CallCredentials(); CallCredentials();
~CallCredentials(); ~CallCredentials();

@ -34,7 +34,7 @@
#ifndef GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H #ifndef GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
#define GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H #define GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
#include <grpc/support/port_platform.h> #include <grpc/impl/codegen/port_platform.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

@ -34,7 +34,7 @@
#ifndef GRPC_IMPL_CODEGEN_H #ifndef GRPC_IMPL_CODEGEN_H
#define GRPC_IMPL_CODEGEN_H #define GRPC_IMPL_CODEGEN_H
#include <grpc/support/port_platform.h> #include <grpc/impl/codegen/port_platform.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

@ -115,7 +115,8 @@ GPR_API void gpr_cv_destroy(gpr_cv *cv);
/* Atomically release *mu and wait on *cv. When the calling thread is woken /* Atomically release *mu and wait on *cv. When the calling thread is woken
from *cv or the deadline abs_deadline is exceeded, execute gpr_mu_lock(mu) from *cv or the deadline abs_deadline is exceeded, execute gpr_mu_lock(mu)
and return whether the deadline was exceeded. Use and return whether the deadline was exceeded. Use
abs_deadline==gpr_inf_future for no deadline. May return even when not abs_deadline==gpr_inf_future for no deadline. abs_deadline can be either
an absolute deadline, or a GPR_TIMESPAN. May return even when not
woken explicitly. Requires: *mu and *cv initialized; the calling thread woken explicitly. Requires: *mu and *cv initialized; the calling thread
holds an exclusive lock on *mu. */ holds an exclusive lock on *mu. */
GPR_API int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline); GPR_API int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline);

@ -102,14 +102,16 @@ GPR_API gpr_timespec gpr_time_min(gpr_timespec a, gpr_timespec b);
GPR_API gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b); GPR_API gpr_timespec gpr_time_add(gpr_timespec a, gpr_timespec b);
GPR_API gpr_timespec gpr_time_sub(gpr_timespec a, gpr_timespec b); GPR_API gpr_timespec gpr_time_sub(gpr_timespec a, gpr_timespec b);
/* Return a timespec representing a given number of time units. LONG_MIN is /* Return a timespec representing a given number of time units. INT64_MIN is
interpreted as gpr_inf_past, and LONG_MAX as gpr_inf_future. */ interpreted as gpr_inf_past, and INT64_MAX as gpr_inf_future. */
GPR_API gpr_timespec gpr_time_from_micros(long x, gpr_clock_type clock_type); GPR_API gpr_timespec gpr_time_from_micros(int64_t x, gpr_clock_type clock_type);
GPR_API gpr_timespec gpr_time_from_nanos(long x, gpr_clock_type clock_type); GPR_API gpr_timespec gpr_time_from_nanos(int64_t x, gpr_clock_type clock_type);
GPR_API gpr_timespec gpr_time_from_millis(long x, gpr_clock_type clock_type); GPR_API gpr_timespec gpr_time_from_millis(int64_t x, gpr_clock_type clock_type);
GPR_API gpr_timespec gpr_time_from_seconds(long x, gpr_clock_type clock_type); GPR_API gpr_timespec
GPR_API gpr_timespec gpr_time_from_minutes(long x, gpr_clock_type clock_type); gpr_time_from_seconds(int64_t x, gpr_clock_type clock_type);
GPR_API gpr_timespec gpr_time_from_hours(long x, gpr_clock_type clock_type); GPR_API gpr_timespec
gpr_time_from_minutes(int64_t x, gpr_clock_type clock_type);
GPR_API gpr_timespec gpr_time_from_hours(int64_t x, gpr_clock_type clock_type);
GPR_API int32_t gpr_time_to_millis(gpr_timespec timespec); GPR_API int32_t gpr_time_to_millis(gpr_timespec timespec);

@ -1,6 +1,6 @@
{ {
"name": "grpc", "name": "grpc",
"version": "0.12.0", "version": "0.14.0-dev",
"author": "Google Inc.", "author": "Google Inc.",
"description": "gRPC Library for Node", "description": "gRPC Library for Node",
"homepage": "http://www.grpc.io/", "homepage": "http://www.grpc.io/",
@ -88,59 +88,17 @@
"src/node/src/metadata.js", "src/node/src/metadata.js",
"src/node/src/server.js", "src/node/src/server.js",
"include/grpc/grpc_security.h", "include/grpc/grpc_security.h",
"include/grpc/byte_buffer.h",
"include/grpc/byte_buffer_reader.h",
"include/grpc/compression.h",
"include/grpc/grpc.h",
"include/grpc/status.h",
"include/grpc/support/alloc.h",
"include/grpc/support/atm.h",
"include/grpc/support/atm_gcc_atomic.h",
"include/grpc/support/atm_gcc_sync.h",
"include/grpc/support/atm_win32.h",
"include/grpc/support/avl.h",
"include/grpc/support/cmdline.h",
"include/grpc/support/cpu.h",
"include/grpc/support/histogram.h",
"include/grpc/support/host_port.h",
"include/grpc/support/log.h",
"include/grpc/support/log_win32.h",
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
"include/grpc/support/string_util.h",
"include/grpc/support/subprocess.h",
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
"include/grpc/support/sync_posix.h",
"include/grpc/support/sync_win32.h",
"include/grpc/support/thd.h",
"include/grpc/support/time.h",
"include/grpc/support/tls.h",
"include/grpc/support/tls_gcc.h",
"include/grpc/support/tls_msvc.h",
"include/grpc/support/tls_pthread.h",
"include/grpc/support/useful.h",
"include/grpc/impl/codegen/alloc.h",
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
"include/grpc/impl/codegen/atm_win32.h",
"include/grpc/impl/codegen/byte_buffer.h", "include/grpc/impl/codegen/byte_buffer.h",
"include/grpc/impl/codegen/compression_types.h", "include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h", "include/grpc/impl/codegen/connectivity_state.h",
"include/grpc/impl/codegen/grpc_types.h", "include/grpc/impl/codegen/grpc_types.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/propagation_bits.h", "include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/slice.h",
"include/grpc/impl/codegen/slice_buffer.h",
"include/grpc/impl/codegen/status.h", "include/grpc/impl/codegen/status.h",
"include/grpc/impl/codegen/sync.h", "include/grpc/byte_buffer.h",
"include/grpc/impl/codegen/sync_generic.h", "include/grpc/byte_buffer_reader.h",
"include/grpc/impl/codegen/sync_posix.h", "include/grpc/compression.h",
"include/grpc/impl/codegen/sync_win32.h", "include/grpc/grpc.h",
"include/grpc/impl/codegen/time.h", "include/grpc/status.h",
"include/grpc/census.h", "include/grpc/census.h",
"src/core/security/auth_filters.h", "src/core/security/auth_filters.h",
"src/core/security/base64.h", "src/core/security/base64.h",
@ -269,16 +227,6 @@
"src/core/transport/static_metadata.h", "src/core/transport/static_metadata.h",
"src/core/transport/transport.h", "src/core/transport/transport.h",
"src/core/transport/transport_impl.h", "src/core/transport/transport_impl.h",
"src/core/profiling/timers.h",
"src/core/support/block_annotate.h",
"src/core/support/env.h",
"src/core/support/file.h",
"src/core/support/murmur_hash.h",
"src/core/support/stack_lockfree.h",
"src/core/support/string.h",
"src/core/support/string_win32.h",
"src/core/support/thd_internal.h",
"src/core/support/time_precise.h",
"src/core/census/aggregation.h", "src/core/census/aggregation.h",
"src/core/census/rpc_metric_id.h", "src/core/census/rpc_metric_id.h",
"src/core/httpcli/httpcli_security_connector.c", "src/core/httpcli/httpcli_security_connector.c",
@ -429,6 +377,89 @@
"src/core/transport/static_metadata.c", "src/core/transport/static_metadata.c",
"src/core/transport/transport.c", "src/core/transport/transport.c",
"src/core/transport/transport_op_string.c", "src/core/transport/transport_op_string.c",
"src/core/census/context.c",
"src/core/census/initialize.c",
"src/core/census/operation.c",
"src/core/census/placeholders.c",
"src/core/census/tracing.c",
"third_party/zlib/crc32.h",
"third_party/zlib/deflate.h",
"third_party/zlib/gzguts.h",
"third_party/zlib/inffast.h",
"third_party/zlib/inffixed.h",
"third_party/zlib/inflate.h",
"third_party/zlib/inftrees.h",
"third_party/zlib/trees.h",
"third_party/zlib/zconf.h",
"third_party/zlib/zlib.h",
"third_party/zlib/zutil.h",
"third_party/zlib/adler32.c",
"third_party/zlib/compress.c",
"third_party/zlib/crc32.c",
"third_party/zlib/deflate.c",
"third_party/zlib/gzclose.c",
"third_party/zlib/gzlib.c",
"third_party/zlib/gzread.c",
"third_party/zlib/gzwrite.c",
"third_party/zlib/infback.c",
"third_party/zlib/inffast.c",
"third_party/zlib/inflate.c",
"third_party/zlib/inftrees.c",
"third_party/zlib/trees.c",
"third_party/zlib/uncompr.c",
"third_party/zlib/zutil.c",
"include/grpc/support/alloc.h",
"include/grpc/support/atm.h",
"include/grpc/support/atm_gcc_atomic.h",
"include/grpc/support/atm_gcc_sync.h",
"include/grpc/support/atm_win32.h",
"include/grpc/support/avl.h",
"include/grpc/support/cmdline.h",
"include/grpc/support/cpu.h",
"include/grpc/support/histogram.h",
"include/grpc/support/host_port.h",
"include/grpc/support/log.h",
"include/grpc/support/log_win32.h",
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
"include/grpc/support/string_util.h",
"include/grpc/support/subprocess.h",
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
"include/grpc/support/sync_posix.h",
"include/grpc/support/sync_win32.h",
"include/grpc/support/thd.h",
"include/grpc/support/time.h",
"include/grpc/support/tls.h",
"include/grpc/support/tls_gcc.h",
"include/grpc/support/tls_msvc.h",
"include/grpc/support/tls_pthread.h",
"include/grpc/support/useful.h",
"include/grpc/impl/codegen/alloc.h",
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
"include/grpc/impl/codegen/atm_win32.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
"include/grpc/impl/codegen/slice_buffer.h",
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
"include/grpc/impl/codegen/sync_win32.h",
"include/grpc/impl/codegen/time.h",
"src/core/profiling/timers.h",
"src/core/support/block_annotate.h",
"src/core/support/env.h",
"src/core/support/file.h",
"src/core/support/murmur_hash.h",
"src/core/support/stack_lockfree.h",
"src/core/support/string.h",
"src/core/support/string_win32.h",
"src/core/support/thd_internal.h",
"src/core/support/time_precise.h",
"src/core/profiling/basic_timers.c", "src/core/profiling/basic_timers.c",
"src/core/profiling/stap_timers.c", "src/core/profiling/stap_timers.c",
"src/core/support/alloc.c", "src/core/support/alloc.c",
@ -472,37 +503,6 @@
"src/core/support/time_win32.c", "src/core/support/time_win32.c",
"src/core/support/tls_pthread.c", "src/core/support/tls_pthread.c",
"src/core/support/wrap_memcpy.c", "src/core/support/wrap_memcpy.c",
"src/core/census/context.c",
"src/core/census/initialize.c",
"src/core/census/operation.c",
"src/core/census/placeholders.c",
"src/core/census/tracing.c",
"third_party/zlib/crc32.h",
"third_party/zlib/deflate.h",
"third_party/zlib/gzguts.h",
"third_party/zlib/inffast.h",
"third_party/zlib/inffixed.h",
"third_party/zlib/inflate.h",
"third_party/zlib/inftrees.h",
"third_party/zlib/trees.h",
"third_party/zlib/zconf.h",
"third_party/zlib/zlib.h",
"third_party/zlib/zutil.h",
"third_party/zlib/adler32.c",
"third_party/zlib/compress.c",
"third_party/zlib/crc32.c",
"third_party/zlib/deflate.c",
"third_party/zlib/gzclose.c",
"third_party/zlib/gzlib.c",
"third_party/zlib/gzread.c",
"third_party/zlib/gzwrite.c",
"third_party/zlib/infback.c",
"third_party/zlib/inffast.c",
"third_party/zlib/inflate.c",
"third_party/zlib/inftrees.c",
"third_party/zlib/trees.c",
"third_party/zlib/uncompr.c",
"third_party/zlib/zutil.c",
"third_party/boringssl/crypto/aes/internal.h", "third_party/boringssl/crypto/aes/internal.h",
"third_party/boringssl/crypto/asn1/asn1_locl.h", "third_party/boringssl/crypto/asn1/asn1_locl.h",
"third_party/boringssl/crypto/bio/internal.h", "third_party/boringssl/crypto/bio/internal.h",

@ -3,3 +3,4 @@ enum34>=1.0.4
futures>=2.2.0 futures>=2.2.0
cython>=0.23 cython>=0.23
coverage>=4.0 coverage>=4.0
six>=1.10

@ -54,6 +54,7 @@ sys.path.insert(0, os.path.abspath(PYTHON_STEM))
# Break import-style to ensure we can actually find our in-repo dependencies. # Break import-style to ensure we can actually find our in-repo dependencies.
import commands import commands
import grpc_core_dependencies import grpc_core_dependencies
import grpc_version
LICENSE = '3-clause BSD' LICENSE = '3-clause BSD'
@ -117,6 +118,8 @@ def cython_extensions(package_names, module_names, extra_sources, include_dirs,
sources=[module_file] + extra_sources, sources=[module_file] + extra_sources,
include_dirs=include_dirs, libraries=libraries, include_dirs=include_dirs, libraries=libraries,
define_macros=define_macros, define_macros=define_macros,
extra_compile_args=list(CFLAGS),
extra_link_args=list(LDFLAGS),
) for (module_name, module_file) in zip(module_names, module_files) ) for (module_name, module_file) in zip(module_names, module_files)
] ]
if build_with_cython: if build_with_cython:
@ -164,7 +167,7 @@ COMMAND_CLASS = {
} }
# Ensure that package data is copied over before any commands have been run: # Ensure that package data is copied over before any commands have been run:
credentials_dir = os.path.join(PYTHON_STEM, 'grpc/_adapter/credentials') credentials_dir = os.path.join(PYTHON_STEM, 'grpc/_cython/_credentials')
try: try:
os.mkdir(credentials_dir) os.mkdir(credentials_dir)
except OSError: except OSError:
@ -198,10 +201,8 @@ TEST_LOADER = 'tests:Loader'
TEST_RUNNER = 'tests:Runner' TEST_RUNNER = 'tests:Runner'
PACKAGE_DATA = { PACKAGE_DATA = {
'grpc._adapter': [
'credentials/roots.pem'
],
'grpc._cython': [ 'grpc._cython': [
'_credentials/roots.pem',
'_windows/grpc_c.32.python', '_windows/grpc_c.32.python',
'_windows/grpc_c.64.python', '_windows/grpc_c.64.python',
], ],
@ -215,7 +216,7 @@ else:
setuptools.setup( setuptools.setup(
name='grpcio', name='grpcio',
version='0.12.0b8', version=grpc_version.VERSION,
license=LICENSE, license=LICENSE,
ext_modules=CYTHON_EXTENSION_MODULES, ext_modules=CYTHON_EXTENSION_MODULES,
packages=list(PACKAGES), packages=list(PACKAGES),

@ -33,6 +33,8 @@ import sys
import os import os
import yaml import yaml
sys.dont_write_bytecode = True
boring_ssl_root = os.path.abspath(os.path.join( boring_ssl_root = os.path.abspath(os.path.join(
os.path.dirname(sys.argv[0]), os.path.dirname(sys.argv[0]),
'../../third_party/boringssl')) '../../third_party/boringssl'))

@ -1106,6 +1106,7 @@ void PrintSourceService(grpc::protobuf::io::Printer *printer,
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) {
const grpc::protobuf::MethodDescriptor *method = service->method(i); const grpc::protobuf::MethodDescriptor *method = service->method(i);
(*vars)["Idx"] = as_string(i); (*vars)["Idx"] = as_string(i);

@ -57,7 +57,7 @@ static HANDLE g_iocp;
static DWORD deadline_to_millis_timeout(gpr_timespec deadline, static DWORD deadline_to_millis_timeout(gpr_timespec deadline,
gpr_timespec now) { gpr_timespec now) {
gpr_timespec timeout; gpr_timespec timeout;
static const int max_spin_polling_us = 10; static const int64_t max_spin_polling_us = 10;
if (gpr_time_cmp(deadline, gpr_inf_future(deadline.clock_type)) == 0) { if (gpr_time_cmp(deadline, gpr_inf_future(deadline.clock_type)) == 0) {
return INFINITE; return INFINITE;
} }

@ -393,7 +393,7 @@ void grpc_pollset_shutdown(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
int grpc_poll_deadline_to_millis_timeout(gpr_timespec deadline, int grpc_poll_deadline_to_millis_timeout(gpr_timespec deadline,
gpr_timespec now) { gpr_timespec now) {
gpr_timespec timeout; gpr_timespec timeout;
static const int max_spin_polling_us = 10; static const int64_t max_spin_polling_us = 10;
if (gpr_time_cmp(deadline, gpr_inf_future(deadline.clock_type)) == 0) { if (gpr_time_cmp(deadline, gpr_inf_future(deadline.clock_type)) == 0) {
return -1; return -1;
} }

@ -212,10 +212,8 @@ void grpc_pollset_kick(grpc_pollset *p, grpc_pollset_worker *specific_worker) {
grpc_iocp_kick(); grpc_iocp_kick();
} }
} else { } else {
if (p->is_iocp_worker) { if (p->is_iocp_worker && g_active_poller == specific_worker) {
if (g_active_poller == specific_worker) { grpc_iocp_kick();
grpc_iocp_kick();
}
} else { } else {
specific_worker->kicked = 1; specific_worker->kicked = 1;
gpr_cv_signal(&specific_worker->cv); gpr_cv_signal(&specific_worker->cv);

@ -40,15 +40,14 @@
/* Forward decl of grpc_tcp_server */ /* Forward decl of grpc_tcp_server */
typedef struct grpc_tcp_server grpc_tcp_server; typedef struct grpc_tcp_server grpc_tcp_server;
typedef struct grpc_tcp_server_acceptor grpc_tcp_server_acceptor; typedef struct grpc_tcp_server_acceptor {
struct grpc_tcp_server_acceptor {
/* grpc_tcp_server_cb functions share a ref on from_server that is valid /* grpc_tcp_server_cb functions share a ref on from_server that is valid
until the function returns. */ until the function returns. */
grpc_tcp_server *from_server; grpc_tcp_server *from_server;
/* Indices that may be passed to grpc_tcp_server_port_fd(). */ /* Indices that may be passed to grpc_tcp_server_port_fd(). */
unsigned port_index; unsigned port_index;
unsigned fd_index; unsigned fd_index;
}; } grpc_tcp_server_acceptor;
/* Called for newly connected TCP connections. */ /* Called for newly connected TCP connections. */
typedef void (*grpc_tcp_server_cb)(grpc_exec_ctx *exec_ctx, void *arg, typedef void (*grpc_tcp_server_cb)(grpc_exec_ctx *exec_ctx, void *arg,
@ -57,7 +56,7 @@ typedef void (*grpc_tcp_server_cb)(grpc_exec_ctx *exec_ctx, void *arg,
/* Create a server, initially not bound to any ports. The caller owns one ref. /* Create a server, initially not bound to any ports. The caller owns one ref.
If shutdown_complete is not NULL, it will be used by If shutdown_complete is not NULL, it will be used by
grpc_tcp_server_unref(). */ grpc_tcp_server_unref() when the ref count reaches zero. */
grpc_tcp_server *grpc_tcp_server_create(grpc_closure *shutdown_complete); grpc_tcp_server *grpc_tcp_server_create(grpc_closure *shutdown_complete);
/* Start listening to bound ports */ /* Start listening to bound ports */
@ -84,7 +83,7 @@ unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server *s, unsigned port_index);
/* Returns the file descriptor of the Mth (fd_index) listening socket of the Nth /* Returns the file descriptor of the Mth (fd_index) listening socket of the Nth
(port_index) call to add_port() on this server, or -1 if the indices are out (port_index) call to add_port() on this server, or -1 if the indices are out
of bounds. The file descriptor remains owned by the server, and will be of bounds. The file descriptor remains owned by the server, and will be
cleaned up when grpc_tcp_server_destroy is called. */ cleaned up when the ref count reaches zero. */
int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index, int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index,
unsigned fd_index); unsigned fd_index);
@ -97,7 +96,7 @@ grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s);
void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s, void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s,
grpc_closure *shutdown_starting); grpc_closure *shutdown_starting);
/* If the recount drops to zero, delete s, and call (exec_ctx==NULL) or enqueue /* If the refcount drops to zero, delete s, and call (exec_ctx==NULL) or enqueue
a call (exec_ctx!=NULL) to shutdown_complete. */ a call (exec_ctx!=NULL) to shutdown_complete. */
void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s); void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s);

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -99,6 +99,11 @@ gpr_stack_lockfree *gpr_stack_lockfree_create(size_t entries) {
/* Point the head at reserved dummy entry */ /* Point the head at reserved dummy entry */
stack->head.contents.index = INVALID_ENTRY_INDEX; stack->head.contents.index = INVALID_ENTRY_INDEX;
/* Fill in the pad and aba_ctr to avoid confusing memcheck tools */
#ifdef GPR_ARCH_64
stack->head.contents.pad = 0;
#endif
stack->head.contents.aba_ctr = 0;
return stack; return stack;
} }
@ -115,6 +120,11 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) {
/* First fill in the entry's index and aba ctr for new head */ /* First fill in the entry's index and aba ctr for new head */
newhead.contents.index = (uint16_t)entry; newhead.contents.index = (uint16_t)entry;
#ifdef GPR_ARCH_64
/* Fill in the pad to avoid confusing memcheck tools */
newhead.contents.pad = 0;
#endif
/* Also post-increment the aba_ctr */ /* Also post-increment the aba_ctr */
curent.atm = gpr_atm_no_barrier_load(&stack->entries[entry].atm); curent.atm = gpr_atm_no_barrier_load(&stack->entries[entry].atm);
newhead.contents.aba_ctr = ++curent.contents.aba_ctr; newhead.contents.aba_ctr = ++curent.contents.aba_ctr;

@ -87,6 +87,7 @@ int gpr_cv_wait(gpr_cv *cv, gpr_mu *mu, gpr_timespec abs_deadline) {
0) { 0) {
SleepConditionVariableCS(cv, &mu->cs, INFINITE); SleepConditionVariableCS(cv, &mu->cs, INFINITE);
} else { } else {
abs_deadline = gpr_convert_clock_type(abs_deadline, GPR_CLOCK_REALTIME);
gpr_timespec now = gpr_now(abs_deadline.clock_type); gpr_timespec now = gpr_now(abs_deadline.clock_type);
int64_t now_ms = (int64_t)now.tv_sec * 1000 + now.tv_nsec / 1000000; int64_t now_ms = (int64_t)now.tv_sec * 1000 + now.tv_nsec / 1000000;
int64_t deadline_ms = int64_t deadline_ms =

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -83,12 +83,12 @@ gpr_timespec gpr_inf_past(gpr_clock_type type) {
/* TODO(ctiller): consider merging _nanos, _micros, _millis into a single /* TODO(ctiller): consider merging _nanos, _micros, _millis into a single
function for maintainability. Similarly for _seconds, _minutes, and _hours */ function for maintainability. Similarly for _seconds, _minutes, and _hours */
gpr_timespec gpr_time_from_nanos(long ns, gpr_clock_type type) { gpr_timespec gpr_time_from_nanos(int64_t ns, gpr_clock_type type) {
gpr_timespec result; gpr_timespec result;
result.clock_type = type; result.clock_type = type;
if (ns == LONG_MAX) { if (ns == INT64_MAX) {
result = gpr_inf_future(type); result = gpr_inf_future(type);
} else if (ns == LONG_MIN) { } else if (ns == INT64_MIN) {
result = gpr_inf_past(type); result = gpr_inf_past(type);
} else if (ns >= 0) { } else if (ns >= 0) {
result.tv_sec = ns / GPR_NS_PER_SEC; result.tv_sec = ns / GPR_NS_PER_SEC;
@ -101,12 +101,12 @@ gpr_timespec gpr_time_from_nanos(long ns, gpr_clock_type type) {
return result; return result;
} }
gpr_timespec gpr_time_from_micros(long us, gpr_clock_type type) { gpr_timespec gpr_time_from_micros(int64_t us, gpr_clock_type type) {
gpr_timespec result; gpr_timespec result;
result.clock_type = type; result.clock_type = type;
if (us == LONG_MAX) { if (us == INT64_MAX) {
result = gpr_inf_future(type); result = gpr_inf_future(type);
} else if (us == LONG_MIN) { } else if (us == INT64_MIN) {
result = gpr_inf_past(type); result = gpr_inf_past(type);
} else if (us >= 0) { } else if (us >= 0) {
result.tv_sec = us / 1000000; result.tv_sec = us / 1000000;
@ -119,12 +119,12 @@ gpr_timespec gpr_time_from_micros(long us, gpr_clock_type type) {
return result; return result;
} }
gpr_timespec gpr_time_from_millis(long ms, gpr_clock_type type) { gpr_timespec gpr_time_from_millis(int64_t ms, gpr_clock_type type) {
gpr_timespec result; gpr_timespec result;
result.clock_type = type; result.clock_type = type;
if (ms == LONG_MAX) { if (ms == INT64_MAX) {
result = gpr_inf_future(type); result = gpr_inf_future(type);
} else if (ms == LONG_MIN) { } else if (ms == INT64_MIN) {
result = gpr_inf_past(type); result = gpr_inf_past(type);
} else if (ms >= 0) { } else if (ms >= 0) {
result.tv_sec = ms / 1000; result.tv_sec = ms / 1000;
@ -137,12 +137,12 @@ gpr_timespec gpr_time_from_millis(long ms, gpr_clock_type type) {
return result; return result;
} }
gpr_timespec gpr_time_from_seconds(long s, gpr_clock_type type) { gpr_timespec gpr_time_from_seconds(int64_t s, gpr_clock_type type) {
gpr_timespec result; gpr_timespec result;
result.clock_type = type; result.clock_type = type;
if (s == LONG_MAX) { if (s == INT64_MAX) {
result = gpr_inf_future(type); result = gpr_inf_future(type);
} else if (s == LONG_MIN) { } else if (s == INT64_MIN) {
result = gpr_inf_past(type); result = gpr_inf_past(type);
} else { } else {
result.tv_sec = s; result.tv_sec = s;
@ -151,12 +151,12 @@ gpr_timespec gpr_time_from_seconds(long s, gpr_clock_type type) {
return result; return result;
} }
gpr_timespec gpr_time_from_minutes(long m, gpr_clock_type type) { gpr_timespec gpr_time_from_minutes(int64_t m, gpr_clock_type type) {
gpr_timespec result; gpr_timespec result;
result.clock_type = type; result.clock_type = type;
if (m >= LONG_MAX / 60) { if (m >= INT64_MAX / 60) {
result = gpr_inf_future(type); result = gpr_inf_future(type);
} else if (m <= LONG_MIN / 60) { } else if (m <= INT64_MIN / 60) {
result = gpr_inf_past(type); result = gpr_inf_past(type);
} else { } else {
result.tv_sec = m * 60; result.tv_sec = m * 60;
@ -165,12 +165,12 @@ gpr_timespec gpr_time_from_minutes(long m, gpr_clock_type type) {
return result; return result;
} }
gpr_timespec gpr_time_from_hours(long h, gpr_clock_type type) { gpr_timespec gpr_time_from_hours(int64_t h, gpr_clock_type type) {
gpr_timespec result; gpr_timespec result;
result.clock_type = type; result.clock_type = type;
if (h >= LONG_MAX / 3600) { if (h >= INT64_MAX / 3600) {
result = gpr_inf_future(type); result = gpr_inf_future(type);
} else if (h <= LONG_MIN / 3600) { } else if (h <= INT64_MIN / 3600) {
result = gpr_inf_past(type); result = gpr_inf_past(type);
} else { } else {
result.tv_sec = h * 3600; result.tv_sec = h * 3600;

@ -36,4 +36,4 @@
#include <grpc/grpc.h> #include <grpc/grpc.h>
const char *grpc_version_string(void) { return "0.13.0.0"; } const char *grpc_version_string(void) { return "0.14.0-dev"; }

@ -75,6 +75,9 @@ int grpc_chttp2_unlocking_check_writes(
GRPC_CHTTP2_FLOW_MOVE_TRANSPORT("write", transport_writing, outgoing_window, GRPC_CHTTP2_FLOW_MOVE_TRANSPORT("write", transport_writing, outgoing_window,
transport_global, outgoing_window); transport_global, outgoing_window);
bool is_window_available = transport_writing->outgoing_window > 0;
grpc_chttp2_list_flush_writing_stalled_by_transport(transport_writing,
is_window_available);
/* 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 */
@ -329,10 +332,6 @@ void grpc_chttp2_cleanup_writing(
grpc_chttp2_transport_writing *transport_writing) { grpc_chttp2_transport_writing *transport_writing) {
grpc_chttp2_stream_writing *stream_writing; grpc_chttp2_stream_writing *stream_writing;
grpc_chttp2_stream_global *stream_global; grpc_chttp2_stream_global *stream_global;
bool is_window_available = transport_writing->outgoing_window > 0;
grpc_chttp2_list_flush_writing_stalled_by_transport(transport_writing,
is_window_available);
while (grpc_chttp2_list_pop_written_stream( while (grpc_chttp2_list_pop_written_stream(
transport_global, transport_writing, &stream_global, &stream_writing)) { transport_global, transport_writing, &stream_global, &stream_writing)) {

@ -35,11 +35,11 @@
* WARNING: Auto-generated code. * WARNING: Auto-generated code.
* *
* To make changes to this file, change * To make changes to this file, change
*tools/codegen/core/gen_static_metadata.py, * tools/codegen/core/gen_static_metadata.py,
* and then re-run it. * and then re-run it.
* *
* See metadata.h for an explanation of the interface here, and metadata.c for * See metadata.h for an explanation of the interface here, and metadata.c for
*an * an
* explanation of what's going on. * explanation of what's going on.
*/ */
@ -69,21 +69,21 @@ const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = {
"0", "1", "2", "200", "204", "206", "304", "400", "404", "500", "accept", "0", "1", "2", "200", "204", "206", "304", "400", "404", "500", "accept",
"accept-charset", "accept-encoding", "accept-language", "accept-ranges", "accept-charset", "accept-encoding", "accept-language", "accept-ranges",
"access-control-allow-origin", "age", "allow", "application/grpc", "access-control-allow-origin", "age", "allow", "application/grpc",
":authority", "authorization", "cache-control", "census", "census-bin", ":authority", "authorization", "cache-control", "census-bin",
"content-disposition", "content-encoding", "content-language", "census-binary-bin", "content-disposition", "content-encoding",
"content-length", "content-location", "content-range", "content-type", "content-language", "content-length", "content-location", "content-range",
"cookie", "date", "deflate", "deflate,gzip", "", "etag", "expect", "content-type", "cookie", "date", "deflate", "deflate,gzip", "", "etag",
"expires", "from", "GET", "grpc", "grpc-accept-encoding", "grpc-encoding", "expect", "expires", "from", "GET", "grpc", "grpc-accept-encoding",
"grpc-internal-encoding-request", "grpc-message", "grpc-status", "grpc-encoding", "grpc-internal-encoding-request", "grpc-message",
"grpc-timeout", "gzip", "gzip, deflate", "host", "http", "https", "grpc-status", "grpc-timeout", "gzip", "gzip, deflate", "host", "http",
"identity", "identity,deflate", "identity,deflate,gzip", "identity,gzip", "https", "identity", "identity,deflate", "identity,deflate,gzip",
"if-match", "if-modified-since", "if-none-match", "if-range", "identity,gzip", "if-match", "if-modified-since", "if-none-match",
"if-unmodified-since", "last-modified", "link", "location", "max-forwards", "if-range", "if-unmodified-since", "last-modified", "link", "location",
":method", ":path", "POST", "proxy-authenticate", "proxy-authorization", "max-forwards", ":method", ":path", "POST", "proxy-authenticate",
"range", "referer", "refresh", "retry-after", ":scheme", "server", "proxy-authorization", "range", "referer", "refresh", "retry-after",
"set-cookie", "/", "/index.html", ":status", "strict-transport-security", ":scheme", "server", "set-cookie", "/", "/index.html", ":status",
"te", "trailers", "transfer-encoding", "user-agent", "vary", "via", "strict-transport-security", "te", "trailers", "transfer-encoding",
"www-authenticate"}; "user-agent", "vary", "via", "www-authenticate"};
const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 29, 26, 30, const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 29, 26, 30,
28, 32, 27, 31}; 28, 32, 27, 31};

@ -94,10 +94,10 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT];
#define GRPC_MDSTR_AUTHORIZATION (&grpc_static_mdstr_table[20]) #define GRPC_MDSTR_AUTHORIZATION (&grpc_static_mdstr_table[20])
/* "cache-control" */ /* "cache-control" */
#define GRPC_MDSTR_CACHE_CONTROL (&grpc_static_mdstr_table[21]) #define GRPC_MDSTR_CACHE_CONTROL (&grpc_static_mdstr_table[21])
/* "census" */
#define GRPC_MDSTR_CENSUS (&grpc_static_mdstr_table[22])
/* "census-bin" */ /* "census-bin" */
#define GRPC_MDSTR_CENSUS_BIN (&grpc_static_mdstr_table[23]) #define GRPC_MDSTR_CENSUS_BIN (&grpc_static_mdstr_table[22])
/* "census-binary-bin" */
#define GRPC_MDSTR_CENSUS_BINARY_BIN (&grpc_static_mdstr_table[23])
/* "content-disposition" */ /* "content-disposition" */
#define GRPC_MDSTR_CONTENT_DISPOSITION (&grpc_static_mdstr_table[24]) #define GRPC_MDSTR_CONTENT_DISPOSITION (&grpc_static_mdstr_table[24])
/* "content-encoding" */ /* "content-encoding" */

@ -1,6 +1,6 @@
#region Copyright notice and license #region Copyright notice and license
// Copyright 2015, Google Inc. // Copyright 2015-2016, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -84,7 +84,7 @@ namespace Grpc.Core.Tests
{ {
var coreVersion = GrpcEnvironment.GetCoreVersionString(); var coreVersion = GrpcEnvironment.GetCoreVersionString();
var parts = coreVersion.Split('.'); var parts = coreVersion.Split('.');
Assert.AreEqual(4, parts.Length); Assert.AreEqual(3, parts.Length);
} }
} }
} }

@ -106,7 +106,7 @@ namespace Grpc.Core.Internal
private static string GetExecutingAssemblyDirectory() private static string GetExecutingAssemblyDirectory()
{ {
return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); return Path.GetDirectoryName(typeof(NativeExtension).GetTypeInfo().Assembly.Location);
} }
private static string GetPlatformString() private static string GetPlatformString()

@ -1,6 +1,6 @@
#region Copyright notice and license #region Copyright notice and license
// Copyright 2015, Google Inc. // Copyright 2015-2016, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -111,7 +111,7 @@ namespace Grpc.Core.Profiling
public void Dump(string filepath) public void Dump(string filepath)
{ {
using (var stream = new StreamWriter(filepath)) using (var stream = File.CreateText(filepath))
{ {
Dump(stream); Dump(stream);
} }

@ -1,6 +1,6 @@
#region Copyright notice and license #region Copyright notice and license
// Copyright 2015, Google Inc. // Copyright 2015-2016, Google Inc.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without // Redistribution and use in source and binary forms, with or without
@ -34,4 +34,4 @@
using System.Reflection; using System.Reflection;
// The current version of gRPC C#. // The current version of gRPC C#.
[assembly: AssemblyVersion(Grpc.Core.VersionInfo.CurrentVersion + ".0")] [assembly: AssemblyVersion(Grpc.Core.VersionInfo.CurrentAssemblyVersion)]

@ -38,9 +38,14 @@ namespace Grpc.Core
/// </summary> /// </summary>
public static class VersionInfo public static class VersionInfo
{ {
/// <summary>
/// Current version of gRPC C# assemblies
/// </summary>
public const string CurrentAssemblyVersion = "0.14.0.0";
/// <summary> /// <summary>
/// Current version of gRPC C# /// Current version of gRPC C#
/// </summary> /// </summary>
public const string CurrentVersion = "0.13.0"; public const string CurrentVersion = "0.14.0-dev";
} }
} }

@ -1,7 +1,7 @@
@rem Builds gRPC NuGet packages @rem Builds gRPC NuGet packages
@rem Current package versions @rem Current package versions
set VERSION=0.13.0 set VERSION=0.14.0-dev
set PROTOBUF_VERSION=3.0.0-beta2 set PROTOBUF_VERSION=3.0.0-beta2
@rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well. @rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well.

@ -63,6 +63,10 @@ grpc_byte_buffer *BufferToByteBuffer(Local<Value> buffer) {
return byte_buffer; return byte_buffer;
} }
namespace {
void delete_buffer(char *data, void *hint) { delete[] data; }
}
Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) { Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
Nan::EscapableHandleScope scope; Nan::EscapableHandleScope scope;
if (buffer == NULL) { if (buffer == NULL) {
@ -80,7 +84,7 @@ Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
gpr_slice_unref(next); gpr_slice_unref(next);
} }
return scope.Escape(MakeFastBuffer( return scope.Escape(MakeFastBuffer(
Nan::NewBuffer(result, length).ToLocalChecked())); Nan::NewBuffer(result, length, delete_buffer, NULL).ToLocalChecked()));
} }
Local<Value> MakeFastBuffer(Local<Value> slowBuffer) { Local<Value> MakeFastBuffer(Local<Value> slowBuffer) {

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -32,6 +32,7 @@
*/ */
#include <limits> #include <limits>
#include <cstdint>
#include "grpc/grpc.h" #include "grpc/grpc.h"
#include "grpc/support/time.h" #include "grpc/support/time.h"
@ -46,7 +47,7 @@ gpr_timespec MillisecondsToTimespec(double millis) {
} else if (millis == -std::numeric_limits<double>::infinity()) { } else if (millis == -std::numeric_limits<double>::infinity()) {
return gpr_inf_past(GPR_CLOCK_REALTIME); return gpr_inf_past(GPR_CLOCK_REALTIME);
} else { } else {
return gpr_time_from_micros(static_cast<long>(millis * 1000), return gpr_time_from_micros(static_cast<int64_t>(millis * 1000),
GPR_CLOCK_REALTIME); GPR_CLOCK_REALTIME);
} }
} }

@ -33,9 +33,15 @@
'use strict'; 'use strict';
var os = require('os');
var BenchmarkClient = require('./benchmark_client'); var BenchmarkClient = require('./benchmark_client');
var BenchmarkServer = require('./benchmark_server'); var BenchmarkServer = require('./benchmark_server');
exports.quitWorker = function quitWorker(call, callback) {
callback(null, {});
process.exit(0);
}
exports.runClient = function runClient(call) { exports.runClient = function runClient(call) {
var client; var client;
call.on('data', function(request) { call.on('data', function(request) {
@ -130,3 +136,7 @@ exports.runServer = function runServer(call) {
}); });
}); });
}; };
exports.coreCount = function coreCount(call, callback) {
callback(null, {cores: os.cpus().length});
};

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -30,9 +30,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#import "GRPCCall.h"
#import "GRPCChannel.h" /**
* Methods to configure GRPC channel options.
*/
@interface GRPCCall (ChannelArg)
/**
* Use the provided @c userAgentPrefix at the beginning of the HTTP User Agent string for all calls
* to the specified @c host.
*/
+ (void)setUserAgentPrefix:(NSString *)userAgentPrefix forHost:(NSString *)host;
@interface GRPCUnsecuredChannel : GRPCChannel
- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER;
@end @end

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -31,20 +31,19 @@
* *
*/ */
#import "GRPCUnsecuredChannel.h" #import "GRPCCall+ChannelArg.h"
#include <grpc/grpc.h> #import "private/GRPCHost.h"
@implementation GRPCUnsecuredChannel @implementation GRPCCall (ChannelArg)
- (instancetype)initWithHost:(NSString *)host { + (void)setUserAgentPrefix:(NSString *)userAgentPrefix forHost:(NSString *)host {
return (self = [super initWithChannel:grpc_insecure_channel_create(host.UTF8String, NULL, NULL)]); if (!host) {
[NSException raise:NSInvalidArgumentException
format:@"host and userAgentPrefix must be provided."];
}
GRPCHost *hostConfig = [GRPCHost hostWithAddress:host];
hostConfig.userAgentPrefix = userAgentPrefix;
} }
// TODO(jcanizales): GRPCSecureChannel and GRPCUnsecuredChannel are just convenience initializers
// for GRPCChannel. Move them into GRPCChannel, which will make the following unnecessary.
- (instancetype)initWithChannel:(grpc_channel *)unmanagedChannel {
[NSException raise:NSInternalInconsistencyException format:@"use the other initializer"];
return [self initWithHost:nil]; // silence warnings
}
@end @end

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -33,18 +33,51 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
struct grpc_channel; #include <grpc/grpc.h>
struct grpc_channel_credentials;
/** /**
* Each separate instance of this class represents at least one TCP connection to the provided host. * Each separate instance of this class represents at least one TCP connection to the provided host.
* Create them using one of the subclasses |GRPCSecureChannel| and |GRPCUnsecuredChannel|.
*/ */
@interface GRPCChannel : NSObject @interface GRPCChannel : NSObject
@property(nonatomic, readonly) struct grpc_channel *unmanagedChannel;
@property(nonatomic, readonly, nonnull) struct grpc_channel *unmanagedChannel;
- (nullable instancetype)init NS_UNAVAILABLE;
/** /**
* This initializer takes ownership of the passed channel, and will destroy it when this object is * Creates a secure channel to the specified @c host using default credentials and channel
* deallocated. It's illegal to pass the same grpc_channel to two different GRPCChannel objects. * arguments. If certificates could not be found to create a secure channel, then @c nil is
* returned.
*/ */
- (instancetype)initWithChannel:(struct grpc_channel *)unmanagedChannel NS_DESIGNATED_INITIALIZER; + (nullable GRPCChannel *)secureChannelWithHost:(nonnull NSString *)host;
/**
* Creates a secure channel to the specified @c host using the specified @c pathToCertificates and
* @c channelArgs. Only in tests should @c pathToCertificates be nil or
* @c GRPC_SSL_TARGET_NAME_OVERRIDE_ARG channel arg be set. Passing nil for @c pathToCertificates
* results in using the default root certificates distributed with the library. If certificates
* could not be found in any case, then @c nil is returned.
*/
+ (nullable GRPCChannel *)secureChannelWithHost:(nonnull NSString *)host
pathToCertificates:(nullable NSString *)pathToCertificates
channelArgs:(nullable NSDictionary *)channelArgs;
/**
* Creates a secure channel to the specified @c host using the specified @c credentials and
* @c channelArgs. Only in tests should @c GRPC_SSL_TARGET_NAME_OVERRIDE_ARG channel arg be set.
*/
+ (nonnull GRPCChannel *)secureChannelWithHost:(nonnull NSString *)host
credentials:(nonnull struct grpc_channel_credentials *)credentials
channelArgs:(nullable NSDictionary *)channelArgs;
/**
* Creates an insecure channel to the specified @c host using the specified @c channelArgs.
*/
+ (nonnull GRPCChannel *)insecureChannelWithHost:(nonnull NSString *)host
channelArgs:(nullable NSDictionary *)channelArgs;
@end @end

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -33,22 +33,114 @@
#import "GRPCChannel.h" #import "GRPCChannel.h"
#include <grpc/grpc.h> #include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@implementation GRPCChannel /**
* Returns @c grpc_channel_credentials from the specified @c path. If the file at the path could not
* be read then NULL is returned. If NULL is returned, @c errorPtr may not be NULL if there are
* details available describing what went wrong.
*/
static grpc_channel_credentials *CertificatesAtPath(NSString *path, NSError **errorPtr) {
// Files in PEM format can have non-ASCII characters in their comments (e.g. for the name of the
// issuer). Load them as UTF8 and produce an ASCII equivalent.
NSString *contentInUTF8 = [NSString stringWithContentsOfFile:path
encoding:NSUTF8StringEncoding
error:errorPtr];
NSData *contentInASCII = [contentInUTF8 dataUsingEncoding:NSASCIIStringEncoding
allowLossyConversion:YES];
if (!contentInASCII.bytes) {
// Passing NULL to grpc_ssl_credentials_create produces behavior we don't want, so return.
return NULL;
}
return grpc_ssl_credentials_create(contentInASCII.bytes, NULL, NULL);
}
void freeChannelArgs(grpc_channel_args *channel_args) {
for (size_t i = 0; i < channel_args->num_args; ++i) {
grpc_arg *arg = &channel_args->args[i];
gpr_free(arg->key);
if (arg->type == GRPC_ARG_STRING) {
gpr_free(arg->value.string);
}
}
gpr_free(channel_args);
}
/**
* Allocates a @c grpc_channel_args and populates it with the options specified in the
* @c dictionary. Keys must be @c NSString. If the value responds to @c @selector(UTF8String) then
* it will be mapped to @c GRPC_ARG_STRING. If not, it will be mapped to @c GRPC_ARG_INTEGER if the
* value responds to @c @selector(intValue). Otherwise, an exception will be raised. The caller of
* this function is responsible for calling @c freeChannelArgs on a non-NULL returned value.
*/
grpc_channel_args * buildChannelArgs(NSDictionary *dictionary) {
if (!dictionary) {
return NULL;
}
- (instancetype)init { NSArray *keys = [dictionary allKeys];
return [self initWithChannel:NULL]; NSUInteger argCount = [keys count];
grpc_channel_args *channelArgs = gpr_malloc(sizeof(grpc_channel_args));
channelArgs->num_args = argCount;
channelArgs->args = gpr_malloc(argCount * sizeof(grpc_arg));
// TODO(kriswuollett) Check that keys adhere to GRPC core library requirements
for (NSUInteger i = 0; i < argCount; ++i) {
grpc_arg *arg = &channelArgs->args[i];
arg->key = gpr_strdup([keys[i] UTF8String]);
id value = dictionary[keys[i]];
if ([value respondsToSelector:@selector(UTF8String)]) {
arg->type = GRPC_ARG_STRING;
arg->value.string = gpr_strdup([value UTF8String]);
} else if ([value respondsToSelector:@selector(intValue)]) {
arg->type = GRPC_ARG_INTEGER;
arg->value.integer = [value intValue];
} else {
[NSException raise:NSInvalidArgumentException
format:@"Invalid value type: %@", [value class]];
}
}
return channelArgs;
}
@implementation GRPCChannel {
// Retain arguments to channel_create because they may not be used on the thread that invoked
// the channel_create function.
NSString *_host;
grpc_channel_args *_channelArgs;
} }
// Designated initializer
- (instancetype)initWithChannel:(grpc_channel *)unmanagedChannel { - (instancetype)initWithHost:(NSString *)host
if (!unmanagedChannel) { secure:(BOOL)secure
credentials:(struct grpc_channel_credentials *)credentials
channelArgs:(NSDictionary *)channelArgs {
if (!host) {
[NSException raise:NSInvalidArgumentException format:@"host argument missing"];
}
if (secure && !credentials) {
return nil; return nil;
} }
if ((self = [super init])) {
_unmanagedChannel = unmanagedChannel; if (self = [super init]) {
_channelArgs = buildChannelArgs(channelArgs);
_host = [host copy];
if (secure) {
_unmanagedChannel = grpc_secure_channel_create(credentials, _host.UTF8String, _channelArgs,
NULL);
} else {
_unmanagedChannel = grpc_insecure_channel_create(_host.UTF8String, _channelArgs, NULL);
}
} }
return self; return self;
} }
@ -56,5 +148,61 @@
// TODO(jcanizales): Be sure to add a test with a server that closes the connection prematurely, // TODO(jcanizales): Be sure to add a test with a server that closes the connection prematurely,
// as in the past that made this call to crash. // as in the past that made this call to crash.
grpc_channel_destroy(_unmanagedChannel); grpc_channel_destroy(_unmanagedChannel);
freeChannelArgs(_channelArgs);
} }
+ (GRPCChannel *)secureChannelWithHost:(NSString *)host {
return [[GRPCChannel alloc] initWithHost:host secure:YES credentials:NULL channelArgs:NULL];
}
+ (GRPCChannel *)secureChannelWithHost:(NSString *)host
pathToCertificates:(NSString *)path
channelArgs:(NSDictionary *)channelArgs {
// Load default SSL certificates once.
static grpc_channel_credentials *kDefaultCertificates;
static dispatch_once_t loading;
dispatch_once(&loading, ^{
NSString *defaultPath = @"gRPCCertificates.bundle/roots"; // .pem
// Do not use NSBundle.mainBundle, as it's nil for tests of library projects.
NSBundle *bundle = [NSBundle bundleForClass:self.class];
NSString *path = [bundle pathForResource:defaultPath ofType:@"pem"];
NSError *error;
kDefaultCertificates = CertificatesAtPath(path, &error);
NSAssert(kDefaultCertificates, @"Could not read %@/%@.pem. This file, with the root "
"certificates, is needed to establish secure (TLS) connections. Because the file is "
"distributed with the gRPC library, this error is usually a sign that the library "
"wasn't configured correctly for your project. Error: %@",
bundle.bundlePath, defaultPath, error);
});
//TODO(jcanizales): Add NSError** parameter to the initializer.
grpc_channel_credentials *certificates = path
? CertificatesAtPath(path, NULL)
: kDefaultCertificates;
return [[GRPCChannel alloc] initWithHost:host
secure:YES
credentials:certificates
channelArgs:channelArgs];
}
+ (GRPCChannel *)secureChannelWithHost:(NSString *)host
credentials:(struct grpc_channel_credentials *)credentials
channelArgs:(NSDictionary *)channelArgs {
return [[GRPCChannel alloc] initWithHost:host
secure:YES
credentials:credentials
channelArgs:channelArgs];
}
+ (GRPCChannel *)insecureChannelWithHost:(NSString *)host
channelArgs:(NSDictionary *)channelArgs {
return [[GRPCChannel alloc] initWithHost:host
secure:NO
credentials:NULL
channelArgs:channelArgs];
}
@end @end

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,6 +39,7 @@ struct grpc_call;
@interface GRPCHost : NSObject @interface GRPCHost : NSObject
@property(nonatomic, readonly) NSString *address; @property(nonatomic, readonly) NSString *address;
@property(nonatomic, copy) NSString *userAgentPrefix;
/** The following properties should only be modified for testing: */ /** The following properties should only be modified for testing: */

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -34,11 +34,15 @@
#import "GRPCHost.h" #import "GRPCHost.h"
#include <grpc/grpc.h> #include <grpc/grpc.h>
#import <GRPCClient/GRPCCall+ChannelArg.h>
#import "GRPCChannel.h" #import "GRPCChannel.h"
#import "GRPCCompletionQueue.h" #import "GRPCCompletionQueue.h"
#import "GRPCSecureChannel.h" #import "NSDictionary+GRPC.h"
#import "GRPCUnsecuredChannel.h"
// TODO(jcanizales): Generate the version in a standalone header, from templates. Like
// templates/src/core/surface/version.c.template .
#define GRPC_OBJC_VERSION_STRING @"0.13.0"
@interface GRPCHost () @interface GRPCHost ()
// TODO(mlumish): Investigate whether caching channels with strong links is a good idea. // TODO(mlumish): Investigate whether caching channels with strong links is a good idea.
@ -106,13 +110,28 @@
- (GRPCChannel *)channel { - (GRPCChannel *)channel {
// Create it lazily, because we don't want to open a connection just because someone is // Create it lazily, because we don't want to open a connection just because someone is
// configuring a host. // configuring a host.
if (!_channel) { if (!_channel) {
NSMutableDictionary *args = [NSMutableDictionary dictionary];
// TODO(jcanizales): Add OS and device information (see
// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#user-agents ).
NSString *userAgent = @"grpc-objc/" GRPC_OBJC_VERSION_STRING;
if (_userAgentPrefix) {
userAgent = [@[_userAgentPrefix, userAgent] componentsJoinedByString:@" "];
}
args[@GRPC_ARG_PRIMARY_USER_AGENT_STRING] = userAgent;
if (_secure) { if (_secure) {
_channel = [[GRPCSecureChannel alloc] initWithHost:_address if (_hostNameOverride) {
pathToCertificates:_pathToCertificates args[@GRPC_SSL_TARGET_NAME_OVERRIDE_ARG] = _hostNameOverride;
hostNameOverride:_hostNameOverride]; }
_channel = [GRPCChannel secureChannelWithHost:_address
pathToCertificates:_pathToCertificates
channelArgs:args];
} else { } else {
_channel = [[GRPCUnsecuredChannel alloc] initWithHost:_address]; _channel = [GRPCChannel insecureChannelWithHost:_address channelArgs:args];
} }
} }
return _channel; return _channel;

@ -1,118 +0,0 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#import "GRPCSecureChannel.h"
#include <grpc/grpc_security.h>
// Returns NULL if the file at path couldn't be read. In that case, if errorPtr isn't NULL,
// *errorPtr will be an object describing what went wrong.
static grpc_channel_credentials *CertificatesAtPath(NSString *path, NSError **errorPtr) {
// Files in PEM format can have non-ASCII characters in their comments (e.g. for the name of the
// issuer). Load them as UTF8 and produce an ASCII equivalent.
NSString *contentInUTF8 = [NSString stringWithContentsOfFile:path
encoding:NSUTF8StringEncoding
error:errorPtr];
NSData *contentInASCII = [contentInUTF8 dataUsingEncoding:NSASCIIStringEncoding
allowLossyConversion:YES];
if (!contentInASCII.bytes) {
// Passing NULL to grpc_ssl_credentials_create produces behavior we don't want, so return.
return NULL;
}
return grpc_ssl_credentials_create(contentInASCII.bytes, NULL, NULL);
}
@implementation GRPCSecureChannel
- (instancetype)initWithHost:(NSString *)host {
return [self initWithHost:host pathToCertificates:nil hostNameOverride:nil];
}
- (instancetype)initWithHost:(NSString *)host
pathToCertificates:(NSString *)path
hostNameOverride:(NSString *)hostNameOverride {
// Load default SSL certificates once.
static grpc_channel_credentials *kDefaultCertificates;
static dispatch_once_t loading;
dispatch_once(&loading, ^{
NSString *defaultPath = @"gRPCCertificates.bundle/roots"; // .pem
// Do not use NSBundle.mainBundle, as it's nil for tests of library projects.
NSBundle *bundle = [NSBundle bundleForClass:self.class];
NSString *path = [bundle pathForResource:defaultPath ofType:@"pem"];
NSError *error;
kDefaultCertificates = CertificatesAtPath(path, &error);
NSAssert(kDefaultCertificates, @"Could not read %@/%@.pem. This file, with the root "
"certificates, is needed to establish secure (TLS) connections. Because the file is "
"distributed with the gRPC library, this error is usually a sign that the library "
"wasn't configured correctly for your project. Error: %@",
bundle.bundlePath, defaultPath, error);
});
//TODO(jcanizales): Add NSError** parameter to the initializer.
grpc_channel_credentials *certificates = path
? CertificatesAtPath(path, NULL)
: kDefaultCertificates;
if (!certificates) {
return nil;
}
// Ritual to pass the SSL host name override to the C library.
grpc_channel_args channelArgs;
grpc_arg nameOverrideArg;
channelArgs.num_args = 1;
channelArgs.args = &nameOverrideArg;
nameOverrideArg.type = GRPC_ARG_STRING;
nameOverrideArg.key = GRPC_SSL_TARGET_NAME_OVERRIDE_ARG;
// Cast const away. Hope C gRPC doesn't modify it!
nameOverrideArg.value.string = (char *) hostNameOverride.UTF8String;
grpc_channel_args *args = hostNameOverride ? &channelArgs : NULL;
return [self initWithHost:host credentials:certificates args:args];
}
- (instancetype)initWithHost:(NSString *)host
credentials:(grpc_channel_credentials *)credentials
args:(grpc_channel_args *)args {
return (self = [super
initWithChannel:grpc_secure_channel_create(
credentials, host.UTF8String, args, NULL)]);
}
// TODO(jcanizales): GRPCSecureChannel and GRPCUnsecuredChannel are just convenience initializers
// for GRPCChannel. Move them into GRPCChannel, which will make the following unnecessary.
- (instancetype)initWithChannel:(grpc_channel *)unmanagedChannel {
[NSException raise:NSInternalInconsistencyException format:@"use another initializer"];
return [self initWithHost:nil]; // silence warnings
}
@end

@ -50,6 +50,17 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_LIBPATH($GRPC_LIBDIR) PHP_ADD_LIBPATH($GRPC_LIBDIR)
PHP_CHECK_LIBRARY(gpr,gpr_now,
[
PHP_ADD_LIBRARY(gpr,,GRPC_SHARED_LIBADD)
PHP_ADD_LIBRARY(gpr)
AC_DEFINE(HAVE_GPRLIB,1,[ ])
],[
AC_MSG_ERROR([wrong gpr lib version or lib not found])
],[
-L$GRPC_LIBDIR
])
PHP_CHECK_LIBRARY(grpc,grpc_channel_destroy, PHP_CHECK_LIBRARY(grpc,grpc_channel_destroy,
[ [
PHP_ADD_LIBRARY(grpc,,GRPC_SHARED_LIBADD) PHP_ADD_LIBRARY(grpc,,GRPC_SHARED_LIBADD)

@ -166,3 +166,6 @@ message CoreResponse {
// Number of cores available on the server // Number of cores available on the server
int32 cores = 1; int32 cores = 1;
} }
message Void {
}

@ -65,4 +65,7 @@ service WorkerService {
// Just return the core count - unary call // Just return the core count - unary call
rpc CoreCount(CoreRequest) returns (CoreResponse); rpc CoreCount(CoreRequest) returns (CoreResponse);
// Quit this worker
rpc QuitWorker(Void) returns (Void);
} }

@ -14,4 +14,4 @@ nosetests.xml
doc/ doc/
_grpcio_metadata.py _grpcio_metadata.py
htmlcov/ htmlcov/
grpc/_adapter/credentials grpc/_cython/_credentials

@ -52,6 +52,13 @@ import support
PYTHON_STEM = os.path.dirname(os.path.abspath(__file__)) PYTHON_STEM = os.path.dirname(os.path.abspath(__file__))
BINARIES_REPOSITORY = os.environ.get(
'GRPC_PYTHON_BINARIES_REPOSITORY',
'https://storage.googleapis.com/grpc-precompiled-binaries/python')
USE_GRPC_CUSTOM_BDIST = bool(int(os.environ.get(
'GRPC_PYTHON_USE_CUSTOM_BDIST', '1')))
CONF_PY_ADDENDUM = """ CONF_PY_ADDENDUM = """
extensions.append('sphinx.ext.napoleon') extensions.append('sphinx.ext.napoleon')
napoleon_google_docstring = True napoleon_google_docstring = True
@ -78,10 +85,7 @@ def _get_grpc_custom_bdist_egg(decorated_basename, target_egg_basename):
from six.moves.urllib import request from six.moves.urllib import request
decorated_path = decorated_basename + '.egg' decorated_path = decorated_basename + '.egg'
try: try:
url = ( url = BINARIES_REPOSITORY + '/{target}'.format(target=decorated_path)
'https://storage.googleapis.com/grpc-precompiled-binaries/'
'python/{target}'
.format(target=decorated_path))
egg_data = request.urlopen(url).read() egg_data = request.urlopen(url).read()
except IOError as error: except IOError as error:
raise CommandError( raise CommandError(
@ -134,7 +138,7 @@ class Install(install.install, EggNameMixin):
def initialize_options(self): def initialize_options(self):
install.install.initialize_options(self) install.install.initialize_options(self)
self.use_grpc_custom_bdist = False self.use_grpc_custom_bdist = USE_GRPC_CUSTOM_BDIST
def finalize_options(self): def finalize_options(self):
install.install.finalize_options(self) install.install.finalize_options(self)
@ -142,22 +146,25 @@ class Install(install.install, EggNameMixin):
def run(self): def run(self):
if self.use_grpc_custom_bdist: if self.use_grpc_custom_bdist:
try: try:
egg_path = _get_grpc_custom_bdist_egg(self.egg_name(True), try:
self.egg_name(False)) egg_path = _get_grpc_custom_bdist_egg(self.egg_name(True),
except CommandError as error: self.egg_name(False))
sys.stderr.write( except CommandError as error:
'\nWARNING: Failed to acquire grpcio prebuilt binary:\n' sys.stderr.write(
'{}.\n\n'.format(error.message)) '\nWARNING: Failed to acquire grpcio prebuilt binary:\n'
raise '{}.\n\n'.format(error.message))
try: raise
self._run_bdist_retrieval_install(egg_path) try:
except Exception as error: self._run_bdist_retrieval_install(egg_path)
# if anything else happens (and given how there's no way to really know except Exception as error:
# what's happening in setuptools here, I mean *anything*), warn the user # if anything else happens (and given how there's no way to really know
# and fall back to building from source. # what's happening in setuptools here, I mean *anything*), warn the user
sys.stderr.write( # and fall back to building from source.
'{}\nWARNING: Failed to install grpcio prebuilt binary.\n\n' sys.stderr.write(
.format(traceback.format_exc())) '{}\nWARNING: Failed to install grpcio prebuilt binary.\n\n'
.format(traceback.format_exc()))
raise
except Exception:
install.install.run(self) install.install.run(self)
else: else:
install.install.run(self) install.install.run(self)

@ -27,7 +27,6 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import pkg_resources
import threading import threading
from grpc import _grpcio_metadata from grpc import _grpcio_metadata
@ -35,7 +34,6 @@ from grpc._cython import cygrpc
from grpc._adapter import _implementations from grpc._adapter import _implementations
from grpc._adapter import _types from grpc._adapter import _types
_ROOT_CERTIFICATES_RESOURCE_PATH = 'credentials/roots.pem'
_USER_AGENT = 'Python-gRPC-{}'.format(_grpcio_metadata.__version__) _USER_AGENT = 'Python-gRPC-{}'.format(_grpcio_metadata.__version__)
ChannelCredentials = cygrpc.ChannelCredentials ChannelCredentials = cygrpc.ChannelCredentials
@ -56,9 +54,6 @@ def channel_credentials_ssl(
pair = None pair = None
if private_key is not None or certificate_chain is not None: if private_key is not None or certificate_chain is not None:
pair = cygrpc.SslPemKeyCertPair(private_key, certificate_chain) pair = cygrpc.SslPemKeyCertPair(private_key, certificate_chain)
if root_certificates is None:
root_certificates = pkg_resources.resource_string(
__name__, _ROOT_CERTIFICATES_RESOURCE_PATH)
return cygrpc.channel_credentials_ssl(root_certificates, pair) return cygrpc.channel_credentials_ssl(root_certificates, pair)

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -100,6 +100,11 @@ cdef extern from "grpc/_cython/loader.h":
GRPC_STATUS_DATA_LOSS GRPC_STATUS_DATA_LOSS
GRPC_STATUS__DO_NOT_USE GRPC_STATUS__DO_NOT_USE
ctypedef enum grpc_ssl_roots_override_result:
GRPC_SSL_ROOTS_OVERRIDE_OK
GRPC_SSL_ROOTS_OVERRIDE_FAILED_PERMANENTLY
GRPC_SSL_ROOTS_OVERRIDE_FAILED
struct grpc_byte_buffer_reader: struct grpc_byte_buffer_reader:
# We don't care about the internals # We don't care about the internals
pass pass
@ -338,6 +343,10 @@ cdef extern from "grpc/_cython/loader.h":
# We don't care about the internals (and in fact don't know them) # We don't care about the internals (and in fact don't know them)
pass pass
ctypedef void (*grpc_ssl_roots_override_callback)(char **pem_root_certs)
void grpc_set_ssl_roots_override_callback(grpc_ssl_roots_override_callback cb)
grpc_channel_credentials *grpc_google_default_credentials_create() grpc_channel_credentials *grpc_google_default_credentials_create()
grpc_channel_credentials *grpc_ssl_credentials_create( grpc_channel_credentials *grpc_ssl_credentials_create(
const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair,

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without

@ -0,0 +1,32 @@
# 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.
cdef grpc_ssl_roots_override_result ssl_roots_override_callback(
char **pem_root_certs) with gil

@ -0,0 +1,44 @@
# 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.
from libc.string cimport memcpy
import pkg_resources
cdef grpc_ssl_roots_override_result ssl_roots_override_callback(
char **pem_root_certs) with gil:
temporary_pem_root_certs = pkg_resources.resource_string(
'grpc._cython', '_credentials/roots.pem')
pem_root_certs[0] = <char *>gpr_malloc(len(temporary_pem_root_certs) + 1)
memcpy(
pem_root_certs[0], <char *>temporary_pem_root_certs,
len(temporary_pem_root_certs))
pem_root_certs[0][len(temporary_pem_root_certs)] = '\0'
return GRPC_SSL_ROOTS_OVERRIDE_OK

@ -34,4 +34,5 @@ include "grpc/_cython/_cygrpc/channel.pxd.pxi"
include "grpc/_cython/_cygrpc/credentials.pxd.pxi" include "grpc/_cython/_cygrpc/credentials.pxd.pxi"
include "grpc/_cython/_cygrpc/completion_queue.pxd.pxi" include "grpc/_cython/_cygrpc/completion_queue.pxd.pxi"
include "grpc/_cython/_cygrpc/records.pxd.pxi" include "grpc/_cython/_cygrpc/records.pxd.pxi"
include "grpc/_cython/_cygrpc/security.pxd.pxi"
include "grpc/_cython/_cygrpc/server.pxd.pxi" include "grpc/_cython/_cygrpc/server.pxd.pxi"

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -40,6 +40,7 @@ include "grpc/_cython/_cygrpc/channel.pyx.pxi"
include "grpc/_cython/_cygrpc/credentials.pyx.pxi" include "grpc/_cython/_cygrpc/credentials.pyx.pxi"
include "grpc/_cython/_cygrpc/completion_queue.pyx.pxi" include "grpc/_cython/_cygrpc/completion_queue.pyx.pxi"
include "grpc/_cython/_cygrpc/records.pyx.pxi" include "grpc/_cython/_cygrpc/records.pyx.pxi"
include "grpc/_cython/_cygrpc/security.pyx.pxi"
include "grpc/_cython/_cygrpc/server.pyx.pxi" include "grpc/_cython/_cygrpc/server.pyx.pxi"
# #
@ -58,6 +59,8 @@ cdef class _ModuleState:
raise ImportError('failed to load core gRPC library') raise ImportError('failed to load core gRPC library')
grpc_init() grpc_init()
self.is_loaded = True self.is_loaded = True
grpc_set_ssl_roots_override_callback(
<grpc_ssl_roots_override_callback>ssl_roots_override_callback)
def __dealloc__(self): def __dealloc__(self):
if self.is_loaded: if self.is_loaded:

@ -655,22 +655,22 @@ extern gpr_time_add_type gpr_time_add_import;
typedef gpr_timespec(*gpr_time_sub_type)(gpr_timespec a, gpr_timespec b); typedef gpr_timespec(*gpr_time_sub_type)(gpr_timespec a, gpr_timespec b);
extern gpr_time_sub_type gpr_time_sub_import; extern gpr_time_sub_type gpr_time_sub_import;
#define gpr_time_sub gpr_time_sub_import #define gpr_time_sub gpr_time_sub_import
typedef gpr_timespec(*gpr_time_from_micros_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_micros_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_micros_type gpr_time_from_micros_import; extern gpr_time_from_micros_type gpr_time_from_micros_import;
#define gpr_time_from_micros gpr_time_from_micros_import #define gpr_time_from_micros gpr_time_from_micros_import
typedef gpr_timespec(*gpr_time_from_nanos_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_nanos_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_nanos_type gpr_time_from_nanos_import; extern gpr_time_from_nanos_type gpr_time_from_nanos_import;
#define gpr_time_from_nanos gpr_time_from_nanos_import #define gpr_time_from_nanos gpr_time_from_nanos_import
typedef gpr_timespec(*gpr_time_from_millis_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_millis_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_millis_type gpr_time_from_millis_import; extern gpr_time_from_millis_type gpr_time_from_millis_import;
#define gpr_time_from_millis gpr_time_from_millis_import #define gpr_time_from_millis gpr_time_from_millis_import
typedef gpr_timespec(*gpr_time_from_seconds_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_seconds_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_seconds_type gpr_time_from_seconds_import; extern gpr_time_from_seconds_type gpr_time_from_seconds_import;
#define gpr_time_from_seconds gpr_time_from_seconds_import #define gpr_time_from_seconds gpr_time_from_seconds_import
typedef gpr_timespec(*gpr_time_from_minutes_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_minutes_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_minutes_type gpr_time_from_minutes_import; extern gpr_time_from_minutes_type gpr_time_from_minutes_import;
#define gpr_time_from_minutes gpr_time_from_minutes_import #define gpr_time_from_minutes gpr_time_from_minutes_import
typedef gpr_timespec(*gpr_time_from_hours_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_hours_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_hours_type gpr_time_from_hours_import; extern gpr_time_from_hours_type gpr_time_from_hours_import;
#define gpr_time_from_hours gpr_time_from_hours_import #define gpr_time_from_hours gpr_time_from_hours_import
typedef int32_t(*gpr_time_to_millis_type)(gpr_timespec timespec); typedef int32_t(*gpr_time_to_millis_type)(gpr_timespec timespec);

@ -30,6 +30,49 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_core_dependencies.py.template`!!! # AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_core_dependencies.py.template`!!!
CORE_SOURCE_FILES = [ CORE_SOURCE_FILES = [
'src/core/profiling/basic_timers.c',
'src/core/profiling/stap_timers.c',
'src/core/support/alloc.c',
'src/core/support/avl.c',
'src/core/support/cmdline.c',
'src/core/support/cpu_iphone.c',
'src/core/support/cpu_linux.c',
'src/core/support/cpu_posix.c',
'src/core/support/cpu_windows.c',
'src/core/support/env_linux.c',
'src/core/support/env_posix.c',
'src/core/support/env_win32.c',
'src/core/support/file.c',
'src/core/support/file_posix.c',
'src/core/support/file_win32.c',
'src/core/support/histogram.c',
'src/core/support/host_port.c',
'src/core/support/log.c',
'src/core/support/log_android.c',
'src/core/support/log_linux.c',
'src/core/support/log_posix.c',
'src/core/support/log_win32.c',
'src/core/support/murmur_hash.c',
'src/core/support/slice.c',
'src/core/support/slice_buffer.c',
'src/core/support/stack_lockfree.c',
'src/core/support/string.c',
'src/core/support/string_posix.c',
'src/core/support/string_win32.c',
'src/core/support/subprocess_posix.c',
'src/core/support/subprocess_windows.c',
'src/core/support/sync.c',
'src/core/support/sync_posix.c',
'src/core/support/sync_win32.c',
'src/core/support/thd.c',
'src/core/support/thd_posix.c',
'src/core/support/thd_win32.c',
'src/core/support/time.c',
'src/core/support/time_posix.c',
'src/core/support/time_precise.c',
'src/core/support/time_win32.c',
'src/core/support/tls_pthread.c',
'src/core/support/wrap_memcpy.c',
'src/core/httpcli/httpcli_security_connector.c', 'src/core/httpcli/httpcli_security_connector.c',
'src/core/security/base64.c', 'src/core/security/base64.c',
'src/core/security/client_auth_filter.c', 'src/core/security/client_auth_filter.c',
@ -178,49 +221,6 @@ CORE_SOURCE_FILES = [
'src/core/transport/static_metadata.c', 'src/core/transport/static_metadata.c',
'src/core/transport/transport.c', 'src/core/transport/transport.c',
'src/core/transport/transport_op_string.c', 'src/core/transport/transport_op_string.c',
'src/core/profiling/basic_timers.c',
'src/core/profiling/stap_timers.c',
'src/core/support/alloc.c',
'src/core/support/avl.c',
'src/core/support/cmdline.c',
'src/core/support/cpu_iphone.c',
'src/core/support/cpu_linux.c',
'src/core/support/cpu_posix.c',
'src/core/support/cpu_windows.c',
'src/core/support/env_linux.c',
'src/core/support/env_posix.c',
'src/core/support/env_win32.c',
'src/core/support/file.c',
'src/core/support/file_posix.c',
'src/core/support/file_win32.c',
'src/core/support/histogram.c',
'src/core/support/host_port.c',
'src/core/support/log.c',
'src/core/support/log_android.c',
'src/core/support/log_linux.c',
'src/core/support/log_posix.c',
'src/core/support/log_win32.c',
'src/core/support/murmur_hash.c',
'src/core/support/slice.c',
'src/core/support/slice_buffer.c',
'src/core/support/stack_lockfree.c',
'src/core/support/string.c',
'src/core/support/string_posix.c',
'src/core/support/string_win32.c',
'src/core/support/subprocess_posix.c',
'src/core/support/subprocess_windows.c',
'src/core/support/sync.c',
'src/core/support/sync_posix.c',
'src/core/support/sync_win32.c',
'src/core/support/thd.c',
'src/core/support/thd_posix.c',
'src/core/support/thd_win32.c',
'src/core/support/time.c',
'src/core/support/time_posix.c',
'src/core/support/time_precise.c',
'src/core/support/time_win32.c',
'src/core/support/tls_pthread.c',
'src/core/support/wrap_memcpy.c',
'src/core/census/context.c', 'src/core/census/context.c',
'src/core/census/initialize.c', 'src/core/census/initialize.c',
'src/core/census/operation.c', 'src/core/census/operation.c',

@ -0,0 +1,32 @@
# Copyright 2015-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.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!!
VERSION='0.14.0.dev0'

@ -0,0 +1,54 @@
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Tests the implementations module of the gRPC Python Beta API."""
import unittest
from grpc.beta import implementations
from tests.unit import resources
class ChannelCredentialsTest(unittest.TestCase):
def test_runtime_provided_root_certificates(self):
channel_credentials = implementations.ssl_channel_credentials(
None, None, None)
self.assertIsInstance(
channel_credentials, implementations.ChannelCredentials)
def test_application_provided_root_certificates(self):
channel_credentials = implementations.ssl_channel_credentials(
resources.test_root_certificates(), None, None)
self.assertIsInstance(
channel_credentials, implementations.ChannelCredentials)
if __name__ == '__main__':
unittest.main(verbosity=2)

@ -66,6 +66,8 @@ else
grpc_lib_dir = File.join(grpc_root, 'libs', grpc_config) grpc_lib_dir = File.join(grpc_root, 'libs', grpc_config)
end end
ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.7'
unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a')) or windows unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a')) or windows
ENV['AR'] = RbConfig::CONFIG['AR'] + ' rcs' ENV['AR'] = RbConfig::CONFIG['AR'] + ' rcs'
ENV['CC'] = RbConfig::CONFIG['CC'] ENV['CC'] = RbConfig::CONFIG['CC']
@ -75,6 +77,7 @@ unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a')) or windows
ENV['EMBED_OPENSSL'] = 'true' ENV['EMBED_OPENSSL'] = 'true'
ENV['EMBED_ZLIB'] = 'true' ENV['EMBED_ZLIB'] = 'true'
ENV['ARCH_FLAGS'] = RbConfig::CONFIG['ARCH_FLAG']
ENV['ARCH_FLAGS'] = '-arch i386 -arch x86_64' if RUBY_PLATFORM =~ /darwin/ ENV['ARCH_FLAGS'] = '-arch i386 -arch x86_64' if RUBY_PLATFORM =~ /darwin/
ENV['CFLAGS'] = '-DGPR_BACKWARDS_COMPATIBILITY_MODE' ENV['CFLAGS'] = '-DGPR_BACKWARDS_COMPATIBILITY_MODE'

@ -229,7 +229,7 @@ static VALUE grpc_rb_channel_watch_connectivity_state(VALUE self,
} }
grpc_channel_watch_connectivity_state( grpc_channel_watch_connectivity_state(
ch, ch,
NUM2LONG(last_state), (grpc_connectivity_state)NUM2LONG(last_state),
grpc_rb_time_timeval(deadline, /* absolute time */ 0), grpc_rb_time_timeval(deadline, /* absolute time */ 0),
cq, cq,
ROBJECT(tag)); ROBJECT(tag));

@ -655,22 +655,22 @@ extern gpr_time_add_type gpr_time_add_import;
typedef gpr_timespec(*gpr_time_sub_type)(gpr_timespec a, gpr_timespec b); typedef gpr_timespec(*gpr_time_sub_type)(gpr_timespec a, gpr_timespec b);
extern gpr_time_sub_type gpr_time_sub_import; extern gpr_time_sub_type gpr_time_sub_import;
#define gpr_time_sub gpr_time_sub_import #define gpr_time_sub gpr_time_sub_import
typedef gpr_timespec(*gpr_time_from_micros_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_micros_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_micros_type gpr_time_from_micros_import; extern gpr_time_from_micros_type gpr_time_from_micros_import;
#define gpr_time_from_micros gpr_time_from_micros_import #define gpr_time_from_micros gpr_time_from_micros_import
typedef gpr_timespec(*gpr_time_from_nanos_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_nanos_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_nanos_type gpr_time_from_nanos_import; extern gpr_time_from_nanos_type gpr_time_from_nanos_import;
#define gpr_time_from_nanos gpr_time_from_nanos_import #define gpr_time_from_nanos gpr_time_from_nanos_import
typedef gpr_timespec(*gpr_time_from_millis_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_millis_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_millis_type gpr_time_from_millis_import; extern gpr_time_from_millis_type gpr_time_from_millis_import;
#define gpr_time_from_millis gpr_time_from_millis_import #define gpr_time_from_millis gpr_time_from_millis_import
typedef gpr_timespec(*gpr_time_from_seconds_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_seconds_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_seconds_type gpr_time_from_seconds_import; extern gpr_time_from_seconds_type gpr_time_from_seconds_import;
#define gpr_time_from_seconds gpr_time_from_seconds_import #define gpr_time_from_seconds gpr_time_from_seconds_import
typedef gpr_timespec(*gpr_time_from_minutes_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_minutes_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_minutes_type gpr_time_from_minutes_import; extern gpr_time_from_minutes_type gpr_time_from_minutes_import;
#define gpr_time_from_minutes gpr_time_from_minutes_import #define gpr_time_from_minutes gpr_time_from_minutes_import
typedef gpr_timespec(*gpr_time_from_hours_type)(long x, gpr_clock_type clock_type); typedef gpr_timespec(*gpr_time_from_hours_type)(int64_t x, gpr_clock_type clock_type);
extern gpr_time_from_hours_type gpr_time_from_hours_import; extern gpr_time_from_hours_type gpr_time_from_hours_import;
#define gpr_time_from_hours gpr_time_from_hours_import #define gpr_time_from_hours gpr_time_from_hours_import
typedef int32_t(*gpr_time_to_millis_type)(gpr_timespec timespec); typedef int32_t(*gpr_time_to_millis_type)(gpr_timespec timespec);

@ -177,7 +177,7 @@ static VALUE grpc_rb_server_credentials_init(VALUE self, VALUE pem_root_certs,
VALUE key = Qnil; VALUE key = Qnil;
VALUE key_cert = Qnil; VALUE key_cert = Qnil;
int auth_client = 0; int auth_client = 0;
int num_key_certs = 0; long num_key_certs = 0;
int i; int i;
if (NIL_P(force_client_auth) || if (NIL_P(force_client_auth) ||

@ -29,5 +29,5 @@
# GRPC contains the General RPC module. # GRPC contains the General RPC module.
module GRPC module GRPC
VERSION = '0.12.0' VERSION = '0.14.0.dev'
end end

@ -68,7 +68,7 @@
% endfor % endfor
% for lib in libs: % for lib in libs:
% if lib.name in ("grpc"): % if lib.name in ("grpc", "gpr"):
${objc_library(lib)} ${objc_library(lib)}
% endif % endif
% endfor % endfor

@ -276,7 +276,7 @@
Q = @ Q = @
endif endif
VERSION = ${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build} VERSION = ${settings.core_version}
CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
@ -320,7 +320,7 @@
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
SHARED_EXT = dll SHARED_EXT = dll
SHARED_PREFIX = SHARED_PREFIX =
SHARED_VERSION = -${settings.version.major} SHARED_VERSION = -${settings.core_version.major}
else ifeq ($(SYSTEM),Darwin) else ifeq ($(SYSTEM),Darwin)
SHARED_EXT = dylib SHARED_EXT = dylib
SHARED_PREFIX = lib SHARED_PREFIX = lib
@ -551,26 +551,20 @@
# grpc .pc file # grpc .pc file
PC_NAME = gRPC PC_NAME = gRPC
PC_DESCRIPTION = High performance general RPC framework PC_DESCRIPTION = high performance general RPC framework
PC_CFLAGS = -pthread PC_CFLAGS =
PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) $(PC_REQUIRES_SECURE) -lpthread PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) $(PC_REQUIRES_SECURE)
PC_LIBS_PRIVATE = $(PC_LIBS_GRPC) $(PC_LIBS_SECURE) PC_LIBS_PRIVATE = $(PC_LIBS_GRPC) $(PC_LIBS_SECURE)
PC_LIB = -lgrpc PC_LIB = -lgrpc
ifneq ($(SYSTEM),Darwin)
PC_LIBS_PRIVATE += -lrt
endif
GRPC_PC_FILE := $(PC_TEMPLATE) GRPC_PC_FILE := $(PC_TEMPLATE)
# gprc_unsecure .pc file # grpc_unsecure .pc file
PC_NAME = gRPC unsecure PC_NAME = gRPC unsecure
PC_DESCRIPTION = High performance general RPC framework without SSL PC_DESCRIPTION = high performance general RPC framework without SSL
PC_CFLAGS = -pthread PC_CFLAGS =
PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC) -lpthread PC_REQUIRES_PRIVATE = $(PC_REQUIRES_GRPC)
PC_LIBS_PRIVATE = $(PC_LIBS_GRPC) PC_LIBS_PRIVATE = $(PC_LIBS_GRPC)
PC_LIB = -lgrpc PC_LIB = -lgrpc
ifneq ($(SYSTEM),Darwin)
PC_LIBS_PRIVATE += -lrt
endif
GRPC_UNSECURE_PC_FILE := $(PC_TEMPLATE) GRPC_UNSECURE_PC_FILE := $(PC_TEMPLATE)
# grpc_zookeeper .pc file # grpc_zookeeper .pc file
@ -1286,7 +1280,7 @@
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.version.major} $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.core_version.major}
$(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so
endif endif
% endif % endif
@ -1304,7 +1298,7 @@
ifeq ($(SYSTEM),MINGW32) ifeq ($(SYSTEM),MINGW32)
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a
else ifneq ($(SYSTEM),Darwin) else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.version.major} $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so.${settings.core_version.major}
$(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) $(prefix)/lib/lib${lib.name}.so
endif endif
% endif % endif
@ -1484,6 +1478,7 @@
% endif % endif
$(LIB${lib.name.upper()}_OBJS) \ $(LIB${lib.name.upper()}_OBJS) \
% if lib.get('baselib', False): % if lib.get('baselib', False):
$(LIBGPR_OBJS) \
$(ZLIB_MERGE_OBJS) \ $(ZLIB_MERGE_OBJS) \
% if lib.get('secure', 'check') == True: % if lib.get('secure', 'check') == True:
$(OPENSSL_MERGE_OBJS) \ $(OPENSSL_MERGE_OBJS) \
@ -1495,6 +1490,7 @@
$(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a
$(Q) $(AR) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(LIB${lib.name.upper()}_OBJS) \ $(Q) $(AR) $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(LIB${lib.name.upper()}_OBJS) \
% if lib.get('baselib', False): % if lib.get('baselib', False):
$(LIBGPR_OBJS) \
$(ZLIB_MERGE_OBJS) \ $(ZLIB_MERGE_OBJS) \
% if lib.get('secure', 'check') == True: % if lib.get('secure', 'check') == True:
$(OPENSSL_MERGE_OBJS) \ $(OPENSSL_MERGE_OBJS) \
@ -1578,8 +1574,8 @@
ifeq ($(SYSTEM),Darwin) ifeq ($(SYSTEM),Darwin)
$(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) -dynamiclib -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) -dynamiclib -o ${out_libbase}.$(SHARED_EXT) ${common}${libs}
else else
$(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.version.major} -o ${out_libbase}.$(SHARED_EXT) ${common}${libs} $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,lib${lib.name}.so.${settings.core_version.major} -o ${out_libbase}.$(SHARED_EXT) ${common}${libs}
$(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) ${out_libbase}.so.${settings.version.major} $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) ${out_libbase}.so.${settings.core_version.major}
$(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) ${out_libbase}.so $(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION).$(SHARED_EXT) ${out_libbase}.so
endif endif
endif endif

@ -39,7 +39,7 @@
def grpc_files(libs): def grpc_files(libs):
out = [] out = []
for lib in libs: for lib in libs:
if lib.name in ("grpc"): if lib.name in ("grpc", "gpr"):
out += lib.get('headers', []) out += lib.get('headers', [])
out += lib.get('public_headers', []) out += lib.get('public_headers', [])
out += lib.get('src', []) out += lib.get('src', [])
@ -48,7 +48,7 @@
def grpc_private_headers(libs): def grpc_private_headers(libs):
out = [] out = []
for lib in libs: for lib in libs:
if lib.name in ("grpc"): if lib.name in ("grpc", "gpr"):
out += lib.get('headers', []) out += lib.get('headers', [])
return out return out
%> %>

@ -16,7 +16,6 @@
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'
s.required_ruby_version = '>= 2.0.0' s.required_ruby_version = '>= 2.0.0'
s.requirements << 'libgrpc ~> 0.11.0 needs to be installed'
s.files = %w( Makefile ) s.files = %w( Makefile )
s.files += %w( etc/roots.pem ) s.files += %w( etc/roots.pem )
@ -34,7 +33,7 @@
s.require_paths = %w( src/ruby/bin src/ruby/lib src/ruby/pb ) s.require_paths = %w( src/ruby/bin src/ruby/lib src/ruby/pb )
s.platform = Gem::Platform::RUBY s.platform = Gem::Platform::RUBY
s.add_dependency 'google-protobuf', '~> 3.0.0alpha.1.1' s.add_dependency 'google-protobuf', '~> 3.0.0.alpha.5.0.2'
s.add_dependency 'googleauth', '~> 0.5.1' s.add_dependency 'googleauth', '~> 0.5.1'
s.add_development_dependency 'bundler', '~> 1.9' s.add_development_dependency 'bundler', '~> 1.9'
@ -42,7 +41,7 @@
s.add_development_dependency 'simplecov', '~> 0.9' s.add_development_dependency 'simplecov', '~> 0.9'
s.add_development_dependency 'rake', '~> 10.4' s.add_development_dependency 'rake', '~> 10.4'
s.add_development_dependency 'rake-compiler', '~> 0.9' s.add_development_dependency 'rake-compiler', '~> 0.9'
s.add_development_dependency 'rake-compiler-dock', '~> 0.5' s.add_development_dependency 'rake-compiler-dock', '~> 0.5.1'
s.add_development_dependency 'rspec', '~> 3.2' s.add_development_dependency 'rspec', '~> 3.2'
s.add_development_dependency 'rubocop', '~> 0.30.0' s.add_development_dependency 'rubocop', '~> 0.30.0'
s.add_development_dependency 'signet', '~> 0.7.0' s.add_development_dependency 'signet', '~> 0.7.0'

@ -2,7 +2,7 @@
--- | --- |
{ {
"name": "grpc", "name": "grpc",
"version": "0.12.0", "version": "${settings.node_version}",
"author": "Google Inc.", "author": "Google Inc.",
"description": "gRPC Library for Node", "description": "gRPC Library for Node",
"homepage": "http://www.grpc.io/", "homepage": "http://www.grpc.io/",

@ -38,5 +38,4 @@
#include <grpc/grpc.h> #include <grpc/grpc.h>
const char *grpc_version_string(void) { \ const char *grpc_version_string(void) { return "${settings.core_version}"; }
return "${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build}"; }

@ -40,9 +40,14 @@
/// </summary> /// </summary>
public static class VersionInfo public static class VersionInfo
{ {
/// <summary>
/// Current version of gRPC C# assemblies
/// </summary>
public const string CurrentAssemblyVersion = "${settings.version.major}.${settings.version.minor}.${settings.version.patch}.0";
/// <summary> /// <summary>
/// Current version of gRPC C# /// Current version of gRPC C#
/// </summary> /// </summary>
public const string CurrentVersion = "${settings.version.major}.${settings.version.minor}.${settings.version.micro}"; public const string CurrentVersion = "${settings.csharp_version}";
} }
} }

@ -3,7 +3,7 @@
@rem Builds gRPC NuGet packages @rem Builds gRPC NuGet packages
@rem Current package versions @rem Current package versions
set VERSION=${settings.version.major}.${settings.version.minor}.${settings.version.micro} set VERSION=${settings.csharp_version}
set PROTOBUF_VERSION=3.0.0-beta2 set PROTOBUF_VERSION=3.0.0-beta2
@rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well. @rem Packages that depend on prerelease packages (like Google.Protobuf) need to have prerelease suffix as well.

@ -0,0 +1,34 @@
%YAML 1.2
--- |
# Copyright 2015-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.
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!!
VERSION='${settings.python_version.pep440()}'

@ -0,0 +1,35 @@
%YAML 1.2
--- |
# Copyright 2015-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.
# GRPC contains the General RPC module.
module GRPC
VERSION = '${settings.ruby_version.ruby()}'
end

@ -0,0 +1,33 @@
# Install Git and basic packages.
RUN apt-get update && apt-get install -y ${'\\'}
autoconf ${'\\'}
autotools-dev ${'\\'}
build-essential ${'\\'}
bzip2 ${'\\'}
ccache ${'\\'}
curl ${'\\'}
gcc ${'\\'}
gcc-multilib ${'\\'}
git ${'\\'}
golang ${'\\'}
gyp ${'\\'}
lcov ${'\\'}
libc6 ${'\\'}
libc6-dbg ${'\\'}
libc6-dev ${'\\'}
libgtest-dev ${'\\'}
libtool ${'\\'}
make ${'\\'}
perl ${'\\'}
strace ${'\\'}
python-dev ${'\\'}
python-setuptools ${'\\'}
python-yaml ${'\\'}
telnet ${'\\'}
unzip ${'\\'}
wget ${'\\'}
zip && apt-get clean
#================
# Build profiling
RUN apt-get update && apt-get install -y time && apt-get clean

@ -0,0 +1,7 @@
# Prepare ccache
RUN ln -s /usr/bin/ccache /usr/local/bin/gcc
RUN ln -s /usr/bin/ccache /usr/local/bin/g++
RUN ln -s /usr/bin/ccache /usr/local/bin/cc
RUN ln -s /usr/bin/ccache /usr/local/bin/c++
RUN ln -s /usr/bin/ccache /usr/local/bin/clang
RUN ln -s /usr/bin/ccache /usr/local/bin/clang++

@ -0,0 +1,16 @@
#================
# C# dependencies
# Update to a newer version of mono
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
# Install dependencies
RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y ${'\\'}
mono-devel ${'\\'}
ca-certificates-mono ${'\\'}
nuget ${'\\'}
&& apt-get clean

@ -0,0 +1,3 @@
#=================
# C++ dependencies
RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean

@ -0,0 +1,7 @@
#==================
# Node dependencies
# Install nvm
RUN touch .profile
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
RUN /bin/bash -l -c "nvm install 0.12 && npm config set cache /tmp/npm-cache"

@ -0,0 +1,13 @@
#=================
# PHP dependencies
# Install dependencies
RUN /bin/bash -l -c "echo 'deb http://packages.dotdeb.org wheezy-php55 all' ${'\\'}
>> /etc/apt/sources.list.d/dotdeb.list"
RUN /bin/bash -l -c "echo 'deb-src http://packages.dotdeb.org wheezy-php55 all' ${'\\'}
>> /etc/apt/sources.list.d/dotdeb.list"
RUN wget http://www.dotdeb.org/dotdeb.gpg -O- | apt-key add -
RUN apt-get update && apt-get install -y ${'\\'}
git php5 php5-dev phpunit unzip

@ -0,0 +1,14 @@
#====================
# Python dependencies
# Install dependencies
RUN apt-get update && apt-get install -y ${'\\'}
python-all-dev ${'\\'}
python3-all-dev ${'\\'}
python-pip
# Install Python packages from PyPI
RUN pip install pip --upgrade
RUN pip install virtualenv
RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2 tox

@ -0,0 +1,14 @@
#==================
# Ruby dependencies
# Install rvm
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
RUN \curl -sSL https://get.rvm.io | bash -s stable
# Install Ruby 2.1
RUN /bin/bash -l -c "rvm install ruby-2.1"
RUN /bin/bash -l -c "rvm use --default ruby-2.1"
RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc"
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"

@ -0,0 +1,7 @@
<%include file="ccache_setup.include"/>
#======================
# Zookeeper dependencies
# TODO(jtattermusch): is zookeeper still needed?
RUN apt-get install -y libzookeeper-mt-dev
RUN mkdir /var/local/jenkins

@ -0,0 +1,39 @@
%YAML 1.2
--- |
# Copyright 2015-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.
FROM debian:jessie
<%include file="../../apt_get_basic.include"/>
<%include file="../../csharp_deps.include"/>
<%include file="../../run_tests_addons.include"/>
# Define the default command.
CMD ["bash"]

@ -0,0 +1,39 @@
%YAML 1.2
--- |
# Copyright 2015-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.
FROM debian:jessie
<%include file="../../apt_get_basic.include"/>
<%include file="../../cxx_deps.include"/>
<%include file="../../run_tests_addons.include"/>
# Define the default command.
CMD ["bash"]

@ -0,0 +1,39 @@
%YAML 1.2
--- |
# Copyright 2015-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.
FROM 32bit/debian:jessie
<%include file="../../apt_get_basic.include"/>
<%include file="../../cxx_deps.include"/>
<%include file="../../run_tests_addons.include"/>
# Define the default command.
CMD ["bash"]

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

Loading…
Cancel
Save