aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2016-10-24 11:21:07 -0700
committerGravatar murgatroid99 <mlumish@google.com>2016-10-24 11:21:07 -0700
commit952b99cf21016e8669ad28b00abe1030b975c6fd (patch)
tree10d5b611128d6bc31ce8798e2659bab222ba1e97 /src
parentc0a64cda947f331420ad24b9b4c80637d28b825e (diff)
parent1d9b3fed2482b45753957eba286fcb33f863e946 (diff)
Merge remote-tracking branch 'upstream/v1.0.x' into node_package_updates
Diffstat (limited to 'src')
-rw-r--r--src/compiler/README.md4
-rw-r--r--src/compiler/node_generator.cc34
-rw-r--r--src/compiler/python_generator.cc18
-rw-r--r--src/compiler/ruby_generator.cc37
-rw-r--r--src/core/README.md6
-rw-r--r--src/core/ext/client_config/subchannel.c54
-rw-r--r--src/core/lib/channel/channel_args.c18
-rw-r--r--src/core/lib/channel/channel_args.h8
-rw-r--r--src/core/lib/iomgr/tcp_server_posix.c4
-rw-r--r--src/core/lib/iomgr/tcp_windows.c1
-rw-r--r--src/core/lib/surface/version.c2
-rw-r--r--src/cpp/README.md4
-rw-r--r--src/cpp/client/channel_cc.cc (renamed from src/cpp/client/channel.cc)0
-rw-r--r--src/cpp/client/credentials_cc.cc (renamed from src/cpp/client/credentials.cc)0
-rw-r--r--src/cpp/common/completion_queue_cc.cc (renamed from src/cpp/common/completion_queue.cc)0
-rw-r--r--src/cpp/server/server_cc.cc (renamed from src/cpp/server/server.cc)0
-rw-r--r--src/cpp/util/byte_buffer_cc.cc (renamed from src/cpp/util/byte_buffer.cc)0
-rw-r--r--src/cpp/util/slice_cc.cc (renamed from src/cpp/util/slice.cc)0
-rw-r--r--src/cpp/util/time_cc.cc (renamed from src/cpp/util/time.cc)0
-rw-r--r--src/csharp/Grpc.Auth/Grpc.Auth.csproj43
-rw-r--r--src/csharp/Grpc.Auth/Grpc.Auth.nuspec2
-rw-r--r--src/csharp/Grpc.Auth/packages.config7
-rw-r--r--src/csharp/Grpc.Auth/project.json13
-rw-r--r--src/csharp/Grpc.Core.Tests/SanityTest.cs5
-rw-r--r--src/csharp/Grpc.Core.Tests/project.json11
-rw-r--r--src/csharp/Grpc.Core/GrpcEnvironment.cs14
-rw-r--r--src/csharp/Grpc.Core/Internal/NativeExtension.cs18
-rw-r--r--src/csharp/Grpc.Core/Internal/PlatformApis.cs11
-rw-r--r--src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs29
-rw-r--r--src/csharp/Grpc.Core/VersionInfo.cs4
-rw-r--r--src/csharp/Grpc.Core/project.json6
-rw-r--r--src/csharp/Grpc.Examples.MathClient/project.json14
-rw-r--r--src/csharp/Grpc.Examples.MathServer/project.json14
-rw-r--r--src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj6
-rw-r--r--src/csharp/Grpc.Examples.Tests/packages.config4
-rw-r--r--src/csharp/Grpc.Examples.Tests/project.json11
-rw-r--r--src/csharp/Grpc.Examples/Grpc.Examples.csproj7
-rw-r--r--src/csharp/Grpc.Examples/packages.config4
-rw-r--r--src/csharp/Grpc.Examples/project.json16
-rw-r--r--src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj6
-rw-r--r--src/csharp/Grpc.HealthCheck.Tests/packages.config2
-rw-r--r--src/csharp/Grpc.HealthCheck.Tests/project.json11
-rw-r--r--src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj7
-rw-r--r--src/csharp/Grpc.HealthCheck/packages.config2
-rw-r--r--src/csharp/Grpc.HealthCheck/project.json9
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj43
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Client/packages.config7
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Client/project.json22
-rw-r--r--src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj1
-rw-r--r--src/csharp/Grpc.IntegrationTesting.QpsWorker/app.config15
-rw-r--r--src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json22
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj43
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Server/packages.config7
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Server/project.json22
-rw-r--r--src/csharp/Grpc.IntegrationTesting.StressClient/project.json22
-rw-r--r--src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs3
-rw-r--r--src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj51
-rw-r--r--src/csharp/Grpc.IntegrationTesting/InteropClient.cs63
-rw-r--r--src/csharp/Grpc.IntegrationTesting/InteropServer.cs32
-rw-r--r--src/csharp/Grpc.IntegrationTesting/QpsWorker.cs30
-rw-r--r--src/csharp/Grpc.IntegrationTesting/StressTestClient.cs51
-rw-r--r--src/csharp/Grpc.IntegrationTesting/packages.config16
-rw-r--r--src/csharp/Grpc.IntegrationTesting/project.json30
-rw-r--r--src/csharp/Grpc.Tools.nuspec25
-rw-r--r--src/csharp/README.md20
-rw-r--r--src/csharp/build_packages.bat10
-rwxr-xr-xsrc/csharp/build_packages_dotnetcli.sh70
-rw-r--r--src/csharp/ext/grpc_csharp_ext.c14
-rw-r--r--src/node/README.md3
-rw-r--r--src/node/ext/node_grpc.cc8
-rw-r--r--src/node/health_check/package.json4
-rw-r--r--src/node/tools/package.json2
-rw-r--r--src/objective-c/!ProtoCompiler-gRPCPlugin.podspec7
-rw-r--r--src/objective-c/BoringSSL.podspec532
-rw-r--r--src/objective-c/CronetFramework.podspec39
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m5
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m4
-rw-r--r--src/objective-c/GRPCClient/private/GRPCWrappedCall.m5
-rw-r--r--src/objective-c/README.md13
-rw-r--r--src/objective-c/examples/RemoteTestClient/RemoteTest.podspec13
-rw-r--r--src/objective-c/tests/RemoteTestClient/RemoteTest.podspec13
-rw-r--r--src/php/README.md4
-rw-r--r--src/php/composer.json2
-rw-r--r--src/php/ext/grpc/call.c3
-rw-r--r--src/php/ext/grpc/call_credentials.c20
-rwxr-xr-xsrc/php/tests/interop/interop_client.php37
-rw-r--r--src/php/tests/unit_tests/CallCredentials2Test.php65
-rw-r--r--src/php/tests/unit_tests/CallCredentials3Test.php135
-rw-r--r--src/php/tests/unit_tests/CallTest.php24
-rw-r--r--src/proto/grpc/testing/echo.proto2
-rw-r--r--src/python/grpcio/_spawn_patch.py (renamed from src/python/grpcio/_unixccompiler_patch.py)62
-rw-r--r--src/python/grpcio/grpc/__init__.py20
-rw-r--r--src/python/grpcio/grpc/_server.py1
-rw-r--r--src/python/grpcio/grpc_version.py2
-rw-r--r--src/python/grpcio_health_checking/grpc_version.py2
-rw-r--r--src/python/grpcio_health_checking/setup.py4
-rw-r--r--src/python/grpcio_tests/grpc_version.py2
-rw-r--r--src/python/grpcio_tests/setup.py14
-rw-r--r--src/python/grpcio_tests/tests/interop/_insecure_interop_test.py14
-rw-r--r--src/python/grpcio_tests/tests/interop/_secure_interop_test.py24
-rw-r--r--src/python/grpcio_tests/tests/interop/client.py56
-rw-r--r--src/python/grpcio_tests/tests/interop/methods.py270
-rw-r--r--src/python/grpcio_tests/tests/interop/server.py12
-rw-r--r--src/python/grpcio_tests/tests/stress/client.py21
-rw-r--r--src/python/grpcio_tests/tests/stress/metrics_server.py2
-rw-r--r--src/ruby/README.md5
-rw-r--r--src/ruby/ext/grpc/extconf.rb4
-rw-r--r--src/ruby/lib/grpc/generic/active_call.rb4
-rw-r--r--src/ruby/lib/grpc/generic/bidi_call.rb95
-rw-r--r--src/ruby/lib/grpc/generic/rpc_server.rb1
-rw-r--r--src/ruby/lib/grpc/grpc.rb11
-rw-r--r--src/ruby/lib/grpc/version.rb2
-rwxr-xr-xsrc/ruby/pb/test/server.rb65
-rw-r--r--src/ruby/qps/client.rb7
-rw-r--r--src/ruby/qps/qps-common.rb16
-rw-r--r--src/ruby/qps/server.rb14
-rwxr-xr-xsrc/ruby/qps/worker.rb8
-rw-r--r--src/ruby/tools/version.rb2
118 files changed, 1431 insertions, 1334 deletions
diff --git a/src/compiler/README.md b/src/compiler/README.md
new file mode 100644
index 0000000000..a2f49b3cd5
--- /dev/null
+++ b/src/compiler/README.md
@@ -0,0 +1,4 @@
+#Overview
+
+This directory contains source code for gRPC protocol buffer compiler (*protoc*) plugins. Along with `protoc`,
+these plugins are used to generate gRPC client and server stubs from `.proto` files.
diff --git a/src/compiler/node_generator.cc b/src/compiler/node_generator.cc
index 1fe090d17a..bce156f449 100644
--- a/src/compiler/node_generator.cc
+++ b/src/compiler/node_generator.cc
@@ -103,16 +103,19 @@ grpc::string GetRelativePath(const grpc::string& from_file,
/* Finds all message types used in all services in the file, and returns them
* as a map of fully qualified message type name to message descriptor */
-map<grpc::string, const Descriptor*> GetAllMessages(const FileDescriptor *file) {
- map<grpc::string, const Descriptor*> message_types;
- for (int service_num = 0; service_num < file->service_count(); service_num++) {
- const ServiceDescriptor* service = file->service(service_num);
- for (int method_num = 0; method_num < service->method_count(); method_num++) {
- const MethodDescriptor* method = service->method(method_num);
- const Descriptor* input_type = method->input_type();
- const Descriptor* output_type = method->output_type();
- message_types[input_type->name()] = input_type;
- message_types[output_type->name()] = output_type;
+map<grpc::string, const Descriptor *> GetAllMessages(
+ const FileDescriptor *file) {
+ map<grpc::string, const Descriptor *> message_types;
+ for (int service_num = 0; service_num < file->service_count();
+ service_num++) {
+ const ServiceDescriptor *service = file->service(service_num);
+ for (int method_num = 0; method_num < service->method_count();
+ method_num++) {
+ const MethodDescriptor *method = service->method(method_num);
+ const Descriptor *input_type = method->input_type();
+ const Descriptor *output_type = method->output_type();
+ message_types[input_type->full_name()] = input_type;
+ message_types[output_type->full_name()] = output_type;
}
}
return message_types;
@@ -124,7 +127,7 @@ grpc::string MessageIdentifierName(const grpc::string& name) {
grpc::string NodeObjectPath(const Descriptor *descriptor) {
grpc::string module_alias = ModuleAlias(descriptor->file()->name());
- grpc::string name = descriptor->name();
+ grpc::string name = descriptor->full_name();
grpc_generator::StripPrefix(&name, descriptor->file()->package() + ".");
return module_alias + "." + name;
}
@@ -132,8 +135,9 @@ grpc::string NodeObjectPath(const Descriptor *descriptor) {
// Prints out the message serializer and deserializer functions
void PrintMessageTransformer(const Descriptor *descriptor, Printer *out) {
map<grpc::string, grpc::string> template_vars;
- template_vars["identifier_name"] = MessageIdentifierName(descriptor->name());
- template_vars["name"] = descriptor->name();
+ grpc::string full_name = descriptor->full_name();
+ template_vars["identifier_name"] = MessageIdentifierName(full_name);
+ template_vars["name"] = full_name;
template_vars["node_name"] = NodeObjectPath(descriptor);
// Print the serializer
out->Print(template_vars, "function serialize_$identifier_name$(arg) {\n");
@@ -166,9 +170,9 @@ void PrintMethod(const MethodDescriptor *method, Printer *out) {
vars["service_name"] = method->service()->full_name();
vars["name"] = method->name();
vars["input_type"] = NodeObjectPath(input_type);
- vars["input_type_id"] = MessageIdentifierName(input_type->name());
+ vars["input_type_id"] = MessageIdentifierName(input_type->full_name());
vars["output_type"] = NodeObjectPath(output_type);
- vars["output_type_id"] = MessageIdentifierName(output_type->name());
+ vars["output_type_id"] = MessageIdentifierName(output_type->full_name());
vars["client_stream"] = method->client_streaming() ? "true" : "false";
vars["server_stream"] = method->server_streaming() ? "true" : "false";
out->Print("{\n");
diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc
index c5f1ed8061..0e7b9fbf4d 100644
--- a/src/compiler/python_generator.cc
+++ b/src/compiler/python_generator.cc
@@ -236,6 +236,10 @@ bool PrintBetaServicer(const ServiceDescriptor* service,
service->name());
{
IndentScope raii_class_indent(out);
+ out->Print("\"\"\"The Beta API is deprecated for 0.15.0 and later.\n"
+ "\nIt is recommended to use the GA API (classes and functions in this\n"
+ "file not marked beta) for all further purposes. This class was generated\n"
+ "only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.\"\"\"\n");
PrintAllComments(service, out);
for (int i = 0; i < service->method_count(); ++i) {
auto meth = service->method(i);
@@ -259,6 +263,10 @@ bool PrintBetaStub(const ServiceDescriptor* service,
out->Print("class Beta$Service$Stub(object):\n", "Service", service->name());
{
IndentScope raii_class_indent(out);
+ out->Print("\"\"\"The Beta API is deprecated for 0.15.0 and later.\n"
+ "\nIt is recommended to use the GA API (classes and functions in this\n"
+ "file not marked beta) for all further purposes. This class was generated\n"
+ "only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.\"\"\"\n");
PrintAllComments(service, out);
for (int i = 0; i < service->method_count(); ++i) {
const MethodDescriptor* meth = service->method(i);
@@ -287,6 +295,11 @@ bool PrintBetaServerFactory(const grpc::string& package_qualified_service_name,
"Service", service->name());
{
IndentScope raii_create_server_indent(out);
+ out->Print("\"\"\"The Beta API is deprecated for 0.15.0 and later.\n"
+ "\nIt is recommended to use the GA API (classes and functions in this\n"
+ "file not marked beta) for all further purposes. This function was\n"
+ "generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"
+ "\"\"\"\n");
map<grpc::string, grpc::string> method_implementation_constructors;
map<grpc::string, grpc::string> input_message_modules_and_classes;
map<grpc::string, grpc::string> output_message_modules_and_classes;
@@ -381,6 +394,11 @@ bool PrintBetaStubFactory(const grpc::string& package_qualified_service_name,
" metadata_transformer=None, pool=None, pool_size=None):\n");
{
IndentScope raii_create_server_indent(out);
+ out->Print("\"\"\"The Beta API is deprecated for 0.15.0 and later.\n"
+ "\nIt is recommended to use the GA API (classes and functions in this\n"
+ "file not marked beta) for all further purposes. This function was\n"
+ "generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0"
+ "\"\"\"\n");
map<grpc::string, grpc::string> method_cardinalities;
map<grpc::string, grpc::string> input_message_modules_and_classes;
map<grpc::string, grpc::string> output_message_modules_and_classes;
diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc
index 1501c3f3e0..ee2502e150 100644
--- a/src/compiler/ruby_generator.cc
+++ b/src/compiler/ruby_generator.cc
@@ -115,6 +115,41 @@ void PrintService(const ServiceDescriptor *service, const grpc::string &package,
} // namespace
+// The following functions are copied directly from the source for the protoc ruby generator
+// to ensure compatibility (with the exception of int and string type changes).
+// See https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/ruby/ruby_generator.cc#L250
+// TODO: keep up to date with protoc code generation, though this behavior isn't expected to change
+bool IsLower(char ch) { return ch >= 'a' && ch <= 'z'; }
+
+char ToUpper(char ch) { return IsLower(ch) ? (ch - 'a' + 'A') : ch; }
+
+
+// Package names in protobuf are snake_case by convention, but Ruby module
+// names must be PascalCased.
+//
+// foo_bar_baz -> FooBarBaz
+grpc::string PackageToModule(const grpc::string& name) {
+ bool next_upper = true;
+ grpc::string result;
+ result.reserve(name.size());
+
+ for (uint i = 0; i < name.size(); i++) {
+ if (name[i] == '_') {
+ next_upper = true;
+ } else {
+ if (next_upper) {
+ result.push_back(ToUpper(name[i]));
+ } else {
+ result.push_back(name[i]);
+ }
+ next_upper = false;
+ }
+ }
+
+ return result;
+}
+// end copying of protoc generator for ruby code
+
grpc::string GetServices(const FileDescriptor *file) {
grpc::string output;
{
@@ -156,7 +191,7 @@ grpc::string GetServices(const FileDescriptor *file) {
std::vector<grpc::string> modules = Split(file->package(), '.');
for (size_t i = 0; i < modules.size(); ++i) {
std::map<grpc::string, grpc::string> module_vars =
- ListToDict({"module.name", CapitalizeFirst(modules[i]), });
+ ListToDict({"module.name", PackageToModule(modules[i]), });
out.Print(module_vars, "module $module.name$\n");
out.Indent();
}
diff --git a/src/core/README.md b/src/core/README.md
index 0d8c0d5bd9..44c6f24772 100644
--- a/src/core/README.md
+++ b/src/core/README.md
@@ -1,8 +1,4 @@
#Overview
-This directory contains source code for shared C library. Libraries in other languages in this repository (C++, Ruby,
+This directory contains source code for C library (a.k.a the *gRPC C core*) that provides all gRPC's core functionality through a low level API. Libraries in other languages in this repository (C++, Ruby,
Python, PHP, NodeJS, Objective-C) are layered on top of this library.
-
-#Status
-
-Beta
diff --git a/src/core/ext/client_config/subchannel.c b/src/core/ext/client_config/subchannel.c
index d089cd4399..02cdf8648e 100644
--- a/src/core/ext/client_config/subchannel.c
+++ b/src/core/ext/client_config/subchannel.c
@@ -33,6 +33,7 @@
#include "src/core/ext/client_config/subchannel.h"
+#include <limits.h>
#include <string.h>
#include <grpc/support/alloc.h>
@@ -331,41 +332,40 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx,
grpc_closure_init(&c->connected, subchannel_connected, c);
grpc_connectivity_state_init(&c->state_tracker, GRPC_CHANNEL_IDLE,
"subchannel");
- gpr_backoff_init(&c->backoff_state,
- GRPC_SUBCHANNEL_RECONNECT_BACKOFF_MULTIPLIER,
- GRPC_SUBCHANNEL_RECONNECT_JITTER,
- GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS * 1000,
- GRPC_SUBCHANNEL_RECONNECT_MAX_BACKOFF_SECONDS * 1000);
+ int initial_backoff_ms =
+ GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS * 1000;
+ int max_backoff_ms = GRPC_SUBCHANNEL_RECONNECT_MAX_BACKOFF_SECONDS * 1000;
+ bool fixed_reconnect_backoff = false;
if (c->args) {
for (size_t i = 0; i < c->args->num_args; i++) {
if (0 == strcmp(c->args->args[i].key,
"grpc.testing.fixed_reconnect_backoff")) {
GPR_ASSERT(c->args->args[i].type == GRPC_ARG_INTEGER);
- gpr_backoff_init(&c->backoff_state, 1.0, 0.0,
- c->args->args[i].value.integer,
- c->args->args[i].value.integer);
- }
- if (0 ==
- strcmp(c->args->args[i].key, GRPC_ARG_MAX_RECONNECT_BACKOFF_MS)) {
- if (c->args->args[i].type == GRPC_ARG_INTEGER) {
- if (c->args->args[i].value.integer >= 0) {
- gpr_backoff_init(
- &c->backoff_state, GRPC_SUBCHANNEL_RECONNECT_BACKOFF_MULTIPLIER,
- GRPC_SUBCHANNEL_RECONNECT_JITTER,
- GPR_MIN(c->args->args[i].value.integer,
- GRPC_SUBCHANNEL_INITIAL_CONNECT_BACKOFF_SECONDS * 1000),
- c->args->args[i].value.integer);
- } else {
- gpr_log(GPR_ERROR, GRPC_ARG_MAX_RECONNECT_BACKOFF_MS
- " : must be non-negative");
- }
- } else {
- gpr_log(GPR_ERROR,
- GRPC_ARG_MAX_RECONNECT_BACKOFF_MS " : must be an integer");
- }
+ fixed_reconnect_backoff = true;
+ initial_backoff_ms = max_backoff_ms = grpc_channel_arg_get_integer(
+ &c->args->args[i],
+ (grpc_integer_options){initial_backoff_ms, 100, INT_MAX});
+ } else if (0 == strcmp(c->args->args[i].key,
+ GRPC_ARG_MAX_RECONNECT_BACKOFF_MS)) {
+ fixed_reconnect_backoff = false;
+ max_backoff_ms = grpc_channel_arg_get_integer(
+ &c->args->args[i],
+ (grpc_integer_options){max_backoff_ms, 100, INT_MAX});
+ } else if (0 == strcmp(c->args->args[i].key,
+ GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS)) {
+ fixed_reconnect_backoff = false;
+ initial_backoff_ms = grpc_channel_arg_get_integer(
+ &c->args->args[i],
+ (grpc_integer_options){initial_backoff_ms, 100, INT_MAX});
}
}
}
+ gpr_backoff_init(
+ &c->backoff_state,
+ fixed_reconnect_backoff ? 1.0
+ : GRPC_SUBCHANNEL_RECONNECT_BACKOFF_MULTIPLIER,
+ fixed_reconnect_backoff ? 0.0 : GRPC_SUBCHANNEL_RECONNECT_JITTER,
+ initial_backoff_ms, max_backoff_ms);
gpr_mu_init(&c->mu);
return grpc_subchannel_index_register(exec_ctx, key, c);
diff --git a/src/core/lib/channel/channel_args.c b/src/core/lib/channel/channel_args.c
index 79ceeb66b3..3a56b1ff20 100644
--- a/src/core/lib/channel/channel_args.c
+++ b/src/core/lib/channel/channel_args.c
@@ -271,3 +271,21 @@ int grpc_channel_args_compare(const grpc_channel_args *a,
}
return 0;
}
+
+int grpc_channel_arg_get_integer(grpc_arg *arg, grpc_integer_options options) {
+ if (arg->type != GRPC_ARG_INTEGER) {
+ gpr_log(GPR_ERROR, "%s ignored: it must be an integer", arg->key);
+ return options.default_value;
+ }
+ if (arg->value.integer < options.min_value) {
+ gpr_log(GPR_ERROR, "%s ignored: it must be >= %d", arg->key,
+ options.min_value);
+ return options.default_value;
+ }
+ if (arg->value.integer > options.max_value) {
+ gpr_log(GPR_ERROR, "%s ignored: it must be <= %d", arg->key,
+ options.max_value);
+ return options.default_value;
+ }
+ return arg->value.integer;
+}
diff --git a/src/core/lib/channel/channel_args.h b/src/core/lib/channel/channel_args.h
index 653d04f427..e85e979eeb 100644
--- a/src/core/lib/channel/channel_args.h
+++ b/src/core/lib/channel/channel_args.h
@@ -87,4 +87,12 @@ uint32_t grpc_channel_args_compression_algorithm_get_states(
int grpc_channel_args_compare(const grpc_channel_args *a,
const grpc_channel_args *b);
+typedef struct grpc_integer_options {
+ int default_value; // Return this if value is outside of expected bounds.
+ int min_value;
+ int max_value;
+} grpc_integer_options;
+/** Returns the value of \a arg, subject to the contraints in \a options. */
+int grpc_channel_arg_get_integer(grpc_arg *arg, grpc_integer_options options);
+
#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H */
diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.c
index cb2ff782d6..425634d009 100644
--- a/src/core/lib/iomgr/tcp_server_posix.c
+++ b/src/core/lib/iomgr/tcp_server_posix.c
@@ -138,15 +138,17 @@ struct grpc_tcp_server {
};
static gpr_once check_init = GPR_ONCE_INIT;
-static bool has_so_reuseport;
+static bool has_so_reuseport = false;
static void init(void) {
+#ifndef GPR_MANYLINUX1
int s = socket(AF_INET, SOCK_STREAM, 0);
if (s >= 0) {
has_so_reuseport = GRPC_LOG_IF_ERROR("check for SO_REUSEPORT",
grpc_set_socket_reuse_port(s, 1));
close(s);
}
+#endif
}
grpc_error *grpc_tcp_server_create(grpc_closure *shutdown_complete,
diff --git a/src/core/lib/iomgr/tcp_windows.c b/src/core/lib/iomgr/tcp_windows.c
index 35054c42b5..448a72671c 100644
--- a/src/core/lib/iomgr/tcp_windows.c
+++ b/src/core/lib/iomgr/tcp_windows.c
@@ -319,6 +319,7 @@ static void win_write(grpc_exec_ctx *exec_ctx, grpc_endpoint *ep,
? GRPC_ERROR_NONE
: GRPC_WSA_ERROR(info->wsa_error, "WSASend");
grpc_exec_ctx_sched(exec_ctx, cb, error, NULL);
+ if (allocated) gpr_free(allocated);
return;
}
diff --git a/src/core/lib/surface/version.c b/src/core/lib/surface/version.c
index dab7f542ee..9463436ada 100644
--- a/src/core/lib/surface/version.c
+++ b/src/core/lib/surface/version.c
@@ -36,4 +36,4 @@
#include <grpc/grpc.h>
-const char *grpc_version_string(void) { return "1.0.0-pre2"; }
+const char *grpc_version_string(void) { return "1.0.1-pre1"; }
diff --git a/src/cpp/README.md b/src/cpp/README.md
index 8c0f85e5ff..d9b521317a 100644
--- a/src/cpp/README.md
+++ b/src/cpp/README.md
@@ -3,10 +3,6 @@
This directory contains source code for C++ implementation of gRPC.
-#Status
-
-Beta
-
#Pre-requisites
##Linux
diff --git a/src/cpp/client/channel.cc b/src/cpp/client/channel_cc.cc
index 43b3875cb3..43b3875cb3 100644
--- a/src/cpp/client/channel.cc
+++ b/src/cpp/client/channel_cc.cc
diff --git a/src/cpp/client/credentials.cc b/src/cpp/client/credentials_cc.cc
index e6a4f81b0d..e6a4f81b0d 100644
--- a/src/cpp/client/credentials.cc
+++ b/src/cpp/client/credentials_cc.cc
diff --git a/src/cpp/common/completion_queue.cc b/src/cpp/common/completion_queue_cc.cc
index 00cc102f92..00cc102f92 100644
--- a/src/cpp/common/completion_queue.cc
+++ b/src/cpp/common/completion_queue_cc.cc
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server_cc.cc
index af04fd4ca6..af04fd4ca6 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server_cc.cc
diff --git a/src/cpp/util/byte_buffer.cc b/src/cpp/util/byte_buffer_cc.cc
index c2cd20ee07..c2cd20ee07 100644
--- a/src/cpp/util/byte_buffer.cc
+++ b/src/cpp/util/byte_buffer_cc.cc
diff --git a/src/cpp/util/slice.cc b/src/cpp/util/slice_cc.cc
index 7e88423b6c..7e88423b6c 100644
--- a/src/cpp/util/slice.cc
+++ b/src/cpp/util/slice_cc.cc
diff --git a/src/cpp/util/time.cc b/src/cpp/util/time_cc.cc
index c43d848cc6..c43d848cc6 100644
--- a/src/cpp/util/time.cc
+++ b/src/cpp/util/time_cc.cc
diff --git a/src/csharp/Grpc.Auth/Grpc.Auth.csproj b/src/csharp/Grpc.Auth/Grpc.Auth.csproj
index 1fa14fc3df..a44aaf1fdd 100644
--- a/src/csharp/Grpc.Auth/Grpc.Auth.csproj
+++ b/src/csharp/Grpc.Auth/Grpc.Auth.csproj
@@ -39,30 +39,37 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="BouncyCastle.Crypto, Version=1.7.4137.9688, Culture=neutral, PublicKeyToken=a4292a325f69b123, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
+ <Reference Include="System" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Net.Http.WebRequest" />
+ <Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
- <Reference Include="Google.Apis.Auth, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll</HintPath>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
- <Reference Include="Google.Apis.Auth.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
+ <Reference Include="log4net">
+ <HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
</Reference>
- <Reference Include="Google.Apis.Core, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
+ <Reference Include="Google.Apis.Core">
+ <HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Zlib.Portable">
+ <HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.PlatformServices">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.Auth">
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.Auth.PlatformServices">
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
- <Reference Include="System" />
- <Reference Include="System.Net" />
- <Reference Include="System.Net.Http" />
- <Reference Include="System.Net.Http.WebRequest" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.Auth/Grpc.Auth.nuspec b/src/csharp/Grpc.Auth/Grpc.Auth.nuspec
index 4baed3704c..a1f5668e2e 100644
--- a/src/csharp/Grpc.Auth/Grpc.Auth.nuspec
+++ b/src/csharp/Grpc.Auth/Grpc.Auth.nuspec
@@ -15,7 +15,7 @@
<copyright>Copyright 2015, Google Inc.</copyright>
<tags>gRPC RPC Protocol HTTP/2 Auth OAuth2</tags>
<dependencies>
- <dependency id="Google.Apis.Auth" version="1.11.1" />
+ <dependency id="Google.Apis.Auth" version="1.15.0" />
<dependency id="Grpc.Core" version="$version$" />
</dependencies>
</metadata>
diff --git a/src/csharp/Grpc.Auth/packages.config b/src/csharp/Grpc.Auth/packages.config
index c20d9ceed6..11c6375c63 100644
--- a/src/csharp/Grpc.Auth/packages.config
+++ b/src/csharp/Grpc.Auth/packages.config
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
- <package id="Google.Apis.Auth" version="1.11.1" targetFramework="net45" />
- <package id="Google.Apis.Core" version="1.11.1" targetFramework="net45" />
+ <package id="Google.Apis" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
+ <package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
+ <package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.Auth/project.json b/src/csharp/Grpc.Auth/project.json
index 6a1c9fc990..dd72e8239e 100644
--- a/src/csharp/Grpc.Auth/project.json
+++ b/src/csharp/Grpc.Auth/project.json
@@ -1,5 +1,5 @@
{
- "version": "1.0.0-pre2",
+ "version": "1.0.1-pre1",
"title": "gRPC C# Auth",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",
@@ -22,19 +22,14 @@
}
},
"dependencies": {
- "Grpc.Core": "1.0.0-pre2",
- "Google.Apis.Auth": "1.11.1"
+ "Grpc.Core": "1.0.1-pre1",
+ "Google.Apis.Auth": "1.16.0"
},
"frameworks": {
"net45": { },
"netstandard1.5": {
- "imports": [
- "net45"
- ],
"dependencies": {
- "Microsoft.NETCore.Portable.Compatibility": "1.0.1",
- "NETStandard.Library": "1.6.0",
- "System.Threading.Tasks": "4.0.11"
+ "NETStandard.Library": "1.6.0"
}
}
}
diff --git a/src/csharp/Grpc.Core.Tests/SanityTest.cs b/src/csharp/Grpc.Core.Tests/SanityTest.cs
index 19c7a0b440..f1eb13dffc 100644
--- a/src/csharp/Grpc.Core.Tests/SanityTest.cs
+++ b/src/csharp/Grpc.Core.Tests/SanityTest.cs
@@ -59,9 +59,10 @@ namespace Grpc.Core.Tests
public void TestsJsonUpToDate()
{
var discoveredTests = DiscoverAllTestClasses();
- string discoveredTestsJson = JsonConvert.SerializeObject(discoveredTests, Formatting.Indented);
+ var testsFromFile
+ = JsonConvert.DeserializeObject<Dictionary<string, List<string>>>(ReadTestsJson());
- Assert.AreEqual(discoveredTestsJson, ReadTestsJson());
+ Assert.AreEqual(discoveredTests, testsFromFile);
}
/// <summary>
diff --git a/src/csharp/Grpc.Core.Tests/project.json b/src/csharp/Grpc.Core.Tests/project.json
index 014e2262e9..faf28dcee8 100644
--- a/src/csharp/Grpc.Core.Tests/project.json
+++ b/src/csharp/Grpc.Core.Tests/project.json
@@ -42,11 +42,6 @@
}
}
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.Core": {
@@ -66,8 +61,10 @@
"portable-net45"
],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0"
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
}
}
},
diff --git a/src/csharp/Grpc.Core/GrpcEnvironment.cs b/src/csharp/Grpc.Core/GrpcEnvironment.cs
index eeed699712..3538633d61 100644
--- a/src/csharp/Grpc.Core/GrpcEnvironment.cs
+++ b/src/csharp/Grpc.Core/GrpcEnvironment.cs
@@ -352,11 +352,11 @@ namespace Grpc.Core
{
if (!hooksRegistered)
{
- // TODO(jtattermusch): register shutdownhooks for CoreCLR as well
-#if !NETSTANDARD1_5
-
- AppDomain.CurrentDomain.ProcessExit += ShutdownHookHandler;
- AppDomain.CurrentDomain.DomainUnload += ShutdownHookHandler;
+#if NETSTANDARD1_5
+ System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += (assemblyLoadContext) => { HandleShutdown(); };
+#else
+ AppDomain.CurrentDomain.ProcessExit += (sender, eventArgs) => { HandleShutdown(); };
+ AppDomain.CurrentDomain.DomainUnload += (sender, eventArgs) => { HandleShutdown(); };
#endif
}
hooksRegistered = true;
@@ -364,9 +364,9 @@ namespace Grpc.Core
}
/// <summary>
- /// Handler for AppDomain.DomainUnload and AppDomain.ProcessExit hooks.
+ /// Handler for AppDomain.DomainUnload, AppDomain.ProcessExit and AssemblyLoadContext.Unloading hooks.
/// </summary>
- private static void ShutdownHookHandler(object sender, EventArgs e)
+ private static void HandleShutdown()
{
Task.WaitAll(GrpcEnvironment.ShutdownChannelsAsync(), GrpcEnvironment.KillServersAsync());
}
diff --git a/src/csharp/Grpc.Core/Internal/NativeExtension.cs b/src/csharp/Grpc.Core/Internal/NativeExtension.cs
index 509baf7cb1..61d8b57c76 100644
--- a/src/csharp/Grpc.Core/Internal/NativeExtension.cs
+++ b/src/csharp/Grpc.Core/Internal/NativeExtension.cs
@@ -100,19 +100,19 @@ namespace Grpc.Core.Internal
// With old-style VS projects, the native libraries get copied using a .targets rule to the build output folder
// alongside the compiled assembly.
- // With dotnet cli projects, the native libraries (just the required ones) are similarly copied to the built output folder,
- // through the magic of Microsoft.NETCore.Platforms.
+ // With dotnet cli projects targeting net45 framework, the native libraries (just the required ones)
+ // are similarly copied to the built output folder, through the magic of Microsoft.NETCore.Platforms.
var classicPath = Path.Combine(assemblyDirectory, GetNativeLibraryFilename());
- // DNX-style project.json projects will use Grpc.Core assembly directly in the location where it got restored
+ // With dotnet cli project targeting netcoreapp1.0, projects will use Grpc.Core assembly directly in the location where it got restored
// by nuget. We locate the native libraries based on known structure of Grpc.Core nuget package.
+ // When "dotnet publish" is used, the runtimes directory is copied next to the published assemblies.
+ string runtimesDirectory = string.Format("runtimes/{0}/native", GetPlatformString());
+ var netCorePublishedAppStylePath = Path.Combine(assemblyDirectory, runtimesDirectory, GetNativeLibraryFilename());
+ var netCoreAppStylePath = Path.Combine(assemblyDirectory, "../..", runtimesDirectory, GetNativeLibraryFilename());
- // TODO: Support .NET Core applications, which act slightly differently. We may be okay if "dotnet publish"
- // is used, but "dotnet run" leaves the native libraries in-package, while copying assemblies.
- string platform = GetPlatformString();
- string relativeDirectory = string.Format("../../runtimes/{0}/native", platform);
- var dnxStylePath = Path.Combine(assemblyDirectory, relativeDirectory, GetNativeLibraryFilename());
- string[] paths = new[] { classicPath, dnxStylePath };
+ // Look for all native library in all possible locations in given order.
+ string[] paths = new[] { classicPath, netCorePublishedAppStylePath, netCoreAppStylePath};
return new UnmanagedLibrary(paths);
}
diff --git a/src/csharp/Grpc.Core/Internal/PlatformApis.cs b/src/csharp/Grpc.Core/Internal/PlatformApis.cs
index 15391ddc64..406204e0a7 100644
--- a/src/csharp/Grpc.Core/Internal/PlatformApis.cs
+++ b/src/csharp/Grpc.Core/Internal/PlatformApis.cs
@@ -50,6 +50,7 @@ namespace Grpc.Core.Internal
static readonly bool isMacOSX;
static readonly bool isWindows;
static readonly bool isMono;
+ static readonly bool isNetCore;
static PlatformApis()
{
@@ -57,6 +58,7 @@ namespace Grpc.Core.Internal
isLinux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
isMacOSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
+ isNetCore = RuntimeInformation.FrameworkDescription.StartsWith(".NET Core");
#else
var platform = Environment.OSVersion.Platform;
@@ -64,6 +66,7 @@ namespace Grpc.Core.Internal
isMacOSX = (platform == PlatformID.Unix && GetUname() == "Darwin");
isLinux = (platform == PlatformID.Unix && !isMacOSX);
isWindows = (platform == PlatformID.Win32NT || platform == PlatformID.Win32S || platform == PlatformID.Win32Windows);
+ isNetCore = false;
#endif
isMono = Type.GetType("Mono.Runtime") != null;
}
@@ -88,6 +91,14 @@ namespace Grpc.Core.Internal
get { return isMono; }
}
+ /// <summary>
+ /// true if running on .NET Core (CoreCLR), false otherwise.
+ /// </summary>
+ public static bool IsNetCore
+ {
+ get { return isNetCore; }
+ }
+
public static bool Is64Bit
{
get { return IntPtr.Size == 8; }
diff --git a/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs b/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs
index dc629bd714..31e1402849 100644
--- a/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs
+++ b/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs
@@ -44,10 +44,9 @@ namespace Grpc.Core.Internal
{
/// <summary>
/// Represents a dynamically loaded unmanaged library in a (partially) platform independent manner.
- /// An important difference in library loading semantics is that on Windows, once we load a dynamic library using LoadLibrary,
- /// that library becomes instantly available for <c>DllImport</c> P/Invoke calls referring to the same library name.
- /// On Unix systems, dlopen has somewhat different semantics, so we need to use dlsym and <c>Marshal.GetDelegateForFunctionPointer</c>
- /// to obtain delegates to native methods.
+ /// First, the native library is loaded using dlopen (on Unix systems) or using LoadLibrary (on Windows).
+ /// dlsym or GetProcAddress are then used to obtain symbol addresses. <c>Marshal.GetDelegateForFunctionPointer</c>
+ /// transforms the addresses into delegates to native methods.
/// See http://stackoverflow.com/questions/13461989/p-invoke-to-dynamically-loaded-library-on-mono.
/// </summary>
internal class UnmanagedLibrary
@@ -114,6 +113,10 @@ namespace Grpc.Core.Internal
{
return Mono.dlsym(this.handle, symbolName);
}
+ if (PlatformApis.IsNetCore)
+ {
+ return CoreCLR.dlsym(this.handle, symbolName);
+ }
return Linux.dlsym(this.handle, symbolName);
}
if (PlatformApis.IsMacOSX)
@@ -149,6 +152,10 @@ namespace Grpc.Core.Internal
{
return Mono.dlopen(libraryPath, RTLD_GLOBAL + RTLD_LAZY);
}
+ if (PlatformApis.IsNetCore)
+ {
+ return CoreCLR.dlopen(libraryPath, RTLD_GLOBAL + RTLD_LAZY);
+ }
return Linux.dlopen(libraryPath, RTLD_GLOBAL + RTLD_LAZY);
}
if (PlatformApis.IsMacOSX)
@@ -215,5 +222,19 @@ namespace Grpc.Core.Internal
[DllImport("__Internal")]
internal static extern IntPtr dlsym(IntPtr handle, string symbol);
}
+
+ /// <summary>
+ /// Similarly as for Mono on Linux, we load symbols for
+ /// dlopen and dlsym from the "libcoreclr.so",
+ /// to avoid the dependency on libc-dev Linux.
+ /// </summary>
+ private static class CoreCLR
+ {
+ [DllImport("libcoreclr.so")]
+ internal static extern IntPtr dlopen(string filename, int flags);
+
+ [DllImport("libcoreclr.so")]
+ internal static extern IntPtr dlsym(IntPtr handle, string symbol);
+ }
}
}
diff --git a/src/csharp/Grpc.Core/VersionInfo.cs b/src/csharp/Grpc.Core/VersionInfo.cs
index 37df7ff489..febd7a23fe 100644
--- a/src/csharp/Grpc.Core/VersionInfo.cs
+++ b/src/csharp/Grpc.Core/VersionInfo.cs
@@ -48,11 +48,11 @@ namespace Grpc.Core
/// <summary>
/// Current <c>AssemblyFileVersion</c> of gRPC C# assemblies
/// </summary>
- public const string CurrentAssemblyFileVersion = "1.0.0.0";
+ public const string CurrentAssemblyFileVersion = "1.0.1.0";
/// <summary>
/// Current version of gRPC C#
/// </summary>
- public const string CurrentVersion = "1.0.0-pre2";
+ public const string CurrentVersion = "1.0.1-pre1";
}
}
diff --git a/src/csharp/Grpc.Core/project.json b/src/csharp/Grpc.Core/project.json
index 4922b8c616..8cdb1720a4 100644
--- a/src/csharp/Grpc.Core/project.json
+++ b/src/csharp/Grpc.Core/project.json
@@ -1,5 +1,5 @@
{
- "version": "1.0.0-pre2",
+ "version": "1.0.1-pre1",
"title": "gRPC C# Core",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",
@@ -36,11 +36,9 @@
"frameworks": {
"net45": { },
"netstandard1.5": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
"NETStandard.Library": "1.6.0",
+ "System.Runtime.Loader": "4.0.0",
"System.Threading.Thread": "4.0.0"
}
}
diff --git a/src/csharp/Grpc.Examples.MathClient/project.json b/src/csharp/Grpc.Examples.MathClient/project.json
index ad319478ab..628f532966 100644
--- a/src/csharp/Grpc.Examples.MathClient/project.json
+++ b/src/csharp/Grpc.Examples.MathClient/project.json
@@ -42,11 +42,6 @@
}
}
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.Examples": {
@@ -56,12 +51,11 @@
"frameworks": {
"net45": { },
"netcoreapp1.0": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0"
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
}
}
}
diff --git a/src/csharp/Grpc.Examples.MathServer/project.json b/src/csharp/Grpc.Examples.MathServer/project.json
index ad319478ab..628f532966 100644
--- a/src/csharp/Grpc.Examples.MathServer/project.json
+++ b/src/csharp/Grpc.Examples.MathServer/project.json
@@ -42,11 +42,6 @@
}
}
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.Examples": {
@@ -56,12 +51,11 @@
"frameworks": {
"net45": { },
"netcoreapp1.0": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0"
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
}
}
}
diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
index c8801a9413..a114d96127 100644
--- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
+++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
@@ -36,9 +36,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
- <Reference Include="Google.Protobuf">
- <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
- </Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
@@ -48,6 +45,9 @@
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.Examples.Tests/packages.config b/src/csharp/Grpc.Examples.Tests/packages.config
index cc473eb34c..f14517d2e2 100644
--- a/src/csharp/Grpc.Examples.Tests/packages.config
+++ b/src/csharp/Grpc.Examples.Tests/packages.config
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
- <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" />
+ <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.Examples.Tests/project.json b/src/csharp/Grpc.Examples.Tests/project.json
index 1cd1848e99..0109617e6b 100644
--- a/src/csharp/Grpc.Examples.Tests/project.json
+++ b/src/csharp/Grpc.Examples.Tests/project.json
@@ -42,11 +42,6 @@
}
}
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.Examples": {
@@ -62,8 +57,10 @@
"portable-net45"
],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0"
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
}
}
}
diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj
index 4521649b6f..dcbef5fc0b 100644
--- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj
+++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj
@@ -37,10 +37,6 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
- </Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
@@ -50,6 +46,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.Examples/packages.config b/src/csharp/Grpc.Examples/packages.config
index 8985ae4c77..d17347f08f 100644
--- a/src/csharp/Grpc.Examples/packages.config
+++ b/src/csharp/Grpc.Examples/packages.config
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
- <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
+ <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.Examples/project.json b/src/csharp/Grpc.Examples/project.json
index 98bd5d852c..21a730cb22 100644
--- a/src/csharp/Grpc.Examples/project.json
+++ b/src/csharp/Grpc.Examples/project.json
@@ -1,17 +1,12 @@
{
"buildOptions": {
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.Core": {
"target": "project"
},
- "Google.Protobuf": "3.0.0-beta3"
+ "Google.Protobuf": "3.0.0"
},
"frameworks": {
"net45": {
@@ -21,12 +16,11 @@
}
},
"netcoreapp1.0": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0"
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
}
}
}
diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
index aefacfbcc0..93c3b3a55f 100644
--- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
+++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
@@ -44,15 +44,15 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
- <Reference Include="Google.Protobuf">
- <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
- </Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.HealthCheck.Tests/packages.config b/src/csharp/Grpc.HealthCheck.Tests/packages.config
index 2bcfec8829..e796d6b135 100644
--- a/src/csharp/Grpc.HealthCheck.Tests/packages.config
+++ b/src/csharp/Grpc.HealthCheck.Tests/packages.config
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.HealthCheck.Tests/project.json b/src/csharp/Grpc.HealthCheck.Tests/project.json
index faa4400304..66dcd79a39 100644
--- a/src/csharp/Grpc.HealthCheck.Tests/project.json
+++ b/src/csharp/Grpc.HealthCheck.Tests/project.json
@@ -42,11 +42,6 @@
}
}
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.HealthCheck": {
@@ -62,8 +57,10 @@
"portable-net45"
],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0"
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
}
}
}
diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
index e13416cc1a..54a2984964 100644
--- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
+++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
@@ -38,10 +38,6 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -53,6 +49,9 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.HealthCheck/packages.config b/src/csharp/Grpc.HealthCheck/packages.config
index 063094f775..f8e353bf26 100644
--- a/src/csharp/Grpc.HealthCheck/packages.config
+++ b/src/csharp/Grpc.HealthCheck/packages.config
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.HealthCheck/project.json b/src/csharp/Grpc.HealthCheck/project.json
index aa7a6b69ca..2d06cb3eab 100644
--- a/src/csharp/Grpc.HealthCheck/project.json
+++ b/src/csharp/Grpc.HealthCheck/project.json
@@ -1,5 +1,5 @@
{
- "version": "1.0.0-pre2",
+ "version": "1.0.1-pre1",
"title": "gRPC C# Healthchecking",
"authors": [ "Google Inc." ],
"copyright": "Copyright 2015, Google Inc.",
@@ -22,8 +22,8 @@
}
},
"dependencies": {
- "Grpc.Core": "1.0.0-pre2",
- "Google.Protobuf": "3.0.0-beta3"
+ "Grpc.Core": "1.0.1-pre1",
+ "Google.Protobuf": "3.0.0"
},
"frameworks": {
"net45": {
@@ -33,9 +33,6 @@
}
},
"netstandard1.5": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
"NETStandard.Library": "1.6.0"
}
diff --git a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
index 91fb3ce5bc..ae58073b52 100644
--- a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
+++ b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
@@ -39,30 +39,37 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="BouncyCastle.Crypto, Version=1.7.4137.9688, Culture=neutral, PublicKeyToken=a4292a325f69b123, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
+ <Reference Include="System" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Net.Http.WebRequest" />
+ <Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
- <Reference Include="Google.Apis.Auth, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll</HintPath>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
- <Reference Include="Google.Apis.Auth.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
+ <Reference Include="log4net">
+ <HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
</Reference>
- <Reference Include="Google.Apis.Core, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
+ <Reference Include="Google.Apis.Core">
+ <HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Zlib.Portable">
+ <HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.PlatformServices">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.Auth">
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.Auth.PlatformServices">
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
- <Reference Include="System" />
- <Reference Include="System.Net" />
- <Reference Include="System.Net.Http" />
- <Reference Include="System.Net.Http.WebRequest" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.IntegrationTesting.Client/packages.config b/src/csharp/Grpc.IntegrationTesting.Client/packages.config
index c20d9ceed6..11c6375c63 100644
--- a/src/csharp/Grpc.IntegrationTesting.Client/packages.config
+++ b/src/csharp/Grpc.IntegrationTesting.Client/packages.config
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
- <package id="Google.Apis.Auth" version="1.11.1" targetFramework="net45" />
- <package id="Google.Apis.Core" version="1.11.1" targetFramework="net45" />
+ <package id="Google.Apis" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
+ <package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
+ <package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.IntegrationTesting.Client/project.json b/src/csharp/Grpc.IntegrationTesting.Client/project.json
index 287950720f..1b900c8af3 100644
--- a/src/csharp/Grpc.IntegrationTesting.Client/project.json
+++ b/src/csharp/Grpc.IntegrationTesting.Client/project.json
@@ -13,8 +13,10 @@
"includeFiles": [ "../Grpc.Core/Version.cs" ]
},
"copyToOutput": {
- "include": "data/*",
"mappings": {
+ "data/ca.pem": "../Grpc.IntegrationTesting/data/ca.pem",
+ "data/server1.key": "../Grpc.IntegrationTesting/data/server1.key",
+ "data/server1.pem": "../Grpc.IntegrationTesting/data/server1.pem",
"grpc_csharp_ext.x64.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"grpc_csharp_ext.x86.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"libgrpc_csharp_ext.x64.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
@@ -33,8 +35,10 @@
"includeFiles": [ "../Grpc.Core/Version.cs" ]
},
"copyToOutput": {
- "include": "data/*",
"mappings": {
+ "data/ca.pem": "../Grpc.IntegrationTesting/data/ca.pem",
+ "data/server1.key": "../Grpc.IntegrationTesting/data/server1.key",
+ "data/server1.pem": "../Grpc.IntegrationTesting/data/server1.pem",
"grpc_csharp_ext.x64.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"grpc_csharp_ext.x86.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"libgrpc_csharp_ext.x64.so": "../../../libs/opt/libgrpc_csharp_ext.so",
@@ -44,11 +48,6 @@
}
}
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.IntegrationTesting": {
@@ -59,12 +58,13 @@
"net45": { },
"netcoreapp1.0": {
"imports": [
- "portable-net45",
- "net45"
+ "portable-net45"
],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0"
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
}
}
}
diff --git a/src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj b/src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj
index dda26a6892..593bf0939d 100644
--- a/src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj
+++ b/src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj
@@ -58,7 +58,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <None Include="app.config" />
<None Include="Grpc.IntegrationTesting.QpsWorker.project.json" />
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/src/csharp/Grpc.IntegrationTesting.QpsWorker/app.config b/src/csharp/Grpc.IntegrationTesting.QpsWorker/app.config
deleted file mode 100644
index e204447bb3..0000000000
--- a/src/csharp/Grpc.IntegrationTesting.QpsWorker/app.config
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Google.Apis.Core" publicKeyToken="4b01fa6e34db77ab" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-1.11.1.0" newVersion="1.11.1.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration> \ No newline at end of file
diff --git a/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json b/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json
index 287950720f..1b900c8af3 100644
--- a/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json
+++ b/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json
@@ -13,8 +13,10 @@
"includeFiles": [ "../Grpc.Core/Version.cs" ]
},
"copyToOutput": {
- "include": "data/*",
"mappings": {
+ "data/ca.pem": "../Grpc.IntegrationTesting/data/ca.pem",
+ "data/server1.key": "../Grpc.IntegrationTesting/data/server1.key",
+ "data/server1.pem": "../Grpc.IntegrationTesting/data/server1.pem",
"grpc_csharp_ext.x64.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"grpc_csharp_ext.x86.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"libgrpc_csharp_ext.x64.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
@@ -33,8 +35,10 @@
"includeFiles": [ "../Grpc.Core/Version.cs" ]
},
"copyToOutput": {
- "include": "data/*",
"mappings": {
+ "data/ca.pem": "../Grpc.IntegrationTesting/data/ca.pem",
+ "data/server1.key": "../Grpc.IntegrationTesting/data/server1.key",
+ "data/server1.pem": "../Grpc.IntegrationTesting/data/server1.pem",
"grpc_csharp_ext.x64.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"grpc_csharp_ext.x86.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"libgrpc_csharp_ext.x64.so": "../../../libs/opt/libgrpc_csharp_ext.so",
@@ -44,11 +48,6 @@
}
}
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.IntegrationTesting": {
@@ -59,12 +58,13 @@
"net45": { },
"netcoreapp1.0": {
"imports": [
- "portable-net45",
- "net45"
+ "portable-net45"
],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0"
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
}
}
}
diff --git a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
index f73d99dbd1..d5c40ba948 100644
--- a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
+++ b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
@@ -39,30 +39,37 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="BouncyCastle.Crypto, Version=1.7.4137.9688, Culture=neutral, PublicKeyToken=a4292a325f69b123, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
+ <Reference Include="System" />
+ <Reference Include="System.Net" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Net.Http.WebRequest" />
+ <Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
- <Reference Include="Google.Apis.Auth, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll</HintPath>
+ <Reference Include="Newtonsoft.Json">
+ <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
- <Reference Include="Google.Apis.Auth.PlatformServices, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
+ <Reference Include="log4net">
+ <HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
</Reference>
- <Reference Include="Google.Apis.Core, Version=1.11.1.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
+ <Reference Include="Google.Apis.Core">
+ <HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
</Reference>
- <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Reference Include="Zlib.Portable">
+ <HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.PlatformServices">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.Auth">
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.Auth.PlatformServices">
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
- <Reference Include="System" />
- <Reference Include="System.Net" />
- <Reference Include="System.Net.Http" />
- <Reference Include="System.Net.Http.WebRequest" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.IntegrationTesting.Server/packages.config b/src/csharp/Grpc.IntegrationTesting.Server/packages.config
index c20d9ceed6..11c6375c63 100644
--- a/src/csharp/Grpc.IntegrationTesting.Server/packages.config
+++ b/src/csharp/Grpc.IntegrationTesting.Server/packages.config
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
- <package id="Google.Apis.Auth" version="1.11.1" targetFramework="net45" />
- <package id="Google.Apis.Core" version="1.11.1" targetFramework="net45" />
+ <package id="Google.Apis" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
+ <package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
+ <package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.IntegrationTesting.Server/project.json b/src/csharp/Grpc.IntegrationTesting.Server/project.json
index 287950720f..1b900c8af3 100644
--- a/src/csharp/Grpc.IntegrationTesting.Server/project.json
+++ b/src/csharp/Grpc.IntegrationTesting.Server/project.json
@@ -13,8 +13,10 @@
"includeFiles": [ "../Grpc.Core/Version.cs" ]
},
"copyToOutput": {
- "include": "data/*",
"mappings": {
+ "data/ca.pem": "../Grpc.IntegrationTesting/data/ca.pem",
+ "data/server1.key": "../Grpc.IntegrationTesting/data/server1.key",
+ "data/server1.pem": "../Grpc.IntegrationTesting/data/server1.pem",
"grpc_csharp_ext.x64.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"grpc_csharp_ext.x86.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"libgrpc_csharp_ext.x64.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
@@ -33,8 +35,10 @@
"includeFiles": [ "../Grpc.Core/Version.cs" ]
},
"copyToOutput": {
- "include": "data/*",
"mappings": {
+ "data/ca.pem": "../Grpc.IntegrationTesting/data/ca.pem",
+ "data/server1.key": "../Grpc.IntegrationTesting/data/server1.key",
+ "data/server1.pem": "../Grpc.IntegrationTesting/data/server1.pem",
"grpc_csharp_ext.x64.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"grpc_csharp_ext.x86.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"libgrpc_csharp_ext.x64.so": "../../../libs/opt/libgrpc_csharp_ext.so",
@@ -44,11 +48,6 @@
}
}
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.IntegrationTesting": {
@@ -59,12 +58,13 @@
"net45": { },
"netcoreapp1.0": {
"imports": [
- "portable-net45",
- "net45"
+ "portable-net45"
],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0"
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
}
}
}
diff --git a/src/csharp/Grpc.IntegrationTesting.StressClient/project.json b/src/csharp/Grpc.IntegrationTesting.StressClient/project.json
index 287950720f..1b900c8af3 100644
--- a/src/csharp/Grpc.IntegrationTesting.StressClient/project.json
+++ b/src/csharp/Grpc.IntegrationTesting.StressClient/project.json
@@ -13,8 +13,10 @@
"includeFiles": [ "../Grpc.Core/Version.cs" ]
},
"copyToOutput": {
- "include": "data/*",
"mappings": {
+ "data/ca.pem": "../Grpc.IntegrationTesting/data/ca.pem",
+ "data/server1.key": "../Grpc.IntegrationTesting/data/server1.key",
+ "data/server1.pem": "../Grpc.IntegrationTesting/data/server1.pem",
"grpc_csharp_ext.x64.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"grpc_csharp_ext.x86.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"libgrpc_csharp_ext.x64.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
@@ -33,8 +35,10 @@
"includeFiles": [ "../Grpc.Core/Version.cs" ]
},
"copyToOutput": {
- "include": "data/*",
"mappings": {
+ "data/ca.pem": "../Grpc.IntegrationTesting/data/ca.pem",
+ "data/server1.key": "../Grpc.IntegrationTesting/data/server1.key",
+ "data/server1.pem": "../Grpc.IntegrationTesting/data/server1.pem",
"grpc_csharp_ext.x64.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"grpc_csharp_ext.x86.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"libgrpc_csharp_ext.x64.so": "../../../libs/opt/libgrpc_csharp_ext.so",
@@ -44,11 +48,6 @@
}
}
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.IntegrationTesting": {
@@ -59,12 +58,13 @@
"net45": { },
"netcoreapp1.0": {
"imports": [
- "portable-net45",
- "net45"
+ "portable-net45"
],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0"
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ }
}
}
}
diff --git a/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs b/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
index c17ede7561..ac6c8d0740 100644
--- a/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
+++ b/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
@@ -48,8 +48,6 @@ namespace Grpc.IntegrationTesting
{
TestService.TestServiceClient unimplementedClient = new UnimplementedTestServiceClient();
- // TODO: replace Moq by some mocking library with CoreCLR support.
-#if !NETCOREAPP1_0
[Test]
public void ExpandedParamOverloadCanBeMocked()
{
@@ -72,7 +70,6 @@ namespace Grpc.IntegrationTesting
Assert.AreSame(expected, mockClient.Object.UnaryCall(new SimpleRequest(), new CallOptions()));
}
-#endif
[Test]
public void DefaultMethodStubThrows_UnaryCall()
diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
index 7512d2a5d1..afd85fb484 100644
--- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
+++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
@@ -38,12 +38,6 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="CommandLine">
- <HintPath>..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath>
- </Reference>
- <Reference Include="Moq">
- <HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
@@ -51,18 +45,6 @@
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
- <Reference Include="Google.Apis.Auth">
- <HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.dll</HintPath>
- </Reference>
- <Reference Include="Google.Apis.Auth.PlatformServices">
- <HintPath>..\packages\Google.Apis.Auth.1.11.1\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
- </Reference>
- <Reference Include="Google.Apis.Core">
- <HintPath>..\packages\Google.Apis.Core.1.11.1\lib\net45\Google.Apis.Core.dll</HintPath>
- </Reference>
- <Reference Include="Google.Protobuf">
- <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
- </Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
@@ -75,6 +57,39 @@
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
+ <Reference Include="CommandLineParser.Unofficial">
+ <HintPath>..\packages\CommandLineParser.Unofficial.2.0.275\lib\net45\CommandLineParser.Unofficial.dll</HintPath>
+ </Reference>
+ <Reference Include="log4net">
+ <HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.Core">
+ <HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Zlib.Portable">
+ <HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.PlatformServices">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.Auth">
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.Auth.PlatformServices">
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
+ <Reference Include="Castle.Core">
+ <HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Moq">
+ <HintPath>..\packages\Moq.4.6.38-alpha\lib\net45\Moq.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs
index ec407d3fcf..79fd18b6d5 100644
--- a/src/csharp/Grpc.IntegrationTesting/InteropClient.cs
+++ b/src/csharp/Grpc.IntegrationTesting/InteropClient.cs
@@ -56,24 +56,24 @@ namespace Grpc.IntegrationTesting
{
private class ClientOptions
{
- [Option("server_host", DefaultValue = "127.0.0.1")]
+ [Option("server_host", Default = "127.0.0.1")]
public string ServerHost { get; set; }
- [Option("server_host_override", DefaultValue = TestCredentials.DefaultHostOverride)]
+ [Option("server_host_override", Default = TestCredentials.DefaultHostOverride)]
public string ServerHostOverride { get; set; }
[Option("server_port", Required = true)]
public int ServerPort { get; set; }
- [Option("test_case", DefaultValue = "large_unary")]
+ [Option("test_case", Default = "large_unary")]
public string TestCase { get; set; }
// Deliberately using nullable bool type to allow --use_tls=true syntax (as opposed to --use_tls)
- [Option("use_tls", DefaultValue = false)]
+ [Option("use_tls", Default = false)]
public bool? UseTls { get; set; }
// Deliberately using nullable bool type to allow --use_test_ca=true syntax (as opposed to --use_test_ca)
- [Option("use_test_ca", DefaultValue = false)]
+ [Option("use_test_ca", Default = false)]
public bool? UseTestCa { get; set; }
[Option("default_service_account", Required = false)]
@@ -84,19 +84,6 @@ namespace Grpc.IntegrationTesting
[Option("service_account_key_file", Required = false)]
public string ServiceAccountKeyFile { get; set; }
-
- [HelpOption]
- public string GetUsage()
- {
- var help = new HelpText
- {
- Heading = "gRPC C# interop testing client",
- AddDashesToOption = true
- };
- help.AddPreOptionsLine("Usage:");
- help.AddOptions(this);
- return help;
- }
}
ClientOptions options;
@@ -108,14 +95,13 @@ namespace Grpc.IntegrationTesting
public static void Run(string[] args)
{
- var options = new ClientOptions();
- if (!Parser.Default.ParseArguments(args, options))
- {
- Environment.Exit(1);
- }
-
- var interopClient = new InteropClient(options);
- interopClient.Run().Wait();
+ var parserResult = Parser.Default.ParseArguments<ClientOptions>(args)
+ .WithNotParsed(errors => Environment.Exit(1))
+ .WithParsed(options =>
+ {
+ var interopClient = new InteropClient(options);
+ interopClient.Run().Wait();
+ });
}
private async Task Run()
@@ -145,26 +131,16 @@ namespace Grpc.IntegrationTesting
if (options.TestCase == "jwt_token_creds")
{
-#if !NETCOREAPP1_0
var googleCredential = await GoogleCredential.GetApplicationDefaultAsync();
Assert.IsTrue(googleCredential.IsCreateScopedRequired);
credentials = ChannelCredentials.Create(credentials, googleCredential.ToCallCredentials());
-#else
- // TODO(jtattermusch): implement this
- throw new NotImplementedException("Not supported on CoreCLR yet");
-#endif
}
if (options.TestCase == "compute_engine_creds")
{
-#if !NETCOREAPP1_0
var googleCredential = await GoogleCredential.GetApplicationDefaultAsync();
Assert.IsFalse(googleCredential.IsCreateScopedRequired);
credentials = ChannelCredentials.Create(credentials, googleCredential.ToCallCredentials());
-#else
- // TODO(jtattermusch): implement this
- throw new NotImplementedException("Not supported on CoreCLR yet");
-#endif
}
return credentials;
}
@@ -395,7 +371,6 @@ namespace Grpc.IntegrationTesting
public static async Task RunOAuth2AuthTokenAsync(TestService.TestServiceClient client, string oauthScope)
{
-#if !NETCOREAPP1_0
Console.WriteLine("running oauth2_auth_token");
ITokenAccess credential = (await GoogleCredential.GetApplicationDefaultAsync()).CreateScoped(new[] { oauthScope });
string oauth2Token = await credential.GetAccessTokenForRequestAsync();
@@ -413,15 +388,10 @@ namespace Grpc.IntegrationTesting
Assert.True(oauthScope.Contains(response.OauthScope));
Assert.AreEqual(GetEmailFromServiceAccountFile(), response.Username);
Console.WriteLine("Passed!");
-#else
- // TODO(jtattermusch): implement this
- throw new NotImplementedException("Not supported on CoreCLR yet");
-#endif
}
public static async Task RunPerRpcCredsAsync(TestService.TestServiceClient client, string oauthScope)
{
-#if !NETCOREAPP1_0
Console.WriteLine("running per_rpc_creds");
ITokenAccess googleCredential = await GoogleCredential.GetApplicationDefaultAsync();
@@ -435,10 +405,6 @@ namespace Grpc.IntegrationTesting
Assert.AreEqual(GetEmailFromServiceAccountFile(), response.Username);
Console.WriteLine("Passed!");
-#else
- // TODO(jtattermusch): implement this
- throw new NotImplementedException("Not supported on CoreCLR yet");
-#endif
}
public static async Task RunCancelAfterBeginAsync(TestService.TestServiceClient client)
@@ -731,17 +697,12 @@ namespace Grpc.IntegrationTesting
// extracts the client_email field from service account file used for auth test cases
private static string GetEmailFromServiceAccountFile()
{
-#if !NETCOREAPP1_0
string keyFile = Environment.GetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS");
Assert.IsNotNull(keyFile);
var jobject = JObject.Parse(File.ReadAllText(keyFile));
string email = jobject.GetValue("client_email").Value<string>();
Assert.IsTrue(email.Length > 0); // spec requires nonempty client email.
return email;
-#else
- // TODO(jtattermusch): implement this
- throw new NotImplementedException("Not supported on CoreCLR yet");
-#endif
}
private static Metadata CreateTestMetadata()
diff --git a/src/csharp/Grpc.IntegrationTesting/InteropServer.cs b/src/csharp/Grpc.IntegrationTesting/InteropServer.cs
index cd47e31c2b..4118f99c2b 100644
--- a/src/csharp/Grpc.IntegrationTesting/InteropServer.cs
+++ b/src/csharp/Grpc.IntegrationTesting/InteropServer.cs
@@ -51,25 +51,12 @@ namespace Grpc.IntegrationTesting
{
private class ServerOptions
{
- [Option("port", DefaultValue = 8070)]
+ [Option("port", Default = 8070)]
public int Port { get; set; }
// Deliberately using nullable bool type to allow --use_tls=true syntax (as opposed to --use_tls)
- [Option("use_tls", DefaultValue = false)]
+ [Option("use_tls", Default = false)]
public bool? UseTls { get; set; }
-
- [HelpOption]
- public string GetUsage()
- {
- var help = new HelpText
- {
- Heading = "gRPC C# interop testing server",
- AddDashesToOption = true
- };
- help.AddPreOptionsLine("Usage:");
- help.AddOptions(this);
- return help;
- }
}
ServerOptions options;
@@ -81,14 +68,13 @@ namespace Grpc.IntegrationTesting
public static void Run(string[] args)
{
- var options = new ServerOptions();
- if (!Parser.Default.ParseArguments(args, options))
- {
- Environment.Exit(1);
- }
-
- var interopServer = new InteropServer(options);
- interopServer.Run();
+ var parserResult = Parser.Default.ParseArguments<ServerOptions>(args)
+ .WithNotParsed(errors => Environment.Exit(1))
+ .WithParsed(options =>
+ {
+ var interopServer = new InteropServer(options);
+ interopServer.Run();
+ });
}
private void Run()
diff --git a/src/csharp/Grpc.IntegrationTesting/QpsWorker.cs b/src/csharp/Grpc.IntegrationTesting/QpsWorker.cs
index a7c9fa894d..865556c242 100644
--- a/src/csharp/Grpc.IntegrationTesting/QpsWorker.cs
+++ b/src/csharp/Grpc.IntegrationTesting/QpsWorker.cs
@@ -52,21 +52,8 @@ namespace Grpc.IntegrationTesting
{
private class ServerOptions
{
- [Option("driver_port", DefaultValue = 0)]
+ [Option("driver_port", Default = 0)]
public int DriverPort { get; set; }
-
- [HelpOption]
- public string GetUsage()
- {
- var help = new HelpText
- {
- Heading = "gRPC C# performance testing worker",
- AddDashesToOption = true
- };
- help.AddPreOptionsLine("Usage:");
- help.AddOptions(this);
- return help;
- }
}
ServerOptions options;
@@ -78,14 +65,13 @@ namespace Grpc.IntegrationTesting
public static void Run(string[] args)
{
- var options = new ServerOptions();
- if (!Parser.Default.ParseArguments(args, options))
- {
- Environment.Exit(1);
- }
-
- var workerServer = new QpsWorker(options);
- workerServer.RunAsync().Wait();
+ var parserResult = Parser.Default.ParseArguments<ServerOptions>(args)
+ .WithNotParsed((x) => Environment.Exit(1))
+ .WithParsed(options =>
+ {
+ var workerServer = new QpsWorker(options);
+ workerServer.RunAsync().Wait();
+ });
}
private async Task RunAsync()
diff --git a/src/csharp/Grpc.IntegrationTesting/StressTestClient.cs b/src/csharp/Grpc.IntegrationTesting/StressTestClient.cs
index 74ee040ae4..750613b078 100644
--- a/src/csharp/Grpc.IntegrationTesting/StressTestClient.cs
+++ b/src/csharp/Grpc.IntegrationTesting/StressTestClient.cs
@@ -54,36 +54,23 @@ namespace Grpc.IntegrationTesting
private class ClientOptions
{
- [Option("server_addresses", DefaultValue = "localhost:8080")]
+ [Option("server_addresses", Default = "localhost:8080")]
public string ServerAddresses { get; set; }
- [Option("test_cases", DefaultValue = "large_unary:100")]
+ [Option("test_cases", Default = "large_unary:100")]
public string TestCases { get; set; }
- [Option("test_duration_secs", DefaultValue = -1)]
+ [Option("test_duration_secs", Default = -1)]
public int TestDurationSecs { get; set; }
- [Option("num_channels_per_server", DefaultValue = 1)]
+ [Option("num_channels_per_server", Default = 1)]
public int NumChannelsPerServer { get; set; }
- [Option("num_stubs_per_channel", DefaultValue = 1)]
+ [Option("num_stubs_per_channel", Default = 1)]
public int NumStubsPerChannel { get; set; }
- [Option("metrics_port", DefaultValue = 8081)]
+ [Option("metrics_port", Default = 8081)]
public int MetricsPort { get; set; }
-
- [HelpOption]
- public string GetUsage()
- {
- var help = new HelpText
- {
- Heading = "gRPC C# stress test client",
- AddDashesToOption = true
- };
- help.AddPreOptionsLine("Usage:");
- help.AddOptions(this);
- return help;
- }
}
ClientOptions options;
@@ -105,23 +92,21 @@ namespace Grpc.IntegrationTesting
public static void Run(string[] args)
{
- var options = new ClientOptions();
- if (!Parser.Default.ParseArguments(args, options))
- {
- Environment.Exit(1);
- }
-
- GrpcPreconditions.CheckArgument(options.NumChannelsPerServer > 0);
- GrpcPreconditions.CheckArgument(options.NumStubsPerChannel > 0);
+ var parserResult = Parser.Default.ParseArguments<ClientOptions>(args)
+ .WithNotParsed((x) => Environment.Exit(1))
+ .WithParsed(options => {
+ GrpcPreconditions.CheckArgument(options.NumChannelsPerServer > 0);
+ GrpcPreconditions.CheckArgument(options.NumStubsPerChannel > 0);
- var serverAddresses = options.ServerAddresses.Split(',');
- GrpcPreconditions.CheckArgument(serverAddresses.Length > 0, "You need to provide at least one server address");
+ var serverAddresses = options.ServerAddresses.Split(',');
+ GrpcPreconditions.CheckArgument(serverAddresses.Length > 0, "You need to provide at least one server address");
- var testCases = ParseWeightedTestCases(options.TestCases);
- GrpcPreconditions.CheckArgument(testCases.Count > 0, "You need to provide at least one test case");
+ var testCases = ParseWeightedTestCases(options.TestCases);
+ GrpcPreconditions.CheckArgument(testCases.Count > 0, "You need to provide at least one test case");
- var interopClient = new StressTestClient(options, serverAddresses.ToList(), testCases);
- interopClient.Run().Wait();
+ var interopClient = new StressTestClient(options, serverAddresses.ToList(), testCases);
+ interopClient.Run().Wait();
+ });
}
async Task Run()
diff --git a/src/csharp/Grpc.IntegrationTesting/packages.config b/src/csharp/Grpc.IntegrationTesting/packages.config
index e6e64e6558..a39fb3a23e 100644
--- a/src/csharp/Grpc.IntegrationTesting/packages.config
+++ b/src/csharp/Grpc.IntegrationTesting/packages.config
@@ -1,13 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
- <package id="CommandLineParser" version="1.9.71" targetFramework="net45" />
- <package id="Google.Apis.Auth" version="1.11.1" targetFramework="net45" />
- <package id="Google.Apis.Core" version="1.11.1" targetFramework="net45" />
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
- <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
- <package id="Moq" version="4.2.1510.2205" targetFramework="net45" />
+ <package id="Castle.Core" version="3.3.3" targetFramework="net45" />
+ <package id="CommandLineParser.Unofficial" version="2.0.275" targetFramework="net45" />
+ <package id="Google.Apis" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
+ <package id="log4net" version="2.0.3" targetFramework="net45" />
+ <package id="Moq" version="4.6.38-alpha" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" />
+ <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
+ <package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.IntegrationTesting/project.json b/src/csharp/Grpc.IntegrationTesting/project.json
index bb61a679c1..0225abb414 100644
--- a/src/csharp/Grpc.IntegrationTesting/project.json
+++ b/src/csharp/Grpc.IntegrationTesting/project.json
@@ -13,8 +13,10 @@
"includeFiles": [ "../Grpc.Core/Version.cs" ]
},
"copyToOutput": {
- "include": "data/*",
"mappings": {
+ "data/ca.pem": "../Grpc.IntegrationTesting/data/ca.pem",
+ "data/server1.key": "../Grpc.IntegrationTesting/data/server1.key",
+ "data/server1.pem": "../Grpc.IntegrationTesting/data/server1.pem",
"grpc_csharp_ext.x64.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll",
"grpc_csharp_ext.x86.dll": "../../../vsprojects/Debug/grpc_csharp_ext.dll",
"libgrpc_csharp_ext.x64.so": "../../../libs/dbg/libgrpc_csharp_ext.so",
@@ -33,8 +35,10 @@
"includeFiles": [ "../Grpc.Core/Version.cs" ]
},
"copyToOutput": {
- "include": "data/*",
"mappings": {
+ "data/ca.pem": "../Grpc.IntegrationTesting/data/ca.pem",
+ "data/server1.key": "../Grpc.IntegrationTesting/data/server1.key",
+ "data/server1.pem": "../Grpc.IntegrationTesting/data/server1.pem",
"grpc_csharp_ext.x64.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll",
"grpc_csharp_ext.x86.dll": "../../../vsprojects/Release/grpc_csharp_ext.dll",
"libgrpc_csharp_ext.x64.so": "../../../libs/opt/libgrpc_csharp_ext.so",
@@ -44,11 +48,6 @@
}
}
},
- "runtimes": {
- "win7-x64": { },
- "debian.8-x64": { },
- "osx.10.11-x64": { }
- },
"dependencies": {
"Grpc.Auth": {
@@ -57,16 +56,14 @@
"Grpc.Core": {
"target": "project"
},
- "Google.Protobuf": "3.0.0-beta3",
- "CommandLineParser": "1.9.71",
+ "Google.Protobuf": "3.0.0",
+ "CommandLineParser.Unofficial": "2.0.275",
+ "Moq": "4.6.38-alpha",
"NUnit": "3.2.0",
"NUnitLite": "3.2.0-*"
},
"frameworks": {
"net45": {
- "dependencies": {
- "Moq": "4.2.1510.2205"
- },
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": ""
@@ -74,12 +71,13 @@
},
"netcoreapp1.0": {
"imports": [
- "portable-net45",
- "net45"
+ "portable-net45"
],
"dependencies": {
- "Microsoft.NETCore.App": "1.0.0",
- "NETStandard.Library": "1.6.0",
+ "Microsoft.NETCore.App": {
+ "type": "platform",
+ "version": "1.0.0"
+ },
"System.Linq.Expressions": "4.1.0"
}
}
diff --git a/src/csharp/Grpc.Tools.nuspec b/src/csharp/Grpc.Tools.nuspec
index 31d1bed647..ba4e1d674c 100644
--- a/src/csharp/Grpc.Tools.nuspec
+++ b/src/csharp/Grpc.Tools.nuspec
@@ -16,17 +16,18 @@
<tags>gRPC RPC Protocol HTTP/2</tags>
</metadata>
<files>
- <file src="protoc_plugins\windows_x86\protoc.exe" target="tools\windows_x86\protoc.exe" />
- <file src="protoc_plugins\windows_x86\grpc_csharp_plugin.exe" target="tools\windows_x86\grpc_csharp_plugin.exe" />
- <file src="protoc_plugins\windows_x64\protoc.exe" target="tools\windows_x64\protoc.exe" />
- <file src="protoc_plugins\windows_x64\grpc_csharp_plugin.exe" target="tools\windows_x64\grpc_csharp_plugin.exe" />
- <file src="protoc_plugins\linux_x86\protoc" target="tools\linux_x86\protoc" />
- <file src="protoc_plugins\linux_x86\grpc_csharp_plugin" target="tools\linux_x86\grpc_csharp_plugin" />
- <file src="protoc_plugins\linux_x64\protoc" target="tools\linux_x64\protoc" />
- <file src="protoc_plugins\linux_x64\grpc_csharp_plugin" target="tools\linux_x64\grpc_csharp_plugin" />
- <file src="protoc_plugins\macosx_x86\protoc" target="tools\macosx_x86\protoc" />
- <file src="protoc_plugins\macosx_x86\grpc_csharp_plugin" target="tools\macosx_x86\grpc_csharp_plugin" />
- <file src="protoc_plugins\macosx_x64\protoc" target="tools\macosx_x64\protoc" />
- <file src="protoc_plugins\macosx_x64\grpc_csharp_plugin" target="tools\macosx_x64\grpc_csharp_plugin" />
+ <!-- forward slashes in src path enable building on Linux -->
+ <file src="protoc_plugins/windows_x86/protoc.exe" target="tools/windows_x86/protoc.exe" />
+ <file src="protoc_plugins/windows_x86/grpc_csharp_plugin.exe" target="tools/windows_x86/grpc_csharp_plugin.exe" />
+ <file src="protoc_plugins/windows_x64/protoc.exe" target="tools/windows_x64/protoc.exe" />
+ <file src="protoc_plugins/windows_x64/grpc_csharp_plugin.exe" target="tools/windows_x64/grpc_csharp_plugin.exe" />
+ <file src="protoc_plugins/linux_x86/protoc" target="tools/linux_x86/protoc" />
+ <file src="protoc_plugins/linux_x86/grpc_csharp_plugin" target="tools/linux_x86/grpc_csharp_plugin" />
+ <file src="protoc_plugins/linux_x64/protoc" target="tools/linux_x64/protoc" />
+ <file src="protoc_plugins/linux_x64/grpc_csharp_plugin" target="tools/linux_x64/grpc_csharp_plugin" />
+ <file src="protoc_plugins/macosx_x86/protoc" target="tools/macosx_x86/protoc" />
+ <file src="protoc_plugins/macosx_x86/grpc_csharp_plugin" target="tools/macosx_x86/grpc_csharp_plugin" />
+ <file src="protoc_plugins/macosx_x64/protoc" target="tools/macosx_x64/protoc" />
+ <file src="protoc_plugins/macosx_x64/grpc_csharp_plugin" target="tools/macosx_x64/grpc_csharp_plugin" />
</files>
</package>
diff --git a/src/csharp/README.md b/src/csharp/README.md
index 18d5945a8a..0405ff88a0 100644
--- a/src/csharp/README.md
+++ b/src/csharp/README.md
@@ -4,10 +4,13 @@ gRPC C#
A C# implementation of gRPC.
-Status
-------
+SUPPORTED PLATFORMS
+------------------
+
+- .NET Framework 4.5+ (Windows)
+- [.NET Core](https://dotnet.github.io/) on Linux, Windows and Mac OS X (starting from version 1.0.1)
+- Mono 4+ on Linux, Windows and Mac OS X
-Beta
PREREQUISITES
--------------
@@ -16,6 +19,7 @@ PREREQUISITES
- Linux: Mono 4+, MonoDevelop 5.9+ (with NuGet add-in installed)
- Mac OS X: Xamarin Studio 5.9+
+
HOW TO USE
--------------
@@ -69,12 +73,6 @@ different languages.
tools/run_tests/run_tests.py -l csharp
```
-ON .NET CORE SUPPORT
-------------------
-
-We are committed to providing full support for [.NET Core](https://dotnet.github.io/) in near future,
-but currently, the support is for .NET Core is experimental/work-in-progress.
-
DOCUMENTATION
-------------
- [API Reference][]
@@ -102,9 +100,7 @@ CONTENTS
THE NATIVE DEPENDENCY
---------------
-Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes its functionality via P/Invoke. `grpc_csharp_ext` library is a native extension library that facilitates this by wrapping some C core API into a form that's more digestible for P/Invoke.
-
-Prior to version 0.13, installing `grpc_csharp_ext` was required to make gRPC work on Linux and MacOS. Starting with version 0.13, we have improved the packaging story significantly and precompiled versions of the native library for all supported platforms are now shipped with the NuGet package. Just installing the `Grpc` NuGet package should be the only step needed to use gRPC C#, regardless of your platform (Windows, Linux or Mac) and the bitness (32 or 64bit).
+Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes its functionality via P/Invoke. The fact that a native library is used should be fully transparent to the users and just installing the `Grpc.Core` NuGet package is the only step needed to use gRPC C# on all supported platforms.
[API Reference]: http://www.grpc.io/grpc/csharp/
[Helloworld Example]: ../../examples/csharp/helloworld
diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat
index 9f544ff085..2b0e904225 100644
--- a/src/csharp/build_packages.bat
+++ b/src/csharp/build_packages.bat
@@ -29,8 +29,12 @@
@rem Builds gRPC NuGet packages
+@rem This way of building nuget packages is now obsolete. C# nuget packages
+@rem with CoreCLR support are now being built using the dotnet cli
+@rem in build_packages_dotnetcli.sh
+
@rem Current package versions
-set VERSION=1.0.0-pre2
+set VERSION=1.0.1-pre1
set PROTOBUF_VERSION=3.0.0
@rem Adjust the location of nuget.exe
@@ -77,8 +81,8 @@ endlocal
xcopy /Y /I *.nupkg ..\..\artifacts\
@rem create a zipfile with the artifacts as well
-powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets.zip');"
-xcopy /Y /I csharp_nugets.zip ..\..\artifacts\
+powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets_obsolete.zip');"
+xcopy /Y /I csharp_nugets_obsolete.zip ..\..\artifacts\
goto :EOF
diff --git a/src/csharp/build_packages_dotnetcli.sh b/src/csharp/build_packages_dotnetcli.sh
new file mode 100755
index 0000000000..2f26fd8911
--- /dev/null
+++ b/src/csharp/build_packages_dotnetcli.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+# 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.
+
+set -ex
+
+cd $(dirname $0)
+
+mkdir -p ../../artifacts/
+
+mkdir -p nativelibs/windows_x86 nativelibs/windows_x64 \
+ nativelibs/linux_x86 nativelibs/linux_x64 \
+ nativelibs/macosx_x86 nativelibs/macosx_x64
+
+mkdir -p protoc_plugins/windows_x86 protoc_plugins/windows_x64 \
+ protoc_plugins/linux_x86 protoc_plugins/linux_x64 \
+ protoc_plugins/macosx_x86 protoc_plugins/macosx_x64
+
+# Collect the artifacts built by the previous build step if running on Jenkins
+cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=windows/artifacts/* nativelibs/windows_x86 || true
+cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=windows/artifacts/* nativelibs/windows_x64 || true
+cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=linux/artifacts/* nativelibs/linux_x86 || true
+cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=linux/artifacts/* nativelibs/linux_x64 || true
+cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x86 || true
+cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x64 || true
+
+# Collect protoc artifacts built by the previous build step
+cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x86 || true
+cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x64 || true
+cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x86 || true
+cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x64 || true
+cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x86 || true
+cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x64 || true
+
+dotnet restore .
+
+dotnet pack --configuration Release Grpc.Core/project.json --output ../../artifacts
+dotnet pack --configuration Release Grpc.Auth/project.json --output ../../artifacts
+dotnet pack --configuration Release Grpc.HealthCheck/project.json --output ../../artifacts
+
+nuget pack Grpc.nuspec -Version "1.0.1-pre1" -OutputDirectory ../../artifacts
+nuget pack Grpc.Tools.nuspec -Version "1.0.1-pre1" -OutputDirectory ../../artifacts
+
+(cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg)
diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c
index c670ea65c7..068bf709b8 100644
--- a/src/csharp/ext/grpc_csharp_ext.c
+++ b/src/csharp/ext/grpc_csharp_ext.c
@@ -253,9 +253,12 @@ GPR_EXPORT intptr_t GPR_CALLTYPE grpcsharp_batch_context_recv_message_length(
if (!ctx->recv_message) {
return -1;
}
- /* TODO(issue:#7206): check return value of grpc_byte_buffer_reader_init. */
- grpc_byte_buffer_reader_init(&reader, ctx->recv_message);
- return (intptr_t)grpc_byte_buffer_length(reader.buffer_out);
+
+ GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, ctx->recv_message));
+ intptr_t result = (intptr_t)grpc_byte_buffer_length(reader.buffer_out);
+ grpc_byte_buffer_reader_destroy(&reader);
+
+ return result;
}
/*
@@ -268,8 +271,7 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_batch_context_recv_message_to_buffer(
gpr_slice slice;
size_t offset = 0;
- /* TODO(issue:#7206): check return value of grpc_byte_buffer_reader_init. */
- grpc_byte_buffer_reader_init(&reader, ctx->recv_message);
+ GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, ctx->recv_message));
while (grpc_byte_buffer_reader_next(&reader, &slice)) {
size_t len = GPR_SLICE_LENGTH(slice);
@@ -279,6 +281,8 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_batch_context_recv_message_to_buffer(
offset += len;
gpr_slice_unref(slice);
}
+
+ grpc_byte_buffer_reader_destroy(&reader);
}
GPR_EXPORT grpc_status_code GPR_CALLTYPE
diff --git a/src/node/README.md b/src/node/README.md
index 15d4c6d02f..fc407435cd 100644
--- a/src/node/README.md
+++ b/src/node/README.md
@@ -1,9 +1,6 @@
[![npm](https://img.shields.io/npm/v/grpc.svg)](https://www.npmjs.com/package/grpc)
# Node.js gRPC Library
-## Status
-Beta
-
## PREREQUISITES
- `node`: This requires `node` to be installed, version `0.12` or above. If you instead have the `nodejs` executable on Debian, you should install the [`nodejs-legacy`](https://packages.debian.org/sid/nodejs-legacy) package.
diff --git a/src/node/ext/node_grpc.cc b/src/node/ext/node_grpc.cc
index ec81356761..848c601587 100644
--- a/src/node/ext/node_grpc.cc
+++ b/src/node/ext/node_grpc.cc
@@ -261,10 +261,10 @@ void InitLogConstants(Local<Object> exports) {
Nan::HandleScope scope;
Local<Object> log_verbosity = Nan::New<Object>();
Nan::Set(exports, Nan::New("logVerbosity").ToLocalChecked(), log_verbosity);
- Local<Value> DEBUG_LOG(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_DEBUG));
- Nan::Set(log_verbosity, Nan::New("DEBUG").ToLocalChecked(), DEBUG_LOG);
- Local<Value> INFO(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_INFO));
- Nan::Set(log_verbosity, Nan::New("INFO").ToLocalChecked(), INFO);
+ Local<Value> LOG_DEBUG(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_DEBUG));
+ Nan::Set(log_verbosity, Nan::New("DEBUG").ToLocalChecked(), LOG_DEBUG);
+ Local<Value> LOG_INFO(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_INFO));
+ Nan::Set(log_verbosity, Nan::New("INFO").ToLocalChecked(), LOG_INFO);
Local<Value> LOG_ERROR(Nan::New<Uint32, uint32_t>(GPR_LOG_SEVERITY_ERROR));
Nan::Set(log_verbosity, Nan::New("ERROR").ToLocalChecked(), LOG_ERROR);
}
diff --git a/src/node/health_check/package.json b/src/node/health_check/package.json
index 224e4ad6ca..7e5dbb556b 100644
--- a/src/node/health_check/package.json
+++ b/src/node/health_check/package.json
@@ -1,6 +1,6 @@
{
"name": "grpc-health-check",
- "version": "1.0.0-pre2",
+ "version": "1.0.1-pre1",
"author": "Google Inc.",
"description": "Health check service for use with gRPC",
"repository": {
@@ -15,7 +15,7 @@
}
],
"dependencies": {
- "grpc": "^1.0.0-pre2",
+ "grpc": "^1.0.1-pre1",
"lodash": "^3.9.3",
"google-protobuf": "^3.0.0"
},
diff --git a/src/node/tools/package.json b/src/node/tools/package.json
index 8ae5174178..fd22e752cf 100644
--- a/src/node/tools/package.json
+++ b/src/node/tools/package.json
@@ -1,6 +1,6 @@
{
"name": "grpc-tools",
- "version": "1.0.0-pre2",
+ "version": "1.0.1-pre1",
"author": "Google Inc.",
"description": "Tools for developing with gRPC on Node.js",
"homepage": "http://www.grpc.io/",
diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
index 07d62d2047..3ec4a313e8 100644
--- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
+++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec
@@ -36,8 +36,8 @@ Pod::Spec.new do |s|
# exclamation mark ensures that other "regular" pods will be able to find it as it'll be installed
# before them.
s.name = '!ProtoCompiler-gRPCPlugin'
- v = '1.0.0-pre1'
- s.version = "#{v}.2" # .2 to depend on protoc 3.0.0
+ v = '1.0.1-pre1'
+ s.version = v
s.summary = 'The gRPC ProtoC plugin generates Objective-C files from .proto services.'
s.description = <<-DESC
This podspec only downloads the gRPC protoc plugin so that local pods generating protos can use
@@ -82,10 +82,9 @@ Pod::Spec.new do |s|
s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }
repo = 'grpc/grpc'
- release = "objective-c-v#{v}"
file = "grpc_objective_c_plugin-#{v}-macos-x86_64.zip"
s.source = {
- :http => "https://github.com/#{repo}/releases/download/#{release}/#{file}",
+ :http => "https://github.com/#{repo}/releases/download/v#{v}/#{file}",
# TODO(jcanizales): Add sha1 or sha256
# :sha1 => '??',
}
diff --git a/src/objective-c/BoringSSL.podspec b/src/objective-c/BoringSSL.podspec
index b759997c11..47b5b1a2e7 100644
--- a/src/objective-c/BoringSSL.podspec
+++ b/src/objective-c/BoringSSL.podspec
@@ -31,7 +31,7 @@
Pod::Spec.new do |s|
s.name = 'BoringSSL'
- version = '5.0'
+ version = '7.0'
s.version = version
s.summary = 'BoringSSL is a fork of OpenSSL that is designed to meet Google’s needs.'
# Adapted from the homepage:
@@ -70,7 +70,7 @@ Pod::Spec.new do |s|
s.source = {
:git => 'https://boringssl.googlesource.com/boringssl',
:tag => "version_for_cocoapods_#{version}",
- # :commit => '8d343b44bbab829d1a28fdef650ca95f7db4412e',
+ # :commit => '4fec04b48406111cb88fdd8d196253adc54f7a31',
}
name = 'openssl'
@@ -388,42 +388,42 @@ Pod::Spec.new do |s|
0x28340c19,
0x283480ac,
0x283500ea,
- 0x2c3227cb,
- 0x2c32a7d9,
- 0x2c3327eb,
- 0x2c33a7fd,
- 0x2c342811,
- 0x2c34a823,
- 0x2c35283e,
- 0x2c35a850,
- 0x2c362863,
+ 0x2c322910,
+ 0x2c32a91e,
+ 0x2c332930,
+ 0x2c33a942,
+ 0x2c342956,
+ 0x2c34a968,
+ 0x2c352983,
+ 0x2c35a995,
+ 0x2c3629a8,
0x2c36832d,
- 0x2c372870,
- 0x2c37a882,
- 0x2c382895,
- 0x2c38a8ac,
- 0x2c3928ba,
- 0x2c39a8ca,
- 0x2c3a28dc,
- 0x2c3aa8f0,
- 0x2c3b2901,
- 0x2c3ba920,
- 0x2c3c2934,
- 0x2c3ca94a,
- 0x2c3d2963,
- 0x2c3da980,
- 0x2c3e2991,
- 0x2c3ea99f,
- 0x2c3f29b7,
- 0x2c3fa9cf,
- 0x2c4029dc,
+ 0x2c3729b5,
+ 0x2c37a9c7,
+ 0x2c3829da,
+ 0x2c38a9f1,
+ 0x2c3929ff,
+ 0x2c39aa0f,
+ 0x2c3a2a21,
+ 0x2c3aaa35,
+ 0x2c3b2a46,
+ 0x2c3baa65,
+ 0x2c3c2a79,
+ 0x2c3caa8f,
+ 0x2c3d2aa8,
+ 0x2c3daac5,
+ 0x2c3e2ad6,
+ 0x2c3eaae4,
+ 0x2c3f2afc,
+ 0x2c3fab14,
+ 0x2c402b21,
0x2c4090e7,
- 0x2c4129ed,
- 0x2c41aa00,
+ 0x2c412b32,
+ 0x2c41ab45,
0x2c4210c0,
- 0x2c42aa11,
+ 0x2c42ab56,
0x2c430720,
- 0x2c43a912,
+ 0x2c43aa57,
0x30320000,
0x30328015,
0x3033001f,
@@ -576,169 +576,183 @@ Pod::Spec.new do |s|
0x403b9861,
0x403c0064,
0x403c8083,
- 0x403d186d,
- 0x403d9883,
- 0x403e1892,
- 0x403e98a5,
- 0x403f18bf,
- 0x403f98cd,
- 0x404018e2,
- 0x404098f6,
- 0x40411913,
- 0x4041992e,
- 0x40421947,
- 0x4042995a,
- 0x4043196e,
- 0x40439986,
- 0x4044199d,
+ 0x403d18aa,
+ 0x403d98c0,
+ 0x403e18cf,
+ 0x403e98e2,
+ 0x403f18fc,
+ 0x403f990a,
+ 0x4040191f,
+ 0x40409933,
+ 0x40411950,
+ 0x4041996b,
+ 0x40421984,
+ 0x40429997,
+ 0x404319ab,
+ 0x404399c3,
+ 0x404419da,
0x404480ac,
- 0x404519b2,
- 0x404599c4,
- 0x404619e8,
- 0x40469a08,
- 0x40471a16,
- 0x40479a3d,
- 0x40481a52,
- 0x40489a6b,
- 0x40491a82,
- 0x40499a9c,
- 0x404a1ab3,
- 0x404a9ad1,
- 0x404b1ae9,
- 0x404b9b00,
- 0x404c1b16,
- 0x404c9b28,
- 0x404d1b49,
- 0x404d9b6b,
- 0x404e1b7f,
- 0x404e9b8c,
- 0x404f1ba3,
- 0x404f9bb3,
- 0x40501bdd,
- 0x40509bf1,
- 0x40511c0c,
- 0x40519c1c,
- 0x40521c33,
- 0x40529c45,
- 0x40531c5d,
- 0x40539c70,
- 0x40541c85,
- 0x40549ca8,
- 0x40551cb6,
- 0x40559cd3,
- 0x40561ce0,
- 0x40569cf9,
- 0x40571d11,
- 0x40579d24,
- 0x40581d39,
- 0x40589d4b,
- 0x40591d7a,
- 0x40599d93,
- 0x405a1da7,
- 0x405a9db7,
- 0x405b1dcf,
- 0x405b9de0,
- 0x405c1df3,
- 0x405c9e04,
- 0x405d1e11,
- 0x405d9e28,
- 0x405e1e48,
+ 0x404519ef,
+ 0x40459a01,
+ 0x40461a25,
+ 0x40469a45,
+ 0x40471a53,
+ 0x40479a7a,
+ 0x40481ab7,
+ 0x40489ad0,
+ 0x40491ae7,
+ 0x40499b01,
+ 0x404a1b18,
+ 0x404a9b36,
+ 0x404b1b4e,
+ 0x404b9b65,
+ 0x404c1b7b,
+ 0x404c9b8d,
+ 0x404d1bae,
+ 0x404d9bd0,
+ 0x404e1be4,
+ 0x404e9bf1,
+ 0x404f1c1e,
+ 0x404f9c47,
+ 0x40501c71,
+ 0x40509c85,
+ 0x40511ca0,
+ 0x40519cb0,
+ 0x40521cc7,
+ 0x40529ceb,
+ 0x40531d03,
+ 0x40539d16,
+ 0x40541d2b,
+ 0x40549d4e,
+ 0x40551d5c,
+ 0x40559d79,
+ 0x40561d86,
+ 0x40569d9f,
+ 0x40571db7,
+ 0x40579dca,
+ 0x40581ddf,
+ 0x40589e06,
+ 0x40591e35,
+ 0x40599e62,
+ 0x405a1e76,
+ 0x405a9e86,
+ 0x405b1e9e,
+ 0x405b9eaf,
+ 0x405c1ec2,
+ 0x405c9ee3,
+ 0x405d1ef0,
+ 0x405d9f07,
+ 0x405e1f27,
0x405e8a95,
- 0x405f1e69,
- 0x405f9e76,
- 0x40601e84,
- 0x40609ea6,
- 0x40611ece,
- 0x40619ee3,
- 0x40621efa,
- 0x40629f0b,
- 0x40631f1c,
- 0x40639f31,
- 0x40641f48,
- 0x40649f59,
- 0x40651f74,
- 0x40659f8b,
- 0x40661fa3,
- 0x40669fcd,
- 0x40671ff8,
- 0x4067a019,
- 0x4068202c,
- 0x4068a04d,
- 0x4069207f,
- 0x4069a0ad,
- 0x406a20ce,
- 0x406aa0ee,
- 0x406b2276,
- 0x406ba299,
- 0x406c22af,
- 0x406ca4db,
- 0x406d250a,
- 0x406da532,
- 0x406e254b,
- 0x406ea563,
- 0x406f2582,
- 0x406fa597,
- 0x407025aa,
- 0x4070a5c7,
+ 0x405f1f48,
+ 0x405f9f55,
+ 0x40601f63,
+ 0x40609f85,
+ 0x40611fad,
+ 0x40619fc2,
+ 0x40621fd9,
+ 0x40629fea,
+ 0x40631ffb,
+ 0x4063a010,
+ 0x40642027,
+ 0x4064a053,
+ 0x4065206e,
+ 0x4065a085,
+ 0x4066209d,
+ 0x4066a0c7,
+ 0x406720f2,
+ 0x4067a113,
+ 0x40682126,
+ 0x4068a147,
+ 0x40692179,
+ 0x4069a1a7,
+ 0x406a21c8,
+ 0x406aa1e8,
+ 0x406b2370,
+ 0x406ba393,
+ 0x406c23a9,
+ 0x406ca60b,
+ 0x406d263a,
+ 0x406da662,
+ 0x406e2690,
+ 0x406ea6a8,
+ 0x406f26c7,
+ 0x406fa6dc,
+ 0x407026ef,
+ 0x4070a70c,
0x40710800,
- 0x4071a5d9,
- 0x407225ec,
- 0x4072a605,
- 0x4073261d,
+ 0x4071a71e,
+ 0x40722731,
+ 0x4072a74a,
+ 0x40732762,
0x4073936d,
- 0x40742631,
- 0x4074a64b,
- 0x4075265c,
- 0x4075a670,
- 0x4076267e,
+ 0x40742776,
+ 0x4074a790,
+ 0x407527a1,
+ 0x4075a7b5,
+ 0x407627c3,
0x407691aa,
- 0x407726a3,
- 0x4077a6c5,
- 0x407826e0,
- 0x4078a719,
- 0x40792730,
- 0x4079a746,
- 0x407a2752,
- 0x407aa765,
- 0x407b277a,
- 0x407ba78c,
- 0x407c27a1,
- 0x407ca7aa,
- 0x407d2068,
- 0x407d9bc3,
- 0x407e26f5,
- 0x407e9d5b,
- 0x407f1a2a,
- 0x41f421a1,
- 0x41f92233,
- 0x41fe2126,
- 0x41fea302,
- 0x41ff23f3,
- 0x420321ba,
- 0x420821dc,
- 0x4208a218,
- 0x4209210a,
- 0x4209a252,
- 0x420a2161,
- 0x420aa141,
- 0x420b2181,
- 0x420ba1fa,
- 0x420c240f,
- 0x420ca2cf,
- 0x420d22e9,
- 0x420da320,
- 0x4212233a,
- 0x421723d6,
- 0x4217a37c,
- 0x421c239e,
- 0x421f2359,
- 0x42212426,
- 0x422623b9,
- 0x422b24bf,
- 0x422ba488,
- 0x422c24a7,
- 0x422ca462,
- 0x422d2441,
+ 0x407727e8,
+ 0x4077a80a,
+ 0x40782825,
+ 0x4078a85e,
+ 0x40792875,
+ 0x4079a88b,
+ 0x407a2897,
+ 0x407aa8aa,
+ 0x407b28bf,
+ 0x407ba8d1,
+ 0x407c28e6,
+ 0x407ca8ef,
+ 0x407d2162,
+ 0x407d9c57,
+ 0x407e283a,
+ 0x407e9e16,
+ 0x407f1a67,
+ 0x407f9887,
+ 0x40801c2e,
+ 0x40809a8f,
+ 0x40811cd9,
+ 0x40819c08,
+ 0x4082267b,
+ 0x4082986d,
+ 0x40831df1,
+ 0x4083a038,
+ 0x40841aa3,
+ 0x40849e4e,
+ 0x40851ed3,
+ 0x41f4229b,
+ 0x41f9232d,
+ 0x41fe2220,
+ 0x41fea3fc,
+ 0x41ff24ed,
+ 0x420322b4,
+ 0x420822d6,
+ 0x4208a312,
+ 0x42092204,
+ 0x4209a34c,
+ 0x420a225b,
+ 0x420aa23b,
+ 0x420b227b,
+ 0x420ba2f4,
+ 0x420c2509,
+ 0x420ca3c9,
+ 0x420d23e3,
+ 0x420da41a,
+ 0x42122434,
+ 0x421724d0,
+ 0x4217a476,
+ 0x421c2498,
+ 0x421f2453,
+ 0x42212520,
+ 0x422624b3,
+ 0x422b25ef,
+ 0x422ba59d,
+ 0x422c25d7,
+ 0x422ca55c,
+ 0x422d253b,
+ 0x422da5bc,
+ 0x422e2582,
0x4432072b,
0x4432873a,
0x44330746,
@@ -781,69 +795,69 @@ Pod::Spec.new do |s|
0x4c3d136d,
0x4c3d937c,
0x4c3e1389,
- 0x50322a23,
- 0x5032aa32,
- 0x50332a3d,
- 0x5033aa4d,
- 0x50342a66,
- 0x5034aa80,
- 0x50352a8e,
- 0x5035aaa4,
- 0x50362ab6,
- 0x5036aacc,
- 0x50372ae5,
- 0x5037aaf8,
- 0x50382b10,
- 0x5038ab21,
- 0x50392b36,
- 0x5039ab4a,
- 0x503a2b6a,
- 0x503aab80,
- 0x503b2b98,
- 0x503babaa,
- 0x503c2bc6,
- 0x503cabdd,
- 0x503d2bf6,
- 0x503dac0c,
- 0x503e2c19,
- 0x503eac2f,
- 0x503f2c41,
+ 0x50322b68,
+ 0x5032ab77,
+ 0x50332b82,
+ 0x5033ab92,
+ 0x50342bab,
+ 0x5034abc5,
+ 0x50352bd3,
+ 0x5035abe9,
+ 0x50362bfb,
+ 0x5036ac11,
+ 0x50372c2a,
+ 0x5037ac3d,
+ 0x50382c55,
+ 0x5038ac66,
+ 0x50392c7b,
+ 0x5039ac8f,
+ 0x503a2caf,
+ 0x503aacc5,
+ 0x503b2cdd,
+ 0x503bacef,
+ 0x503c2d0b,
+ 0x503cad22,
+ 0x503d2d3b,
+ 0x503dad51,
+ 0x503e2d5e,
+ 0x503ead74,
+ 0x503f2d86,
0x503f8382,
- 0x50402c54,
- 0x5040ac64,
- 0x50412c7e,
- 0x5041ac8d,
- 0x50422ca7,
- 0x5042acc4,
- 0x50432cd4,
- 0x5043ace4,
- 0x50442cf3,
+ 0x50402d99,
+ 0x5040ada9,
+ 0x50412dc3,
+ 0x5041add2,
+ 0x50422dec,
+ 0x5042ae09,
+ 0x50432e19,
+ 0x5043ae29,
+ 0x50442e38,
0x5044843f,
- 0x50452d07,
- 0x5045ad25,
- 0x50462d38,
- 0x5046ad4e,
- 0x50472d60,
- 0x5047ad75,
- 0x50482d9b,
- 0x5048ada9,
- 0x50492dbc,
- 0x5049add1,
- 0x504a2de7,
- 0x504aadf7,
- 0x504b2e17,
- 0x504bae2a,
- 0x504c2e4d,
- 0x504cae7b,
- 0x504d2e8d,
- 0x504daeaa,
- 0x504e2ec5,
- 0x504eaee1,
- 0x504f2ef3,
- 0x504faf0a,
- 0x50502f19,
+ 0x50452e4c,
+ 0x5045ae6a,
+ 0x50462e7d,
+ 0x5046ae93,
+ 0x50472ea5,
+ 0x5047aeba,
+ 0x50482ee0,
+ 0x5048aeee,
+ 0x50492f01,
+ 0x5049af16,
+ 0x504a2f2c,
+ 0x504aaf3c,
+ 0x504b2f5c,
+ 0x504baf6f,
+ 0x504c2f92,
+ 0x504cafc0,
+ 0x504d2fd2,
+ 0x504dafef,
+ 0x504e300a,
+ 0x504eb026,
+ 0x504f3038,
+ 0x504fb04f,
+ 0x5050305e,
0x505086ef,
- 0x50512f2c,
+ 0x50513071,
0x58320ec9,
0x68320e8b,
0x68328c25,
@@ -1204,6 +1218,8 @@ Pod::Spec.new do |s|
"BAD_SSL_FILETYPE\\0"
"BAD_WRITE_RETRY\\0"
"BIO_NOT_SET\\0"
+ "BLOCK_CIPHER_PAD_IS_WRONG\\0"
+ "BUFFERED_MESSAGES_ON_CIPHER_CHANGE\\0"
"CA_DN_LENGTH_MISMATCH\\0"
"CA_DN_TOO_LONG\\0"
"CCS_RECEIVED_EARLY\\0"
@@ -1226,6 +1242,8 @@ Pod::Spec.new do |s|
"DIGEST_CHECK_FAILED\\0"
"DOWNGRADE_DETECTED\\0"
"DTLS_MESSAGE_TOO_BIG\\0"
+ "DUPLICATE_EXTENSION\\0"
+ "DUPLICATE_KEY_SHARE\\0"
"ECC_CERT_NOT_FOR_SIGNING\\0"
"EMS_STATE_INCONSISTENT\\0"
"ENCRYPTED_LENGTH_TOO_LONG\\0"
@@ -1240,7 +1258,9 @@ Pod::Spec.new do |s|
"HTTPS_PROXY_REQUEST\\0"
"HTTP_REQUEST\\0"
"INAPPROPRIATE_FALLBACK\\0"
+ "INVALID_ALPN_PROTOCOL\\0"
"INVALID_COMMAND\\0"
+ "INVALID_COMPRESSION_LIST\\0"
"INVALID_MESSAGE\\0"
"INVALID_OUTER_RECORD_TYPE\\0"
"INVALID_SSL_SESSION\\0"
@@ -1248,6 +1268,7 @@ Pod::Spec.new do |s|
"LENGTH_MISMATCH\\0"
"LIBRARY_HAS_NO_CIPHERS\\0"
"MISSING_EXTENSION\\0"
+ "MISSING_KEY_SHARE\\0"
"MISSING_RSA_CERTIFICATE\\0"
"MISSING_TMP_DH_KEY\\0"
"MISSING_TMP_ECDH_KEY\\0"
@@ -1260,15 +1281,18 @@ Pod::Spec.new do |s|
"NO_CERTIFICATE_SET\\0"
"NO_CIPHERS_AVAILABLE\\0"
"NO_CIPHERS_PASSED\\0"
+ "NO_CIPHERS_SPECIFIED\\0"
"NO_CIPHER_MATCH\\0"
"NO_COMMON_SIGNATURE_ALGORITHMS\\0"
"NO_COMPRESSION_SPECIFIED\\0"
+ "NO_GROUPS_SPECIFIED\\0"
"NO_METHOD_SPECIFIED\\0"
"NO_P256_SUPPORT\\0"
"NO_PRIVATE_KEY_ASSIGNED\\0"
"NO_RENEGOTIATION\\0"
"NO_REQUIRED_DIGEST\\0"
"NO_SHARED_CIPHER\\0"
+ "NO_SHARED_GROUP\\0"
"NULL_SSL_CTX\\0"
"NULL_SSL_METHOD_PASSED\\0"
"OLD_SESSION_CIPHER_NOT_RETURNED\\0"
@@ -1284,6 +1308,7 @@ Pod::Spec.new do |s|
"READ_TIMEOUT_EXPIRED\\0"
"RECORD_LENGTH_MISMATCH\\0"
"RECORD_TOO_LARGE\\0"
+ "RENEGOTIATION_EMS_MISMATCH\\0"
"RENEGOTIATION_ENCODING_ERR\\0"
"RENEGOTIATION_MISMATCH\\0"
"REQUIRED_CIPHER_MISSING\\0"
@@ -1328,12 +1353,15 @@ Pod::Spec.new do |s|
"TLSV1_ALERT_USER_CANCELLED\\0"
"TLSV1_BAD_CERTIFICATE_HASH_VALUE\\0"
"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE\\0"
+ "TLSV1_CERTIFICATE_REQUIRED\\0"
"TLSV1_CERTIFICATE_UNOBTAINABLE\\0"
+ "TLSV1_UNKNOWN_PSK_IDENTITY\\0"
"TLSV1_UNRECOGNIZED_NAME\\0"
"TLSV1_UNSUPPORTED_EXTENSION\\0"
"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST\\0"
"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG\\0"
"TOO_MANY_EMPTY_FRAGMENTS\\0"
+ "TOO_MANY_KEY_UPDATES\\0"
"TOO_MANY_WARNING_ALERTS\\0"
"UNABLE_TO_FIND_ECDH_PARAMETERS\\0"
"UNEXPECTED_EXTENSION\\0"
diff --git a/src/objective-c/CronetFramework.podspec b/src/objective-c/CronetFramework.podspec
index 3ebcacf055..2f47b02c0c 100644
--- a/src/objective-c/CronetFramework.podspec
+++ b/src/objective-c/CronetFramework.podspec
@@ -30,14 +30,47 @@
Pod::Spec.new do |s|
s.name = "CronetFramework"
- s.version = "0.0.2"
+ s.version = "0.0.3"
s.summary = "Cronet, precompiled and used as a framework."
s.homepage = "http://chromium.org"
- s.license = { :type => 'BSD' }
+ s.license = {
+ :type => 'BSD',
+ :text => <<-LICENSE
+ Copyright 2015, Google Inc.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ * Neither the name of Google Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ LICENSE
+ }
s.vendored_framework = "Cronet.framework"
s.author = "The Chromium Authors"
- s.ios.deployment_target = "7.1"
+ s.ios.deployment_target = "8.0"
s.source = { :http => 'https://storage.googleapis.com/grpc-precompiled-binaries/cronet/Cronet.framework.zip' }
s.preserve_paths = "Cronet.framework"
s.public_header_files = "Cronet.framework/Headers/**/*{.h}"
+ s.source_files = "Cronet.framework/Headers/**/*{.h}"
end
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index da9473f9a2..b5d8309787 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -103,6 +103,11 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey";
@synthesize state = _state;
+// TODO(jcanizales): If grpc_init is idempotent, this should be changed from load to initialize.
++ (void)load {
+ grpc_init();
+}
+
- (instancetype)init {
return [self initWithHost:nil path:nil requestsWriter:nil];
}
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index 477ddf51d9..b57c54b6ce 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
// TODO(jcanizales): Generate the version in a standalone header, from templates. Like
// templates/src/core/surface/version.c.template .
-#define GRPC_OBJC_VERSION_STRING @"1.0.0-pre1"
+#define GRPC_OBJC_VERSION_STRING @"1.0.0"
static NSMutableDictionary *kHostCache;
@@ -219,6 +219,8 @@ static NSMutableDictionary *kHostCache;
if (_responseSizeLimitOverride) {
args[@GRPC_ARG_MAX_MESSAGE_LENGTH] = _responseSizeLimitOverride;
}
+ // Use 10000ms initial backoff time for correct behavior on bad/slow networks
+ args[@GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS] = @10000;
return args;
}
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
index 97f6b89340..1339429660 100644
--- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
+++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
@@ -245,11 +245,6 @@
}
if (self = [super init]) {
- static dispatch_once_t initialization;
- dispatch_once(&initialization, ^{
- grpc_init();
- });
-
// Each completion queue consumes one thread. There's a trade to be made between creating and
// consuming too many threads and having contention of multiple calls in a single completion
// queue. Currently we use a singleton queue.
diff --git a/src/objective-c/README.md b/src/objective-c/README.md
index 909b12bab2..3624475b9c 100644
--- a/src/objective-c/README.md
+++ b/src/objective-c/README.md
@@ -48,7 +48,7 @@ Pod::Spec.new do |s|
src = '.'
# We'll use protoc with the gRPC plugin.
- s.dependency '!ProtoCompiler-gRPCPlugin', '~> 1.0.0-pre1.2'
+ s.dependency '!ProtoCompiler-gRPCPlugin', '~> 1.0'
# Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
pods_root = '<path to your Podfile>/Pods'
@@ -82,10 +82,6 @@ Pod::Spec.new do |s|
ms.requires_arc = false
# The generated files depend on the protobuf runtime.
ms.dependency 'Protobuf'
- # This is needed by all pods that depend on Protobuf:
- ms.pod_target_xcconfig = {
- 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
- }
end
# The --objcgrpc_out plugin generates a pair of .pbrpc.h/.pbrpc.m files for each .proto file with
@@ -98,6 +94,13 @@ Pod::Spec.new do |s|
ss.dependency 'gRPC-ProtoRPC'
ss.dependency "#{s.name}/Messages"
end
+
+ s.pod_target_xcconfig = {
+ # This is needed by all pods that depend on Protobuf:
+ 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
+ # This is needed by all pods that depend on gRPC-RxLibrary:
+ 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
+ }
end
```
diff --git a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
index 974a6765c7..ea6181316a 100644
--- a/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
+++ b/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.9'
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
- s.dependency "!ProtoCompiler-gRPCPlugin", "~> 1.0.0-pre1.2"
+ s.dependency "!ProtoCompiler-gRPCPlugin"
repo_root = '../../../..'
bin_dir = "#{repo_root}/bins/$CONFIG"
@@ -35,10 +35,6 @@ Pod::Spec.new do |s|
ms.header_mappings_dir = '.'
ms.requires_arc = false
ms.dependency 'Protobuf'
- # This is needed by all pods that depend on Protobuf:
- ms.pod_target_xcconfig = {
- 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
- }
end
s.subspec 'Services' do |ss|
@@ -48,4 +44,11 @@ Pod::Spec.new do |s|
ss.dependency 'gRPC-ProtoRPC'
ss.dependency "#{s.name}/Messages"
end
+
+ s.pod_target_xcconfig = {
+ # This is needed by all pods that depend on Protobuf:
+ 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
+ # This is needed by all pods that depend on gRPC-RxLibrary:
+ 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
+ }
end
diff --git a/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec b/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec
index 3d28234fa2..2e0a050b0c 100644
--- a/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec
+++ b/src/objective-c/tests/RemoteTestClient/RemoteTest.podspec
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.9'
# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
- s.dependency "!ProtoCompiler-gRPCPlugin", "~> 1.0.0-pre1.2"
+ s.dependency "!ProtoCompiler-gRPCPlugin"
repo_root = '../../../..'
bin_dir = "#{repo_root}/bins/$CONFIG"
@@ -35,10 +35,6 @@ Pod::Spec.new do |s|
ms.header_mappings_dir = "."
ms.requires_arc = false
ms.dependency "Protobuf"
- # This is needed by all pods that depend on Protobuf:
- ms.pod_target_xcconfig = {
- 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
- }
end
s.subspec "Services" do |ss|
@@ -48,4 +44,11 @@ Pod::Spec.new do |s|
ss.dependency "gRPC-ProtoRPC"
ss.dependency "#{s.name}/Messages"
end
+
+ s.pod_target_xcconfig = {
+ # This is needed by all pods that depend on Protobuf:
+ 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
+ # This is needed by all pods that depend on gRPC-RxLibrary:
+ 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
+ }
end
diff --git a/src/php/README.md b/src/php/README.md
index 7e9819b256..f2ad96f7a8 100644
--- a/src/php/README.md
+++ b/src/php/README.md
@@ -3,10 +3,6 @@
This directory contains source code for PHP implementation of gRPC layered on shared C library.
-#Status
-
-GA
-
## Environment
Prerequisite:
diff --git a/src/php/composer.json b/src/php/composer.json
index 1eacc643a2..db56d2ce6e 100644
--- a/src/php/composer.json
+++ b/src/php/composer.json
@@ -5,7 +5,7 @@
"keywords": ["rpc"],
"homepage": "http://grpc.io",
"license": "BSD-3-Clause",
- "version": "1.0.0",
+ "version": "1.0.1",
"require": {
"php": ">=5.5.0",
"stanley-cheung/protobuf-php": "v0.6"
diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c
index 66ca1513ed..31c59fe5ad 100644
--- a/src/php/ext/grpc/call.c
+++ b/src/php/ext/grpc/call.c
@@ -164,6 +164,9 @@ bool create_metadata_array(zval *array, grpc_metadata_array *metadata) {
if (key_type1 != HASH_KEY_IS_STRING) {
return false;
}
+ if (!grpc_header_key_is_legal(key1, strlen(key1))) {
+ return false;
+ }
inner_array_hash = Z_ARRVAL_P(inner_array);
PHP_GRPC_HASH_FOREACH_VAL_START(inner_array_hash, value)
if (Z_TYPE_P(value) != IS_STRING) {
diff --git a/src/php/ext/grpc/call_credentials.c b/src/php/ext/grpc/call_credentials.c
index 6921a5df17..25c92c91fe 100644
--- a/src/php/ext/grpc/call_credentials.c
+++ b/src/php/ext/grpc/call_credentials.c
@@ -192,24 +192,16 @@ void plugin_get_metadata(void *ptr, grpc_auth_metadata_context context,
/* call the user callback function */
zend_call_function(state->fci, state->fci_cache TSRMLS_CC);
- if (Z_TYPE_P(retval) != IS_ARRAY) {
- zend_throw_exception(spl_ce_InvalidArgumentException,
- "plugin callback must return metadata array",
- 1 TSRMLS_CC);
- return;
- }
-
+ grpc_status_code code = GRPC_STATUS_OK;
grpc_metadata_array metadata;
- if (!create_metadata_array(retval, &metadata)) {
- zend_throw_exception(spl_ce_InvalidArgumentException,
- "invalid metadata", 1 TSRMLS_CC);
+
+ if (Z_TYPE_P(retval) != IS_ARRAY) {
+ code = GRPC_STATUS_INVALID_ARGUMENT;
+ } else if (!create_metadata_array(retval, &metadata)) {
grpc_metadata_array_destroy(&metadata);
- return;
+ code = GRPC_STATUS_INVALID_ARGUMENT;
}
- /* TODO: handle error */
- grpc_status_code code = GRPC_STATUS_OK;
-
/* Pass control back to core */
cb(user_data, metadata.metadata, metadata.count, code, NULL);
}
diff --git a/src/php/tests/interop/interop_client.php b/src/php/tests/interop/interop_client.php
index bf40549a04..c94ba61296 100755
--- a/src/php/tests/interop/interop_client.php
+++ b/src/php/tests/interop/interop_client.php
@@ -54,6 +54,15 @@ function hardAssert($value, $error_message)
}
}
+function hardAssertIfStatusOk($status)
+{
+ if ($status->code !== Grpc\STATUS_OK) {
+ echo "Call did not complete successfully. Status object:\n";
+ var_dump($status);
+ exit(1);
+ }
+}
+
/**
* Run the empty_unary test.
*
@@ -62,7 +71,7 @@ function hardAssert($value, $error_message)
function emptyUnary($stub)
{
list($result, $status) = $stub->EmptyCall(new grpc\testing\EmptyMessage())->wait();
- hardAssert($status->code === Grpc\STATUS_OK, 'Call did not complete successfully');
+ hardAssertIfStatusOk($status);
hardAssert($result !== null, 'Call completed with a null response');
}
@@ -105,7 +114,7 @@ function performLargeUnary($stub, $fillUsername = false, $fillOauthScope = false
}
list($result, $status) = $stub->UnaryCall($request, [], $options)->wait();
- hardAssert($status->code === Grpc\STATUS_OK, 'Call did not complete successfully');
+ hardAssertIfStatusOk($status);
hardAssert($result !== null, 'Call returned a null response');
$payload = $result->getPayload();
hardAssert($payload->getType() === grpc\testing\PayloadType::COMPRESSABLE,
@@ -197,7 +206,12 @@ function updateAuthMetadataCallback($context)
$methodName = $context->method_name;
$auth_credentials = ApplicationDefaultCredentials::getCredentials();
- return $auth_credentials->updateMetadata($metadata = [], $authUri);
+ $metadata = [];
+ $result = $auth_credentials->updateMetadata([], $authUri);
+ foreach ($result as $key => $value) {
+ $metadata[strtolower($key)] = $value;
+ }
+ return $metadata;
}
/**
@@ -242,7 +256,7 @@ function clientStreaming($stub)
$call->write($request);
}
list($result, $status) = $call->wait();
- hardAssert($status->code === Grpc\STATUS_OK, 'Call did not complete successfully');
+ hardAssertIfStatusOk($status);
hardAssert($result->getAggregatedPayloadSize() === 74922,
'aggregated_payload_size was incorrect');
}
@@ -275,8 +289,7 @@ function serverStreaming($stub)
'Response '.$i.' had the wrong length');
$i += 1;
}
- hardAssert($call->getStatus()->code === Grpc\STATUS_OK,
- 'Call did not complete successfully');
+ hardAssertIfStatusOk($call->getStatus());
}
/**
@@ -312,8 +325,7 @@ function pingPong($stub)
}
$call->writesDone();
hardAssert($call->read() === null, 'Server returned too many responses');
- hardAssert($call->getStatus()->code === Grpc\STATUS_OK,
- 'Call did not complete successfully');
+ hardAssertIfStatusOk($call->getStatus());
}
/**
@@ -326,8 +338,7 @@ function emptyStream($stub)
$call = $stub->FullDuplexCall();
$call->writesDone();
hardAssert($call->read() === null, 'Server returned too many responses');
- hardAssert($call->getStatus()->code === Grpc\STATUS_OK,
- 'Call did not complete successfully');
+ hardAssertIfStatusOk($call->getStatus());
}
/**
@@ -419,8 +430,7 @@ function customMetadata($stub)
'Incorrect initial metadata value');
list($result, $status) = $call->wait();
- hardAssert($status->code === Grpc\STATUS_OK,
- 'Call did not complete successfully');
+ hardAssertIfStatusOk($status);
$trailing_metadata = $call->getTrailingMetadata();
hardAssert(array_key_exists($ECHO_TRAILING_KEY, $trailing_metadata),
@@ -435,8 +445,7 @@ function customMetadata($stub)
$streaming_call->write($streaming_request);
$streaming_call->writesDone();
- hardAssert($streaming_call->getStatus()->code === Grpc\STATUS_OK,
- 'Call did not complete successfully');
+ hardAssertIfStatusOk($streaming_call->getStatus());
$streaming_trailing_metadata = $streaming_call->getTrailingMetadata();
hardAssert(array_key_exists($ECHO_TRAILING_KEY,
diff --git a/src/php/tests/unit_tests/CallCredentials2Test.php b/src/php/tests/unit_tests/CallCredentials2Test.php
index a57e2b9b4e..b3b98a22ca 100644
--- a/src/php/tests/unit_tests/CallCredentials2Test.php
+++ b/src/php/tests/unit_tests/CallCredentials2Test.php
@@ -132,4 +132,69 @@ class CallCredentials2Test extends PHPUnit_Framework_TestCase
unset($call);
unset($server_call);
}
+
+ public function invalidKeyCallbackFunc($context)
+ {
+ $this->assertTrue(is_string($context->service_url));
+ $this->assertTrue(is_string($context->method_name));
+
+ return ['K1' => ['v1']];
+ }
+
+ public function testCallbackWithInvalidKey()
+ {
+ $deadline = Grpc\Timeval::infFuture();
+ $status_text = 'xyz';
+ $call = new Grpc\Call($this->channel,
+ '/abc/dummy_method',
+ $deadline,
+ $this->host_override);
+
+ $call_credentials = Grpc\CallCredentials::createFromPlugin(
+ array($this, 'invalidKeyCallbackFunc'));
+ $call->setCredentials($call_credentials);
+
+ $event = $call->startBatch([
+ Grpc\OP_SEND_INITIAL_METADATA => [],
+ Grpc\OP_SEND_CLOSE_FROM_CLIENT => true,
+ Grpc\OP_RECV_STATUS_ON_CLIENT => true,
+ ]);
+
+ $this->assertTrue($event->send_metadata);
+ $this->assertTrue($event->send_close);
+ $this->assertTrue($event->status->code == Grpc\STATUS_UNAUTHENTICATED);
+ }
+
+ public function invalidReturnCallbackFunc($context)
+ {
+ $this->assertTrue(is_string($context->service_url));
+ $this->assertTrue(is_string($context->method_name));
+
+ return "a string";
+ }
+
+ public function testCallbackWithInvalidReturnValue()
+ {
+ $deadline = Grpc\Timeval::infFuture();
+ $status_text = 'xyz';
+ $call = new Grpc\Call($this->channel,
+ '/abc/dummy_method',
+ $deadline,
+ $this->host_override);
+
+ $call_credentials = Grpc\CallCredentials::createFromPlugin(
+ array($this, 'invalidReturnCallbackFunc'));
+ $call->setCredentials($call_credentials);
+
+ $event = $call->startBatch([
+ Grpc\OP_SEND_INITIAL_METADATA => [],
+ Grpc\OP_SEND_CLOSE_FROM_CLIENT => true,
+ Grpc\OP_RECV_STATUS_ON_CLIENT => true,
+ ]);
+
+ $this->assertTrue($event->send_metadata);
+ $this->assertTrue($event->send_close);
+ $this->assertTrue($event->status->code == Grpc\STATUS_UNAUTHENTICATED);
+ }
+
}
diff --git a/src/php/tests/unit_tests/CallCredentials3Test.php b/src/php/tests/unit_tests/CallCredentials3Test.php
deleted file mode 100644
index 8f5e109bf5..0000000000
--- a/src/php/tests/unit_tests/CallCredentials3Test.php
+++ /dev/null
@@ -1,135 +0,0 @@
-<?php
-/*
- *
- * 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.
- *
- */
-
-class CallCredentials3Test extends PHPUnit_Framework_TestCase
-{
- public function setUp()
- {
- $this->credentials = Grpc\ChannelCredentials::createSsl(
- file_get_contents(dirname(__FILE__).'/../data/ca.pem'));
- $server_credentials = Grpc\ServerCredentials::createSsl(
- null,
- file_get_contents(dirname(__FILE__).'/../data/server1.key'),
- file_get_contents(dirname(__FILE__).'/../data/server1.pem'));
- $this->server = new Grpc\Server();
- $this->port = $this->server->addSecureHttp2Port('0.0.0.0:0',
- $server_credentials);
- $this->server->start();
- $this->host_override = 'foo.test.google.fr';
- $this->channel = new Grpc\Channel(
- 'localhost:'.$this->port,
- [
- 'grpc.ssl_target_name_override' => $this->host_override,
- 'grpc.default_authority' => $this->host_override,
- 'credentials' => $this->credentials,
- ]
- );
- }
-
- public function tearDown()
- {
- unset($this->channel);
- unset($this->server);
- }
-
- public function callbackFunc($context)
- {
- $this->assertTrue(is_string($context->service_url));
- $this->assertTrue(is_string($context->method_name));
-
- return ['k1' => ['v1'], 'k2' => ['v2']];
- }
-
- public function testCreateFromPlugin()
- {
- $deadline = Grpc\Timeval::infFuture();
- $status_text = 'xyz';
- $call = new Grpc\Call($this->channel,
- '/abc/dummy_method',
- $deadline,
- $this->host_override);
-
- $call_credentials = Grpc\CallCredentials::createFromPlugin(
- [$this, 'callbackFunc']);
- $call->setCredentials($call_credentials);
-
- $event = $call->startBatch([
- Grpc\OP_SEND_INITIAL_METADATA => [],
- Grpc\OP_SEND_CLOSE_FROM_CLIENT => true,
- ]);
-
- $this->assertTrue($event->send_metadata);
- $this->assertTrue($event->send_close);
-
- $event = $this->server->requestCall();
-
- $this->assertTrue(is_array($event->metadata));
- $metadata = $event->metadata;
- $this->assertTrue(array_key_exists('k1', $metadata));
- $this->assertTrue(array_key_exists('k2', $metadata));
- $this->assertSame($metadata['k1'], ['v1']);
- $this->assertSame($metadata['k2'], ['v2']);
-
- $this->assertSame('/abc/dummy_method', $event->method);
- $server_call = $event->call;
-
- $event = $server_call->startBatch([
- Grpc\OP_SEND_INITIAL_METADATA => [],
- Grpc\OP_SEND_STATUS_FROM_SERVER => [
- 'metadata' => [],
- 'code' => Grpc\STATUS_OK,
- 'details' => $status_text,
- ],
- Grpc\OP_RECV_CLOSE_ON_SERVER => true,
- ]);
-
- $this->assertTrue($event->send_metadata);
- $this->assertTrue($event->send_status);
- $this->assertFalse($event->cancelled);
-
- $event = $call->startBatch([
- Grpc\OP_RECV_INITIAL_METADATA => true,
- Grpc\OP_RECV_STATUS_ON_CLIENT => true,
- ]);
-
- $this->assertSame([], $event->metadata);
- $status = $event->status;
- $this->assertSame([], $status->metadata);
- $this->assertSame(Grpc\STATUS_OK, $status->code);
- $this->assertSame($status_text, $status->details);
-
- unset($call);
- unset($server_call);
- }
-}
diff --git a/src/php/tests/unit_tests/CallTest.php b/src/php/tests/unit_tests/CallTest.php
index d736f51546..1205f0cd8e 100644
--- a/src/php/tests/unit_tests/CallTest.php
+++ b/src/php/tests/unit_tests/CallTest.php
@@ -113,7 +113,7 @@ class CallTest extends PHPUnit_Framework_TestCase
/**
* @expectedException InvalidArgumentException
*/
- public function testInvalidMetadataKey()
+ public function testInvalidStartBatchKey()
{
$batch = [
'invalid' => ['key1' => 'value1'],
@@ -124,6 +124,28 @@ class CallTest extends PHPUnit_Framework_TestCase
/**
* @expectedException InvalidArgumentException
*/
+ public function testInvalidMetadataStrKey()
+ {
+ $batch = [
+ Grpc\OP_SEND_INITIAL_METADATA => ['Key' => ['value1', 'value2']],
+ ];
+ $result = $this->call->startBatch($batch);
+ }
+
+ /**
+ * @expectedException InvalidArgumentException
+ */
+ public function testInvalidMetadataIntKey()
+ {
+ $batch = [
+ Grpc\OP_SEND_INITIAL_METADATA => [1 => ['value1', 'value2']],
+ ];
+ $result = $this->call->startBatch($batch);
+ }
+
+ /**
+ * @expectedException InvalidArgumentException
+ */
public function testInvalidMetadataInnerValue()
{
$batch = [
diff --git a/src/proto/grpc/testing/echo.proto b/src/proto/grpc/testing/echo.proto
index c596aabfcc..ca60a41b4f 100644
--- a/src/proto/grpc/testing/echo.proto
+++ b/src/proto/grpc/testing/echo.proto
@@ -42,7 +42,7 @@ service EchoTestService {
rpc Unimplemented(EchoRequest) returns (EchoResponse);
}
-service UnimplementedService {
+service UnimplementedEchoService {
rpc Unimplemented(EchoRequest) returns (EchoResponse);
}
diff --git a/src/python/grpcio/_unixccompiler_patch.py b/src/python/grpcio/_spawn_patch.py
index 894c3ef395..24306f0dd9 100644
--- a/src/python/grpcio/_unixccompiler_patch.py
+++ b/src/python/grpcio/_spawn_patch.py
@@ -27,51 +27,47 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Covers inadequacies in distutils."""
+"""Patches the spawn() command for windows compilers.
+
+Windows has an 8191 character command line limit, but some compilers
+support an @command_file directive where command_file is a file
+containing the full command line.
+"""
from distutils import ccompiler
-from distutils import errors
-from distutils import unixccompiler
import os
import os.path
-import shlex
import shutil
import sys
import tempfile
-def _unix_commandfile_spawn(self, command):
- """Wrapper around distutils.util.spawn that attempts to use command files.
+MAX_COMMAND_LENGTH = 8191
- Meant to replace the CCompiler method `spawn` on UnixCCompiler and its
- derivatives (e.g. the MinGW32 compiler).
+_classic_spawn = ccompiler.CCompiler.spawn
- Some commands like `gcc` (and friends like `clang`) support command files to
- work around shell command length limits.
- """
- # Sometimes distutils embeds the executables as full strings including some
- # hard-coded flags rather than as lists.
- command = list(shlex.split(command[0])) + list(command[1:])
- command_base = os.path.basename(command[0].strip())
- if command_base == 'ccache':
- command_base = command[:2]
- command_args = command[2:]
- elif command_base.startswith('ccache') or command_base in ['gcc', 'clang', 'clang++', 'g++']:
- command_base = command[:1]
- command_args = command[1:]
+def _commandfile_spawn(self, command):
+ command_length = sum([len(arg) for arg in command])
+ if os.name == 'nt' and command_length > MAX_COMMAND_LENGTH:
+ # Even if this command doesn't support the @command_file, it will
+ # fail as is so we try blindly
+ print('Command line length exceeded, using command file')
+ print(' '.join(command))
+ temporary_directory = tempfile.mkdtemp()
+ command_filename = os.path.abspath(
+ os.path.join(temporary_directory, 'command'))
+ with open(command_filename, 'w') as command_file:
+ escaped_args = ['"' + arg.replace('\\', '\\\\') + '"' for arg in command[1:]]
+ command_file.write(' '.join(escaped_args))
+ modified_command = command[:1] + ['@{}'.format(command_filename)]
+ try:
+ _classic_spawn(self, modified_command)
+ finally:
+ shutil.rmtree(temporary_directory)
else:
- return ccompiler.CCompiler.spawn(self, command)
- temporary_directory = tempfile.mkdtemp()
- command_filename = os.path.abspath(os.path.join(temporary_directory, 'command'))
- with open(command_filename, 'w') as command_file:
- escaped_args = [arg.replace('\\', '\\\\') for arg in command_args]
- command_file.write(' '.join(escaped_args))
- modified_command = command_base + ['@{}'.format(command_filename)]
- result = ccompiler.CCompiler.spawn(self, modified_command)
- shutil.rmtree(temporary_directory)
- return result
+ _classic_spawn(self, command)
-def monkeypatch_unix_compiler():
+def monkeypatch_spawn():
"""Monkeypatching is dumb, but it's either that or we become maintainers of
something much, much bigger."""
- unixccompiler.UnixCCompiler.spawn = _unix_commandfile_spawn
+ ccompiler.CCompiler.spawn = _commandfile_spawn
diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py
index 513839df7d..89583dee9c 100644
--- a/src/python/grpcio/grpc/__init__.py
+++ b/src/python/grpcio/grpc/__init__.py
@@ -649,6 +649,10 @@ class Channel(six.with_metaclass(abc.ABCMeta)):
Args:
method: The name of the RPC method.
+ request_serializer: Optional behaviour for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional behaviour for deserializing the response
+ message. Response goes undeserialized in case None is passed.
Returns:
A UnaryUnaryMultiCallable value for the named unary-unary method.
@@ -662,6 +666,10 @@ class Channel(six.with_metaclass(abc.ABCMeta)):
Args:
method: The name of the RPC method.
+ request_serializer: Optional behaviour for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional behaviour for deserializing the response
+ message. Response goes undeserialized in case None is passed.
Returns:
A UnaryStreamMultiCallable value for the name unary-stream method.
@@ -675,6 +683,10 @@ class Channel(six.with_metaclass(abc.ABCMeta)):
Args:
method: The name of the RPC method.
+ request_serializer: Optional behaviour for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional behaviour for deserializing the response
+ message. Response goes undeserialized in case None is passed.
Returns:
A StreamUnaryMultiCallable value for the named stream-unary method.
@@ -688,6 +700,10 @@ class Channel(six.with_metaclass(abc.ABCMeta)):
Args:
method: The name of the RPC method.
+ request_serializer: Optional behaviour for serializing the request
+ message. Request goes unserialized in case None is passed.
+ response_deserializer: Optional behaviour for deserializing the response
+ message. Response goes undeserialized in case None is passed.
Returns:
A StreamStreamMultiCallable value for the named stream-stream method.
@@ -1078,7 +1094,7 @@ def access_token_call_credentials(access_token):
Args:
access_token: A string to place directly in the http request
- authorization header, ie "Authorization: Bearer <access_token>".
+ authorization header, ie "authorization: Bearer <access_token>".
Returns:
A CallCredentials.
@@ -1193,7 +1209,7 @@ def insecure_channel(target, options=None):
def secure_channel(target, credentials, options=None):
- """Creates an insecure Channel to a server.
+ """Creates a secure Channel to a server.
Args:
target: The target to which to connect.
diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py
index 94a13bfb2f..f70cd2afa5 100644
--- a/src/python/grpcio/grpc/_server.py
+++ b/src/python/grpcio/grpc/_server.py
@@ -462,7 +462,6 @@ def _unary_response_in_pool(
rpc_event, state, response, response_serializer)
if serialized_response is not None:
_status(rpc_event, state, serialized_response)
- return
def _stream_response_in_pool(
diff --git a/src/python/grpcio/grpc_version.py b/src/python/grpcio/grpc_version.py
index c5c358cbb9..efa94a0228 100644
--- a/src/python/grpcio/grpc_version.py
+++ b/src/python/grpcio/grpc_version.py
@@ -29,4 +29,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!!
-VERSION='1.0.0rc2'
+VERSION='1.0.1rc1'
diff --git a/src/python/grpcio_health_checking/grpc_version.py b/src/python/grpcio_health_checking/grpc_version.py
index 4bc1f3ffb1..082453c1ac 100644
--- a/src/python/grpcio_health_checking/grpc_version.py
+++ b/src/python/grpcio_health_checking/grpc_version.py
@@ -29,4 +29,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!!
-VERSION='1.0.0rc2'
+VERSION='1.0.1rc1'
diff --git a/src/python/grpcio_health_checking/setup.py b/src/python/grpcio_health_checking/setup.py
index 6074175a44..8c92ee16a9 100644
--- a/src/python/grpcio_health_checking/setup.py
+++ b/src/python/grpcio_health_checking/setup.py
@@ -46,12 +46,12 @@ PACKAGE_DIRECTORIES = {
}
SETUP_REQUIRES = (
- 'grpcio-tools>=0.15.0',
+ 'grpcio-tools>={version}'.format(version=grpc_version.VERSION),
)
INSTALL_REQUIRES = (
'protobuf>=3.0.0',
- 'grpcio>=0.15.0',
+ 'grpcio>={version}'.format(version=grpc_version.VERSION),
)
COMMAND_CLASS = {
diff --git a/src/python/grpcio_tests/grpc_version.py b/src/python/grpcio_tests/grpc_version.py
index 16e4eb8ba7..79c479cccd 100644
--- a/src/python/grpcio_tests/grpc_version.py
+++ b/src/python/grpcio_tests/grpc_version.py
@@ -29,4 +29,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!!
-VERSION='1.0.0rc2'
+VERSION='1.0.1rc1'
diff --git a/src/python/grpcio_tests/setup.py b/src/python/grpcio_tests/setup.py
index 5c60eaca3a..7384206602 100644
--- a/src/python/grpcio_tests/setup.py
+++ b/src/python/grpcio_tests/setup.py
@@ -31,13 +31,9 @@
import os
import os.path
-import shutil
import sys
-from distutils import core as _core
-from distutils import extension as _extension
import setuptools
-from setuptools.command import egg_info
import grpc.tools.command
@@ -60,17 +56,14 @@ INSTALL_REQUIRES = (
'coverage>=4.0',
'enum34>=1.0.4',
'futures>=2.2.0',
- 'grpcio>=0.14.0',
- 'grpcio-health-checking>=0.14.0',
+ 'grpcio>={version}'.format(version=grpc_version.VERSION),
+ 'grpcio-tools>={version}'.format(version=grpc_version.VERSION),
+ 'grpcio-health-checking>={version}'.format(version=grpc_version.VERSION),
'oauth2client>=1.4.7',
'protobuf>=3.0.0',
'six>=1.10',
)
-SETUP_REQUIRES = (
- 'grpcio-tools>=0.14.0',
-)
-
COMMAND_CLASS = {
# Run `preprocess` *before* doing any packaging!
'preprocess': commands.GatherProto,
@@ -115,7 +108,6 @@ setuptools.setup(
package_dir=PACKAGE_DIRECTORIES,
package_data=PACKAGE_DATA,
install_requires=INSTALL_REQUIRES,
- setup_requires=SETUP_REQUIRES,
cmdclass=COMMAND_CLASS,
tests_require=TESTS_REQUIRE,
test_suite=TEST_SUITE,
diff --git a/src/python/grpcio_tests/tests/interop/_insecure_interop_test.py b/src/python/grpcio_tests/tests/interop/_insecure_interop_test.py
index c753d6faf0..936c895bd2 100644
--- a/src/python/grpcio_tests/tests/interop/_insecure_interop_test.py
+++ b/src/python/grpcio_tests/tests/interop/_insecure_interop_test.py
@@ -29,9 +29,10 @@
"""Insecure client-server interoperability as a unit test."""
+from concurrent import futures
import unittest
-from grpc.beta import implementations
+import grpc
from src.proto.grpc.testing import test_pb2
from tests.interop import _interop_test_case
@@ -44,14 +45,13 @@ class InsecureInteropTest(
unittest.TestCase):
def setUp(self):
- self.server = test_pb2.beta_create_TestService_server(methods.TestService())
+ self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
+ test_pb2.add_TestServiceServicer_to_server(
+ methods.TestService(), self.server)
port = self.server.add_insecure_port('[::]:0')
self.server.start()
- self.stub = test_pb2.beta_create_TestService_stub(
- implementations.insecure_channel('localhost', port))
-
- def tearDown(self):
- self.server.stop(0)
+ self.stub = test_pb2.TestServiceStub(
+ grpc.insecure_channel('localhost:{}'.format(port)))
if __name__ == '__main__':
diff --git a/src/python/grpcio_tests/tests/interop/_secure_interop_test.py b/src/python/grpcio_tests/tests/interop/_secure_interop_test.py
index cb09f54a34..eaca553e1b 100644
--- a/src/python/grpcio_tests/tests/interop/_secure_interop_test.py
+++ b/src/python/grpcio_tests/tests/interop/_secure_interop_test.py
@@ -29,17 +29,16 @@
"""Secure client-server interoperability as a unit test."""
+from concurrent import futures
import unittest
-from grpc.beta import implementations
+import grpc
from src.proto.grpc.testing import test_pb2
from tests.interop import _interop_test_case
from tests.interop import methods
from tests.interop import resources
-from tests.unit.beta import test_utilities
-
_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'
@@ -48,19 +47,18 @@ class SecureInteropTest(
unittest.TestCase):
def setUp(self):
- self.server = test_pb2.beta_create_TestService_server(methods.TestService())
+ self.server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
+ test_pb2.add_TestServiceServicer_to_server(
+ methods.TestService(), self.server)
port = self.server.add_secure_port(
- '[::]:0', implementations.ssl_server_credentials(
+ '[::]:0', grpc.ssl_server_credentials(
[(resources.private_key(), resources.certificate_chain())]))
self.server.start()
- self.stub = test_pb2.beta_create_TestService_stub(
- test_utilities.not_really_secure_channel(
- 'localhost', port, implementations.ssl_channel_credentials(
- resources.test_root_certificates()),
- _SERVER_HOST_OVERRIDE))
-
- def tearDown(self):
- self.server.stop(0)
+ self.stub = test_pb2.TestServiceStub(
+ grpc.secure_channel(
+ 'localhost:{}'.format(port),
+ grpc.ssl_channel_credentials(resources.test_root_certificates()),
+ (('grpc.ssl_target_name_override', _SERVER_HOST_OVERRIDE,),)))
if __name__ == '__main__':
diff --git a/src/python/grpcio_tests/tests/interop/client.py b/src/python/grpcio_tests/tests/interop/client.py
index 8aa1ce30c1..9d61d18975 100644
--- a/src/python/grpcio_tests/tests/interop/client.py
+++ b/src/python/grpcio_tests/tests/interop/client.py
@@ -32,14 +32,12 @@
import argparse
from oauth2client import client as oauth2client_client
+import grpc
from grpc.beta import implementations
from src.proto.grpc.testing import test_pb2
from tests.interop import methods
from tests.interop import resources
-from tests.unit.beta import test_utilities
-
-_ONE_DAY_IN_SECONDS = 60 * 60 * 24
def _args():
@@ -66,41 +64,49 @@ def _args():
return parser.parse_args()
+def _application_default_credentials():
+ return oauth2client_client.GoogleCredentials.get_application_default()
+
+
def _stub(args):
+ target = '{}:{}'.format(args.server_host, args.server_port)
if args.test_case == 'oauth2_auth_token':
- creds = oauth2client_client.GoogleCredentials.get_application_default()
- scoped_creds = creds.create_scoped([args.oauth_scope])
- access_token = scoped_creds.get_access_token().access_token
- call_creds = implementations.access_token_call_credentials(access_token)
+ google_credentials = _application_default_credentials()
+ scoped_credentials = google_credentials.create_scoped([args.oauth_scope])
+ access_token = scoped_credentials.get_access_token().access_token
+ call_credentials = grpc.access_token_call_credentials(access_token)
elif args.test_case == 'compute_engine_creds':
- creds = oauth2client_client.GoogleCredentials.get_application_default()
- scoped_creds = creds.create_scoped([args.oauth_scope])
- call_creds = implementations.google_call_credentials(scoped_creds)
+ google_credentials = _application_default_credentials()
+ scoped_credentials = google_credentials.create_scoped([args.oauth_scope])
+ # TODO(https://github.com/grpc/grpc/issues/6799): Eliminate this last
+ # remaining use of the Beta API.
+ call_credentials = implementations.google_call_credentials(
+ scoped_credentials)
elif args.test_case == 'jwt_token_creds':
- creds = oauth2client_client.GoogleCredentials.get_application_default()
- call_creds = implementations.google_call_credentials(creds)
+ google_credentials = _application_default_credentials()
+ # TODO(https://github.com/grpc/grpc/issues/6799): Eliminate this last
+ # remaining use of the Beta API.
+ call_credentials = implementations.google_call_credentials(
+ google_credentials)
else:
- call_creds = None
+ call_credentials = None
if args.use_tls:
if args.use_test_ca:
root_certificates = resources.test_root_certificates()
else:
root_certificates = None # will load default roots.
- channel_creds = implementations.ssl_channel_credentials(root_certificates)
- if call_creds is not None:
- channel_creds = implementations.composite_channel_credentials(
- channel_creds, call_creds)
+ channel_credentials = grpc.ssl_channel_credentials(root_certificates)
+ if call_credentials is not None:
+ channel_credentials = grpc.composite_channel_credentials(
+ channel_credentials, call_credentials)
- channel = test_utilities.not_really_secure_channel(
- args.server_host, args.server_port, channel_creds,
- args.server_host_override)
- stub = test_pb2.beta_create_TestService_stub(channel)
+ channel = grpc.secure_channel(
+ target, channel_credentials,
+ (('grpc.ssl_target_name_override', args.server_host_override,),))
else:
- channel = implementations.insecure_channel(
- args.server_host, args.server_port)
- stub = test_pb2.beta_create_TestService_stub(channel)
- return stub
+ channel = grpc.insecure_channel(target)
+ return test_pb2.TestServiceStub(channel)
def _test_case_from_arg(test_case_arg):
diff --git a/src/python/grpcio_tests/tests/interop/methods.py b/src/python/grpcio_tests/tests/interop/methods.py
index 97e6c9e27e..7edd75c56c 100644
--- a/src/python/grpcio_tests/tests/interop/methods.py
+++ b/src/python/grpcio_tests/tests/interop/methods.py
@@ -29,8 +29,6 @@
"""Implementations of interoperability test methods."""
-from __future__ import print_function
-
import enum
import json
import os
@@ -41,26 +39,21 @@ from oauth2client import client as oauth2client_client
import grpc
from grpc.beta import implementations
-from grpc.beta import interfaces
-from grpc.framework.common import cardinality
-from grpc.framework.interfaces.face import face
from src.proto.grpc.testing import empty_pb2
from src.proto.grpc.testing import messages_pb2
from src.proto.grpc.testing import test_pb2
-_TIMEOUT = 7
-
-class TestService(test_pb2.BetaTestServiceServicer):
+class TestService(test_pb2.TestServiceServicer):
def EmptyCall(self, request, context):
return empty_pb2.Empty()
def UnaryCall(self, request, context):
if request.HasField('response_status'):
- context.code(request.response_status.code)
- context.details(request.response_status.message)
+ context.set_code(request.response_status.code)
+ context.set_details(request.response_status.message)
return messages_pb2.SimpleResponse(
payload=messages_pb2.Payload(
type=messages_pb2.COMPRESSABLE,
@@ -68,8 +61,8 @@ class TestService(test_pb2.BetaTestServiceServicer):
def StreamingOutputCall(self, request, context):
if request.HasField('response_status'):
- context.code(request.response_status.code)
- context.details(request.response_status.message)
+ context.set_code(request.response_status.code)
+ context.set_details(request.response_status.message)
for response_parameters in request.response_parameters:
yield messages_pb2.StreamingOutputCallResponse(
payload=messages_pb2.Payload(
@@ -79,7 +72,7 @@ class TestService(test_pb2.BetaTestServiceServicer):
def StreamingInputCall(self, request_iterator, context):
aggregate_size = 0
for request in request_iterator:
- if request.payload and request.payload.body:
+ if request.payload is not None and request.payload.body:
aggregate_size += len(request.payload.body)
return messages_pb2.StreamingInputCallResponse(
aggregated_payload_size=aggregate_size)
@@ -87,8 +80,8 @@ class TestService(test_pb2.BetaTestServiceServicer):
def FullDuplexCall(self, request_iterator, context):
for request in request_iterator:
if request.HasField('response_status'):
- context.code(request.response_status.code)
- context.details(request.response_status.message)
+ context.set_code(request.response_status.code)
+ context.set_details(request.response_status.message)
for response_parameters in request.response_parameters:
yield messages_pb2.StreamingOutputCallResponse(
payload=messages_pb2.Payload(
@@ -101,83 +94,80 @@ class TestService(test_pb2.BetaTestServiceServicer):
return self.FullDuplexCall(request_iterator, context)
-def _large_unary_common_behavior(stub, fill_username, fill_oauth_scope,
- protocol_options=None):
- with stub:
- request = messages_pb2.SimpleRequest(
- response_type=messages_pb2.COMPRESSABLE, response_size=314159,
- payload=messages_pb2.Payload(body=b'\x00' * 271828),
- fill_username=fill_username, fill_oauth_scope=fill_oauth_scope)
- response_future = stub.UnaryCall.future(request, _TIMEOUT,
- protocol_options=protocol_options)
- response = response_future.result()
- if response.payload.type is not messages_pb2.COMPRESSABLE:
- raise ValueError(
- 'response payload type is "%s"!' % type(response.payload.type))
- if len(response.payload.body) != 314159:
- raise ValueError(
- 'response body of incorrect size %d!' % len(response.payload.body))
+def _large_unary_common_behavior(
+ stub, fill_username, fill_oauth_scope, call_credentials):
+ request = messages_pb2.SimpleRequest(
+ response_type=messages_pb2.COMPRESSABLE, response_size=314159,
+ payload=messages_pb2.Payload(body=b'\x00' * 271828),
+ fill_username=fill_username, fill_oauth_scope=fill_oauth_scope)
+ response_future = stub.UnaryCall.future(
+ request, credentials=call_credentials)
+ response = response_future.result()
+ if response.payload.type is not messages_pb2.COMPRESSABLE:
+ raise ValueError(
+ 'response payload type is "%s"!' % type(response.payload.type))
+ elif len(response.payload.body) != 314159:
+ raise ValueError(
+ 'response body of incorrect size %d!' % len(response.payload.body))
+ else:
return response
def _empty_unary(stub):
- with stub:
- response = stub.EmptyCall(empty_pb2.Empty(), _TIMEOUT)
- if not isinstance(response, empty_pb2.Empty):
- raise TypeError(
- 'response is of type "%s", not empty_pb2.Empty!', type(response))
+ response = stub.EmptyCall(empty_pb2.Empty())
+ if not isinstance(response, empty_pb2.Empty):
+ raise TypeError(
+ 'response is of type "%s", not empty_pb2.Empty!', type(response))
def _large_unary(stub):
- _large_unary_common_behavior(stub, False, False)
+ _large_unary_common_behavior(stub, False, False, None)
def _client_streaming(stub):
- with stub:
- payload_body_sizes = (27182, 8, 1828, 45904)
- payloads = (
- messages_pb2.Payload(body=b'\x00' * size)
- for size in payload_body_sizes)
- requests = (
- messages_pb2.StreamingInputCallRequest(payload=payload)
- for payload in payloads)
- response = stub.StreamingInputCall(requests, _TIMEOUT)
- if response.aggregated_payload_size != 74922:
- raise ValueError(
- 'incorrect size %d!' % response.aggregated_payload_size)
+ payload_body_sizes = (27182, 8, 1828, 45904,)
+ payloads = (
+ messages_pb2.Payload(body=b'\x00' * size)
+ for size in payload_body_sizes)
+ requests = (
+ messages_pb2.StreamingInputCallRequest(payload=payload)
+ for payload in payloads)
+ response = stub.StreamingInputCall(requests)
+ if response.aggregated_payload_size != 74922:
+ raise ValueError(
+ 'incorrect size %d!' % response.aggregated_payload_size)
def _server_streaming(stub):
- sizes = (31415, 9, 2653, 58979)
-
- with stub:
- request = messages_pb2.StreamingOutputCallRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(
- messages_pb2.ResponseParameters(size=sizes[0]),
- messages_pb2.ResponseParameters(size=sizes[1]),
- messages_pb2.ResponseParameters(size=sizes[2]),
- messages_pb2.ResponseParameters(size=sizes[3]),
- ))
- response_iterator = stub.StreamingOutputCall(request, _TIMEOUT)
- for index, response in enumerate(response_iterator):
- if response.payload.type != messages_pb2.COMPRESSABLE:
- raise ValueError(
- 'response body of invalid type %s!' % response.payload.type)
- if len(response.payload.body) != sizes[index]:
- raise ValueError(
- 'response body of invalid size %d!' % len(response.payload.body))
+ sizes = (31415, 9, 2653, 58979,)
+
+ request = messages_pb2.StreamingOutputCallRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_parameters=(
+ messages_pb2.ResponseParameters(size=sizes[0]),
+ messages_pb2.ResponseParameters(size=sizes[1]),
+ messages_pb2.ResponseParameters(size=sizes[2]),
+ messages_pb2.ResponseParameters(size=sizes[3]),
+ )
+ )
+ response_iterator = stub.StreamingOutputCall(request)
+ for index, response in enumerate(response_iterator):
+ if response.payload.type != messages_pb2.COMPRESSABLE:
+ raise ValueError(
+ 'response body of invalid type %s!' % response.payload.type)
+ elif len(response.payload.body) != sizes[index]:
+ raise ValueError(
+ 'response body of invalid size %d!' % len(response.payload.body))
def _cancel_after_begin(stub):
- with stub:
- sizes = (27182, 8, 1828, 45904)
- payloads = [messages_pb2.Payload(body=b'\x00' * size) for size in sizes]
- requests = [messages_pb2.StreamingInputCallRequest(payload=payload)
- for payload in payloads]
- responses = stub.StreamingInputCall.future(requests, _TIMEOUT)
- responses.cancel()
- if not responses.cancelled():
- raise ValueError('expected call to be cancelled')
+ sizes = (27182, 8, 1828, 45904,)
+ payloads = (messages_pb2.Payload(body=b'\x00' * size) for size in sizes)
+ requests = (messages_pb2.StreamingInputCallRequest(payload=payload)
+ for payload in payloads)
+ response_future = stub.StreamingInputCall.future(requests)
+ response_future.cancel()
+ if not response_future.cancelled():
+ raise ValueError('expected call to be cancelled')
class _Pipe(object):
@@ -220,18 +210,17 @@ class _Pipe(object):
def _ping_pong(stub):
- request_response_sizes = (31415, 9, 2653, 58979)
- request_payload_sizes = (27182, 8, 1828, 45904)
+ request_response_sizes = (31415, 9, 2653, 58979,)
+ request_payload_sizes = (27182, 8, 1828, 45904,)
- with stub, _Pipe() as pipe:
- response_iterator = stub.FullDuplexCall(pipe, _TIMEOUT)
- print('Starting ping-pong with response iterator %s' % response_iterator)
+ with _Pipe() as pipe:
+ response_iterator = stub.FullDuplexCall(pipe)
for response_size, payload_size in zip(
request_response_sizes, request_payload_sizes):
request = messages_pb2.StreamingOutputCallRequest(
response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(messages_pb2.ResponseParameters(
- size=response_size),),
+ response_parameters=(
+ messages_pb2.ResponseParameters(size=response_size),),
payload=messages_pb2.Payload(body=b'\x00' * payload_size))
pipe.add(request)
response = next(response_iterator)
@@ -244,17 +233,17 @@ def _ping_pong(stub):
def _cancel_after_first_response(stub):
- request_response_sizes = (31415, 9, 2653, 58979)
- request_payload_sizes = (27182, 8, 1828, 45904)
- with stub, _Pipe() as pipe:
- response_iterator = stub.FullDuplexCall(pipe, _TIMEOUT)
+ request_response_sizes = (31415, 9, 2653, 58979,)
+ request_payload_sizes = (27182, 8, 1828, 45904,)
+ with _Pipe() as pipe:
+ response_iterator = stub.FullDuplexCall(pipe)
response_size = request_response_sizes[0]
payload_size = request_payload_sizes[0]
request = messages_pb2.StreamingOutputCallRequest(
response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(messages_pb2.ResponseParameters(
- size=response_size),),
+ response_parameters=(
+ messages_pb2.ResponseParameters(size=response_size),),
payload=messages_pb2.Payload(body=b'\x00' * payload_size))
pipe.add(request)
response = next(response_iterator)
@@ -264,16 +253,17 @@ def _cancel_after_first_response(stub):
try:
next(response_iterator)
- except Exception:
- pass
+ except grpc.RpcError as rpc_error:
+ if rpc_error.code() is not grpc.StatusCode.CANCELLED:
+ raise
else:
raise ValueError('expected call to be cancelled')
def _timeout_on_sleeping_server(stub):
request_payload_size = 27182
- with stub, _Pipe() as pipe:
- response_iterator = stub.FullDuplexCall(pipe, 0.001)
+ with _Pipe() as pipe:
+ response_iterator = stub.FullDuplexCall(pipe, timeout=0.001)
request = messages_pb2.StreamingOutputCallRequest(
response_type=messages_pb2.COMPRESSABLE,
@@ -282,15 +272,16 @@ def _timeout_on_sleeping_server(stub):
time.sleep(0.1)
try:
next(response_iterator)
- except face.ExpirationError:
- pass
+ except grpc.RpcError as rpc_error:
+ if rpc_error.code() is not grpc.StatusCode.DEADLINE_EXCEEDED:
+ raise
else:
raise ValueError('expected call to exceed deadline')
def _empty_stream(stub):
- with stub, _Pipe() as pipe:
- response_iterator = stub.FullDuplexCall(pipe, _TIMEOUT)
+ with _Pipe() as pipe:
+ response_iterator = stub.FullDuplexCall(pipe)
pipe.close()
try:
next(response_iterator)
@@ -300,65 +291,64 @@ def _empty_stream(stub):
def _status_code_and_message(stub):
- with stub:
- message = 'test status message'
- code = 2
- status = grpc.StatusCode.UNKNOWN # code = 2
- request = messages_pb2.SimpleRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_size=1,
- payload=messages_pb2.Payload(body=b'\x00'),
- response_status=messages_pb2.EchoStatus(code=code, message=message)
- )
- response_future = stub.UnaryCall.future(request, _TIMEOUT)
- if response_future.code() != status:
- raise ValueError(
- 'expected code %s, got %s' % (status, response_future.code()))
- if response_future.details() != message:
- raise ValueError(
- 'expected message %s, got %s' % (message, response_future.details()))
-
- request = messages_pb2.StreamingOutputCallRequest(
- response_type=messages_pb2.COMPRESSABLE,
- response_parameters=(
- messages_pb2.ResponseParameters(size=1),),
- response_status=messages_pb2.EchoStatus(code=code, message=message))
- response_iterator = stub.StreamingOutputCall(request, _TIMEOUT)
- if response_future.code() != status:
- raise ValueError(
- 'expected code %s, got %s' % (status, response_iterator.code()))
- if response_future.details() != message:
- raise ValueError(
- 'expected message %s, got %s' % (message, response_iterator.details()))
+ message = 'test status message'
+ code = 2
+ status = grpc.StatusCode.UNKNOWN # code = 2
+ request = messages_pb2.SimpleRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_size=1,
+ payload=messages_pb2.Payload(body=b'\x00'),
+ response_status=messages_pb2.EchoStatus(code=code, message=message)
+ )
+ response_future = stub.UnaryCall.future(request)
+ if response_future.code() != status:
+ raise ValueError(
+ 'expected code %s, got %s' % (status, response_future.code()))
+ elif response_future.details() != message:
+ raise ValueError(
+ 'expected message %s, got %s' % (message, response_future.details()))
+
+ request = messages_pb2.StreamingOutputCallRequest(
+ response_type=messages_pb2.COMPRESSABLE,
+ response_parameters=(
+ messages_pb2.ResponseParameters(size=1),),
+ response_status=messages_pb2.EchoStatus(code=code, message=message))
+ response_iterator = stub.StreamingOutputCall(request)
+ if response_future.code() != status:
+ raise ValueError(
+ 'expected code %s, got %s' % (status, response_iterator.code()))
+ elif response_future.details() != message:
+ raise ValueError(
+ 'expected message %s, got %s' % (message, response_iterator.details()))
def _compute_engine_creds(stub, args):
- response = _large_unary_common_behavior(stub, True, True)
+ response = _large_unary_common_behavior(stub, True, True, None)
if args.default_service_account != response.username:
raise ValueError(
- 'expected username %s, got %s' % (args.default_service_account,
- response.username))
+ 'expected username %s, got %s' % (
+ args.default_service_account, response.username))
def _oauth2_auth_token(stub, args):
json_key_filename = os.environ[
oauth2client_client.GOOGLE_APPLICATION_CREDENTIALS]
wanted_email = json.load(open(json_key_filename, 'rb'))['client_email']
- response = _large_unary_common_behavior(stub, True, True)
+ response = _large_unary_common_behavior(stub, True, True, None)
if wanted_email != response.username:
raise ValueError(
'expected username %s, got %s' % (wanted_email, response.username))
if args.oauth_scope.find(response.oauth_scope) == -1:
raise ValueError(
- 'expected to find oauth scope "%s" in received "%s"' %
- (response.oauth_scope, args.oauth_scope))
+ 'expected to find oauth scope "{}" in received "{}"'.format(
+ response.oauth_scope, args.oauth_scope))
def _jwt_token_creds(stub, args):
json_key_filename = os.environ[
oauth2client_client.GOOGLE_APPLICATION_CREDENTIALS]
wanted_email = json.load(open(json_key_filename, 'rb'))['client_email']
- response = _large_unary_common_behavior(stub, True, False)
+ response = _large_unary_common_behavior(stub, True, False, None)
if wanted_email != response.username:
raise ValueError(
'expected username %s, got %s' % (wanted_email, response.username))
@@ -370,11 +360,11 @@ def _per_rpc_creds(stub, args):
wanted_email = json.load(open(json_key_filename, 'rb'))['client_email']
credentials = oauth2client_client.GoogleCredentials.get_application_default()
scoped_credentials = credentials.create_scoped([args.oauth_scope])
- call_creds = implementations.google_call_credentials(scoped_credentials)
- options = interfaces.grpc_call_options(disable_compression=False,
- credentials=call_creds)
- response = _large_unary_common_behavior(stub, True, False,
- protocol_options=options)
+ # TODO(https://github.com/grpc/grpc/issues/6799): Eliminate this last
+ # remaining use of the Beta API.
+ call_credentials = implementations.google_call_credentials(
+ scoped_credentials)
+ response = _large_unary_common_behavior(stub, True, False, call_credentials)
if wanted_email != response.username:
raise ValueError(
'expected username %s, got %s' % (wanted_email, response.username))
diff --git a/src/python/grpcio_tests/tests/interop/server.py b/src/python/grpcio_tests/tests/interop/server.py
index ab2c3c708f..1ae83bc57d 100644
--- a/src/python/grpcio_tests/tests/interop/server.py
+++ b/src/python/grpcio_tests/tests/interop/server.py
@@ -30,10 +30,11 @@
"""The Python implementation of the GRPC interoperability test server."""
import argparse
+from concurrent import futures
import logging
import time
-from grpc.beta import implementations
+import grpc
from src.proto.grpc.testing import test_pb2
from tests.interop import methods
@@ -51,12 +52,13 @@ def serve():
default=False, type=resources.parse_bool)
args = parser.parse_args()
- server = test_pb2.beta_create_TestService_server(methods.TestService())
+ server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
+ test_pb2.add_TestServiceServicer_to_server(methods.TestService(), server)
if args.use_tls:
private_key = resources.private_key()
certificate_chain = resources.certificate_chain()
- credentials = implementations.ssl_server_credentials(
- [(private_key, certificate_chain)])
+ credentials = grpc.ssl_server_credentials(
+ ((private_key, certificate_chain),))
server.add_secure_port('[::]:{}'.format(args.port), credentials)
else:
server.add_insecure_port('[::]:{}'.format(args.port))
@@ -68,7 +70,7 @@ def serve():
time.sleep(_ONE_DAY_IN_SECONDS)
except BaseException as e:
logging.info('Caught exception "%s"; stopping server...', e)
- server.stop(0)
+ server.stop(None)
logging.info('Server stopped; exiting.')
if __name__ == '__main__':
diff --git a/src/python/grpcio_tests/tests/stress/client.py b/src/python/grpcio_tests/tests/stress/client.py
index 0de2532cd8..975f33b4c1 100644
--- a/src/python/grpcio_tests/tests/stress/client.py
+++ b/src/python/grpcio_tests/tests/stress/client.py
@@ -30,9 +30,10 @@
"""Entry point for running stress tests."""
import argparse
+from concurrent import futures
import threading
-from grpc.beta import implementations
+import grpc
from six.moves import queue
from src.proto.grpc.testing import metrics_pb2
from src.proto.grpc.testing import test_pb2
@@ -92,24 +93,24 @@ def _parse_weighted_test_cases(test_case_args):
def run_test(args):
test_cases = _parse_weighted_test_cases(args.test_cases)
- test_servers = args.server_addresses.split(',')
+ test_server_targets = args.server_addresses.split(',')
# Propagate any client exceptions with a queue
exception_queue = queue.Queue()
stop_event = threading.Event()
hist = histogram.Histogram(1, 1)
runners = []
- server = metrics_pb2.beta_create_MetricsService_server(
- metrics_server.MetricsServer(hist))
+ server = grpc.server(futures.ThreadPoolExecutor(max_workers=25))
+ metrics_pb2.add_MetricsServiceServicer_to_server(
+ metrics_server.MetricsServer(hist), server)
server.add_insecure_port('[::]:{}'.format(args.metrics_port))
server.start()
- for test_server in test_servers:
- host, port = test_server.split(':', 1)
+ for test_server_target in test_server_targets:
for _ in xrange(args.num_channels_per_server):
- channel = implementations.insecure_channel(host, int(port))
+ channel = grpc.insecure_channel(test_server_target)
for _ in xrange(args.num_stubs_per_channel):
- stub = test_pb2.beta_create_TestService_stub(channel)
+ stub = test_pb2.TestServiceStub(channel)
runner = test_runner.TestRunner(stub, test_cases, hist,
exception_queue, stop_event)
runners.append(runner)
@@ -128,8 +129,8 @@ def run_test(args):
stop_event.set()
for runner in runners:
runner.join()
- runner = None
- server.stop(0)
+ runner = None
+ server.stop(None)
if __name__ == '__main__':
run_test(_args())
diff --git a/src/python/grpcio_tests/tests/stress/metrics_server.py b/src/python/grpcio_tests/tests/stress/metrics_server.py
index b994e4643e..33dd1d6f2a 100644
--- a/src/python/grpcio_tests/tests/stress/metrics_server.py
+++ b/src/python/grpcio_tests/tests/stress/metrics_server.py
@@ -36,7 +36,7 @@ from src.proto.grpc.testing import metrics_pb2
GAUGE_NAME = 'python_overall_qps'
-class MetricsServer(metrics_pb2.BetaMetricsServiceServicer):
+class MetricsServer(metrics_pb2.MetricsServiceServicer):
def __init__(self, histogram):
self._start_time = time.time()
diff --git a/src/ruby/README.md b/src/ruby/README.md
index 3179575486..a4d7b56b4e 100644
--- a/src/ruby/README.md
+++ b/src/ruby/README.md
@@ -4,11 +4,6 @@ gRPC Ruby
A Ruby implementation of gRPC.
-Status
-------
-
-Beta
-
PREREQUISITES
-------------
diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb
index 6d65db8306..66c54aa3e0 100644
--- a/src/ruby/ext/grpc/extconf.rb
+++ b/src/ruby/ext/grpc/extconf.rb
@@ -91,6 +91,10 @@ if grpc_config == 'gcov'
$LDFLAGS << ' -fprofile-arcs -ftest-coverage -rdynamic'
end
+if grpc_config == 'dbg'
+ $CFLAGS << ' -O0'
+end
+
$LDFLAGS << ' -Wl,-wrap,memcpy' if RUBY_PLATFORM =~ /linux/
$LDFLAGS << ' -static' if windows
diff --git a/src/ruby/lib/grpc/generic/active_call.rb b/src/ruby/lib/grpc/generic/active_call.rb
index 4260d85437..5787f53463 100644
--- a/src/ruby/lib/grpc/generic/active_call.rb
+++ b/src/ruby/lib/grpc/generic/active_call.rb
@@ -188,7 +188,6 @@ module GRPC
# marshalled.
def remote_send(req, marshalled = false)
# TODO(murgatroid99): ensure metadata was sent
- GRPC.logger.debug("sending #{req}, marshalled? #{marshalled}")
payload = marshalled ? req : @marshal.call(req)
@call.run_batch(SEND_MESSAGE => payload)
end
@@ -225,11 +224,8 @@ module GRPC
@call.metadata = batch_result.metadata
@metadata_received = true
end
- GRPC.logger.debug("received req: #{batch_result}")
unless batch_result.nil? || batch_result.message.nil?
- GRPC.logger.debug("received req.to_s: #{batch_result.message}")
res = @unmarshal.call(batch_result.message)
- GRPC.logger.debug("received_req (unmarshalled): #{res.inspect}")
return res
end
GRPC.logger.debug('found nil; the final response has been sent')
diff --git a/src/ruby/lib/grpc/generic/bidi_call.rb b/src/ruby/lib/grpc/generic/bidi_call.rb
index c2ac3c4daf..75ddff0bfd 100644
--- a/src/ruby/lib/grpc/generic/bidi_call.rb
+++ b/src/ruby/lib/grpc/generic/bidi_call.rb
@@ -61,7 +61,6 @@ module GRPC
@call = call
@marshal = marshal
@op_notifier = nil # signals completion on clients
- @readq = Queue.new
@unmarshal = unmarshal
@metadata_received = metadata_received
@reads_complete = false
@@ -81,8 +80,7 @@ module GRPC
def run_on_client(requests, op_notifier, &blk)
@op_notifier = op_notifier
@enq_th = Thread.new { write_loop(requests) }
- @loop_th = start_read_loop
- each_queued_msg(&blk)
+ read_loop(&blk)
end
# Begins orchestration of the Bidi stream for a server generating replies.
@@ -97,8 +95,7 @@ module GRPC
#
# @param gen_each_reply [Proc] generates the BiDi stream replies.
def run_on_server(gen_each_reply)
- replys = gen_each_reply.call(each_queued_msg)
- @loop_th = start_read_loop(is_client: false)
+ replys = gen_each_reply.call(read_loop(is_client: false))
write_loop(replys, is_client: false)
end
@@ -135,24 +132,6 @@ module GRPC
batch_result
end
- # each_queued_msg yields each message on this instances readq
- #
- # - messages are added to the readq by #read_loop
- # - iteration ends when the instance itself is added
- def each_queued_msg
- return enum_for(:each_queued_msg) unless block_given?
- count = 0
- loop do
- GRPC.logger.debug("each_queued_msg: waiting##{count}")
- count += 1
- req = @readq.pop
- GRPC.logger.debug("each_queued_msg: req = #{req}")
- fail req if req.is_a? StandardError
- break if req.equal?(END_OF_READS)
- yield req
- end
- end
-
def write_loop(requests, is_client: true)
GRPC.logger.debug('bidi-write-loop: starting')
count = 0
@@ -190,47 +169,45 @@ module GRPC
raise e
end
- # starts the read loop
- def start_read_loop(is_client: true)
- Thread.new do
- GRPC.logger.debug('bidi-read-loop: starting')
- begin
- count = 0
- # queue the initial read before beginning the loop
- loop do
- GRPC.logger.debug("bidi-read-loop: #{count}")
- count += 1
- batch_result = read_using_run_batch
-
- # handle the next message
- if batch_result.message.nil?
- GRPC.logger.debug("bidi-read-loop: null batch #{batch_result}")
-
- if is_client
- batch_result = @call.run_batch(RECV_STATUS_ON_CLIENT => nil)
- @call.status = batch_result.status
- batch_result.check_status
- GRPC.logger.debug("bidi-read-loop: done status #{@call.status}")
- end
-
- @readq.push(END_OF_READS)
- GRPC.logger.debug('bidi-read-loop: done reading!')
- break
+ # Provides an enumerator that yields results of remote reads
+ def read_loop(is_client: true)
+ return enum_for(:read_loop,
+ is_client: is_client) unless block_given?
+ GRPC.logger.debug('bidi-read-loop: starting')
+ begin
+ count = 0
+ # queue the initial read before beginning the loop
+ loop do
+ GRPC.logger.debug("bidi-read-loop: #{count}")
+ count += 1
+ batch_result = read_using_run_batch
+
+ # handle the next message
+ if batch_result.message.nil?
+ GRPC.logger.debug("bidi-read-loop: null batch #{batch_result}")
+
+ if is_client
+ batch_result = @call.run_batch(RECV_STATUS_ON_CLIENT => nil)
+ @call.status = batch_result.status
+ batch_result.check_status
+ GRPC.logger.debug("bidi-read-loop: done status #{@call.status}")
end
- # push the latest read onto the queue and continue reading
- res = @unmarshal.call(batch_result.message)
- @readq.push(res)
+ GRPC.logger.debug('bidi-read-loop: done reading!')
+ break
end
- rescue StandardError => e
- GRPC.logger.warn('bidi: read-loop failed')
- GRPC.logger.warn(e)
- @readq.push(e) # let each_queued_msg terminate with this error
+
+ res = @unmarshal.call(batch_result.message)
+ yield res
end
- GRPC.logger.debug('bidi-read-loop: finished')
- @reads_complete = true
- finished
+ rescue StandardError => e
+ GRPC.logger.warn('bidi: read-loop failed')
+ GRPC.logger.warn(e)
+ raise e
end
+ GRPC.logger.debug('bidi-read-loop: finished')
+ @reads_complete = true
+ finished
end
end
end
diff --git a/src/ruby/lib/grpc/generic/rpc_server.rb b/src/ruby/lib/grpc/generic/rpc_server.rb
index 7ea2371365..efdbeb6f2d 100644
--- a/src/ruby/lib/grpc/generic/rpc_server.rb
+++ b/src/ruby/lib/grpc/generic/rpc_server.rb
@@ -391,7 +391,6 @@ module GRPC
# allow the metadata to be accessed from the call
an_rpc.call.metadata = an_rpc.metadata # attaches md to call for handlers
- GRPC.logger.debug("call md is #{an_rpc.metadata}")
connect_md = nil
unless @connect_md_proc.nil?
connect_md = @connect_md_proc.call(an_rpc.method, an_rpc.metadata)
diff --git a/src/ruby/lib/grpc/grpc.rb b/src/ruby/lib/grpc/grpc.rb
index b60a828d66..f46710dc74 100644
--- a/src/ruby/lib/grpc/grpc.rb
+++ b/src/ruby/lib/grpc/grpc.rb
@@ -28,7 +28,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
begin
- require_relative "#{RUBY_VERSION.sub(/\.\d$/, '')}/grpc_c"
-rescue LoadError
- require_relative 'grpc_c'
+ ruby_version_dirname = /(\d+\.\d+)/.match(RUBY_VERSION).to_s
+ distrib_lib_dir = File.expand_path(ruby_version_dirname,
+ File.dirname(__FILE__))
+ if File.directory?(distrib_lib_dir)
+ require_relative "#{distrib_lib_dir}/grpc_c"
+ else
+ require_relative 'grpc_c'
+ end
end
diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb
index 9e53780e44..6de123492d 100644
--- a/src/ruby/lib/grpc/version.rb
+++ b/src/ruby/lib/grpc/version.rb
@@ -29,5 +29,5 @@
# GRPC contains the General RPC module.
module GRPC
- VERSION = '1.0.0.pre2'
+ VERSION = '1.0.1.pre1'
end
diff --git a/src/ruby/pb/test/server.rb b/src/ruby/pb/test/server.rb
index 0808121661..3f1e0a1ccf 100755
--- a/src/ruby/pb/test/server.rb
+++ b/src/ruby/pb/test/server.rb
@@ -129,27 +129,36 @@ def nulls(l)
[].pack('x' * l).force_encoding('ascii-8bit')
end
-# A EnumeratorQueue wraps a Queue yielding the items added to it via each_item.
-class EnumeratorQueue
- extend Forwardable
- def_delegators :@q, :push
-
- def initialize(sentinel)
- @q = Queue.new
- @sentinel = sentinel
- end
+# A FullDuplexEnumerator passes requests to a block and yields generated responses
+class FullDuplexEnumerator
+ include Grpc::Testing
+ include Grpc::Testing::PayloadType
+ def initialize(requests)
+ @requests = requests
+ end
def each_item
return enum_for(:each_item) unless block_given?
- loop do
- r = @q.pop
- break if r.equal?(@sentinel)
- fail r if r.is_a? Exception
- yield r
+ GRPC.logger.info('interop-server: started receiving')
+ begin
+ cls = StreamingOutputCallResponse
+ @requests.each do |req|
+ req.response_parameters.each do |params|
+ resp_size = params.size
+ GRPC.logger.info("read a req, response size is #{resp_size}")
+ yield cls.new(payload: Payload.new(type: req.response_type,
+ body: nulls(resp_size)))
+ end
+ end
+ GRPC.logger.info('interop-server: finished receiving')
+ rescue StandardError => e
+ GRPC.logger.info('interop-server: failed')
+ GRPC.logger.warn(e)
+ fail e
end
end
end
-
+
# A runnable implementation of the schema-specified testing service, with each
# service method implemented as required by the interop testing spec.
class TestTarget < Grpc::Testing::TestService::Service
@@ -182,31 +191,9 @@ class TestTarget < Grpc::Testing::TestService::Service
def full_duplex_call(reqs)
# reqs is a lazy Enumerator of the requests sent by the client.
- q = EnumeratorQueue.new(self)
- cls = StreamingOutputCallResponse
- Thread.new do
- begin
- GRPC.logger.info('interop-server: started receiving')
- reqs.each do |req|
- req.response_parameters.each do |params|
- resp_size = params.size
- GRPC.logger.info("read a req, response size is #{resp_size}")
- resp = cls.new(payload: Payload.new(type: req.response_type,
- body: nulls(resp_size)))
- q.push(resp)
- end
- end
- GRPC.logger.info('interop-server: finished receiving')
- q.push(self)
- rescue StandardError => e
- GRPC.logger.info('interop-server: failed')
- GRPC.logger.warn(e)
- q.push(e) # share the exception with the enumerator
- end
- end
- q.each_item
+ FullDuplexEnumerator.new(reqs).each_item
end
-
+
def half_duplex_call(reqs)
# TODO: update with unique behaviour of the half_duplex_call if that's
# ever required by any of the tests.
diff --git a/src/ruby/qps/client.rb b/src/ruby/qps/client.rb
index 7ed648acef..8aed866da5 100644
--- a/src/ruby/qps/client.rb
+++ b/src/ruby/qps/client.rb
@@ -89,12 +89,14 @@ class BenchmarkClient
payload: gtp.new(type: gtpt::COMPRESSABLE,
body: nulls(simple_params.req_size)))
+ @child_threads = []
+
(0..config.client_channels-1).each do |chan|
gtbss = Grpc::Testing::BenchmarkService::Stub
st = config.server_targets
stub = gtbss.new(st[chan % st.length], cred, **opts)
(0..config.outstanding_rpcs_per_channel-1).each do |r|
- Thread.new {
+ @child_threads << Thread.new {
case config.load_params.load.to_s
when 'closed_loop'
waiter = nil
@@ -162,5 +164,8 @@ class BenchmarkClient
end
def shutdown
@done = true
+ @child_threads.each do |thread|
+ thread.join
+ end
end
end
diff --git a/src/ruby/qps/qps-common.rb b/src/ruby/qps/qps-common.rb
index 4119d600b1..4714ccfdb7 100644
--- a/src/ruby/qps/qps-common.rb
+++ b/src/ruby/qps/qps-common.rb
@@ -52,6 +52,7 @@ def load_test_certs
files.map { |f| File.open(File.join(data_dir, f)).read }
end
+
# A EnumeratorQueue wraps a Queue yielding the items added to it via each_item.
class EnumeratorQueue
extend Forwardable
@@ -73,4 +74,19 @@ class EnumeratorQueue
end
end
+# A PingPongEnumerator reads requests and responds one-by-one when enumerated
+# via #each_item
+class PingPongEnumerator
+ def initialize(reqs)
+ @reqs = reqs
+ end
+ def each_item
+ return enum_for(:each_item) unless block_given?
+ sr = Grpc::Testing::SimpleResponse
+ pl = Grpc::Testing::Payload
+ @reqs.each do |req|
+ yield sr.new(payload: pl.new(body: nulls(req.response_size)))
+ end
+ end
+end
diff --git a/src/ruby/qps/server.rb b/src/ruby/qps/server.rb
index cd98ee1fd9..d0c2073dd1 100644
--- a/src/ruby/qps/server.rb
+++ b/src/ruby/qps/server.rb
@@ -49,16 +49,7 @@ class BenchmarkServiceImpl < Grpc::Testing::BenchmarkService::Service
sr.new(payload: pl.new(body: nulls(req.response_size)))
end
def streaming_call(reqs)
- q = EnumeratorQueue.new(self)
- Thread.new {
- sr = Grpc::Testing::SimpleResponse
- pl = Grpc::Testing::Payload
- reqs.each do |req|
- q.push(sr.new(payload: pl.new(body: nulls(req.response_size))))
- end
- q.push(self)
- }
- q.each_item
+ PingPongEnumerator.new(reqs).each_item
end
end
@@ -71,7 +62,8 @@ class BenchmarkServer
else
cred = :this_port_is_insecure
end
- @server = GRPC::RpcServer.new
+ # Make sure server can handle the large number of calls in benchmarks
+ @server = GRPC::RpcServer.new(pool_size: 100, max_waiting_requests: 100)
@port = @server.add_http2_port("0.0.0.0:" + port.to_s, cred)
@server.handle(BenchmarkServiceImpl.new)
@start_time = Time.now
diff --git a/src/ruby/qps/worker.rb b/src/ruby/qps/worker.rb
index 12b8087ca0..61a0b723a3 100755
--- a/src/ruby/qps/worker.rb
+++ b/src/ruby/qps/worker.rb
@@ -64,8 +64,8 @@ class WorkerServiceImpl < Grpc::Testing::WorkerService::Service
q.push(gtss.new(stats: bms.mark(req.mark.reset), cores: cpu_cores))
end
end
- q.push(self)
bms.stop
+ q.push(self)
}
q.each_item
end
@@ -83,8 +83,8 @@ class WorkerServiceImpl < Grpc::Testing::WorkerService::Service
client.mark(req.mark.reset)))
end
end
- q.push(self)
client.shutdown
+ q.push(self)
}
q.each_item
end
@@ -118,6 +118,10 @@ def main
options['server_port'] = v
end
end.parse!
+
+ # Configure any errors with client or server child threads to surface
+ Thread.abort_on_exception = true
+
s = GRPC::RpcServer.new
s.add_http2_port("0.0.0.0:" + options['driver_port'].to_s,
:this_port_is_insecure)
diff --git a/src/ruby/tools/version.rb b/src/ruby/tools/version.rb
index 84c03b255d..205eca0daa 100644
--- a/src/ruby/tools/version.rb
+++ b/src/ruby/tools/version.rb
@@ -29,6 +29,6 @@
module GRPC
module Tools
- VERSION = '1.0.0.pre2'
+ VERSION = '1.0.1.pre1'
end
end