aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--BUILD3
-rw-r--r--Makefile3
-rw-r--r--build.json2
-rw-r--r--gRPC.podspec38
-rw-r--r--include/grpc/grpc.h20
-rw-r--r--include/grpc/support/string_util.h61
-rw-r--r--src/core/channel/channel_args.c1
-rw-r--r--src/core/debug/trace.c45
-rw-r--r--src/core/debug/trace.h1
-rw-r--r--src/core/httpcli/format_request.c1
-rw-r--r--src/core/httpcli/httpcli.c1
-rw-r--r--src/core/httpcli/httpcli_security_connector.c1
-rw-r--r--src/core/iomgr/endpoint_pair_posix.c1
-rw-r--r--src/core/iomgr/iomgr.c3
-rw-r--r--src/core/iomgr/resolve_address_posix.c1
-rw-r--r--src/core/iomgr/resolve_address_windows.c3
-rw-r--r--src/core/iomgr/sockaddr_utils.c1
-rw-r--r--src/core/iomgr/socket_windows.c2
-rw-r--r--src/core/iomgr/tcp_client_posix.c1
-rw-r--r--src/core/iomgr/tcp_server_posix.c1
-rw-r--r--src/core/iomgr/tcp_server_windows.c1
-rw-r--r--src/core/iomgr/tcp_windows.c1
-rw-r--r--src/core/security/client_auth_filter.c1
-rw-r--r--src/core/security/credentials.c1
-rw-r--r--src/core/security/credentials_posix.c1
-rw-r--r--src/core/security/credentials_win32.c1
-rw-r--r--src/core/security/json_token.c1
-rw-r--r--src/core/security/security_connector.c1
-rw-r--r--src/core/security/security_context.c1
-rw-r--r--src/core/security/server_auth_filter.c1
-rw-r--r--src/core/support/cmdline.c1
-rw-r--r--src/core/support/env_linux.c1
-rw-r--r--src/core/support/env_posix.c1
-rw-r--r--src/core/support/env_win32.c1
-rw-r--r--src/core/support/file.c1
-rw-r--r--src/core/support/file_posix.c1
-rw-r--r--src/core/support/file_win32.c1
-rw-r--r--src/core/support/host_port.c1
-rw-r--r--src/core/support/string.h14
-rw-r--r--src/core/surface/byte_buffer_reader.c15
-rw-r--r--src/core/surface/call.c1
-rw-r--r--src/core/surface/call_log_batch.c1
-rw-r--r--src/core/surface/channel_create.c1
-rw-r--r--src/core/surface/event_string.c1
-rw-r--r--src/core/surface/init.c1
-rw-r--r--src/core/surface/secure_channel_create.c1
-rw-r--r--src/core/surface/server.c1
-rw-r--r--src/core/transport/transport_op_string.c1
-rw-r--r--src/cpp/proto/proto_utils.cc11
-rw-r--r--src/cpp/server/create_default_thread_pool.cc49
-rw-r--r--src/cpp/server/server_builder.cc4
-rw-r--r--src/cpp/server/thread_pool.h2
-rw-r--r--src/cpp/util/byte_buffer.cc7
-rw-r--r--src/csharp/Grpc.Auth/Grpc.Auth.nuspec6
-rw-r--r--src/csharp/Grpc.Core/Grpc.Core.nuspec6
-rw-r--r--src/csharp/Grpc.Tools.nuspec4
-rw-r--r--src/csharp/Grpc.nuspec6
-rw-r--r--src/csharp/ext/grpc_csharp_ext.c9
-rw-r--r--src/node/README.md26
-rw-r--r--src/node/cli/service_packager.js2
-rw-r--r--src/node/examples/perf_test.js2
-rw-r--r--src/node/examples/route_guide_client.js2
-rw-r--r--src/node/examples/route_guide_server.js2
-rw-r--r--src/node/examples/stock_server.js2
-rw-r--r--src/node/ext/byte_buffer.cc6
-rw-r--r--src/node/index.js2
-rw-r--r--src/node/interop/interop_client.js2
-rw-r--r--src/node/interop/interop_server.js2
-rw-r--r--src/node/package.json5
-rw-r--r--src/node/src/client.js2
-rw-r--r--src/node/src/common.js11
-rw-r--r--src/node/src/server.js4
-rw-r--r--src/node/test/surface_test.js6
-rw-r--r--src/objective-c/GRPCClient/private/NSData+GRPC.m13
-rw-r--r--src/objective-c/README.md120
-rw-r--r--src/objective-c/examples/Sample/Podfile1
-rw-r--r--src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h33
-rw-r--r--src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m59
-rw-r--r--src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h221
-rw-r--r--src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m603
-rw-r--r--src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec32
-rw-r--r--src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h12
-rw-r--r--src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m9
-rw-r--r--src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h59
-rw-r--r--src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m96
-rw-r--r--src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.h134
-rw-r--r--src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.m355
-rw-r--r--src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.h43
-rw-r--r--src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.m72
-rw-r--r--src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.podspec26
-rw-r--r--src/objective-c/generated_libraries/RouteGuideClient/Route_guide.podspec24
-rw-r--r--src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto2
-rw-r--r--src/objective-c/tests/LocalClearTextTests.m82
-rw-r--r--src/objective-c/tests/Podfile3
-rw-r--r--src/php/ext/grpc/byte_buffer.c6
-rw-r--r--src/python/README.md63
-rw-r--r--src/python/src/grpc/_adapter/_c/utility.c22
-rw-r--r--src/python/src/grpc/_adapter/_links_test.py2
-rw-r--r--src/ruby/README.md80
-rw-r--r--src/ruby/ext/grpc/extconf.rb47
-rw-r--r--src/ruby/ext/grpc/rb_byte_buffer.c7
-rwxr-xr-xsrc/ruby/grpc.gemspec2
-rw-r--r--src/ruby/lib/grpc/version.rb2
-rw-r--r--test/core/end2end/cq_verifier.c1
-rw-r--r--test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c1
-rw-r--r--test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c4
-rw-r--r--test/core/end2end/tests/census_simple_request.c1
-rw-r--r--test/core/fling/fling_stream_test.c1
-rw-r--r--test/core/fling/fling_test.c3
-rw-r--r--test/core/json/json_test.c1
-rw-r--r--test/core/security/credentials_test.c1
-rw-r--r--test/core/support/murmur_hash_test.c1
-rw-r--r--test/core/support/string_test.c1
-rw-r--r--test/core/surface/byte_buffer_reader_test.c30
-rw-r--r--test/core/transport/chttp2/hpack_table_test.c1
-rw-r--r--test/core/transport/chttp2/stream_encoder_test.c1
-rw-r--r--test/core/transport/chttp2/timeout_encoding_test.c1
-rw-r--r--test/core/transport/metadata_test.c1
-rw-r--r--test/core/tsi/transport_security_test.c1
-rw-r--r--test/cpp/interop/interop_test.cc1
-rw-r--r--tools/README.md6
-rw-r--r--tools/dockerfile/grpc_java/Dockerfile3
-rw-r--r--tools/doxygen/Doxyfile.c++.internal2
-rw-r--r--tools/doxygen/Doxyfile.core2
-rw-r--r--tools/doxygen/Doxyfile.core.internal2
-rwxr-xr-xtools/gce_setup/grpc_docker.sh34
-rwxr-xr-xtools/gce_setup/shared_startup_funcs.sh3
-rw-r--r--tools/jenkins/grpc_jenkins_slave/Dockerfile119
-rwxr-xr-xtools/jenkins/run_jenkins.sh66
-rwxr-xr-xtools/run_tests/build_node.sh2
-rwxr-xr-xtools/run_tests/build_python.sh2
-rwxr-xr-xtools/run_tests/jobset.py40
-rwxr-xr-xtools/run_tests/run_tests.py22
-rw-r--r--vsprojects/gpr/gpr.vcxproj1
-rw-r--r--vsprojects/gpr/gpr.vcxproj.filters3
-rw-r--r--vsprojects/grpc++/grpc++.vcxproj2
-rw-r--r--vsprojects/grpc++/grpc++.vcxproj.filters3
-rw-r--r--vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj2
-rw-r--r--vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters3
-rw-r--r--vsprojects/nuget_package/grpc.native.csharp_ext.nuspec6
140 files changed, 870 insertions, 2159 deletions
diff --git a/BUILD b/BUILD
index f9cdfd7306..bc8fa55a37 100644
--- a/BUILD
+++ b/BUILD
@@ -102,6 +102,7 @@ cc_library(
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
+ "include/grpc/support/string_util.h",
"include/grpc/support/subprocess.h",
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
@@ -586,6 +587,7 @@ cc_library(
"src/cpp/common/rpc_method.cc",
"src/cpp/proto/proto_utils.cc",
"src/cpp/server/async_generic_service.cc",
+ "src/cpp/server/create_default_thread_pool.cc",
"src/cpp/server/insecure_server_credentials.cc",
"src/cpp/server/server.cc",
"src/cpp/server/server_builder.cc",
@@ -665,6 +667,7 @@ cc_library(
"src/cpp/common/rpc_method.cc",
"src/cpp/proto/proto_utils.cc",
"src/cpp/server/async_generic_service.cc",
+ "src/cpp/server/create_default_thread_pool.cc",
"src/cpp/server/insecure_server_credentials.cc",
"src/cpp/server/server.cc",
"src/cpp/server/server_builder.cc",
diff --git a/Makefile b/Makefile
index 60fbc5a05f..1647daaa81 100644
--- a/Makefile
+++ b/Makefile
@@ -2838,6 +2838,7 @@ PUBLIC_HEADERS_C += \
include/grpc/support/port_platform.h \
include/grpc/support/slice.h \
include/grpc/support/slice_buffer.h \
+ include/grpc/support/string_util.h \
include/grpc/support/subprocess.h \
include/grpc/support/sync.h \
include/grpc/support/sync_generic.h \
@@ -3335,6 +3336,7 @@ LIBGRPC++_SRC = \
src/cpp/common/rpc_method.cc \
src/cpp/proto/proto_utils.cc \
src/cpp/server/async_generic_service.cc \
+ src/cpp/server/create_default_thread_pool.cc \
src/cpp/server/insecure_server_credentials.cc \
src/cpp/server/server.cc \
src/cpp/server/server_builder.cc \
@@ -3622,6 +3624,7 @@ LIBGRPC++_UNSECURE_SRC = \
src/cpp/common/rpc_method.cc \
src/cpp/proto/proto_utils.cc \
src/cpp/server/async_generic_service.cc \
+ src/cpp/server/create_default_thread_pool.cc \
src/cpp/server/insecure_server_credentials.cc \
src/cpp/server/server.cc \
src/cpp/server/server_builder.cc \
diff --git a/build.json b/build.json
index 1cf294b253..0ff85a5c0c 100644
--- a/build.json
+++ b/build.json
@@ -83,6 +83,7 @@
"src/cpp/common/rpc_method.cc",
"src/cpp/proto/proto_utils.cc",
"src/cpp/server/async_generic_service.cc",
+ "src/cpp/server/create_default_thread_pool.cc",
"src/cpp/server/insecure_server_credentials.cc",
"src/cpp/server/server.cc",
"src/cpp/server/server_builder.cc",
@@ -316,6 +317,7 @@
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
+ "include/grpc/support/string_util.h",
"include/grpc/support/subprocess.h",
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
diff --git a/gRPC.podspec b/gRPC.podspec
index 217d5ca81e..eaebb27423 100644
--- a/gRPC.podspec
+++ b/gRPC.podspec
@@ -13,23 +13,27 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.8'
s.requires_arc = true
+ # Reactive Extensions library for iOS.
s.subspec 'RxLibrary' do |rs|
- rs.summary = 'Reactive Extensions library for iOS.'
-
rs.source_files = 'src/objective-c/RxLibrary/*.{h,m}',
'src/objective-c/RxLibrary/transformations/*.{h,m}',
'src/objective-c/RxLibrary/private/*.{h,m}'
rs.private_header_files = 'src/objective-c/RxLibrary/private/*.h'
end
+ # Core cross-platform gRPC library, written in C.
s.subspec 'C-Core' do |cs|
- cs.summary = 'Core cross-platform gRPC library, written in C.'
-
cs.source_files = 'src/core/**/*.{h,c}', 'include/grpc/*.h', 'include/grpc/**/*.h'
cs.private_header_files = 'src/core/**/*.h'
cs.header_mappings_dir = '.'
- cs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Build/gRPC" '
- '"$(PODS_ROOT)/Headers/Build/gRPC/include"' }
+ # The core library includes its headers as either "src/core/..." or "grpc/...", meaning we have
+ # to tell XCode to look for headers under the "include" subdirectory too.
+ #
+ # TODO(jcanizales): Instead of doing this, during installation move everything under
+ # "include/grpc" one directory up. The directory names under PODS_ROOT are implementation
+ # details of Cocoapods, and have changed in the past, breaking this podspec.
+ cs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Private/gRPC" ' +
+ '"$(PODS_ROOT)/Headers/Private/gRPC/include"' }
cs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
cs.requires_arc = false
@@ -41,35 +45,38 @@ Pod::Spec.new do |s|
# It renames time.h and string.h to grpc_time.h and grpc_string.h.
# It needs to be here (top-level) instead of in the C-Core subspec because Cocoapods doesn't run
# prepare_command's of subspecs.
+ #
+ # TODO(jcanizales): Try out Todd Reed's solution at Issue #1437.
s.prepare_command = <<-CMD
DIR_TIME="grpc/support"
BAD_TIME="$DIR_TIME/time.h"
GOOD_TIME="$DIR_TIME/grpc_time.h"
+ grep -rl "$BAD_TIME" include/grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
if [ -f "include/$BAD_TIME" ];
then
- grep -rl "$BAD_TIME" include/grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
- mv "include/$BAD_TIME" "include/$GOOD_TIME"
+ mv -f "include/$BAD_TIME" "include/$GOOD_TIME"
fi
DIR_STRING="src/core/support"
BAD_STRING="$DIR_STRING/string.h"
GOOD_STRING="$DIR_STRING/grpc_string.h"
+ grep -rl "$BAD_STRING" include/grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
if [ -f "$BAD_STRING" ];
then
- grep -rl "$BAD_STRING" include/grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
- mv "$BAD_STRING" "$GOOD_STRING"
+ mv -f "$BAD_STRING" "$GOOD_STRING"
fi
CMD
+ # Objective-C wrapper around the core gRPC library.
s.subspec 'GRPCClient' do |gs|
- gs.summary = 'Objective-C wrapper around the core gRPC library.'
-
gs.source_files = 'src/objective-c/GRPCClient/*.{h,m}',
'src/objective-c/GRPCClient/private/*.{h,m}'
gs.private_header_files = 'src/objective-c/GRPCClient/private/*.h'
+ gs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
gs.dependency 'gRPC/C-Core'
- # Is this needed in all dependents?
+ # TODO(jcanizales): Remove this when the prepare_command moves everything under "include/grpc"
+ # one directory up.
gs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Public/gRPC/include"' }
gs.dependency 'gRPC/RxLibrary'
@@ -77,13 +84,12 @@ Pod::Spec.new do |s|
gs.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
end
+ # RPC library for ProtocolBuffers, based on gRPC
s.subspec 'ProtoRPC' do |ps|
- ps.summary = 'RPC library for ProtocolBuffers, based on gRPC'
-
ps.source_files = 'src/objective-c/ProtoRPC/*.{h,m}'
ps.dependency 'gRPC/GRPCClient'
ps.dependency 'gRPC/RxLibrary'
- ps.dependency 'Protobuf', '~> 3.0'
+ ps.dependency 'Protobuf', '~> 3.0.0-alpha-3'
end
end
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index 43ee1211bc..696ec5bad1 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -170,14 +170,18 @@ void grpc_byte_buffer_destroy(grpc_byte_buffer *byte_buffer);
struct grpc_byte_buffer_reader;
typedef struct grpc_byte_buffer_reader grpc_byte_buffer_reader;
-grpc_byte_buffer_reader *grpc_byte_buffer_reader_create(
- grpc_byte_buffer *buffer);
+/** Initialize \a reader to read over \a buffer */
+void grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
+ grpc_byte_buffer *buffer);
+
+/** Cleanup and destroy \a reader */
+void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader);
+
/* At the end of the stream, returns 0. Otherwise, returns 1 and sets slice to
be the returned slice. Caller is responsible for calling gpr_slice_unref on
the result. */
int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
gpr_slice *slice);
-void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader);
/* A single metadata element */
typedef struct grpc_metadata {
@@ -522,6 +526,16 @@ void grpc_server_cancel_all_calls(grpc_server *server);
one call to grpc_server_shutdown_and_notify must have been made). */
void grpc_server_destroy(grpc_server *server);
+/** Enable or disable a tracer.
+
+ Tracers (usually controlled by the environment variable GRPC_TRACE)
+ allow printf-style debugging on GRPC internals, and are useful for
+ tracking down problems in the field.
+
+ Use of this function is not strictly thread-safe, but the
+ thread-safety issues raised by it should not be of concern. */
+int grpc_tracer_set_enabled(const char *name, int enabled);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/grpc/support/string_util.h b/include/grpc/support/string_util.h
new file mode 100644
index 0000000000..515709447b
--- /dev/null
+++ b/include/grpc/support/string_util.h
@@ -0,0 +1,61 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#ifndef GRPC_SUPPORT_STRING_UTIL_H
+#define GRPC_SUPPORT_STRING_UTIL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* String utility functions */
+
+/* Returns a copy of src that can be passed to gpr_free().
+ If allocation fails or if src is NULL, returns NULL. */
+char *gpr_strdup(const char *src);
+
+/* printf to a newly-allocated string. The set of supported formats may vary
+ between platforms.
+
+ On success, returns the number of bytes printed (excluding the final '\0'),
+ and *strp points to a string which must later be destroyed with gpr_free().
+
+ On error, returns -1 and sets *strp to NULL. If the format string is bad,
+ the result is undefined. */
+int gpr_asprintf(char **strp, const char *format, ...);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GRPC_SUPPORT_STRING_UTIL_H */
diff --git a/src/core/channel/channel_args.c b/src/core/channel/channel_args.c
index 509ae0df89..1b0e33b123 100644
--- a/src/core/channel/channel_args.c
+++ b/src/core/channel/channel_args.c
@@ -36,6 +36,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
#include <string.h>
diff --git a/src/core/debug/trace.c b/src/core/debug/trace.c
index 32c35e7fb3..b53dfe804b 100644
--- a/src/core/debug/trace.c
+++ b/src/core/debug/trace.c
@@ -35,6 +35,7 @@
#include <string.h>
+#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/support/env.h"
@@ -80,27 +81,10 @@ static void parse(const char *s) {
char **strings = NULL;
size_t nstrings = 0;
size_t i;
- tracer *t;
split(s, &strings, &nstrings);
for (i = 0; i < nstrings; i++) {
- const char *s = strings[i];
- if (0 == strcmp(s, "all")) {
- for (t = tracers; t; t = t->next) {
- *t->flag = 1;
- }
- } else {
- int found = 0;
- for (t = tracers; t; t = t->next) {
- if (0 == strcmp(s, t->name)) {
- *t->flag = 1;
- found = 1;
- }
- }
- if (!found) {
- gpr_log(GPR_ERROR, "Unknown trace var: '%s'", s);
- }
- }
+ grpc_tracer_set_enabled(strings[i], 1);
}
for (i = 0; i < nstrings; i++) {
@@ -115,9 +99,34 @@ void grpc_tracer_init(const char *env_var) {
parse(e);
gpr_free(e);
}
+}
+
+void grpc_tracer_shutdown(void) {
while (tracers) {
tracer *t = tracers;
tracers = t->next;
gpr_free(t);
}
}
+
+int grpc_tracer_set_enabled(const char *name, int enabled) {
+ tracer *t;
+ if (0 == strcmp(name, "all")) {
+ for (t = tracers; t; t = t->next) {
+ *t->flag = 1;
+ }
+ } else {
+ int found = 0;
+ for (t = tracers; t; t = t->next) {
+ if (0 == strcmp(name, t->name)) {
+ *t->flag = enabled;
+ found = 1;
+ }
+ }
+ if (!found) {
+ gpr_log(GPR_ERROR, "Unknown trace var: '%s'", name);
+ return 0; /* early return */
+ }
+ }
+ return 1;
+}
diff --git a/src/core/debug/trace.h b/src/core/debug/trace.h
index c02f14b7f2..fc8615bc69 100644
--- a/src/core/debug/trace.h
+++ b/src/core/debug/trace.h
@@ -38,5 +38,6 @@
void grpc_register_tracer(const char *name, int *flag);
void grpc_tracer_init(const char *env_var_name);
+void grpc_tracer_shutdown(void);
#endif /* GRPC_INTERNAL_CORE_DEBUG_TRACE_H */
diff --git a/src/core/httpcli/format_request.c b/src/core/httpcli/format_request.c
index af25219084..e875423e87 100644
--- a/src/core/httpcli/format_request.c
+++ b/src/core/httpcli/format_request.c
@@ -40,6 +40,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/slice.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
static void fill_common_header(const grpc_httpcli_request *request, gpr_strvec *buf) {
diff --git a/src/core/httpcli/httpcli.c b/src/core/httpcli/httpcli.c
index d39bcfe55d..1a1bebe9bb 100644
--- a/src/core/httpcli/httpcli.c
+++ b/src/core/httpcli/httpcli.c
@@ -46,6 +46,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
typedef struct {
gpr_slice request_text;
diff --git a/src/core/httpcli/httpcli_security_connector.c b/src/core/httpcli/httpcli_security_connector.c
index 6eed5eaf12..ce0d3d5a70 100644
--- a/src/core/httpcli/httpcli_security_connector.c
+++ b/src/core/httpcli/httpcli_security_connector.c
@@ -39,6 +39,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/tsi/ssl_transport_security.h"
typedef struct {
diff --git a/src/core/iomgr/endpoint_pair_posix.c b/src/core/iomgr/endpoint_pair_posix.c
index 9b3b63f1e7..fa2d2555d6 100644
--- a/src/core/iomgr/endpoint_pair_posix.c
+++ b/src/core/iomgr/endpoint_pair_posix.c
@@ -47,6 +47,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
static void create_sockets(int sv[2]) {
int flags;
diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c
index d2c092b450..c47528aa94 100644
--- a/src/core/iomgr/iomgr.c
+++ b/src/core/iomgr/iomgr.c
@@ -40,8 +40,9 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <grpc/support/thd.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
+#include <grpc/support/thd.h>
static gpr_mu g_mu;
static gpr_cv g_rcv;
diff --git a/src/core/iomgr/resolve_address_posix.c b/src/core/iomgr/resolve_address_posix.c
index fcf48fe0d7..20d8c58eb4 100644
--- a/src/core/iomgr/resolve_address_posix.c
+++ b/src/core/iomgr/resolve_address_posix.c
@@ -47,6 +47,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
diff --git a/src/core/iomgr/resolve_address_windows.c b/src/core/iomgr/resolve_address_windows.c
index 7d0d2f9e7a..fb5fd0d4f6 100644
--- a/src/core/iomgr/resolve_address_windows.c
+++ b/src/core/iomgr/resolve_address_windows.c
@@ -46,6 +46,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
@@ -134,9 +135,9 @@ static void do_request(void *rp) {
grpc_resolve_cb cb = r->cb;
gpr_free(r->name);
gpr_free(r->default_port);
+ grpc_iomgr_unregister_object(&r->iomgr_object);
gpr_free(r);
cb(arg, resolved);
- grpc_iomgr_unregister_object(&r->iomgr_object);
}
void grpc_resolved_addresses_destroy(grpc_resolved_addresses *addrs) {
diff --git a/src/core/iomgr/sockaddr_utils.c b/src/core/iomgr/sockaddr_utils.c
index 3d202a5cc8..e91b94f8c8 100644
--- a/src/core/iomgr/sockaddr_utils.c
+++ b/src/core/iomgr/sockaddr_utils.c
@@ -40,6 +40,7 @@
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <grpc/support/port_platform.h>
+#include <grpc/support/string_util.h>
static const gpr_uint8 kV4MappedPrefix[] = {0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0xff, 0xff};
diff --git a/src/core/iomgr/socket_windows.c b/src/core/iomgr/socket_windows.c
index e4ba0a2b66..fbf3fdc949 100644
--- a/src/core/iomgr/socket_windows.c
+++ b/src/core/iomgr/socket_windows.c
@@ -85,13 +85,13 @@ int grpc_winsocket_shutdown(grpc_winsocket *socket) {
both memory and sockets. */
void grpc_winsocket_orphan(grpc_winsocket *winsocket) {
SOCKET socket = winsocket->socket;
+ grpc_iomgr_unregister_object(&winsocket->iomgr_object);
if (winsocket->read_info.outstanding || winsocket->write_info.outstanding) {
grpc_iocp_socket_orphan(winsocket);
} else {
grpc_winsocket_destroy(winsocket);
}
closesocket(socket);
- grpc_iomgr_unregister_object(&winsocket->iomgr_object);
}
void grpc_winsocket_destroy(grpc_winsocket *winsocket) {
diff --git a/src/core/iomgr/tcp_client_posix.c b/src/core/iomgr/tcp_client_posix.c
index df6203b70c..bbf7711588 100644
--- a/src/core/iomgr/tcp_client_posix.c
+++ b/src/core/iomgr/tcp_client_posix.c
@@ -51,6 +51,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
typedef struct {
diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c
index 713abc6db3..2ac35f863a 100644
--- a/src/core/iomgr/tcp_server_posix.c
+++ b/src/core/iomgr/tcp_server_posix.c
@@ -63,6 +63,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
diff --git a/src/core/iomgr/tcp_server_windows.c b/src/core/iomgr/tcp_server_windows.c
index 9ef369dfd8..d70968de88 100644
--- a/src/core/iomgr/tcp_server_windows.c
+++ b/src/core/iomgr/tcp_server_windows.c
@@ -41,6 +41,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_win32.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
diff --git a/src/core/iomgr/tcp_windows.c b/src/core/iomgr/tcp_windows.c
index 3341f558a3..12dac03080 100644
--- a/src/core/iomgr/tcp_windows.c
+++ b/src/core/iomgr/tcp_windows.c
@@ -41,6 +41,7 @@
#include <grpc/support/log.h>
#include <grpc/support/log_win32.h>
#include <grpc/support/slice_buffer.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "src/core/iomgr/alarm.h"
diff --git a/src/core/security/client_auth_filter.c b/src/core/security/client_auth_filter.c
index 5ef635a262..d11706ece0 100644
--- a/src/core/security/client_auth_filter.c
+++ b/src/core/security/client_auth_filter.c
@@ -37,6 +37,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/support/string.h"
#include "src/core/channel/channel_stack.h"
diff --git a/src/core/security/credentials.c b/src/core/security/credentials.c
index 7fc3f003fd..cf663faf2d 100644
--- a/src/core/security/credentials.c
+++ b/src/core/security/credentials.c
@@ -46,6 +46,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
diff --git a/src/core/security/credentials_posix.c b/src/core/security/credentials_posix.c
index 79622cb024..20f67a7f14 100644
--- a/src/core/security/credentials_posix.c
+++ b/src/core/security/credentials_posix.c
@@ -39,6 +39,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/support/env.h"
#include "src/core/support/string.h"
diff --git a/src/core/security/credentials_win32.c b/src/core/security/credentials_win32.c
index ddb310468b..92dfd9bdfe 100644
--- a/src/core/security/credentials_win32.c
+++ b/src/core/security/credentials_win32.c
@@ -39,6 +39,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/support/env.h"
#include "src/core/support/string.h"
diff --git a/src/core/security/json_token.c b/src/core/security/json_token.c
index eadae33609..6116f1d767 100644
--- a/src/core/security/json_token.c
+++ b/src/core/security/json_token.c
@@ -37,6 +37,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/security/base64.h"
#include "src/core/support/string.h"
diff --git a/src/core/security/security_connector.c b/src/core/security/security_connector.c
index 11505f8cb0..4098636a2e 100644
--- a/src/core/security/security_connector.c
+++ b/src/core/security/security_connector.c
@@ -47,6 +47,7 @@
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <grpc/support/slice_buffer.h>
+#include <grpc/support/string_util.h>
#include "src/core/tsi/fake_transport_security.h"
#include "src/core/tsi/ssl_transport_security.h"
diff --git a/src/core/security/security_context.c b/src/core/security/security_context.c
index 14c194c8f6..9aba1e7f91 100644
--- a/src/core/security/security_context.c
+++ b/src/core/security/security_context.c
@@ -40,6 +40,7 @@
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
/* --- grpc_call --- */
diff --git a/src/core/security/server_auth_filter.c b/src/core/security/server_auth_filter.c
index 1823f75808..b19160b8ed 100644
--- a/src/core/security/server_auth_filter.c
+++ b/src/core/security/server_auth_filter.c
@@ -78,7 +78,6 @@ static void init_call_elem(grpc_call_element *elem,
calld->unused = 0;
GPR_ASSERT(initial_op && initial_op->context != NULL &&
- chand->security_connector->auth_context != NULL &&
initial_op->context[GRPC_CONTEXT_SECURITY].value == NULL);
/* Create a security context for the call and reference the auth context from
diff --git a/src/core/support/cmdline.c b/src/core/support/cmdline.c
index 530952c437..4baad85040 100644
--- a/src/core/support/cmdline.c
+++ b/src/core/support/cmdline.c
@@ -40,6 +40,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
typedef enum { ARGTYPE_INT, ARGTYPE_BOOL, ARGTYPE_STRING } argtype;
diff --git a/src/core/support/env_linux.c b/src/core/support/env_linux.c
index bdadfb6ca4..2e03365e33 100644
--- a/src/core/support/env_linux.c
+++ b/src/core/support/env_linux.c
@@ -45,6 +45,7 @@
#include <stdlib.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/support/string.h"
diff --git a/src/core/support/env_posix.c b/src/core/support/env_posix.c
index 45f89b6737..1dd2af56bc 100644
--- a/src/core/support/env_posix.c
+++ b/src/core/support/env_posix.c
@@ -42,6 +42,7 @@
#include <grpc/support/log.h>
#include "src/core/support/string.h"
+#include <grpc/support/string_util.h>
char *gpr_getenv(const char *name) {
char *result = getenv(name);
diff --git a/src/core/support/env_win32.c b/src/core/support/env_win32.c
index 9b4cd698ad..6b1ff102b0 100644
--- a/src/core/support/env_win32.c
+++ b/src/core/support/env_win32.c
@@ -42,6 +42,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
char *gpr_getenv(const char *name) {
size_t size;
diff --git a/src/core/support/file.c b/src/core/support/file.c
index 3a4ac6f2f0..8ce7a67fb1 100644
--- a/src/core/support/file.c
+++ b/src/core/support/file.c
@@ -38,6 +38,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/support/string.h"
diff --git a/src/core/support/file_posix.c b/src/core/support/file_posix.c
index 11a459ad36..c11c07148a 100644
--- a/src/core/support/file_posix.c
+++ b/src/core/support/file_posix.c
@@ -44,6 +44,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/support/string.h"
diff --git a/src/core/support/file_win32.c b/src/core/support/file_win32.c
index f59d3af397..355744f79a 100644
--- a/src/core/support/file_win32.c
+++ b/src/core/support/file_win32.c
@@ -42,6 +42,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/support/file.h"
#include "src/core/support/string_win32.h"
diff --git a/src/core/support/host_port.c b/src/core/support/host_port.c
index fa49f1a33a..53669f063b 100644
--- a/src/core/support/host_port.c
+++ b/src/core/support/host_port.c
@@ -38,6 +38,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
int gpr_join_host_port(char **out, const char *host, int port) {
if (host[0] != '[' && strchr(host, ':') != NULL) {
diff --git a/src/core/support/string.h b/src/core/support/string.h
index faf3342708..31e9fcb5e9 100644
--- a/src/core/support/string.h
+++ b/src/core/support/string.h
@@ -44,10 +44,6 @@ extern "C" {
/* String utility functions */
-/* Returns a copy of src that can be passed to gpr_free().
- If allocation fails or if src is NULL, returns NULL. */
-char *gpr_strdup(const char *src);
-
/* flag to include plaintext after a hexdump */
#define GPR_HEXDUMP_PLAINTEXT 0x00000001
@@ -71,16 +67,6 @@ int gpr_ltoa(long value, char *output);
/* Reverse a run of bytes */
void gpr_reverse_bytes(char *str, int len);
-/* printf to a newly-allocated string. The set of supported formats may vary
- between platforms.
-
- On success, returns the number of bytes printed (excluding the final '\0'),
- and *strp points to a string which must later be destroyed with gpr_free().
-
- On error, returns -1 and sets *strp to NULL. If the format string is bad,
- the result is undefined. */
-int gpr_asprintf(char **strp, const char *format, ...);
-
/* Join a set of strings, returning the resulting string.
Total combined length (excluding null terminator) is returned in total_length
if it is non-null. */
diff --git a/src/core/surface/byte_buffer_reader.c b/src/core/surface/byte_buffer_reader.c
index fd5289bac3..41ad700274 100644
--- a/src/core/surface/byte_buffer_reader.c
+++ b/src/core/surface/byte_buffer_reader.c
@@ -39,15 +39,18 @@
#include <grpc/support/slice_buffer.h>
#include <grpc/byte_buffer.h>
-grpc_byte_buffer_reader *grpc_byte_buffer_reader_create(
- grpc_byte_buffer *buffer) {
- grpc_byte_buffer_reader *reader = malloc(sizeof(grpc_byte_buffer_reader));
+void grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader,
+ grpc_byte_buffer *buffer) {
reader->buffer = buffer;
switch (buffer->type) {
case GRPC_BB_SLICE_BUFFER:
reader->current.index = 0;
}
- return reader;
+}
+
+void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader) {
+ /* no-op: the user is responsible for memory deallocation.
+ * Other cleanup operations would go here if needed. */
}
int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
@@ -68,7 +71,3 @@ int grpc_byte_buffer_reader_next(grpc_byte_buffer_reader *reader,
}
return 0;
}
-
-void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader) {
- free(reader);
-}
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 2d651be6a5..84a77c45c4 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -42,6 +42,7 @@
#include "src/core/surface/completion_queue.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <assert.h>
#include <stdio.h>
diff --git a/src/core/surface/call_log_batch.c b/src/core/surface/call_log_batch.c
index 9905401bee..55663298c9 100644
--- a/src/core/surface/call_log_batch.c
+++ b/src/core/surface/call_log_batch.c
@@ -35,6 +35,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
int grpc_trace_batch = 0;
diff --git a/src/core/surface/channel_create.c b/src/core/surface/channel_create.c
index d137ce12ac..d069a04a9a 100644
--- a/src/core/surface/channel_create.c
+++ b/src/core/surface/channel_create.c
@@ -53,6 +53,7 @@
#include "src/core/transport/chttp2_transport.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
diff --git a/src/core/surface/event_string.c b/src/core/surface/event_string.c
index 448bb1162b..33cd4a43aa 100644
--- a/src/core/surface/event_string.c
+++ b/src/core/surface/event_string.c
@@ -37,6 +37,7 @@
#include "src/core/support/string.h"
#include <grpc/byte_buffer.h>
+#include <grpc/support/string_util.h>
static void addhdr(gpr_strvec *buf, grpc_event *ev) {
char *tmp;
diff --git a/src/core/surface/init.c b/src/core/surface/init.c
index ac6871c6f2..ca61a38a35 100644
--- a/src/core/surface/init.c
+++ b/src/core/surface/init.c
@@ -78,6 +78,7 @@ void grpc_shutdown(void) {
grpc_iomgr_shutdown();
census_shutdown();
grpc_timers_global_destroy();
+ grpc_tracer_shutdown();
}
gpr_mu_unlock(&g_init_mu);
}
diff --git a/src/core/surface/secure_channel_create.c b/src/core/surface/secure_channel_create.c
index 4854ec9ded..fae3e4e90a 100644
--- a/src/core/surface/secure_channel_create.c
+++ b/src/core/surface/secure_channel_create.c
@@ -56,6 +56,7 @@
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/useful.h>
#include "src/core/tsi/transport_security_interface.h"
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index 68b8d839a0..525fe2e103 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -48,6 +48,7 @@
#include "src/core/transport/metadata.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
typedef enum { PENDING_START, ALL_CALLS, CALL_LIST_COUNT } call_list;
diff --git a/src/core/transport/transport_op_string.c b/src/core/transport/transport_op_string.c
index 7bbe8276c3..5c4edb006a 100644
--- a/src/core/transport/transport_op_string.c
+++ b/src/core/transport/transport_op_string.c
@@ -39,6 +39,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
/* These routines are here to facilitate debugging - they produce string
diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc
index b9554c4bb7..7a7e73bba4 100644
--- a/src/cpp/proto/proto_utils.cc
+++ b/src/cpp/proto/proto_utils.cc
@@ -36,6 +36,7 @@
#include <grpc/grpc.h>
#include <grpc/byte_buffer.h>
+#include <grpc/byte_buffer_reader.h>
#include <grpc/support/slice.h>
#include <grpc/support/slice_buffer.h>
#include <grpc/support/port_platform.h>
@@ -100,11 +101,9 @@ class GrpcBufferReader GRPC_FINAL
public:
explicit GrpcBufferReader(grpc_byte_buffer* buffer)
: byte_count_(0), backup_count_(0) {
- reader_ = grpc_byte_buffer_reader_create(buffer);
- }
- ~GrpcBufferReader() GRPC_OVERRIDE {
- grpc_byte_buffer_reader_destroy(reader_);
+ grpc_byte_buffer_reader_init(&reader_, buffer);
}
+ ~GrpcBufferReader() GRPC_OVERRIDE {}
bool Next(const void** data, int* size) GRPC_OVERRIDE {
if (backup_count_ > 0) {
@@ -114,7 +113,7 @@ class GrpcBufferReader GRPC_FINAL
backup_count_ = 0;
return true;
}
- if (!grpc_byte_buffer_reader_next(reader_, &slice_)) {
+ if (!grpc_byte_buffer_reader_next(&reader_, &slice_)) {
return false;
}
gpr_slice_unref(slice_);
@@ -147,7 +146,7 @@ class GrpcBufferReader GRPC_FINAL
private:
gpr_int64 byte_count_;
gpr_int64 backup_count_;
- grpc_byte_buffer_reader* reader_;
+ grpc_byte_buffer_reader reader_;
gpr_slice slice_;
};
diff --git a/src/cpp/server/create_default_thread_pool.cc b/src/cpp/server/create_default_thread_pool.cc
new file mode 100644
index 0000000000..89c1d7e929
--- /dev/null
+++ b/src/cpp/server/create_default_thread_pool.cc
@@ -0,0 +1,49 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+#include <grpc/support/cpu.h>
+#include "src/cpp/server/thread_pool.h"
+
+#ifndef GRPC_CUSTOM_DEFAULT_THREAD_POOL
+
+namespace grpc {
+
+ThreadPoolInterface* CreateDefaultThreadPool() {
+ int cores = gpr_cpu_num_cores();
+ if (!cores) cores = 4;
+ return new ThreadPool(cores);
+}
+
+} // namespace grpc
+
+#endif // !GRPC_CUSTOM_DEFAULT_THREAD_POOL
diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc
index 4bcbd82952..3ee1d54e76 100644
--- a/src/cpp/server/server_builder.cc
+++ b/src/cpp/server/server_builder.cc
@@ -87,9 +87,7 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() {
return nullptr;
}
if (!thread_pool_ && !services_.empty()) {
- int cores = gpr_cpu_num_cores();
- if (!cores) cores = 4;
- thread_pool_ = new ThreadPool(cores);
+ thread_pool_ = CreateDefaultThreadPool();
thread_pool_owned = true;
}
std::unique_ptr<Server> server(
diff --git a/src/cpp/server/thread_pool.h b/src/cpp/server/thread_pool.h
index 26f25611b5..3b70249bf9 100644
--- a/src/cpp/server/thread_pool.h
+++ b/src/cpp/server/thread_pool.h
@@ -62,6 +62,8 @@ class ThreadPool GRPC_FINAL : public ThreadPoolInterface {
void ThreadFunc();
};
+ThreadPoolInterface* CreateDefaultThreadPool();
+
} // namespace grpc
#endif // GRPC_INTERNAL_CPP_SERVER_THREAD_POOL_H
diff --git a/src/cpp/util/byte_buffer.cc b/src/cpp/util/byte_buffer.cc
index ac2657472c..45eaa2fe5b 100644
--- a/src/cpp/util/byte_buffer.cc
+++ b/src/cpp/util/byte_buffer.cc
@@ -31,6 +31,7 @@
*
*/
+#include <grpc/byte_buffer_reader.h>
#include <grpc++/byte_buffer.h>
namespace grpc {
@@ -56,12 +57,12 @@ void ByteBuffer::Dump(std::vector<Slice>* slices) {
if (!buffer_) {
return;
}
- grpc_byte_buffer_reader* reader = grpc_byte_buffer_reader_create(buffer_);
+ grpc_byte_buffer_reader reader;
+ grpc_byte_buffer_reader_init(&reader,buffer_);
gpr_slice s;
- while (grpc_byte_buffer_reader_next(reader, &s)) {
+ while (grpc_byte_buffer_reader_next(&reader, &s)) {
slices->push_back(Slice(s, Slice::STEAL_REF));
}
- grpc_byte_buffer_reader_destroy(reader);
}
size_t ByteBuffer::Length() {
diff --git a/src/csharp/Grpc.Auth/Grpc.Auth.nuspec b/src/csharp/Grpc.Auth/Grpc.Auth.nuspec
index 171259d18d..e7a538b21b 100644
--- a/src/csharp/Grpc.Auth/Grpc.Auth.nuspec
+++ b/src/csharp/Grpc.Auth/Grpc.Auth.nuspec
@@ -5,19 +5,19 @@
<title>gRPC C# Auth</title>
<summary>Auth library for C# implementation of gRPC - an RPC library and framework</summary>
<description>Auth library for C# implementation of gRPC - an RPC library and framework. See project site for more info.</description>
- <version>0.5.0</version>
+ <version>0.5.1</version>
<authors>Google Inc.</authors>
<owners>grpc-packages</owners>
<licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/grpc/grpc</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
- <releaseNotes>Release 0.5.0 of gRPC C#</releaseNotes>
+ <releaseNotes>Release 0.5.1 of gRPC C#</releaseNotes>
<copyright>Copyright 2015, Google Inc.</copyright>
<tags>gRPC RPC Protocol HTTP/2 Auth OAuth2</tags>
<dependencies>
<dependency id="BouncyCastle" version="1.7.0" />
<dependency id="Google.Apis.Auth" version="1.9.1" />
- <dependency id="Grpc.Core" version="0.5.0" />
+ <dependency id="Grpc.Core" version="0.5.1" />
</dependencies>
</metadata>
<files>
diff --git a/src/csharp/Grpc.Core/Grpc.Core.nuspec b/src/csharp/Grpc.Core/Grpc.Core.nuspec
index 42eb90c9a3..629b978fdf 100644
--- a/src/csharp/Grpc.Core/Grpc.Core.nuspec
+++ b/src/csharp/Grpc.Core/Grpc.Core.nuspec
@@ -5,19 +5,19 @@
<title>gRPC C# Core</title>
<summary>Core C# implementation of gRPC - an RPC library and framework</summary>
<description>Core C# implementation of gRPC - an RPC library and framework. See project site for more info.</description>
- <version>0.5.0</version>
+ <version>0.5.1</version>
<authors>Google Inc.</authors>
<owners>grpc-packages</owners>
<licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/grpc/grpc</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
- <releaseNotes>Release 0.5.0 of gRPC C#</releaseNotes>
+ <releaseNotes>Release 0.5.1 of gRPC C#</releaseNotes>
<copyright>Copyright 2015, Google Inc.</copyright>
<tags>gRPC RPC Protocol HTTP/2</tags>
<dependencies>
<dependency id="Microsoft.Bcl.Immutable" version="1.0.34" />
<dependency id="Ix-Async" version="1.2.3" />
- <dependency id="grpc.native.csharp_ext" version="0.9.0.0" />
+ <dependency id="grpc.native.csharp_ext" version="0.9.1" />
</dependencies>
</metadata>
<files>
diff --git a/src/csharp/Grpc.Tools.nuspec b/src/csharp/Grpc.Tools.nuspec
index 155c2ef8c4..913d4c8f4b 100644
--- a/src/csharp/Grpc.Tools.nuspec
+++ b/src/csharp/Grpc.Tools.nuspec
@@ -5,13 +5,13 @@
<title>gRPC C# Tools</title>
<summary>Tools for C# implementation of gRPC - an RPC library and framework</summary>
<description>Precompiled Windows binaries for generating protocol buffer messages and gRPC client/server code</description>
- <version>0.5.0</version>
+ <version>0.5.1</version>
<authors>Google Inc.</authors>
<owners>grpc-packages</owners>
<licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/grpc/grpc</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
- <releaseNotes>protoc.exe - protocol buffer compiler v3.0.0-alpha-3; grpc_csharp_plugin.exe - gRPC C# protoc plugin version 0.5.0</releaseNotes>
+ <releaseNotes>protoc.exe - protocol buffer compiler v3.0.0-alpha-3; grpc_csharp_plugin.exe - gRPC C# protoc plugin version 0.5.1</releaseNotes>
<copyright>Copyright 2015, Google Inc.</copyright>
<tags>gRPC RPC Protocol HTTP/2</tags>
</metadata>
diff --git a/src/csharp/Grpc.nuspec b/src/csharp/Grpc.nuspec
index 263e016339..cf4c74fa2d 100644
--- a/src/csharp/Grpc.nuspec
+++ b/src/csharp/Grpc.nuspec
@@ -5,17 +5,17 @@
<title>gRPC C#</title>
<summary>C# implementation of gRPC - an RPC library and framework</summary>
<description>C# implementation of gRPC - an RPC library and framework. See project site for more info.</description>
- <version>0.5.0.1</version>
+ <version>0.5.1</version>
<authors>Google Inc.</authors>
<owners>grpc-packages</owners>
<licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/grpc/grpc</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
- <releaseNotes>Release 0.5.0 of gRPC C#</releaseNotes>
+ <releaseNotes>Release 0.5.1 of gRPC C#</releaseNotes>
<copyright>Copyright 2015, Google Inc.</copyright>
<tags>gRPC RPC Protocol HTTP/2</tags>
<dependencies>
- <dependency id="Grpc.Core" version="0.5.0" />
+ <dependency id="Grpc.Core" version="0.5.1" />
</dependencies>
</metadata>
<files/>
diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c
index 173e5c8a46..dc1bbe36f0 100644
--- a/src/csharp/ext/grpc_csharp_ext.c
+++ b/src/csharp/ext/grpc_csharp_ext.c
@@ -33,10 +33,12 @@
#include "src/core/support/string.h"
+#include <grpc/byte_buffer_reader.h>
#include <grpc/support/port_platform.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/slice.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/thd.h>
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
@@ -236,13 +238,13 @@ GPR_EXPORT gpr_intptr GPR_CALLTYPE grpcsharp_batch_context_recv_message_length(
*/
GPR_EXPORT void GPR_CALLTYPE grpcsharp_batch_context_recv_message_to_buffer(
const grpcsharp_batch_context *ctx, char *buffer, size_t buffer_len) {
- grpc_byte_buffer_reader *reader;
+ grpc_byte_buffer_reader reader;
gpr_slice slice;
size_t offset = 0;
- reader = grpc_byte_buffer_reader_create(ctx->recv_message);
+ grpc_byte_buffer_reader_init(&reader, ctx->recv_message);
- while (grpc_byte_buffer_reader_next(reader, &slice)) {
+ while (grpc_byte_buffer_reader_next(&reader, &slice)) {
size_t len = GPR_SLICE_LENGTH(slice);
GPR_ASSERT(offset + len <= buffer_len);
memcpy(buffer + offset, GPR_SLICE_START_PTR(slice),
@@ -250,7 +252,6 @@ 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 6e4934151e..2f4c49096d 100644
--- a/src/node/README.md
+++ b/src/node/README.md
@@ -1,16 +1,22 @@
# Node.js gRPC Library
## Status
-
Alpha : Ready for early adopters
-## Prerequisites
-
-This requires `node` to be installed. If you instead have the `nodejs` executable on Debian, you should install the [`nodejs-legacy`](https://packages.debian.org/sid/nodejs-legacy) package.
+## PREREQUISITES
+- `node`: This requires `node` to be installed. If you instead have the `nodejs` executable on Debian, you should install the [`nodejs-legacy`](https://packages.debian.org/sid/nodejs-legacy) package.
+- [homebrew][] on Mac OS X, [linuxbrew][] on Linux. These simplify the installation of the gRPC C core.
-## Installation
+## INSTALLATION
+On Mac OS X, install [homebrew][]. On Linux, install [linuxbrew][].
+Run the following command to install gRPC Node.js.
+```sh
+$ curl -fsSL https://goo.gl/getgrpc | bash -s nodejs
+```
+This will download and run the [gRPC install script][], then install the latest version of gRPC Nodejs npm package.
- 1. Clone [the grpc repository](https://github.com/grpc/grpc).
+## BUILD FROM SOURCE
+ 1. Clone [the grpc Git Repository](https://github.com/grpc/grpc).
2. Follow the instructions in the `INSTALL` file in the root of that repository to install the C core library that this package depends on.
3. Run `npm install`.
@@ -20,12 +26,10 @@ If you install the gRPC C core library in a custom location, then you need to se
CXXFLAGS=-I<custom location>/include LDFLAGS=-L<custom location>/lib npm install [grpc]
```
-## Tests
-
+## TESTING
To run the test suite, simply run `npm test` in the install location.
## API
-
This library internally uses [ProtoBuf.js](https://github.com/dcodeIO/ProtoBuf.js), and some structures it exports match those exported by that library
If you require this module, you will get an object with the following members
@@ -82,3 +86,7 @@ ServerCredentials
```
An object with factory methods fro creating credential objects for servers.
+
+[homebrew]:http://brew.sh
+[linuxbrew]:https://github.com/Homebrew/linuxbrew#installation
+[gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
diff --git a/src/node/cli/service_packager.js b/src/node/cli/service_packager.js
index f29180b252..c92c450a01 100644
--- a/src/node/cli/service_packager.js
+++ b/src/node/cli/service_packager.js
@@ -36,7 +36,7 @@
var fs = require('fs');
var path = require('path');
-var _ = require('underscore');
+var _ = require('lodash');
var async = require('async');
var pbjs = require('protobufjs/cli/pbjs');
var parseArgs = require('minimist');
diff --git a/src/node/examples/perf_test.js b/src/node/examples/perf_test.js
index 31083e0987..da919eced5 100644
--- a/src/node/examples/perf_test.js
+++ b/src/node/examples/perf_test.js
@@ -35,7 +35,7 @@
var grpc = require('..');
var testProto = grpc.load(__dirname + '/../interop/test.proto').grpc.testing;
-var _ = require('underscore');
+var _ = require('lodash');
var interop_server = require('../interop/interop_server.js');
function runTest(iterations, callback) {
diff --git a/src/node/examples/route_guide_client.js b/src/node/examples/route_guide_client.js
index 0b3e9c5819..8cd532fef1 100644
--- a/src/node/examples/route_guide_client.js
+++ b/src/node/examples/route_guide_client.js
@@ -37,7 +37,7 @@ var async = require('async');
var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
-var _ = require('underscore');
+var _ = require('lodash');
var grpc = require('..');
var examples = grpc.load(__dirname + '/route_guide.proto').examples;
var client = new examples.RouteGuide('localhost:50051');
diff --git a/src/node/examples/route_guide_server.js b/src/node/examples/route_guide_server.js
index 9555368422..c777eab7bc 100644
--- a/src/node/examples/route_guide_server.js
+++ b/src/node/examples/route_guide_server.js
@@ -36,7 +36,7 @@
var fs = require('fs');
var parseArgs = require('minimist');
var path = require('path');
-var _ = require('underscore');
+var _ = require('lodash');
var grpc = require('..');
var examples = grpc.load(__dirname + '/route_guide.proto').examples;
diff --git a/src/node/examples/stock_server.js b/src/node/examples/stock_server.js
index 8c22af147e..caaf9f99ba 100644
--- a/src/node/examples/stock_server.js
+++ b/src/node/examples/stock_server.js
@@ -33,7 +33,7 @@
'use strict';
-var _ = require('underscore');
+var _ = require('lodash');
var grpc = require('..');
var examples = grpc.load(__dirname + '/stock.proto').examples;
diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc
index 01bd92ea52..2c84099069 100644
--- a/src/node/ext/byte_buffer.cc
+++ b/src/node/ext/byte_buffer.cc
@@ -36,6 +36,7 @@
#include <node.h>
#include <nan.h>
#include "grpc/grpc.h"
+#include "grpc/byte_buffer_reader.h"
#include "grpc/support/slice.h"
#include "byte_buffer.h"
@@ -69,9 +70,10 @@ Handle<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
size_t length = grpc_byte_buffer_length(buffer);
char *result = reinterpret_cast<char *>(calloc(length, sizeof(char)));
size_t offset = 0;
- grpc_byte_buffer_reader *reader = grpc_byte_buffer_reader_create(buffer);
+ grpc_byte_buffer_reader reader;
+ grpc_byte_buffer_reader_init(&reader, buffer);
gpr_slice next;
- while (grpc_byte_buffer_reader_next(reader, &next) != 0) {
+ while (grpc_byte_buffer_reader_next(&reader, &next) != 0) {
memcpy(result + offset, GPR_SLICE_START_PTR(next), GPR_SLICE_LENGTH(next));
offset += GPR_SLICE_LENGTH(next);
}
diff --git a/src/node/index.js b/src/node/index.js
index c09e416c6e..b6a4e2d0ee 100644
--- a/src/node/index.js
+++ b/src/node/index.js
@@ -33,7 +33,7 @@
'use strict';
-var _ = require('underscore');
+var _ = require('lodash');
var ProtoBuf = require('protobufjs');
diff --git a/src/node/interop/interop_client.js b/src/node/interop/interop_client.js
index 455055d9f3..b61b0b63c0 100644
--- a/src/node/interop/interop_client.js
+++ b/src/node/interop/interop_client.js
@@ -35,7 +35,7 @@
var fs = require('fs');
var path = require('path');
-var _ = require('underscore');
+var _ = require('lodash');
var grpc = require('..');
var testProto = grpc.load(__dirname + '/test.proto').grpc.testing;
var GoogleAuth = require('google-auth-library');
diff --git a/src/node/interop/interop_server.js b/src/node/interop/interop_server.js
index dad59c1347..0baa78a094 100644
--- a/src/node/interop/interop_server.js
+++ b/src/node/interop/interop_server.js
@@ -35,7 +35,7 @@
var fs = require('fs');
var path = require('path');
-var _ = require('underscore');
+var _ = require('lodash');
var grpc = require('..');
var testProto = grpc.load(__dirname + '/test.proto').grpc.testing;
var Server = grpc.buildServer([testProto.TestService.service]);
diff --git a/src/node/package.json b/src/node/package.json
index d7e9af07bd..3ea2c065e7 100644
--- a/src/node/package.json
+++ b/src/node/package.json
@@ -25,10 +25,9 @@
},
"dependencies": {
"bindings": "^1.2.0",
+ "lodash": "^3.9.3",
"nan": "^1.5.0",
- "protobufjs": "dcodeIO/ProtoBuf.js",
- "underscore": "^1.6.0",
- "underscore.string": "^3.0.0"
+ "protobufjs": "dcodeIO/ProtoBuf.js"
},
"devDependencies": {
"async": "^0.9.0",
diff --git a/src/node/src/client.js b/src/node/src/client.js
index 65339406b2..b7bad949d4 100644
--- a/src/node/src/client.js
+++ b/src/node/src/client.js
@@ -33,7 +33,7 @@
'use strict';
-var _ = require('underscore');
+var _ = require('lodash');
var grpc = require('bindings')('grpc.node');
diff --git a/src/node/src/common.js b/src/node/src/common.js
index 98917c0fdd..7b543353eb 100644
--- a/src/node/src/common.js
+++ b/src/node/src/common.js
@@ -33,10 +33,7 @@
'use strict';
-var _ = require('underscore');
-
-var capitalize = require('underscore.string/capitalize');
-var decapitalize = require('underscore.string/decapitalize');
+var _ = require('lodash');
/**
* Get a function that deserializes a specific type of protobuf.
@@ -81,7 +78,7 @@ function fullyQualifiedName(value) {
}
var name = value.name;
if (value.className === 'Service.RPCMethod') {
- name = capitalize(name);
+ name = _.capitalize(name);
}
if (value.hasOwnProperty('parent')) {
var parent_name = fullyQualifiedName(value.parent);
@@ -118,8 +115,8 @@ function wrapIgnoreNull(func) {
function getProtobufServiceAttrs(service) {
var prefix = '/' + fullyQualifiedName(service) + '/';
return _.object(_.map(service.children, function(method) {
- return [decapitalize(method.name), {
- path: prefix + capitalize(method.name),
+ return [_.camelCase(method.name), {
+ path: prefix + _.capitalize(method.name),
requestStream: method.requestStream,
responseStream: method.responseStream,
requestSerialize: serializeCls(method.resolvedRequestType.build()),
diff --git a/src/node/src/server.js b/src/node/src/server.js
index 079495afd4..c6cf9e7eb8 100644
--- a/src/node/src/server.js
+++ b/src/node/src/server.js
@@ -33,7 +33,7 @@
'use strict';
-var _ = require('underscore');
+var _ = require('lodash');
var grpc = require('bindings')('grpc.node');
@@ -48,8 +48,6 @@ var util = require('util');
var EventEmitter = require('events').EventEmitter;
-var common = require('./common.js');
-
/**
* Handle an error on a call by sending it as a status
* @param {grpc.Call} call The call to send the error on
diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js
index b390f8b2a5..8d1f99aaee 100644
--- a/src/node/test/surface_test.js
+++ b/src/node/test/surface_test.js
@@ -45,9 +45,7 @@ var math_proto = ProtoBuf.loadProtoFile(__dirname + '/../examples/math.proto');
var mathService = math_proto.lookup('math.Math');
-var capitalize = require('underscore.string/capitalize');
-
-var _ = require('underscore');
+var _ = require('lodash');
describe('File loader', function() {
it('Should load a proto file by default', function() {
@@ -159,7 +157,7 @@ describe('Generic client and server', function() {
server = new Server({
string: {
capitalize: function(call, callback) {
- callback(null, capitalize(call.request));
+ callback(null, _.capitalize(call.request));
}
}
});
diff --git a/src/objective-c/GRPCClient/private/NSData+GRPC.m b/src/objective-c/GRPCClient/private/NSData+GRPC.m
index 6ea4ce979e..3a7f76887b 100644
--- a/src/objective-c/GRPCClient/private/NSData+GRPC.m
+++ b/src/objective-c/GRPCClient/private/NSData+GRPC.m
@@ -34,23 +34,26 @@
#import "NSData+GRPC.h"
#include <grpc/byte_buffer.h>
+#include <grpc/byte_buffer_reader.h>
#include <string.h>
// TODO(jcanizales): Move these two incantations to the C library.
static void CopyByteBufferToCharArray(grpc_byte_buffer *buffer, char *array) {
size_t offset = 0;
- grpc_byte_buffer_reader *reader = grpc_byte_buffer_reader_create(buffer);
+ grpc_byte_buffer_reader reader;
+ grpc_byte_buffer_reader_init(&reader, buffer);
gpr_slice next;
- while (grpc_byte_buffer_reader_next(reader, &next) != 0){
- memcpy(array + offset, GPR_SLICE_START_PTR(next), (size_t) GPR_SLICE_LENGTH(next));
+ while (grpc_byte_buffer_reader_next(&reader, &next) != 0){
+ memcpy(array + offset, GPR_SLICE_START_PTR(next),
+ (size_t)GPR_SLICE_LENGTH(next));
offset += GPR_SLICE_LENGTH(next);
gpr_slice_unref(next);
}
- grpc_byte_buffer_reader_destroy(reader);
}
-static grpc_byte_buffer *CopyCharArrayToNewByteBuffer(const char *array, size_t length) {
+static grpc_byte_buffer *CopyCharArrayToNewByteBuffer(const char *array,
+ size_t length) {
gpr_slice slice = gpr_slice_from_copied_buffer(array, length);
grpc_byte_buffer *buffer = grpc_byte_buffer_create(&slice, 1);
gpr_slice_unref(slice);
diff --git a/src/objective-c/README.md b/src/objective-c/README.md
index 921eb69231..728e226480 100644
--- a/src/objective-c/README.md
+++ b/src/objective-c/README.md
@@ -1,78 +1,89 @@
# gRPC for Objective-C
- [Install protoc with the gRPC plugin](#install)
-- [Use protoc to generate a gRPC library](#protoc)
-- [Integrate the generated gRPC library in your project](#cocoapods)
+- [Write your API declaration in proto format](#write-protos)
+- [Integrate a proto library in your project](#cocoapods)
- [Use the generated library in your code](#use)
-- [Alternative methods](#alternatives)
- - [Install protoc and the gRPC plugin without using Homebrew](#nohomebrew)
- - [Integrate the generated gRPC library without using Cocoapods](#nococoapods)
+- [Use gRPC without Protobuf](#no-proto)
+- [Alternative installation methods](#alternatives)
+ - [Install protoc and the gRPC plugin without using Homebrew](#no-homebrew)
+ - [Integrate the generated gRPC library without using Cocoapods](#no-cocoapods)
+
+While gRPC doesn't require the use of an IDL to describe the API of services, using one simplifies
+usage and adds some interoperability guarantees. Here we use [Protocol Buffers][], and provide a
+plugin for the Protobuf Compiler (_protoc_) to generate client libraries to communicate with gRPC
+services.
<a name="install"></a>
## Install protoc with the gRPC plugin
On Mac OS X, install [homebrew][]. On Linux, install [linuxbrew][].
-Run the following command to install the Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin:
+Run the following command to install _protoc_ and the gRPC _protoc_ plugin:
```sh
$ curl -fsSL https://goo.gl/getgrpc | bash -
```
-This will download and run the [gRPC install script][]. After the command completes, you're ready to proceed.
-
-<a name="protoc"></a>
-## Use protoc to generate a gRPC library
+This will download and run the [gRPC install script][]. After the command completes, you're ready to
+proceed.
-Run _protoc_ with the following flags to generate the client library for your `.proto` files:
-
-```sh
-protoc --objc_out=. --objcgrpc_out=. *.proto
-```
+<a name="write-protos"></a>
+## Write your API declaration in proto format
-This will generate a pair of `.pbobjc.h`/`.pbobjc.m` files for each `.proto` file, with the messages and enums defined in them. And a pair of `.pbrpc.h`/`.pbrpc.m` files for each `.proto` file with services defined. The latter contains the code to make remote calls to the specified API.
+For this you can consult the [Protocol Buffers][]' official documentation, or learn from a quick
+example [here](https://github.com/grpc/grpc-common#defining-a-service).
<a name="cocoapods"></a>
-## Integrate the generated gRPC library in your project
+## Integrate a proto library in your project
Install [Cocoapods](https://cocoapods.org/#install).
-You need to create a Podspec file for the generated library. You may simply copy the following example to the directory where the source files were generated, updating the name and other metadata of the Podspec as necessary:
+You need to create a Podspec file for your proto library. You may simply copy the following example
+to the directory where your `.proto` files are located, updating the name, version and license as
+necessary:
```ruby
Pod::Spec.new do |s|
s.name = '<Podspec file name>'
- s.version = '...'
- s.summary = 'Client library to make RPCs to <my proto API>'
- s.homepage = '...'
+ s.version = '0.0.1'
s.license = '...'
- s.authors = { '<my name>' => '<my email>' }
s.ios.deployment_target = '6.0'
s.osx.deployment_target = '10.8'
- s.subspec 'Messages' do |ms|
- ms.source_files = '*.pbobjc.{h,m}', '**/*.pbobjc.{h,m}'
- ms.header_mappings_dir = '.'
+ # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+ # You can run this command manually if you later change your protos and need to regenerate.
+ s.prepare_command = "protoc --objc_out=. --objcgrpc_out=. *.proto **/*.proto"
+
+ # The --objc_out plugin generates a pair of .pbobjc.h/.pbobjc.m files for each .proto file.
+ s.subspec "Messages" do |ms|
+ ms.source_files = "*.pbobjc.{h,m}", "**/*.pbobjc.{h,m}"
+ ms.header_mappings_dir = "."
ms.requires_arc = false
- ms.dependency 'Protobuf', '~> 3.0'
+ ms.dependency "Protobuf", "~> 3.0.0-alpha-3"
end
- s.subspec 'Services' do |ss|
- ss.source_files = '*.pbrpc.{h,m}', '**/*.pbrpc.{h,m}'
- ss.header_mappings_dir = '.'
+ # The --objcgrpc_out plugin generates a pair of .pbrpc.h/.pbrpc.m files for each .proto file with
+ # a service defined.
+ s.subspec "Services" do |ss|
+ ss.source_files = "*.pbrpc.{h,m}", "**/*.pbrpc.{h,m}"
+ ss.header_mappings_dir = "."
ss.requires_arc = true
- ss.dependency 'gRPC', '~> 0.0'
- ss.dependency '<Podspec file name>/Messages'
+ ss.dependency "gRPC", "~> 0.5"
+ ss.dependency "#{s.name}/Messages"
end
end
```
-The file should be named `<Podspec file name>.podspec`. You can refer to this [example Podspec][]. Once your library has a Podspec, Cocoapods can install it into any XCode project. For that, go into your project's directory and create a Podfile by running:
+The file should be named `<Podspec file name>.podspec`. Once your library has a Podspec, Cocoapods
+can install it into any XCode project. For that, go into your project's directory and create a
+Podfile by running:
```sh
pod init
```
-Next add a line to your Podfile to refer to your library's Podspec. Use `:path` as described [here](https://guides.cocoapods.org/using/the-podfile.html#using-the-files-from-a-folder-local-to-the-machine):
+Next add a line to your Podfile to refer to your library's Podspec. Use `:path` as described
+[here](https://guides.cocoapods.org/using/the-podfile.html#using-the-files-from-a-folder-local-to-the-machine):
```ruby
pod '<Podspec file name>', :path => 'path/to/the/directory/of/your/podspec'
@@ -91,15 +102,25 @@ pod install
Please check this [sample app][] for examples of how to use a generated gRPC library.
+<a name="no-proto"></a>
+## Use gRPC without Protobuf
+
+The [sample app][] has an example of how to use the generic gRPC Objective-C client without
+generated files.
+
<a name="alternatives"></a>
-## Alternative methods
+## Alternative installation methods
-<a name="nohomebrew"></a>
+<a name="no-homebrew"></a>
### Install protoc and the gRPC plugin without using Homebrew
-First install v3 of the Protocol Buffers compiler (_protoc_), by cloning [its Git repository](https://github.com/google/protobuf) and following these [installation instructions](https://github.com/google/protobuf#c-installation---unix) (the ones titled C++; don't miss the note for Mac users).
+First install v3 of the Protocol Buffers compiler (_protoc_), by cloning
+[its Git repository](https://github.com/google/protobuf) and following these
+[installation instructions](https://github.com/google/protobuf#c-installation---unix)
+(the ones titled C++; don't miss the note for Mac users).
-Then clone this repository and execute the following commands from the root directory where it was cloned.
+Then clone this repository and execute the following commands from the root directory where it was
+cloned.
Compile the gRPC plugins for _protoc_:
```sh
@@ -110,23 +131,32 @@ Create a symbolic link to the compiled plugin binary somewhere in your `$PATH`:
```sh
ln -s `pwd`/bins/opt/grpc_objective_c_plugin /usr/local/bin/protoc-gen-objcgrpc
```
-(Notice that the name of the created link must begin with "protoc-gen-" for _protoc_ to recognize it as a plugin).
+(Notice that the name of the created link must begin with "protoc-gen-" for _protoc_ to recognize it
+as a plugin).
-If you don't want to create the symbolic link, you can alternatively copy the binary (with the appropriate name). Or you might prefer instead to specify the plugin's path as a flag when invoking _protoc_, in which case no system modification nor renaming is necessary.
+If you don't want to create the symbolic link, you can alternatively copy the binary (with the
+appropriate name). Or you might prefer instead to specify the plugin's path as a flag when invoking
+_protoc_, in which case no system modification nor renaming is necessary.
-<a name="nococoapods"></a>
+<a name="no-cocoapods"></a>
### Integrate the generated gRPC library without using Cocoapods
-You need to compile the generated `.pbpbjc.*` files (the enums and messages) without ARC support, and the generated `.pbrpc.*` files (the services) with ARC support. The generated code depends on v0.3+ of the Objective-C gRPC runtime library and v3.0+ of the Objective-C Protobuf runtime library.
+You need to compile the generated `.pbpbjc.*` files (the enums and messages) without ARC support,
+and the generated `.pbrpc.*` files (the services) with ARC support. The generated code depends on
+v0.5+ of the Objective-C gRPC runtime library and v3.0.0-alpha-3+ of the Objective-C Protobuf
+runtime library.
-These libraries need to be integrated into your project as described in their respective Podspec files:
+These libraries need to be integrated into your project as described in their respective Podspec
+files:
-* [Podspec](https://github.com/grpc/grpc/blob/master/gRPC.podspec) for the Objective-C gRPC runtime library. This can be tedious to configure manually.
-* [Podspec](https://github.com/jcanizales/protobuf/blob/add-podspec/Protobuf.podspec) for the Objective-C Protobuf runtime library.
+* [Podspec](https://github.com/grpc/grpc/blob/master/gRPC.podspec) for the Objective-C gRPC runtime
+library. This can be tedious to configure manually.
+* [Podspec](https://github.com/jcanizales/protobuf/blob/add-podspec/Protobuf.podspec) for the
+Objective-C Protobuf runtime library.
+[Protocol Buffers]:https://developers.google.com/protocol-buffers/
[homebrew]:http://brew.sh
[linuxbrew]:https://github.com/Homebrew/linuxbrew
[gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
-[example Podspec]:https://github.com/grpc/grpc/blob/master/src/objective-c/examples/Sample/RemoteTestClient/RemoteTest.podspec
[example Podfile]:https://github.com/grpc/grpc/blob/master/src/objective-c/examples/Sample/Podfile
[sample app]: https://github.com/grpc/grpc/tree/master/src/objective-c/examples/Sample
diff --git a/src/objective-c/examples/Sample/Podfile b/src/objective-c/examples/Sample/Podfile
index f3c49c12a1..72308c1619 100644
--- a/src/objective-c/examples/Sample/Podfile
+++ b/src/objective-c/examples/Sample/Podfile
@@ -2,7 +2,6 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'gRPC', :path => "../../../.."
-pod 'Protobuf', :git => 'https://github.com/google/protobuf.git'
pod 'RemoteTest', :path => "../../generated_libraries/RemoteTestClient"
target 'Sample' do
diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h b/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h
deleted file mode 100644
index 809d0dde6e..0000000000
--- a/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: empty.proto
-
-#import "GPBProtocolBuffers.h"
-
-#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000
-#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources.
-#endif
-
-CF_EXTERN_C_BEGIN
-
-@class RMTEmpty;
-
-
-#pragma mark - RMTEmptyRoot
-
-@interface RMTEmptyRoot : GPBRootObject
-@end
-
-#pragma mark - RMTEmpty
-
-// An empty message that you can re-use to avoid defining duplicated empty
-// messages in your project. A typical example is to use it as argument or the
-// return value of a service API. For instance:
-//
-// service Foo {
-// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
-// };
-@interface RMTEmpty : GPBMessage
-
-@end
-
-CF_EXTERN_C_END
diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m b/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m
deleted file mode 100644
index 46d481af66..0000000000
--- a/src/objective-c/generated_libraries/RemoteTestClient/Empty.pbobjc.m
+++ /dev/null
@@ -1,59 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: empty.proto
-
-#import "GPBProtocolBuffers_RuntimeSupport.h"
-
-#import "Empty.pbobjc.h"
-
-#pragma mark - RMTEmptyRoot
-
-@implementation RMTEmptyRoot
-
-@end
-
-static GPBFileDescriptor *RMTEmptyRoot_FileDescriptor(void) {
- // This is called by +initialize so there is no need to worry
- // about thread safety of the singleton.
- static GPBFileDescriptor *descriptor = NULL;
- if (!descriptor) {
- descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"grpc.testing"
- syntax:GPBFileSyntaxProto3];
- }
- return descriptor;
-}
-
-#pragma mark - RMTEmpty
-
-@implementation RMTEmpty
-
-
-typedef struct RMTEmpty_Storage {
- uint32_t _has_storage_[0];
-} RMTEmpty_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RMTEmpty class]
- rootClass:[RMTEmptyRoot class]
- file:RMTEmptyRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RMTEmpty_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h b/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h
deleted file mode 100644
index 5f32314175..0000000000
--- a/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.h
+++ /dev/null
@@ -1,221 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: messages.proto
-
-#import "GPBProtocolBuffers.h"
-
-#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000
-#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources.
-#endif
-
-CF_EXTERN_C_BEGIN
-
-@class RMTPayload;
-@class RMTResponseParameters;
-@class RMTSimpleRequest;
-@class RMTSimpleResponse;
-@class RMTStreamingInputCallRequest;
-@class RMTStreamingInputCallResponse;
-@class RMTStreamingOutputCallRequest;
-@class RMTStreamingOutputCallResponse;
-
-#pragma mark - Enum RMTPayloadType
-
-// The type of payload that should be returned.
-typedef GPB_ENUM(RMTPayloadType) {
- RMTPayloadType_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue,
- // Compressable text format.
- RMTPayloadType_Compressable = 0,
-
- // Uncompressable binary format.
- RMTPayloadType_Uncompressable = 1,
-
- // Randomly chosen from all other formats defined in this enum.
- RMTPayloadType_Random = 2,
-};
-
-GPBEnumDescriptor *RMTPayloadType_EnumDescriptor(void);
-
-BOOL RMTPayloadType_IsValidValue(int32_t value);
-
-
-#pragma mark - RMTMessagesRoot
-
-@interface RMTMessagesRoot : GPBRootObject
-@end
-
-#pragma mark - RMTPayload
-
-typedef GPB_ENUM(RMTPayload_FieldNumber) {
- RMTPayload_FieldNumber_Type = 1,
- RMTPayload_FieldNumber_Body = 2,
-};
-
-// A block of data, to simply increase gRPC message size.
-@interface RMTPayload : GPBMessage
-
-// The type of data in body.
-@property(nonatomic, readwrite) RMTPayloadType type;
-
-// Primary contents of payload.
-@property(nonatomic, readwrite, copy) NSData *body;
-
-@end
-
-int32_t RMTPayload_Type_RawValue(RMTPayload *message);
-void SetRMTPayload_Type_RawValue(RMTPayload *message, int32_t value);
-
-#pragma mark - RMTSimpleRequest
-
-typedef GPB_ENUM(RMTSimpleRequest_FieldNumber) {
- RMTSimpleRequest_FieldNumber_ResponseType = 1,
- RMTSimpleRequest_FieldNumber_ResponseSize = 2,
- RMTSimpleRequest_FieldNumber_Payload = 3,
- RMTSimpleRequest_FieldNumber_FillUsername = 4,
- RMTSimpleRequest_FieldNumber_FillOauthScope = 5,
-};
-
-// Unary request.
-@interface RMTSimpleRequest : GPBMessage
-
-// Desired payload type in the response from the server.
-// If response_type is RANDOM, server randomly chooses one from other formats.
-@property(nonatomic, readwrite) RMTPayloadType responseType;
-
-// Desired payload size in the response from the server.
-// If response_type is COMPRESSABLE, this denotes the size before compression.
-@property(nonatomic, readwrite) int32_t responseSize;
-
-// Optional input payload sent along with the request.
-@property(nonatomic, readwrite) BOOL hasPayload;
-@property(nonatomic, readwrite, strong) RMTPayload *payload;
-
-// Whether SimpleResponse should include username.
-@property(nonatomic, readwrite) BOOL fillUsername;
-
-// Whether SimpleResponse should include OAuth scope.
-@property(nonatomic, readwrite) BOOL fillOauthScope;
-
-@end
-
-int32_t RMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message);
-void SetRMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message, int32_t value);
-
-#pragma mark - RMTSimpleResponse
-
-typedef GPB_ENUM(RMTSimpleResponse_FieldNumber) {
- RMTSimpleResponse_FieldNumber_Payload = 1,
- RMTSimpleResponse_FieldNumber_Username = 2,
- RMTSimpleResponse_FieldNumber_OauthScope = 3,
-};
-
-// Unary response, as configured by the request.
-@interface RMTSimpleResponse : GPBMessage
-
-// Payload to increase message size.
-@property(nonatomic, readwrite) BOOL hasPayload;
-@property(nonatomic, readwrite, strong) RMTPayload *payload;
-
-// The user the request came from, for verifying authentication was
-// successful when the client expected it.
-@property(nonatomic, readwrite, copy) NSString *username;
-
-// OAuth scope.
-@property(nonatomic, readwrite, copy) NSString *oauthScope;
-
-@end
-
-#pragma mark - RMTStreamingInputCallRequest
-
-typedef GPB_ENUM(RMTStreamingInputCallRequest_FieldNumber) {
- RMTStreamingInputCallRequest_FieldNumber_Payload = 1,
-};
-
-// Client-streaming request.
-@interface RMTStreamingInputCallRequest : GPBMessage
-
-// Optional input payload sent along with the request.
-@property(nonatomic, readwrite) BOOL hasPayload;
-@property(nonatomic, readwrite, strong) RMTPayload *payload;
-
-@end
-
-#pragma mark - RMTStreamingInputCallResponse
-
-typedef GPB_ENUM(RMTStreamingInputCallResponse_FieldNumber) {
- RMTStreamingInputCallResponse_FieldNumber_AggregatedPayloadSize = 1,
-};
-
-// Client-streaming response.
-@interface RMTStreamingInputCallResponse : GPBMessage
-
-// Aggregated size of payloads received from the client.
-@property(nonatomic, readwrite) int32_t aggregatedPayloadSize;
-
-@end
-
-#pragma mark - RMTResponseParameters
-
-typedef GPB_ENUM(RMTResponseParameters_FieldNumber) {
- RMTResponseParameters_FieldNumber_Size = 1,
- RMTResponseParameters_FieldNumber_IntervalUs = 2,
-};
-
-// Configuration for a particular response.
-@interface RMTResponseParameters : GPBMessage
-
-// Desired payload sizes in responses from the server.
-// If response_type is COMPRESSABLE, this denotes the size before compression.
-@property(nonatomic, readwrite) int32_t size;
-
-// Desired interval between consecutive responses in the response stream in
-// microseconds.
-@property(nonatomic, readwrite) int32_t intervalUs;
-
-@end
-
-#pragma mark - RMTStreamingOutputCallRequest
-
-typedef GPB_ENUM(RMTStreamingOutputCallRequest_FieldNumber) {
- RMTStreamingOutputCallRequest_FieldNumber_ResponseType = 1,
- RMTStreamingOutputCallRequest_FieldNumber_ResponseParametersArray = 2,
- RMTStreamingOutputCallRequest_FieldNumber_Payload = 3,
-};
-
-// Server-streaming request.
-@interface RMTStreamingOutputCallRequest : GPBMessage
-
-// Desired payload type in the response from the server.
-// If response_type is RANDOM, the payload from each response in the stream
-// might be of different types. This is to simulate a mixed type of payload
-// stream.
-@property(nonatomic, readwrite) RMTPayloadType responseType;
-
-// Configuration for each expected response message.
-// |responseParametersArray| contains |RMTResponseParameters|
-@property(nonatomic, readwrite, strong) NSMutableArray *responseParametersArray;
-
-// Optional input payload sent along with the request.
-@property(nonatomic, readwrite) BOOL hasPayload;
-@property(nonatomic, readwrite, strong) RMTPayload *payload;
-
-@end
-
-int32_t RMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message);
-void SetRMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message, int32_t value);
-
-#pragma mark - RMTStreamingOutputCallResponse
-
-typedef GPB_ENUM(RMTStreamingOutputCallResponse_FieldNumber) {
- RMTStreamingOutputCallResponse_FieldNumber_Payload = 1,
-};
-
-// Server-streaming response, as configured by the request and parameters.
-@interface RMTStreamingOutputCallResponse : GPBMessage
-
-// Payload to increase response size.
-@property(nonatomic, readwrite) BOOL hasPayload;
-@property(nonatomic, readwrite, strong) RMTPayload *payload;
-
-@end
-
-CF_EXTERN_C_END
diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m b/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m
deleted file mode 100644
index 98eb1dc87c..0000000000
--- a/src/objective-c/generated_libraries/RemoteTestClient/Messages.pbobjc.m
+++ /dev/null
@@ -1,603 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: messages.proto
-
-#import "GPBProtocolBuffers_RuntimeSupport.h"
-
-#import "Messages.pbobjc.h"
-
-#pragma mark - RMTMessagesRoot
-
-@implementation RMTMessagesRoot
-
-@end
-
-static GPBFileDescriptor *RMTMessagesRoot_FileDescriptor(void) {
- // This is called by +initialize so there is no need to worry
- // about thread safety of the singleton.
- static GPBFileDescriptor *descriptor = NULL;
- if (!descriptor) {
- descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"grpc.testing"
- syntax:GPBFileSyntaxProto3];
- }
- return descriptor;
-}
-
-#pragma mark - Enum RMTPayloadType
-
-GPBEnumDescriptor *RMTPayloadType_EnumDescriptor(void) {
- static GPBEnumDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageEnumValueDescription values[] = {
- { .name = "Compressable", .number = RMTPayloadType_Compressable },
- { .name = "Uncompressable", .number = RMTPayloadType_Uncompressable },
- { .name = "Random", .number = RMTPayloadType_Random },
- };
- descriptor = [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(RMTPayloadType)
- values:values
- valueCount:sizeof(values) / sizeof(GPBMessageEnumValueDescription)
- enumVerifier:RMTPayloadType_IsValidValue];
- }
- return descriptor;
-}
-
-BOOL RMTPayloadType_IsValidValue(int32_t value__) {
- switch (value__) {
- case RMTPayloadType_Compressable:
- case RMTPayloadType_Uncompressable:
- case RMTPayloadType_Random:
- return YES;
- default:
- return NO;
- }
-}
-
-#pragma mark - RMTPayload
-
-@implementation RMTPayload
-
-@dynamic type;
-@dynamic body;
-
-typedef struct RMTPayload_Storage {
- uint32_t _has_storage_[1];
- RMTPayloadType type;
- NSData *body;
-} RMTPayload_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "type",
- .number = RMTPayload_FieldNumber_Type,
- .hasIndex = 0,
- .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor,
- .type = GPBTypeEnum,
- .offset = offsetof(RMTPayload_Storage, type),
- .defaultValue.valueEnum = RMTPayloadType_Compressable,
- .typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor,
- .fieldOptions = NULL,
- },
- {
- .name = "body",
- .number = RMTPayload_FieldNumber_Body,
- .hasIndex = 1,
- .flags = GPBFieldOptional,
- .type = GPBTypeData,
- .offset = offsetof(RMTPayload_Storage, body),
- .defaultValue.valueData = nil,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RMTPayload class]
- rootClass:[RMTMessagesRoot class]
- file:RMTMessagesRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RMTPayload_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-int32_t RMTPayload_Type_RawValue(RMTPayload *message) {
- GPBDescriptor *descriptor = [RMTPayload descriptor];
- GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTPayload_FieldNumber_Type];
- return GPBGetInt32IvarWithField(message, field);
-}
-
-void SetRMTPayload_Type_RawValue(RMTPayload *message, int32_t value) {
- GPBDescriptor *descriptor = [RMTPayload descriptor];
- GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTPayload_FieldNumber_Type];
- GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
-}
-
-#pragma mark - RMTSimpleRequest
-
-@implementation RMTSimpleRequest
-
-@dynamic responseType;
-@dynamic responseSize;
-@dynamic hasPayload, payload;
-@dynamic fillUsername;
-@dynamic fillOauthScope;
-
-typedef struct RMTSimpleRequest_Storage {
- uint32_t _has_storage_[1];
- BOOL fillUsername;
- BOOL fillOauthScope;
- RMTPayloadType responseType;
- int32_t responseSize;
- RMTPayload *payload;
-} RMTSimpleRequest_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "responseType",
- .number = RMTSimpleRequest_FieldNumber_ResponseType,
- .hasIndex = 0,
- .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor,
- .type = GPBTypeEnum,
- .offset = offsetof(RMTSimpleRequest_Storage, responseType),
- .defaultValue.valueEnum = RMTPayloadType_Compressable,
- .typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor,
- .fieldOptions = NULL,
- },
- {
- .name = "responseSize",
- .number = RMTSimpleRequest_FieldNumber_ResponseSize,
- .hasIndex = 1,
- .flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(RMTSimpleRequest_Storage, responseSize),
- .defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- {
- .name = "payload",
- .number = RMTSimpleRequest_FieldNumber_Payload,
- .hasIndex = 2,
- .flags = GPBFieldOptional,
- .type = GPBTypeMessage,
- .offset = offsetof(RMTSimpleRequest_Storage, payload),
- .defaultValue.valueMessage = nil,
- .typeSpecific.className = GPBStringifySymbol(RMTPayload),
- .fieldOptions = NULL,
- },
- {
- .name = "fillUsername",
- .number = RMTSimpleRequest_FieldNumber_FillUsername,
- .hasIndex = 3,
- .flags = GPBFieldOptional,
- .type = GPBTypeBool,
- .offset = offsetof(RMTSimpleRequest_Storage, fillUsername),
- .defaultValue.valueBool = NO,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- {
- .name = "fillOauthScope",
- .number = RMTSimpleRequest_FieldNumber_FillOauthScope,
- .hasIndex = 4,
- .flags = GPBFieldOptional,
- .type = GPBTypeBool,
- .offset = offsetof(RMTSimpleRequest_Storage, fillOauthScope),
- .defaultValue.valueBool = NO,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RMTSimpleRequest class]
- rootClass:[RMTMessagesRoot class]
- file:RMTMessagesRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RMTSimpleRequest_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-int32_t RMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message) {
- GPBDescriptor *descriptor = [RMTSimpleRequest descriptor];
- GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTSimpleRequest_FieldNumber_ResponseType];
- return GPBGetInt32IvarWithField(message, field);
-}
-
-void SetRMTSimpleRequest_ResponseType_RawValue(RMTSimpleRequest *message, int32_t value) {
- GPBDescriptor *descriptor = [RMTSimpleRequest descriptor];
- GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTSimpleRequest_FieldNumber_ResponseType];
- GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
-}
-
-#pragma mark - RMTSimpleResponse
-
-@implementation RMTSimpleResponse
-
-@dynamic hasPayload, payload;
-@dynamic username;
-@dynamic oauthScope;
-
-typedef struct RMTSimpleResponse_Storage {
- uint32_t _has_storage_[1];
- RMTPayload *payload;
- NSString *username;
- NSString *oauthScope;
-} RMTSimpleResponse_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "payload",
- .number = RMTSimpleResponse_FieldNumber_Payload,
- .hasIndex = 0,
- .flags = GPBFieldOptional,
- .type = GPBTypeMessage,
- .offset = offsetof(RMTSimpleResponse_Storage, payload),
- .defaultValue.valueMessage = nil,
- .typeSpecific.className = GPBStringifySymbol(RMTPayload),
- .fieldOptions = NULL,
- },
- {
- .name = "username",
- .number = RMTSimpleResponse_FieldNumber_Username,
- .hasIndex = 1,
- .flags = GPBFieldOptional,
- .type = GPBTypeString,
- .offset = offsetof(RMTSimpleResponse_Storage, username),
- .defaultValue.valueString = nil,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- {
- .name = "oauthScope",
- .number = RMTSimpleResponse_FieldNumber_OauthScope,
- .hasIndex = 2,
- .flags = GPBFieldOptional,
- .type = GPBTypeString,
- .offset = offsetof(RMTSimpleResponse_Storage, oauthScope),
- .defaultValue.valueString = nil,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RMTSimpleResponse class]
- rootClass:[RMTMessagesRoot class]
- file:RMTMessagesRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RMTSimpleResponse_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-#pragma mark - RMTStreamingInputCallRequest
-
-@implementation RMTStreamingInputCallRequest
-
-@dynamic hasPayload, payload;
-
-typedef struct RMTStreamingInputCallRequest_Storage {
- uint32_t _has_storage_[1];
- RMTPayload *payload;
-} RMTStreamingInputCallRequest_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "payload",
- .number = RMTStreamingInputCallRequest_FieldNumber_Payload,
- .hasIndex = 0,
- .flags = GPBFieldOptional,
- .type = GPBTypeMessage,
- .offset = offsetof(RMTStreamingInputCallRequest_Storage, payload),
- .defaultValue.valueMessage = nil,
- .typeSpecific.className = GPBStringifySymbol(RMTPayload),
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingInputCallRequest class]
- rootClass:[RMTMessagesRoot class]
- file:RMTMessagesRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RMTStreamingInputCallRequest_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-#pragma mark - RMTStreamingInputCallResponse
-
-@implementation RMTStreamingInputCallResponse
-
-@dynamic aggregatedPayloadSize;
-
-typedef struct RMTStreamingInputCallResponse_Storage {
- uint32_t _has_storage_[1];
- int32_t aggregatedPayloadSize;
-} RMTStreamingInputCallResponse_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "aggregatedPayloadSize",
- .number = RMTStreamingInputCallResponse_FieldNumber_AggregatedPayloadSize,
- .hasIndex = 0,
- .flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(RMTStreamingInputCallResponse_Storage, aggregatedPayloadSize),
- .defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingInputCallResponse class]
- rootClass:[RMTMessagesRoot class]
- file:RMTMessagesRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RMTStreamingInputCallResponse_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-#pragma mark - RMTResponseParameters
-
-@implementation RMTResponseParameters
-
-@dynamic size;
-@dynamic intervalUs;
-
-typedef struct RMTResponseParameters_Storage {
- uint32_t _has_storage_[1];
- int32_t size;
- int32_t intervalUs;
-} RMTResponseParameters_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "size",
- .number = RMTResponseParameters_FieldNumber_Size,
- .hasIndex = 0,
- .flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(RMTResponseParameters_Storage, size),
- .defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- {
- .name = "intervalUs",
- .number = RMTResponseParameters_FieldNumber_IntervalUs,
- .hasIndex = 1,
- .flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(RMTResponseParameters_Storage, intervalUs),
- .defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RMTResponseParameters class]
- rootClass:[RMTMessagesRoot class]
- file:RMTMessagesRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RMTResponseParameters_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-#pragma mark - RMTStreamingOutputCallRequest
-
-@implementation RMTStreamingOutputCallRequest
-
-@dynamic responseType;
-@dynamic responseParametersArray;
-@dynamic hasPayload, payload;
-
-typedef struct RMTStreamingOutputCallRequest_Storage {
- uint32_t _has_storage_[1];
- RMTPayloadType responseType;
- NSMutableArray *responseParametersArray;
- RMTPayload *payload;
-} RMTStreamingOutputCallRequest_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "responseType",
- .number = RMTStreamingOutputCallRequest_FieldNumber_ResponseType,
- .hasIndex = 0,
- .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor,
- .type = GPBTypeEnum,
- .offset = offsetof(RMTStreamingOutputCallRequest_Storage, responseType),
- .defaultValue.valueEnum = RMTPayloadType_Compressable,
- .typeSpecific.enumDescFunc = RMTPayloadType_EnumDescriptor,
- .fieldOptions = NULL,
- },
- {
- .name = "responseParametersArray",
- .number = RMTStreamingOutputCallRequest_FieldNumber_ResponseParametersArray,
- .hasIndex = GPBNoHasBit,
- .flags = GPBFieldRepeated,
- .type = GPBTypeMessage,
- .offset = offsetof(RMTStreamingOutputCallRequest_Storage, responseParametersArray),
- .defaultValue.valueMessage = nil,
- .typeSpecific.className = GPBStringifySymbol(RMTResponseParameters),
- .fieldOptions = NULL,
- },
- {
- .name = "payload",
- .number = RMTStreamingOutputCallRequest_FieldNumber_Payload,
- .hasIndex = 2,
- .flags = GPBFieldOptional,
- .type = GPBTypeMessage,
- .offset = offsetof(RMTStreamingOutputCallRequest_Storage, payload),
- .defaultValue.valueMessage = nil,
- .typeSpecific.className = GPBStringifySymbol(RMTPayload),
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingOutputCallRequest class]
- rootClass:[RMTMessagesRoot class]
- file:RMTMessagesRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RMTStreamingOutputCallRequest_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-int32_t RMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message) {
- GPBDescriptor *descriptor = [RMTStreamingOutputCallRequest descriptor];
- GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTStreamingOutputCallRequest_FieldNumber_ResponseType];
- return GPBGetInt32IvarWithField(message, field);
-}
-
-void SetRMTStreamingOutputCallRequest_ResponseType_RawValue(RMTStreamingOutputCallRequest *message, int32_t value) {
- GPBDescriptor *descriptor = [RMTStreamingOutputCallRequest descriptor];
- GPBFieldDescriptor *field = [descriptor fieldWithNumber:RMTStreamingOutputCallRequest_FieldNumber_ResponseType];
- GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
-}
-
-#pragma mark - RMTStreamingOutputCallResponse
-
-@implementation RMTStreamingOutputCallResponse
-
-@dynamic hasPayload, payload;
-
-typedef struct RMTStreamingOutputCallResponse_Storage {
- uint32_t _has_storage_[1];
- RMTPayload *payload;
-} RMTStreamingOutputCallResponse_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "payload",
- .number = RMTStreamingOutputCallResponse_FieldNumber_Payload,
- .hasIndex = 0,
- .flags = GPBFieldOptional,
- .type = GPBTypeMessage,
- .offset = offsetof(RMTStreamingOutputCallResponse_Storage, payload),
- .defaultValue.valueMessage = nil,
- .typeSpecific.className = GPBStringifySymbol(RMTPayload),
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RMTStreamingOutputCallResponse class]
- rootClass:[RMTMessagesRoot class]
- file:RMTMessagesRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RMTStreamingOutputCallResponse_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
diff --git a/src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec b/src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec
index 36c2b509e8..0066313ff6 100644
--- a/src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec
+++ b/src/objective-c/generated_libraries/RemoteTestClient/RemoteTest.podspec
@@ -1,24 +1,26 @@
Pod::Spec.new do |s|
- s.name = 'RemoteTest'
- s.version = '0.0.1'
- s.summary = 'Protobuf library generated from test.proto, messages.proto, and empty.proto'
- s.homepage = 'https://github.com/grpc/grpc/tree/master/src/objective-c/examples/Sample/RemoteTestClient'
- s.license = 'New BSD'
- s.authors = { 'Jorge Canizales' => 'jcanizales@google.com' }
+ s.name = "RemoteTest"
+ s.version = "0.0.1"
+ s.license = "New BSD"
- s.ios.deployment_target = '6.0'
- s.osx.deployment_target = '10.8'
+ s.ios.deployment_target = "6.0"
+ s.osx.deployment_target = "10.8"
- s.subspec 'Messages' do |ms|
- ms.source_files = '*.pbobjc.{h,m}'
+ # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+ s.prepare_command = "protoc --objc_out=. --objcgrpc_out=. *.proto **/*.proto"
+
+ s.subspec "Messages" do |ms|
+ ms.source_files = "*.pbobjc.{h,m}", "**/*.pbobjc.{h,m}"
+ ms.header_mappings_dir = "."
ms.requires_arc = false
- ms.dependency 'Protobuf', '~> 3.0'
+ ms.dependency "Protobuf", "~> 3.0.0-alpha-3"
end
- s.subspec 'Services' do |ss|
- ss.source_files = '*.pbrpc.{h,m}'
+ s.subspec "Services" do |ss|
+ ss.source_files = "*.pbrpc.{h,m}", "**/*.pbrpc.{h,m}"
+ ss.header_mappings_dir = "."
ss.requires_arc = true
- ss.dependency 'gRPC', '~> 0.0'
- ss.dependency 'RemoteTest/Messages'
+ ss.dependency "gRPC", "~> 0.5"
+ ss.dependency "#{s.name}/Messages"
end
end
diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h
deleted file mode 100644
index aaa0b6ce2d..0000000000
--- a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.h
+++ /dev/null
@@ -1,12 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: test.proto
-
-#import "GPBProtocolBuffers.h"
-
-#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000
-#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources.
-#endif
-
-CF_EXTERN_C_BEGIN
-
-CF_EXTERN_C_END
diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m
deleted file mode 100644
index 08562b828a..0000000000
--- a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbobjc.m
+++ /dev/null
@@ -1,9 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: test.proto
-
-// File empty because all messages, extensions and enum have been filtered.
-
-
-// Dummy symbol that will be stripped but will avoid linker warnings about
-// no symbols in the .o form compiling this file.
-static int RMTTestRoot_dummy __attribute__((unused,used)) = 0;
diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h
deleted file mode 100644
index f799c4fc92..0000000000
--- a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#import "Test.pbobjc.h"
-#import <gRPC/ProtoService.h>
-
-#import "Empty.pbobjc.h"
-#import "Messages.pbobjc.h"
-
-@protocol GRXWriteable;
-@protocol GRXWriter;
-
-@protocol RMTTestService <NSObject>
-
-#pragma mark EmptyCall(Empty) returns (Empty)
-
-- (void)emptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler;
-
-- (ProtoRPC *)RPCToEmptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler;
-
-
-#pragma mark UnaryCall(SimpleRequest) returns (SimpleResponse)
-
-- (void)unaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler;
-
-- (ProtoRPC *)RPCToUnaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler;
-
-
-#pragma mark StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
-
-- (void)streamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
-
-- (ProtoRPC *)RPCToStreamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
-
-
-#pragma mark StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse)
-
-- (void)streamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler;
-
-- (ProtoRPC *)RPCToStreamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler;
-
-
-#pragma mark FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
-
-- (void)fullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
-
-- (ProtoRPC *)RPCToFullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
-
-
-#pragma mark HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
-
-- (void)halfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
-
-- (ProtoRPC *)RPCToHalfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler;
-
-
-@end
-
-// Basic service implementation, over gRPC, that only does marshalling and parsing.
-@interface RMTTestService : ProtoService<RMTTestService>
-- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER;
-@end
diff --git a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m b/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m
deleted file mode 100644
index faba07769e..0000000000
--- a/src/objective-c/generated_libraries/RemoteTestClient/Test.pbrpc.m
+++ /dev/null
@@ -1,96 +0,0 @@
-#import "Test.pbrpc.h"
-#import <gRPC/GRXWriteable.h>
-#import <gRPC/GRXWriter+Immediate.h>
-#import <gRPC/ProtoRPC.h>
-
-static NSString *const kPackageName = @"grpc.testing";
-static NSString *const kServiceName = @"TestService";
-
-@implementation RMTTestService
-
-// Designated initializer
-- (instancetype)initWithHost:(NSString *)host {
- return (self = [super initWithHost:host packageName:kPackageName serviceName:kServiceName]);
-}
-
-// Override superclass initializer to disallow different package and service names.
-- (instancetype)initWithHost:(NSString *)host
- packageName:(NSString *)packageName
- serviceName:(NSString *)serviceName {
- return [self initWithHost:host];
-}
-
-
-#pragma mark EmptyCall(Empty) returns (Empty)
-
-- (void)emptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler{
- [[self RPCToEmptyCallWithRequest:request handler:handler] start];
-}
-// Returns a not-yet-started RPC object.
-- (ProtoRPC *)RPCToEmptyCallWithRequest:(RMTEmpty *)request handler:(void(^)(RMTEmpty *response, NSError *error))handler{
- return [self RPCToMethod:@"EmptyCall"
- requestsWriter:[GRXWriter writerWithValue:request]
- responseClass:[RMTEmpty class]
- responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]];
-}
-#pragma mark UnaryCall(SimpleRequest) returns (SimpleResponse)
-
-- (void)unaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler{
- [[self RPCToUnaryCallWithRequest:request handler:handler] start];
-}
-// Returns a not-yet-started RPC object.
-- (ProtoRPC *)RPCToUnaryCallWithRequest:(RMTSimpleRequest *)request handler:(void(^)(RMTSimpleResponse *response, NSError *error))handler{
- return [self RPCToMethod:@"UnaryCall"
- requestsWriter:[GRXWriter writerWithValue:request]
- responseClass:[RMTSimpleResponse class]
- responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]];
-}
-#pragma mark StreamingOutputCall(StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
-
-- (void)streamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
- [[self RPCToStreamingOutputCallWithRequest:request handler:handler] start];
-}
-// Returns a not-yet-started RPC object.
-- (ProtoRPC *)RPCToStreamingOutputCallWithRequest:(RMTStreamingOutputCallRequest *)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
- return [self RPCToMethod:@"StreamingOutputCall"
- requestsWriter:[GRXWriter writerWithValue:request]
- responseClass:[RMTStreamingOutputCallResponse class]
- responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]];
-}
-#pragma mark StreamingInputCall(stream StreamingInputCallRequest) returns (StreamingInputCallResponse)
-
-- (void)streamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler{
- [[self RPCToStreamingInputCallWithRequestsWriter:request handler:handler] start];
-}
-// Returns a not-yet-started RPC object.
-- (ProtoRPC *)RPCToStreamingInputCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RMTStreamingInputCallResponse *response, NSError *error))handler{
- return [self RPCToMethod:@"StreamingInputCall"
- requestsWriter:request
- responseClass:[RMTStreamingInputCallResponse class]
- responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]];
-}
-#pragma mark FullDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
-
-- (void)fullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
- [[self RPCToFullDuplexCallWithRequestsWriter:request handler:handler] start];
-}
-// Returns a not-yet-started RPC object.
-- (ProtoRPC *)RPCToFullDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
- return [self RPCToMethod:@"FullDuplexCall"
- requestsWriter:request
- responseClass:[RMTStreamingOutputCallResponse class]
- responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]];
-}
-#pragma mark HalfDuplexCall(stream StreamingOutputCallRequest) returns (stream StreamingOutputCallResponse)
-
-- (void)halfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
- [[self RPCToHalfDuplexCallWithRequestsWriter:request handler:handler] start];
-}
-// Returns a not-yet-started RPC object.
-- (ProtoRPC *)RPCToHalfDuplexCallWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RMTStreamingOutputCallResponse *response, NSError *error))handler{
- return [self RPCToMethod:@"HalfDuplexCall"
- requestsWriter:request
- responseClass:[RMTStreamingOutputCallResponse class]
- responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]];
-}
-@end
diff --git a/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.h b/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.h
deleted file mode 100644
index 6efaec7f02..0000000000
--- a/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.h
+++ /dev/null
@@ -1,134 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: route_guide.proto
-
-#import "GPBProtocolBuffers.h"
-
-#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30000
-#error This file was generated by a different version of protoc-gen-objc which is incompatible with your Protocol Buffer sources.
-#endif
-
-CF_EXTERN_C_BEGIN
-
-@class RGDFeature;
-@class RGDPoint;
-@class RGDRectangle;
-@class RGDRouteNote;
-@class RGDRouteSummary;
-
-
-#pragma mark - RGDRouteGuideRoot
-
-@interface RGDRouteGuideRoot : GPBRootObject
-@end
-
-#pragma mark - RGDPoint
-
-typedef GPB_ENUM(RGDPoint_FieldNumber) {
- RGDPoint_FieldNumber_Latitude = 1,
- RGDPoint_FieldNumber_Longitude = 2,
-};
-
-// Points are represented as latitude-longitude pairs in the E7 representation
-// (degrees multiplied by 10**7 and rounded to the nearest integer).
-// Latitudes should be in the range +/- 90 degrees and longitude should be in
-// the range +/- 180 degrees (inclusive).
-@interface RGDPoint : GPBMessage
-
-@property(nonatomic, readwrite) int32_t latitude;
-
-@property(nonatomic, readwrite) int32_t longitude;
-
-@end
-
-#pragma mark - RGDRectangle
-
-typedef GPB_ENUM(RGDRectangle_FieldNumber) {
- RGDRectangle_FieldNumber_Lo = 1,
- RGDRectangle_FieldNumber_Hi = 2,
-};
-
-// A latitude-longitude rectangle, represented as two diagonally opposite
-// points "lo" and "hi".
-@interface RGDRectangle : GPBMessage
-
-// One corner of the rectangle.
-@property(nonatomic, readwrite) BOOL hasLo;
-@property(nonatomic, readwrite, strong) RGDPoint *lo;
-
-// The other corner of the rectangle.
-@property(nonatomic, readwrite) BOOL hasHi;
-@property(nonatomic, readwrite, strong) RGDPoint *hi;
-
-@end
-
-#pragma mark - RGDFeature
-
-typedef GPB_ENUM(RGDFeature_FieldNumber) {
- RGDFeature_FieldNumber_Name = 1,
- RGDFeature_FieldNumber_Location = 2,
-};
-
-// A feature names something at a given point.
-//
-// If a feature could not be named, the name is empty.
-@interface RGDFeature : GPBMessage
-
-// The name of the feature.
-@property(nonatomic, readwrite, copy) NSString *name;
-
-// The point where the feature is detected.
-@property(nonatomic, readwrite) BOOL hasLocation;
-@property(nonatomic, readwrite, strong) RGDPoint *location;
-
-@end
-
-#pragma mark - RGDRouteNote
-
-typedef GPB_ENUM(RGDRouteNote_FieldNumber) {
- RGDRouteNote_FieldNumber_Location = 1,
- RGDRouteNote_FieldNumber_Message = 2,
-};
-
-// A RouteNote is a message sent while at a given point.
-@interface RGDRouteNote : GPBMessage
-
-// The location from which the message is sent.
-@property(nonatomic, readwrite) BOOL hasLocation;
-@property(nonatomic, readwrite, strong) RGDPoint *location;
-
-// The message to be sent.
-@property(nonatomic, readwrite, copy) NSString *message;
-
-@end
-
-#pragma mark - RGDRouteSummary
-
-typedef GPB_ENUM(RGDRouteSummary_FieldNumber) {
- RGDRouteSummary_FieldNumber_PointCount = 1,
- RGDRouteSummary_FieldNumber_FeatureCount = 2,
- RGDRouteSummary_FieldNumber_Distance = 3,
- RGDRouteSummary_FieldNumber_ElapsedTime = 4,
-};
-
-// A RouteSummary is received in response to a RecordRoute rpc.
-//
-// It contains the number of individual points received, the number of
-// detected features, and the total distance covered as the cumulative sum of
-// the distance between each point.
-@interface RGDRouteSummary : GPBMessage
-
-// The number of points received.
-@property(nonatomic, readwrite) int32_t pointCount;
-
-// The number of known features passed while traversing the route.
-@property(nonatomic, readwrite) int32_t featureCount;
-
-// The distance covered in metres.
-@property(nonatomic, readwrite) int32_t distance;
-
-// The duration of the traversal in seconds.
-@property(nonatomic, readwrite) int32_t elapsedTime;
-
-@end
-
-CF_EXTERN_C_END
diff --git a/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.m b/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.m
deleted file mode 100644
index 16f291a61c..0000000000
--- a/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbobjc.m
+++ /dev/null
@@ -1,355 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: route_guide.proto
-
-#import "GPBProtocolBuffers_RuntimeSupport.h"
-
-#import "RouteGuide.pbobjc.h"
-
-#pragma mark - RGDRouteGuideRoot
-
-@implementation RGDRouteGuideRoot
-
-@end
-
-static GPBFileDescriptor *RGDRouteGuideRoot_FileDescriptor(void) {
- // This is called by +initialize so there is no need to worry
- // about thread safety of the singleton.
- static GPBFileDescriptor *descriptor = NULL;
- if (!descriptor) {
- descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"grpc.example.routeguide"
- syntax:GPBFileSyntaxProto3];
- }
- return descriptor;
-}
-
-#pragma mark - RGDPoint
-
-@implementation RGDPoint
-
-@dynamic latitude;
-@dynamic longitude;
-
-typedef struct RGDPoint_Storage {
- uint32_t _has_storage_[1];
- int32_t latitude;
- int32_t longitude;
-} RGDPoint_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "latitude",
- .number = RGDPoint_FieldNumber_Latitude,
- .hasIndex = 0,
- .flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(RGDPoint_Storage, latitude),
- .defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- {
- .name = "longitude",
- .number = RGDPoint_FieldNumber_Longitude,
- .hasIndex = 1,
- .flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(RGDPoint_Storage, longitude),
- .defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RGDPoint class]
- rootClass:[RGDRouteGuideRoot class]
- file:RGDRouteGuideRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RGDPoint_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-#pragma mark - RGDRectangle
-
-@implementation RGDRectangle
-
-@dynamic hasLo, lo;
-@dynamic hasHi, hi;
-
-typedef struct RGDRectangle_Storage {
- uint32_t _has_storage_[1];
- RGDPoint *lo;
- RGDPoint *hi;
-} RGDRectangle_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "lo",
- .number = RGDRectangle_FieldNumber_Lo,
- .hasIndex = 0,
- .flags = GPBFieldOptional,
- .type = GPBTypeMessage,
- .offset = offsetof(RGDRectangle_Storage, lo),
- .defaultValue.valueMessage = nil,
- .typeSpecific.className = GPBStringifySymbol(RGDPoint),
- .fieldOptions = NULL,
- },
- {
- .name = "hi",
- .number = RGDRectangle_FieldNumber_Hi,
- .hasIndex = 1,
- .flags = GPBFieldOptional,
- .type = GPBTypeMessage,
- .offset = offsetof(RGDRectangle_Storage, hi),
- .defaultValue.valueMessage = nil,
- .typeSpecific.className = GPBStringifySymbol(RGDPoint),
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RGDRectangle class]
- rootClass:[RGDRouteGuideRoot class]
- file:RGDRouteGuideRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RGDRectangle_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-#pragma mark - RGDFeature
-
-@implementation RGDFeature
-
-@dynamic name;
-@dynamic hasLocation, location;
-
-typedef struct RGDFeature_Storage {
- uint32_t _has_storage_[1];
- NSString *name;
- RGDPoint *location;
-} RGDFeature_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "name",
- .number = RGDFeature_FieldNumber_Name,
- .hasIndex = 0,
- .flags = GPBFieldOptional,
- .type = GPBTypeString,
- .offset = offsetof(RGDFeature_Storage, name),
- .defaultValue.valueString = nil,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- {
- .name = "location",
- .number = RGDFeature_FieldNumber_Location,
- .hasIndex = 1,
- .flags = GPBFieldOptional,
- .type = GPBTypeMessage,
- .offset = offsetof(RGDFeature_Storage, location),
- .defaultValue.valueMessage = nil,
- .typeSpecific.className = GPBStringifySymbol(RGDPoint),
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RGDFeature class]
- rootClass:[RGDRouteGuideRoot class]
- file:RGDRouteGuideRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RGDFeature_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-#pragma mark - RGDRouteNote
-
-@implementation RGDRouteNote
-
-@dynamic hasLocation, location;
-@dynamic message;
-
-typedef struct RGDRouteNote_Storage {
- uint32_t _has_storage_[1];
- RGDPoint *location;
- NSString *message;
-} RGDRouteNote_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "location",
- .number = RGDRouteNote_FieldNumber_Location,
- .hasIndex = 0,
- .flags = GPBFieldOptional,
- .type = GPBTypeMessage,
- .offset = offsetof(RGDRouteNote_Storage, location),
- .defaultValue.valueMessage = nil,
- .typeSpecific.className = GPBStringifySymbol(RGDPoint),
- .fieldOptions = NULL,
- },
- {
- .name = "message",
- .number = RGDRouteNote_FieldNumber_Message,
- .hasIndex = 1,
- .flags = GPBFieldOptional,
- .type = GPBTypeString,
- .offset = offsetof(RGDRouteNote_Storage, message),
- .defaultValue.valueString = nil,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RGDRouteNote class]
- rootClass:[RGDRouteGuideRoot class]
- file:RGDRouteGuideRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RGDRouteNote_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
-#pragma mark - RGDRouteSummary
-
-@implementation RGDRouteSummary
-
-@dynamic pointCount;
-@dynamic featureCount;
-@dynamic distance;
-@dynamic elapsedTime;
-
-typedef struct RGDRouteSummary_Storage {
- uint32_t _has_storage_[1];
- int32_t pointCount;
- int32_t featureCount;
- int32_t distance;
- int32_t elapsedTime;
-} RGDRouteSummary_Storage;
-
-// This method is threadsafe because it is initially called
-// in +initialize for each subclass.
-+ (GPBDescriptor *)descriptor {
- static GPBDescriptor *descriptor = NULL;
- if (!descriptor) {
- static GPBMessageFieldDescription fields[] = {
- {
- .name = "pointCount",
- .number = RGDRouteSummary_FieldNumber_PointCount,
- .hasIndex = 0,
- .flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(RGDRouteSummary_Storage, pointCount),
- .defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- {
- .name = "featureCount",
- .number = RGDRouteSummary_FieldNumber_FeatureCount,
- .hasIndex = 1,
- .flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(RGDRouteSummary_Storage, featureCount),
- .defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- {
- .name = "distance",
- .number = RGDRouteSummary_FieldNumber_Distance,
- .hasIndex = 2,
- .flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(RGDRouteSummary_Storage, distance),
- .defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- {
- .name = "elapsedTime",
- .number = RGDRouteSummary_FieldNumber_ElapsedTime,
- .hasIndex = 3,
- .flags = GPBFieldOptional,
- .type = GPBTypeInt32,
- .offset = offsetof(RGDRouteSummary_Storage, elapsedTime),
- .defaultValue.valueInt32 = 0,
- .typeSpecific.className = NULL,
- .fieldOptions = NULL,
- },
- };
- descriptor = [GPBDescriptor allocDescriptorForClass:[RGDRouteSummary class]
- rootClass:[RGDRouteGuideRoot class]
- file:RGDRouteGuideRoot_FileDescriptor()
- fields:fields
- fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
- oneofs:NULL
- oneofCount:0
- enums:NULL
- enumCount:0
- ranges:NULL
- rangeCount:0
- storageSize:sizeof(RGDRouteSummary_Storage)
- wireFormat:NO];
- }
- return descriptor;
-}
-
-@end
-
diff --git a/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.h b/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.h
deleted file mode 100644
index 9e60865d98..0000000000
--- a/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#import "RouteGuide.pbobjc.h"
-#import <gRPC/ProtoService.h>
-
-
-@protocol GRXWriteable;
-@protocol GRXWriter;
-
-@protocol RGDRouteGuide <NSObject>
-
-#pragma mark GetFeature(Point) returns (Feature)
-
-- (void)getFeatureWithRequest:(RGDPoint *)request handler:(void(^)(RGDFeature *response, NSError *error))handler;
-
-- (ProtoRPC *)RPCToGetFeatureWithRequest:(RGDPoint *)request handler:(void(^)(RGDFeature *response, NSError *error))handler;
-
-
-#pragma mark ListFeatures(Rectangle) returns (stream Feature)
-
-- (void)listFeaturesWithRequest:(RGDRectangle *)request handler:(void(^)(BOOL done, RGDFeature *response, NSError *error))handler;
-
-- (ProtoRPC *)RPCToListFeaturesWithRequest:(RGDRectangle *)request handler:(void(^)(BOOL done, RGDFeature *response, NSError *error))handler;
-
-
-#pragma mark RecordRoute(stream Point) returns (RouteSummary)
-
-- (void)recordRouteWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RGDRouteSummary *response, NSError *error))handler;
-
-- (ProtoRPC *)RPCToRecordRouteWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RGDRouteSummary *response, NSError *error))handler;
-
-
-#pragma mark RouteChat(stream RouteNote) returns (stream RouteNote)
-
-- (void)routeChatWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RGDRouteNote *response, NSError *error))handler;
-
-- (ProtoRPC *)RPCToRouteChatWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RGDRouteNote *response, NSError *error))handler;
-
-
-@end
-
-// Basic service implementation, over gRPC, that only does marshalling and parsing.
-@interface RGDRouteGuide : ProtoService<RGDRouteGuide>
-- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER;
-@end
diff --git a/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.m b/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.m
deleted file mode 100644
index 2ca3dc6768..0000000000
--- a/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.pbrpc.m
+++ /dev/null
@@ -1,72 +0,0 @@
-#import "RouteGuide.pbrpc.h"
-#import <gRPC/GRXWriteable.h>
-#import <gRPC/GRXWriter+Immediate.h>
-#import <gRPC/ProtoRPC.h>
-
-static NSString *const kPackageName = @"grpc.example.routeguide";
-static NSString *const kServiceName = @"RouteGuide";
-
-@implementation RGDRouteGuide
-
-// Designated initializer
-- (instancetype)initWithHost:(NSString *)host {
- return (self = [super initWithHost:host packageName:kPackageName serviceName:kServiceName]);
-}
-
-// Override superclass initializer to disallow different package and service names.
-- (instancetype)initWithHost:(NSString *)host
- packageName:(NSString *)packageName
- serviceName:(NSString *)serviceName {
- return [self initWithHost:host];
-}
-
-
-#pragma mark GetFeature(Point) returns (Feature)
-
-- (void)getFeatureWithRequest:(RGDPoint *)request handler:(void(^)(RGDFeature *response, NSError *error))handler{
- [[self RPCToGetFeatureWithRequest:request handler:handler] start];
-}
-// Returns a not-yet-started RPC object.
-- (ProtoRPC *)RPCToGetFeatureWithRequest:(RGDPoint *)request handler:(void(^)(RGDFeature *response, NSError *error))handler{
- return [self RPCToMethod:@"GetFeature"
- requestsWriter:[GRXWriter writerWithValue:request]
- responseClass:[RGDFeature class]
- responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]];
-}
-#pragma mark ListFeatures(Rectangle) returns (stream Feature)
-
-- (void)listFeaturesWithRequest:(RGDRectangle *)request handler:(void(^)(BOOL done, RGDFeature *response, NSError *error))handler{
- [[self RPCToListFeaturesWithRequest:request handler:handler] start];
-}
-// Returns a not-yet-started RPC object.
-- (ProtoRPC *)RPCToListFeaturesWithRequest:(RGDRectangle *)request handler:(void(^)(BOOL done, RGDFeature *response, NSError *error))handler{
- return [self RPCToMethod:@"ListFeatures"
- requestsWriter:[GRXWriter writerWithValue:request]
- responseClass:[RGDFeature class]
- responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]];
-}
-#pragma mark RecordRoute(stream Point) returns (RouteSummary)
-
-- (void)recordRouteWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RGDRouteSummary *response, NSError *error))handler{
- [[self RPCToRecordRouteWithRequestsWriter:request handler:handler] start];
-}
-// Returns a not-yet-started RPC object.
-- (ProtoRPC *)RPCToRecordRouteWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(RGDRouteSummary *response, NSError *error))handler{
- return [self RPCToMethod:@"RecordRoute"
- requestsWriter:request
- responseClass:[RGDRouteSummary class]
- responsesWriteable:[GRXWriteable writeableWithSingleValueHandler:handler]];
-}
-#pragma mark RouteChat(stream RouteNote) returns (stream RouteNote)
-
-- (void)routeChatWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RGDRouteNote *response, NSError *error))handler{
- [[self RPCToRouteChatWithRequestsWriter:request handler:handler] start];
-}
-// Returns a not-yet-started RPC object.
-- (ProtoRPC *)RPCToRouteChatWithRequestsWriter:(id<GRXWriter>)request handler:(void(^)(BOOL done, RGDRouteNote *response, NSError *error))handler{
- return [self RPCToMethod:@"RouteChat"
- requestsWriter:request
- responseClass:[RGDRouteNote class]
- responsesWriteable:[GRXWriteable writeableWithStreamHandler:handler]];
-}
-@end
diff --git a/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.podspec b/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.podspec
new file mode 100644
index 0000000000..58ccb4873e
--- /dev/null
+++ b/src/objective-c/generated_libraries/RouteGuideClient/RouteGuide.podspec
@@ -0,0 +1,26 @@
+Pod::Spec.new do |s|
+ s.name = "RouteGuide"
+ s.version = "0.0.1"
+ s.license = "New BSD"
+
+ s.ios.deployment_target = "6.0"
+ s.osx.deployment_target = "10.8"
+
+ # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
+ s.prepare_command = "protoc --objc_out=. --objcgrpc_out=. *.proto **/*.proto"
+
+ s.subspec "Messages" do |ms|
+ ms.source_files = "*.pbobjc.{h,m}", "**/*.pbobjc.{h,m}"
+ ms.header_mappings_dir = "."
+ ms.requires_arc = false
+ ms.dependency "Protobuf", "~> 3.0.0-alpha-3"
+ end
+
+ s.subspec "Services" do |ss|
+ ss.source_files = "*.pbrpc.{h,m}", "**/*.pbrpc.{h,m}"
+ ss.header_mappings_dir = "."
+ ss.requires_arc = true
+ ss.dependency "gRPC", "~> 0.5"
+ ss.dependency "#{s.name}/Messages"
+ end
+end
diff --git a/src/objective-c/generated_libraries/RouteGuideClient/Route_guide.podspec b/src/objective-c/generated_libraries/RouteGuideClient/Route_guide.podspec
deleted file mode 100644
index 5b1a68aad5..0000000000
--- a/src/objective-c/generated_libraries/RouteGuideClient/Route_guide.podspec
+++ /dev/null
@@ -1,24 +0,0 @@
-Pod::Spec.new do |s|
- s.name = 'Route_guide'
- s.version = '0.0.1'
- s.summary = 'Protobuf library generated from route_guide.proto'
- s.homepage = 'https://github.com/grpc/grpc/tree/master/src/objective-c/examples/Sample/RouteGuideClient'
- s.license = 'New BSD'
- s.authors = { 'Jorge Canizales' => 'jcanizales@google.com' }
-
- s.ios.deployment_target = '6.0'
- s.osx.deployment_target = '10.8'
-
- s.subspec 'Messages' do |ms|
- ms.source_files = '*.pbobjc.{h,m}'
- ms.requires_arc = false
- ms.dependency 'Protobuf', '~> 3.0'
- end
-
- s.subspec 'Services' do |ss|
- ss.source_files = '*.pbrpc.{h,m}'
- ss.requires_arc = true
- ss.dependency 'gRPC', '~> 0.0'
- ss.dependency 'Route_guide/Messages'
- end
-end
diff --git a/src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto b/src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto
index 16dce26a2b..dace1a5d26 100644
--- a/src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto
+++ b/src/objective-c/generated_libraries/RouteGuideClient/route_guide.proto
@@ -29,7 +29,7 @@
syntax = "proto3";
-package grpc.example.routeguide;
+package examples;
option objc_class_prefix = "RGD";
diff --git a/src/objective-c/tests/LocalClearTextTests.m b/src/objective-c/tests/LocalClearTextTests.m
index 6a9496b623..68ffd23200 100644
--- a/src/objective-c/tests/LocalClearTextTests.m
+++ b/src/objective-c/tests/LocalClearTextTests.m
@@ -38,56 +38,62 @@
#import <gRPC/GRPCMethodName.h>
#import <gRPC/GRXWriter+Immediate.h>
#import <gRPC/GRXWriteable.h>
-#import <Route_guide/RouteGuide.pbobjc.h>
-#import <Route_guide/RouteGuide.pbrpc.h>
+#import <RouteGuide/RouteGuide.pbobjc.h>
+#import <RouteGuide/RouteGuide.pbrpc.h>
-// These tests require the gRPC-Java "RouteGuide" sample server to be running locally. To do so,
-// install Gradle by following the instructions here: https://docs.gradle.org/current/userguide/installation.html
-// And use it to run the server by following the instructions here: https://github.com/grpc/grpc-java/tree/master/examples
+// These tests require a gRPC "RouteGuide" sample server to be running locally. You can compile and
+// run one by following the instructions here: https://github.com/grpc/grpc-common/blob/master/cpp/cpptutorial.md#try-it-out
+// Be sure to have the C gRPC library installed in your system (for example, by having followed the
+// instructions at https://github.com/grpc/homebrew-grpc
+
+static NSString * const kRouteGuideHost = @"http://localhost:50051";
+static NSString * const kPackage = @"examples";
+static NSString * const kService = @"RouteGuide";
@interface LocalClearTextTests : XCTestCase
@end
@implementation LocalClearTextTests
-- (void)testConnectionToLocalServer {
- __weak XCTestExpectation *expectation = [self expectationWithDescription:@"Server reachable."];
-
- // This method isn't implemented by the local server.
- GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.testing"
- interface:@"TestService"
- method:@"EmptyCall"];
-
- id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[NSData data]];
-
- GRPCCall *call = [[GRPCCall alloc] initWithHost:@"http://127.0.0.1:8980"
- method:method
- requestsWriter:requestsWriter];
-
- id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
- XCTFail(@"Received unexpected response: %@", value);
- } completionHandler:^(NSError *errorOrNil) {
- XCTAssertNotNil(errorOrNil, @"Finished without error!");
- XCTAssertEqual(errorOrNil.code, 12, @"Finished with unexpected error: %@", errorOrNil);
- [expectation fulfill];
- }];
-
- [call startWithWriteable:responsesWriteable];
-
- [self waitForExpectationsWithTimeout:2.0 handler:nil];
-}
+// This test currently fails: see Issue #1907.
+//- (void)testConnectionToLocalServer {
+// __weak XCTestExpectation *expectation = [self expectationWithDescription:@"Server reachable."];
+//
+// // This method isn't implemented by the local server.
+// GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:kPackage
+// interface:kService
+// method:@"EmptyCall"];
+//
+// id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[NSData data]];
+//
+// GRPCCall *call = [[GRPCCall alloc] initWithHost:kRouteGuideHost
+// method:method
+// requestsWriter:requestsWriter];
+//
+// id<GRXWriteable> responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) {
+// XCTFail(@"Received unexpected response: %@", value);
+// } completionHandler:^(NSError *errorOrNil) {
+// XCTAssertNotNil(errorOrNil, @"Finished without error!");
+// XCTAssertEqual(errorOrNil.code, 12, @"Finished with unexpected error: %@", errorOrNil);
+// [expectation fulfill];
+// }];
+//
+// [call startWithWriteable:responsesWriteable];
+//
+// [self waitForExpectationsWithTimeout:8.0 handler:nil];
+//}
- (void)testEmptyRPC {
__weak XCTestExpectation *response = [self expectationWithDescription:@"Empty response received."];
__weak XCTestExpectation *completion = [self expectationWithDescription:@"Empty RPC completed."];
- GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.example.routeguide"
- interface:@"RouteGuide"
+ GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:kPackage
+ interface:kService
method:@"RecordRoute"];
id<GRXWriter> requestsWriter = [GRXWriter emptyWriter];
- GRPCCall *call = [[GRPCCall alloc] initWithHost:@"http://127.0.0.1:8980"
+ GRPCCall *call = [[GRPCCall alloc] initWithHost:kRouteGuideHost
method:method
requestsWriter:requestsWriter];
@@ -109,8 +115,8 @@
__weak XCTestExpectation *response = [self expectationWithDescription:@"Response received."];
__weak XCTestExpectation *completion = [self expectationWithDescription:@"RPC completed."];
- GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:@"grpc.example.routeguide"
- interface:@"RouteGuide"
+ GRPCMethodName *method = [[GRPCMethodName alloc] initWithPackage:kPackage
+ interface:kService
method:@"GetFeature"];
RGDPoint *point = [RGDPoint message];
@@ -118,7 +124,7 @@
point.longitude = -15E7;
id<GRXWriter> requestsWriter = [GRXWriter writerWithValue:[point data]];
- GRPCCall *call = [[GRPCCall alloc] initWithHost:@"http://127.0.0.1:8980"
+ GRPCCall *call = [[GRPCCall alloc] initWithHost:kRouteGuideHost
method:method
requestsWriter:requestsWriter];
@@ -145,7 +151,7 @@
point.latitude = 28E7;
point.longitude = -15E7;
- RGDRouteGuide *service = [[RGDRouteGuide alloc] initWithHost:@"http://127.0.0.1:8980"];
+ RGDRouteGuide *service = [[RGDRouteGuide alloc] initWithHost:kRouteGuideHost];
[service getFeatureWithRequest:point handler:^(RGDFeature *response, NSError *error) {
XCTAssertNil(error, @"Finished with unexpected error: %@", error);
XCTAssertEqualObjects(point, response.location);
diff --git a/src/objective-c/tests/Podfile b/src/objective-c/tests/Podfile
index c099fb5182..026868db12 100644
--- a/src/objective-c/tests/Podfile
+++ b/src/objective-c/tests/Podfile
@@ -2,9 +2,8 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'gRPC', :path => "../../.."
-pod 'Protobuf', :git => 'https://github.com/google/protobuf.git'
pod 'RemoteTest', :path => "../generated_libraries/RemoteTestClient"
-pod 'Route_guide', :path => "../generated_libraries/RouteGuideClient"
+pod 'RouteGuide', :path => "../generated_libraries/RouteGuideClient"
link_with 'AllTests'
diff --git a/src/php/ext/grpc/byte_buffer.c b/src/php/ext/grpc/byte_buffer.c
index 4f3e6b67af..bb9d3f5337 100644
--- a/src/php/ext/grpc/byte_buffer.c
+++ b/src/php/ext/grpc/byte_buffer.c
@@ -46,6 +46,7 @@
#include "byte_buffer.h"
#include <grpc/grpc.h>
+#include <grpc/byte_buffer_reader.h>
#include <grpc/support/slice.h>
grpc_byte_buffer *string_to_byte_buffer(char *string, size_t length) {
@@ -65,9 +66,10 @@ void byte_buffer_to_string(grpc_byte_buffer *buffer, char **out_string,
size_t length = grpc_byte_buffer_length(buffer);
char *string = ecalloc(length + 1, sizeof(char));
size_t offset = 0;
- grpc_byte_buffer_reader *reader = grpc_byte_buffer_reader_create(buffer);
+ grpc_byte_buffer_reader reader;
+ grpc_byte_buffer_reader_init(&reader, buffer);
gpr_slice next;
- while (grpc_byte_buffer_reader_next(reader, &next) != 0) {
+ while (grpc_byte_buffer_reader_next(&reader, &next) != 0) {
memcpy(string + offset, GPR_SLICE_START_PTR(next), GPR_SLICE_LENGTH(next));
offset += GPR_SLICE_LENGTH(next);
}
diff --git a/src/python/README.md b/src/python/README.md
index c67201b670..0bca457a33 100644
--- a/src/python/README.md
+++ b/src/python/README.md
@@ -1,25 +1,30 @@
gRPC Python
=========
-
The Python facility of gRPC.
-
Status
-------
-
Alpha : Ready for early adopters
-Prerequisites
------------------------
-
-Python 2.7, virtualenv, pip, libprotobuf-dev, and libprotoc-dev.
-
+PREREQUISITES
+-------------
+- Python 2.7, virtualenv, pip
+- [homebrew][] on Mac OS X, [linuxbrew][] on Linux. These simplify the installation of the gRPC C core.
-Building from source
-----------------------
+INSTALLATION
+-------------
+On Mac OS X, install [homebrew][]. On Linux, install [linuxbrew][].
+Run the following command to install gRPC Python.
+```sh
+$ curl -fsSL https://goo.gl/getgrpc | bash -s python
+```
+This will download and run the [gRPC install script][], then install the latest version of the gRPC Python package. It also installs the Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin for python.
+BUILDING FROM SOURCE
+---------------------
+- Clone this repository
- Build the gRPC core from the root of the
- [gRPC git repo](https://github.com/grpc/grpc)
+ [gRPC Git repository](https://github.com/grpc/grpc)
```
$ make shared_c static_c
```
@@ -29,40 +34,16 @@ $ make shared_c static_c
$ tools/run_tests/build_python.sh
```
-
-Testing
------------------------
+TESTING
+-------
- Use run_python.sh to run gRPC as it was installed into the virtual environment
```
$ tools/run_tests/run_python.sh
```
-
-Installing
------------------------
-
-- Install the gRPC core
- - [Debian package](https://github.com/grpc/grpc/releases)
- ```
- $ wget https://github.com/grpc/grpc/releases/download/release-0_5_0/libgrpc_0.5.0_amd64.deb
- $ wget https://github.com/grpc/grpc/releases/download/release-0_5_0/libgrpc-dev_0.5.0_amd64.deb
- $ sudo dpkg -i libgrpc_0.5.0_amd64.deb libgrpc-dev_0.5.0_amd64.deb
- ```
- - [From source](https://github.com/grpc/grpc/blob/master/INSTALL)
-
-- Install gRPC Python's dependencies
-```
-$ pip install -r src/python/requirements.txt
-```
-
-- Install gRPC Python
-```
-$ pip install src/python/src
-```
-
-Packaging to PyPI
------------------------
+PACKAGING
+---------
- Install packaging dependencies
```
@@ -73,3 +54,7 @@ $ pip install setuptools twine
```
$ ../../tools/distrib/python/submit.py
```
+
+[homebrew]:http://brew.sh
+[linuxbrew]:https://github.com/Homebrew/linuxbrew#installation
+[gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
diff --git a/src/python/src/grpc/_adapter/_c/utility.c b/src/python/src/grpc/_adapter/_c/utility.c
index 6d228c73fe..ced34a6816 100644
--- a/src/python/src/grpc/_adapter/_c/utility.c
+++ b/src/python/src/grpc/_adapter/_c/utility.c
@@ -36,6 +36,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <grpc/grpc.h>
+#include <grpc/byte_buffer_reader.h>
#include <grpc/support/alloc.h>
#include <grpc/support/slice.h>
#include <grpc/support/time.h>
@@ -144,6 +145,11 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
static const int STATUS_INDEX = 4;
static const int STATUS_CODE_INDEX = 0;
static const int STATUS_DETAILS_INDEX = 1;
+ int type;
+ Py_ssize_t message_size;
+ char *message;
+ char *status_details;
+ gpr_slice message_slice;
grpc_op c_op;
if (!PyTuple_Check(op)) {
PyErr_SetString(PyExc_TypeError, "expected tuple op");
@@ -155,14 +161,10 @@ int pygrpc_produce_op(PyObject *op, grpc_op *result) {
PyErr_SetString(PyExc_ValueError, buf);
return 0;
}
- int type = PyInt_AsLong(PyTuple_GET_ITEM(op, TYPE_INDEX));
+ type = PyInt_AsLong(PyTuple_GET_ITEM(op, TYPE_INDEX));
if (PyErr_Occurred()) {
return 0;
}
- Py_ssize_t message_size;
- char *message;
- char *status_details;
- gpr_slice message_slice;
c_op.op = type;
switch (type) {
case GRPC_OP_SEND_INITIAL_METADATA:
@@ -365,7 +367,9 @@ gpr_timespec pygrpc_cast_double_to_gpr_timespec(double seconds) {
int pygrpc_produce_channel_args(PyObject *py_args, grpc_channel_args *c_args) {
size_t num_args = PyList_Size(py_args);
size_t i;
- grpc_channel_args args = {num_args, gpr_malloc(sizeof(grpc_arg) * num_args)};
+ grpc_channel_args args;
+ args.num_args = num_args;
+ args.args = gpr_malloc(sizeof(grpc_arg) * num_args);
for (i = 0; i < args.num_args; ++i) {
char *key;
PyObject *value;
@@ -443,18 +447,18 @@ PyObject *pygrpc_cast_metadata_array_to_pylist(grpc_metadata_array metadata) {
void pygrpc_byte_buffer_to_bytes(
grpc_byte_buffer *buffer, char **result, size_t *result_size) {
- grpc_byte_buffer_reader *reader = grpc_byte_buffer_reader_create(buffer);
+ grpc_byte_buffer_reader reader;
+ grpc_byte_buffer_reader_init(&reader, buffer);
gpr_slice slice;
char *read_result = NULL;
size_t size = 0;
- while (grpc_byte_buffer_reader_next(reader, &slice)) {
+ while (grpc_byte_buffer_reader_next(&reader, &slice)) {
read_result = gpr_realloc(read_result, size + GPR_SLICE_LENGTH(slice));
memcpy(read_result + size, GPR_SLICE_START_PTR(slice),
GPR_SLICE_LENGTH(slice));
size = size + GPR_SLICE_LENGTH(slice);
gpr_slice_unref(slice);
}
- grpc_byte_buffer_reader_destroy(reader);
*result_size = size;
*result = read_result;
}
diff --git a/src/python/src/grpc/_adapter/_links_test.py b/src/python/src/grpc/_adapter/_links_test.py
index 50257d8691..4729b84f84 100644
--- a/src/python/src/grpc/_adapter/_links_test.py
+++ b/src/python/src/grpc/_adapter/_links_test.py
@@ -40,7 +40,7 @@ from grpc.framework.base import interfaces
from grpc.framework.foundation import logging_pool
_IDENTITY = lambda x: x
-_TIMEOUT = 2
+_TIMEOUT = 32
# TODO(nathaniel): End-to-end metadata testing.
diff --git a/src/ruby/README.md b/src/ruby/README.md
index 9c0eef49b0..4b657c0bd4 100644
--- a/src/ruby/README.md
+++ b/src/ruby/README.md
@@ -4,48 +4,44 @@ gRPC Ruby
A Ruby implementation of gRPC.
Status
--------
+------
Alpha : Ready for early adopters
-INSTALLATION PREREQUISITES
---------------------------
+PREREQUISITES
+-------------
-This requires Ruby 2.1, as the RPC API surface uses keyword args.
+- Ruby 2.x. The gRPC API uses keyword args.
+- [homebrew][] on Mac OS X, [linuxbrew][] on Linux. These simplify the installation of the gRPC C core.
-
-QUICK - INSTALL
+INSTALLATION
---------------
-
-- Clone this repository.
-- Follow the instructions in [INSTALL](../../INSTALL) to install the gRPC C core.
-- If you don't have Ruby 2.1 installed, switch to the more detailed instructions below
-- Use bundler to install
+On Mac OS X, install [homebrew][]. On Linux, install [linuxbrew][].
+Run the following command to install gRPC Ruby.
```sh
-$ # from this directory
-$ gem install bundler && bundle install
+$ curl -fsSL https://goo.gl/getgrpc | bash -s ruby
```
+This will download and run the [gRPC install script][], then install the latest version of gRPC Ruby gem. It also installs Protocol Buffers compiler (_protoc_) and the gRPC _protoc_ plugin for ruby.
-Installing from source
-----------------------
-
+BUILD FROM SOURCE
+---------------------
+- Clone this repository
- Build the gRPC C core
-E.g, from the root of the gRPC [git repo](https://github.com/google/grpc)
+E.g, from the root of the gRPC [Git repository](https://github.com/google/grpc)
```sh
$ cd ../..
$ make && sudo make install
```
-- Install Ruby 2.1. Consider doing this with [RVM](http://rvm.io), it's a nice way of controlling
+- Install Ruby 2.x. Consider doing this with [RVM](http://rvm.io), it's a nice way of controlling
the exact ruby version that's used.
```sh
$ command curl -sSL https://rvm.io/mpapis.asc | gpg --import -
-$ \curl -sSL https://get.rvm.io | bash -s stable --ruby=ruby-2.1
+$ \curl -sSL https://get.rvm.io | bash -s stable --ruby=ruby-2
$
$ # follow the instructions to ensure that your're using the latest stable version of Ruby
$ # and that the rvm command is installed
```
-
- Make sure your run `source $HOME/.rvm/scripts/rvm` as instructed to complete the set up of RVM
- Install [bundler](http://bundler.io/)
@@ -53,30 +49,36 @@ $ # and that the rvm command is installed
$ gem install bundler
```
-- Finally, install the gRPC gem locally.
+- Finally, build and install the gRPC gem locally.
```sh
$ # from this directory
$ bundle install # creates the ruby bundle, including building the grpc extension
$ rake # runs the unit tests, see rake -T for other options
```
+DOCUMENTATION
+-------------
+- rubydoc for the gRPC gem is available online at [rubydoc][].
+- the gRPC Ruby reference documentation is available online at [grpc.io][]
+
CONTENTS
--------
-
-Directory structure is the layout for [ruby extensions](http://guides.rubygems.org/gems-with-extensions/)
-
-- ext:
- the gRPC ruby extension
-- lib:
- the entrypoint gRPC ruby library to be used in a 'require' statement
-- spec:
- Rspec unittest
-- bin:
- example gRPC clients and servers, e.g,
-```ruby
-stub = Math::Math::Stub.new('my.test.math.server.com:8080')
-req = Math::DivArgs.new(dividend: 7, divisor: 3)
-logger.info("div(7/3): req=#{req.inspect}")
-resp = stub.div(req)
-logger.info("Answer: #{resp.inspect}")
-```
+Directory structure is the layout for [ruby extensions][]
+- ext: the gRPC ruby extension
+- lib: the entrypoint gRPC ruby library to be used in a 'require' statement
+- spec: Rspec unittests
+- bin: example gRPC clients and servers, e.g,
+
+ ```ruby
+ stub = Math::Math::Stub.new('my.test.math.server.com:8080')
+ req = Math::DivArgs.new(dividend: 7, divisor: 3)
+ GRPC.logger.info("div(7/3): req=#{req.inspect}")
+ resp = stub.div(req)
+ GRPC.logger.info("Answer: #{resp.inspect}")
+ ```
+[homebrew]:http://brew.sh
+[linuxbrew]:https://github.com/Homebrew/linuxbrew#installation
+[gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
+[ruby extensions]:http://guides.rubygems.org/gems-with-extensions/
+[rubydoc]: http://www.rubydoc.info/gems/grpc
+[grpc.io]: http://www.grpc.io/docs/installation/ruby.html
diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb
index 1b801edc8e..0ff8bb9aa7 100644
--- a/src/ruby/ext/grpc/extconf.rb
+++ b/src/ruby/ext/grpc/extconf.rb
@@ -32,29 +32,6 @@ require 'mkmf'
LIBDIR = RbConfig::CONFIG['libdir']
INCLUDEDIR = RbConfig::CONFIG['includedir']
-if ENV.key? 'GRPC_ROOT'
- GRPC_ROOT = ENV['GRPC_ROOT']
-else
- grpc_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
- if File.exist?(File.join(grpc_root, 'include/grpc/grpc.h'))
- GRPC_ROOT = grpc_root
- else
- GRPC_ROOT = nil
- end
-end
-
-if ENV.key? 'CONFIG'
- GRPC_CONFIG = ENV['CONFIG']
-else
- GRPC_CONFIG = 'opt'
-end
-
-if (ENV.key? 'GRPC_LIB_DIR') && (!GRPC_ROOT.nil?)
- GRPC_LIB_DIR = File.join(GRPC_ROOT, ENV['GRPC_LIB_DIR'])
-else
- GRPC_LIB_DIR = File.join(File.join(GRPC_ROOT, 'libs'), GRPC_CONFIG)
-end
-
HEADER_DIRS = [
# Search /opt/local (Mac source install)
'/opt/local/include',
@@ -77,12 +54,26 @@ LIB_DIRS = [
LIBDIR
]
-unless GRPC_ROOT.nil?
- HEADER_DIRS.unshift File.join(GRPC_ROOT, 'include')
- LIB_DIRS.unshift GRPC_LIB_DIR
- unless File.exist?(File.join(GRPC_LIB_DIR, 'libgrpc.a'))
- system("make -C #{GRPC_ROOT} static_c CONFIG=#{GRPC_CONFIG}")
+# Check to see if GRPC_ROOT is defined or available
+grpc_root = ENV['GRPC_ROOT']
+if grpc_root.nil?
+ r = File.expand_path(File.join(File.dirname(__FILE__), '../../../..'))
+ grpc_root = r if File.exist?(File.join(r, 'include/grpc/grpc.h'))
+end
+
+# When grpc_root is available attempt to build the grpc core.
+unless grpc_root.nil?
+ grpc_config = ENV['GRPC_CONFIG'] || 'opt'
+ if ENV.key?('GRPC_LIB_DIR')
+ grpc_lib_dir = File.join(grpc_root, ENV['GRPC_LIB_DIR'])
+ else
+ grpc_lib_dir = File.join(File.join(grpc_root, 'libs'), grpc_config)
+ end
+ unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a'))
+ system("make -C #{grpc_root} static_c CONFIG=#{grpc_config}")
end
+ HEADER_DIRS.unshift File.join(grpc_root, 'include')
+ LIB_DIRS.unshift grpc_lib_dir
end
def crash(msg)
diff --git a/src/ruby/ext/grpc/rb_byte_buffer.c b/src/ruby/ext/grpc/rb_byte_buffer.c
index edf0d3b115..1cc22f4aff 100644
--- a/src/ruby/ext/grpc/rb_byte_buffer.c
+++ b/src/ruby/ext/grpc/rb_byte_buffer.c
@@ -36,6 +36,7 @@
#include <ruby/ruby.h>
#include <grpc/grpc.h>
+#include <grpc/byte_buffer_reader.h>
#include <grpc/support/slice.h>
#include "rb_grpc.h"
@@ -50,7 +51,7 @@ VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer *buffer) {
size_t length = 0;
char *string = NULL;
size_t offset = 0;
- grpc_byte_buffer_reader *reader = NULL;
+ grpc_byte_buffer_reader reader;
gpr_slice next;
if (buffer == NULL) {
return Qnil;
@@ -58,8 +59,8 @@ VALUE grpc_rb_byte_buffer_to_s(grpc_byte_buffer *buffer) {
}
length = grpc_byte_buffer_length(buffer);
string = xmalloc(length + 1);
- reader = grpc_byte_buffer_reader_create(buffer);
- while (grpc_byte_buffer_reader_next(reader, &next) != 0) {
+ grpc_byte_buffer_reader_init(&reader, buffer);
+ while (grpc_byte_buffer_reader_next(&reader, &next) != 0) {
memcpy(string + offset, GPR_SLICE_START_PTR(next), GPR_SLICE_LENGTH(next));
offset += GPR_SLICE_LENGTH(next);
}
diff --git a/src/ruby/grpc.gemspec b/src/ruby/grpc.gemspec
index 3ddb7fac18..319da9470a 100755
--- a/src/ruby/grpc.gemspec
+++ b/src/ruby/grpc.gemspec
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.license = 'BSD-3-Clause'
s.required_ruby_version = '>= 2.0.0'
- s.requirements << 'libgrpc ~> 0.6.0 needs to be installed'
+ s.requirements << 'libgrpc ~> 0.9.1 needs to be installed'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- spec/*`.split("\n")
diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb
index 40b6df9a2b..53265c792c 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 = '0.9.0'
+ VERSION = '0.9.3'
end
diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c
index 024d68ffe5..d37454d9cf 100644
--- a/test/core/end2end/cq_verifier.c
+++ b/test/core/end2end/cq_verifier.c
@@ -42,6 +42,7 @@
#include <grpc/byte_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
diff --git a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c b/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c
index 1c1751d581..94b54253e4 100644
--- a/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c
+++ b/test/core/end2end/fixtures/chttp2_fullstack_uds_posix.c
@@ -48,6 +48,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd.h>
#include <grpc/support/useful.h>
diff --git a/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c b/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c
index fd4f533f6e..e160812fa3 100644
--- a/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c
+++ b/test/core/end2end/fixtures/chttp2_socket_pair_with_grpc_trace.c
@@ -146,6 +146,10 @@ int main(int argc, char **argv) {
grpc_test_init(argc, argv);
grpc_init();
+ GPR_ASSERT(0 == grpc_tracer_set_enabled("also-doesnt-exist", 0));
+ GPR_ASSERT(1 == grpc_tracer_set_enabled("http", 1));
+ GPR_ASSERT(1 == grpc_tracer_set_enabled("all", 1));
+
for (i = 0; i < sizeof(configs) / sizeof(*configs); i++) {
grpc_end2end_tests(configs[i]);
}
diff --git a/test/core/end2end/tests/census_simple_request.c b/test/core/end2end/tests/census_simple_request.c
index 403d615f8e..f3a46e23c9 100644
--- a/test/core/end2end/tests/census_simple_request.c
+++ b/test/core/end2end/tests/census_simple_request.c
@@ -40,6 +40,7 @@
#include <grpc/byte_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include <grpc/support/useful.h>
#include "test/core/end2end/cq_verifier.h"
diff --git a/test/core/fling/fling_stream_test.c b/test/core/fling/fling_stream_test.c
index 41ba995544..4d9253c0ad 100644
--- a/test/core/fling/fling_stream_test.c
+++ b/test/core/fling/fling_stream_test.c
@@ -47,6 +47,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
+#include <grpc/support/string_util.h>
#include "test/core/util/port.h"
int main(int argc, char **argv) {
diff --git a/test/core/fling/fling_test.c b/test/core/fling/fling_test.c
index 6b07f83d5b..f9ba461d24 100644
--- a/test/core/fling/fling_test.c
+++ b/test/core/fling/fling_test.c
@@ -35,8 +35,9 @@
#include <stdio.h>
#include <grpc/support/alloc.h>
-#include <grpc/support/subprocess.h>
#include <grpc/support/host_port.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/subprocess.h>
#include "src/core/support/string.h"
#include "test/core/util/port.h"
diff --git a/test/core/json/json_test.c b/test/core/json/json_test.c
index 9a50a6929e..3033419118 100644
--- a/test/core/json/json_test.c
+++ b/test/core/json/json_test.c
@@ -36,6 +36,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/useful.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/json/json.h"
#include "src/core/support/string.h"
diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c
index b6ac847e83..4e9c787908 100644
--- a/test/core/security/credentials_test.c
+++ b/test/core/security/credentials_test.c
@@ -40,6 +40,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include "test/core/util/test_config.h"
#include <openssl/rsa.h>
diff --git a/test/core/support/murmur_hash_test.c b/test/core/support/murmur_hash_test.c
index e3890a79da..2462abf7de 100644
--- a/test/core/support/murmur_hash_test.c
+++ b/test/core/support/murmur_hash_test.c
@@ -33,6 +33,7 @@
#include "src/core/support/murmur_hash.h"
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "test/core/util/test_config.h"
#include <string.h>
diff --git a/test/core/support/string_test.c b/test/core/support/string_test.c
index a1692ab39f..b59082eecf 100644
--- a/test/core/support/string_test.c
+++ b/test/core/support/string_test.c
@@ -39,6 +39,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "test/core/util/test_config.h"
diff --git a/test/core/surface/byte_buffer_reader_test.c b/test/core/surface/byte_buffer_reader_test.c
index 9265ef16b0..c2f5fc2eb7 100644
--- a/test/core/surface/byte_buffer_reader_test.c
+++ b/test/core/surface/byte_buffer_reader_test.c
@@ -46,21 +46,10 @@
#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
-static void test_create(void) {
- grpc_byte_buffer *buffer;
- grpc_byte_buffer_reader *reader;
- gpr_slice empty = gpr_empty_slice();
- LOG_TEST("test_create");
- buffer = grpc_byte_buffer_create(&empty, 1);
- reader = grpc_byte_buffer_reader_create(buffer);
- grpc_byte_buffer_reader_destroy(reader);
- grpc_byte_buffer_destroy(buffer);
-}
-
static void test_read_one_slice(void) {
gpr_slice slice;
grpc_byte_buffer *buffer;
- grpc_byte_buffer_reader *reader;
+ grpc_byte_buffer_reader reader;
gpr_slice first_slice, second_slice;
int first_code, second_code;
@@ -68,21 +57,20 @@ static void test_read_one_slice(void) {
slice = gpr_slice_from_copied_string("test");
buffer = grpc_byte_buffer_create(&slice, 1);
gpr_slice_unref(slice);
- reader = grpc_byte_buffer_reader_create(buffer);
- first_code = grpc_byte_buffer_reader_next(reader, &first_slice);
+ grpc_byte_buffer_reader_init(&reader, buffer);
+ first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
GPR_ASSERT(first_code != 0);
GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(first_slice), "test", 4) == 0);
gpr_slice_unref(first_slice);
- second_code = grpc_byte_buffer_reader_next(reader, &second_slice);
+ second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
GPR_ASSERT(second_code == 0);
- grpc_byte_buffer_reader_destroy(reader);
grpc_byte_buffer_destroy(buffer);
}
static void test_read_one_slice_malloc(void) {
gpr_slice slice;
grpc_byte_buffer *buffer;
- grpc_byte_buffer_reader *reader;
+ grpc_byte_buffer_reader reader;
gpr_slice first_slice, second_slice;
int first_code, second_code;
@@ -91,20 +79,18 @@ static void test_read_one_slice_malloc(void) {
memcpy(GPR_SLICE_START_PTR(slice), "test", 4);
buffer = grpc_byte_buffer_create(&slice, 1);
gpr_slice_unref(slice);
- reader = grpc_byte_buffer_reader_create(buffer);
- first_code = grpc_byte_buffer_reader_next(reader, &first_slice);
+ grpc_byte_buffer_reader_init(&reader, buffer);
+ first_code = grpc_byte_buffer_reader_next(&reader, &first_slice);
GPR_ASSERT(first_code != 0);
GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(first_slice), "test", 4) == 0);
gpr_slice_unref(first_slice);
- second_code = grpc_byte_buffer_reader_next(reader, &second_slice);
+ second_code = grpc_byte_buffer_reader_next(&reader, &second_slice);
GPR_ASSERT(second_code == 0);
- grpc_byte_buffer_reader_destroy(reader);
grpc_byte_buffer_destroy(buffer);
}
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
- test_create();
test_read_one_slice();
test_read_one_slice_malloc();
return 0;
diff --git a/test/core/transport/chttp2/hpack_table_test.c b/test/core/transport/chttp2/hpack_table_test.c
index 6bc697878a..8b86e08168 100644
--- a/test/core/transport/chttp2/hpack_table_test.c
+++ b/test/core/transport/chttp2/hpack_table_test.c
@@ -39,6 +39,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "test/core/util/test_config.h"
#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
diff --git a/test/core/transport/chttp2/stream_encoder_test.c b/test/core/transport/chttp2/stream_encoder_test.c
index 91833440cd..bf70d43e78 100644
--- a/test/core/transport/chttp2/stream_encoder_test.c
+++ b/test/core/transport/chttp2/stream_encoder_test.c
@@ -39,6 +39,7 @@
#include "src/core/transport/chttp2/hpack_parser.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "test/core/util/parse_hexstring.h"
#include "test/core/util/slice_splitter.h"
#include "test/core/util/test_config.h"
diff --git a/test/core/transport/chttp2/timeout_encoding_test.c b/test/core/transport/chttp2/timeout_encoding_test.c
index daaae1d39d..5bfb9cf0ec 100644
--- a/test/core/transport/chttp2/timeout_encoding_test.c
+++ b/test/core/transport/chttp2/timeout_encoding_test.c
@@ -39,6 +39,7 @@
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include "test/core/util/test_config.h"
diff --git a/test/core/transport/metadata_test.c b/test/core/transport/metadata_test.c
index 9b242c5493..89deee5a40 100644
--- a/test/core/transport/metadata_test.c
+++ b/test/core/transport/metadata_test.c
@@ -39,6 +39,7 @@
#include "src/core/transport/chttp2/bin_encoder.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "test/core/util/test_config.h"
#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
diff --git a/test/core/tsi/transport_security_test.c b/test/core/tsi/transport_security_test.c
index e45602bab7..bba6744194 100644
--- a/test/core/tsi/transport_security_test.c
+++ b/test/core/tsi/transport_security_test.c
@@ -37,6 +37,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include <grpc/support/useful.h>
#include <openssl/crypto.h>
diff --git a/test/cpp/interop/interop_test.cc b/test/cpp/interop/interop_test.cc
index a7a5cc0b2c..aac6e56b89 100644
--- a/test/cpp/interop/interop_test.cc
+++ b/test/cpp/interop/interop_test.cc
@@ -52,6 +52,7 @@ extern "C" {
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "test/core/util/port.h"
int test_client(const char* root, const char* host, int port) {
diff --git a/tools/README.md b/tools/README.md
index 1dbbad886f..3daf73228c 100644
--- a/tools/README.md
+++ b/tools/README.md
@@ -1,5 +1,11 @@
buildgen: contains the template renderer for our build system.
+
distpackages: contains script to generate debian packages.
+
dockerfile: contains all of the docker files to test gRPC.
+
gce_setup: contains boilerplate for running the docker files under GCE.
+
+jenkins: support for running tests on Jenkins
+
run_tests: contains python scripts to properly run the tests in parallel.
diff --git a/tools/dockerfile/grpc_java/Dockerfile b/tools/dockerfile/grpc_java/Dockerfile
index fa67cb2627..c20ab4687c 100644
--- a/tools/dockerfile/grpc_java/Dockerfile
+++ b/tools/dockerfile/grpc_java/Dockerfile
@@ -36,5 +36,8 @@ RUN cd /var/local/git/grpc-java/lib/netty && \
RUN cd /var/local/git/grpc-java && \
./gradlew build installDist
+# Add a service_account directory containing the auth creds file
+ADD service_account service_account
+
# Specify the default command such that the interop server runs on its known testing port
CMD ["/var/local/git/grpc-java/run-test-server.sh", "--use_tls=true", "--port=8030"]
diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal
index 3071693dd1..feac0244cc 100644
--- a/tools/doxygen/Doxyfile.c++.internal
+++ b/tools/doxygen/Doxyfile.c++.internal
@@ -760,7 +760,7 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = include/grpc++/async_generic_service.h include/grpc++/async_unary_call.h include/grpc++/byte_buffer.h include/grpc++/channel_arguments.h include/grpc++/channel_interface.h include/grpc++/client_context.h include/grpc++/completion_queue.h include/grpc++/config.h include/grpc++/create_channel.h include/grpc++/credentials.h include/grpc++/generic_stub.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/grpc_library.h include/grpc++/impl/internal_stub.h include/grpc++/impl/rpc_method.h include/grpc++/impl/rpc_service_method.h include/grpc++/impl/service_type.h include/grpc++/impl/sync.h include/grpc++/impl/sync_cxx11.h include/grpc++/impl/sync_no_cxx11.h include/grpc++/impl/thd.h include/grpc++/impl/thd_cxx11.h include/grpc++/impl/thd_no_cxx11.h include/grpc++/server.h include/grpc++/server_builder.h include/grpc++/server_context.h include/grpc++/server_credentials.h include/grpc++/slice.h include/grpc++/status.h include/grpc++/status_code_enum.h include/grpc++/stream.h include/grpc++/thread_pool_interface.h include/grpc++/time.h src/cpp/client/secure_credentials.h src/cpp/server/secure_server_credentials.h src/cpp/client/channel.h src/cpp/proto/proto_utils.h src/cpp/server/thread_pool.h src/cpp/client/secure_credentials.cc src/cpp/server/secure_server_credentials.cc src/cpp/client/channel.cc src/cpp/client/channel_arguments.cc src/cpp/client/client_context.cc src/cpp/client/client_unary_call.cc src/cpp/client/create_channel.cc src/cpp/client/credentials.cc src/cpp/client/generic_stub.cc src/cpp/client/insecure_credentials.cc src/cpp/client/internal_stub.cc src/cpp/common/call.cc src/cpp/common/completion_queue.cc src/cpp/common/rpc_method.cc src/cpp/proto/proto_utils.cc src/cpp/server/async_generic_service.cc src/cpp/server/insecure_server_credentials.cc src/cpp/server/server.cc src/cpp/server/server_builder.cc src/cpp/server/server_context.cc src/cpp/server/server_credentials.cc src/cpp/server/thread_pool.cc src/cpp/util/byte_buffer.cc src/cpp/util/slice.cc src/cpp/util/status.cc src/cpp/util/time.cc
+INPUT = include/grpc++/async_generic_service.h include/grpc++/async_unary_call.h include/grpc++/byte_buffer.h include/grpc++/channel_arguments.h include/grpc++/channel_interface.h include/grpc++/client_context.h include/grpc++/completion_queue.h include/grpc++/config.h include/grpc++/create_channel.h include/grpc++/credentials.h include/grpc++/generic_stub.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/grpc_library.h include/grpc++/impl/internal_stub.h include/grpc++/impl/rpc_method.h include/grpc++/impl/rpc_service_method.h include/grpc++/impl/service_type.h include/grpc++/impl/sync.h include/grpc++/impl/sync_cxx11.h include/grpc++/impl/sync_no_cxx11.h include/grpc++/impl/thd.h include/grpc++/impl/thd_cxx11.h include/grpc++/impl/thd_no_cxx11.h include/grpc++/server.h include/grpc++/server_builder.h include/grpc++/server_context.h include/grpc++/server_credentials.h include/grpc++/slice.h include/grpc++/status.h include/grpc++/status_code_enum.h include/grpc++/stream.h include/grpc++/thread_pool_interface.h include/grpc++/time.h src/cpp/client/secure_credentials.h src/cpp/server/secure_server_credentials.h src/cpp/client/channel.h src/cpp/proto/proto_utils.h src/cpp/server/thread_pool.h src/cpp/client/secure_credentials.cc src/cpp/server/secure_server_credentials.cc src/cpp/client/channel.cc src/cpp/client/channel_arguments.cc src/cpp/client/client_context.cc src/cpp/client/client_unary_call.cc src/cpp/client/create_channel.cc src/cpp/client/credentials.cc src/cpp/client/generic_stub.cc src/cpp/client/insecure_credentials.cc src/cpp/client/internal_stub.cc src/cpp/common/call.cc src/cpp/common/completion_queue.cc src/cpp/common/rpc_method.cc src/cpp/proto/proto_utils.cc src/cpp/server/async_generic_service.cc src/cpp/server/create_default_thread_pool.cc src/cpp/server/insecure_server_credentials.cc src/cpp/server/server.cc src/cpp/server/server_builder.cc src/cpp/server/server_context.cc src/cpp/server/server_credentials.cc src/cpp/server/thread_pool.cc src/cpp/util/byte_buffer.cc src/cpp/util/slice.cc src/cpp/util/status.cc src/cpp/util/time.cc
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core
index 0fe97c6d2d..9a7a722378 100644
--- a/tools/doxygen/Doxyfile.core
+++ b/tools/doxygen/Doxyfile.core
@@ -760,7 +760,7 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = include/grpc/grpc_security.h include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/grpc.h include/grpc/status.h include/grpc/census.h include/grpc/support/alloc.h include/grpc/support/atm.h include/grpc/support/atm_gcc_atomic.h include/grpc/support/atm_gcc_sync.h include/grpc/support/atm_win32.h include/grpc/support/cancellable_platform.h include/grpc/support/cmdline.h include/grpc/support/cpu.h include/grpc/support/histogram.h include/grpc/support/host_port.h include/grpc/support/log.h include/grpc/support/log_win32.h include/grpc/support/port_platform.h include/grpc/support/slice.h include/grpc/support/slice_buffer.h include/grpc/support/subprocess.h include/grpc/support/sync.h include/grpc/support/sync_generic.h include/grpc/support/sync_posix.h include/grpc/support/sync_win32.h include/grpc/support/thd.h include/grpc/support/time.h include/grpc/support/tls.h include/grpc/support/tls_gcc.h include/grpc/support/tls_msvc.h include/grpc/support/tls_pthread.h include/grpc/support/useful.h
+INPUT = include/grpc/grpc_security.h include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/grpc.h include/grpc/status.h include/grpc/census.h include/grpc/support/alloc.h include/grpc/support/atm.h include/grpc/support/atm_gcc_atomic.h include/grpc/support/atm_gcc_sync.h include/grpc/support/atm_win32.h include/grpc/support/cancellable_platform.h include/grpc/support/cmdline.h include/grpc/support/cpu.h include/grpc/support/histogram.h include/grpc/support/host_port.h include/grpc/support/log.h include/grpc/support/log_win32.h include/grpc/support/port_platform.h include/grpc/support/slice.h include/grpc/support/slice_buffer.h include/grpc/support/string_util.h include/grpc/support/subprocess.h include/grpc/support/sync.h include/grpc/support/sync_generic.h include/grpc/support/sync_posix.h include/grpc/support/sync_win32.h include/grpc/support/thd.h include/grpc/support/time.h include/grpc/support/tls.h include/grpc/support/tls_gcc.h include/grpc/support/tls_msvc.h include/grpc/support/tls_pthread.h include/grpc/support/useful.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index 34295a5c2a..d06a1eb1f2 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -760,7 +760,7 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = include/grpc/grpc_security.h include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/grpc.h include/grpc/status.h include/grpc/census.h src/core/httpcli/format_request.h src/core/httpcli/httpcli.h src/core/httpcli/httpcli_security_connector.h src/core/httpcli/parser.h src/core/security/auth_filters.h src/core/security/base64.h src/core/security/credentials.h src/core/security/json_token.h src/core/security/secure_endpoint.h src/core/security/secure_transport_setup.h src/core/security/security_connector.h src/core/security/security_context.h src/core/tsi/fake_transport_security.h src/core/tsi/ssl_transport_security.h src/core/tsi/transport_security.h src/core/tsi/transport_security_interface.h src/core/census/grpc_context.h src/core/channel/channel_args.h src/core/channel/channel_stack.h src/core/channel/child_channel.h src/core/channel/client_channel.h src/core/channel/client_setup.h src/core/channel/connected_channel.h src/core/channel/http_client_filter.h src/core/channel/http_server_filter.h src/core/channel/noop_filter.h src/core/compression/algorithm.h src/core/compression/message_compress.h src/core/debug/trace.h src/core/iomgr/alarm.h src/core/iomgr/alarm_heap.h src/core/iomgr/alarm_internal.h src/core/iomgr/endpoint.h src/core/iomgr/endpoint_pair.h src/core/iomgr/fd_posix.h src/core/iomgr/iocp_windows.h src/core/iomgr/iomgr.h src/core/iomgr/iomgr_internal.h src/core/iomgr/iomgr_posix.h src/core/iomgr/pollset.h src/core/iomgr/pollset_kick_posix.h src/core/iomgr/pollset_posix.h src/core/iomgr/pollset_set_posix.h src/core/iomgr/pollset_set_windows.h src/core/iomgr/pollset_windows.h src/core/iomgr/resolve_address.h src/core/iomgr/sockaddr.h src/core/iomgr/sockaddr_posix.h src/core/iomgr/sockaddr_utils.h src/core/iomgr/sockaddr_win32.h src/core/iomgr/socket_utils_posix.h src/core/iomgr/socket_windows.h src/core/iomgr/tcp_client.h src/core/iomgr/tcp_posix.h src/core/iomgr/tcp_server.h src/core/iomgr/tcp_windows.h src/core/iomgr/time_averaged_stats.h src/core/iomgr/wakeup_fd_pipe.h src/core/iomgr/wakeup_fd_posix.h src/core/json/json.h src/core/json/json_common.h src/core/json/json_reader.h src/core/json/json_writer.h src/core/profiling/timers.h src/core/profiling/timers_preciseclock.h src/core/surface/byte_buffer_queue.h src/core/surface/call.h src/core/surface/channel.h src/core/surface/client.h src/core/surface/completion_queue.h src/core/surface/event_string.h src/core/surface/init.h src/core/surface/server.h src/core/surface/surface_trace.h src/core/transport/chttp2/alpn.h src/core/transport/chttp2/bin_encoder.h src/core/transport/chttp2/frame.h src/core/transport/chttp2/frame_data.h src/core/transport/chttp2/frame_goaway.h src/core/transport/chttp2/frame_ping.h src/core/transport/chttp2/frame_rst_stream.h src/core/transport/chttp2/frame_settings.h src/core/transport/chttp2/frame_window_update.h src/core/transport/chttp2/hpack_parser.h src/core/transport/chttp2/hpack_table.h src/core/transport/chttp2/http2_errors.h src/core/transport/chttp2/huffsyms.h src/core/transport/chttp2/status_conversion.h src/core/transport/chttp2/stream_encoder.h src/core/transport/chttp2/stream_map.h src/core/transport/chttp2/timeout_encoding.h src/core/transport/chttp2/varint.h src/core/transport/chttp2_transport.h src/core/transport/metadata.h src/core/transport/stream_op.h src/core/transport/transport.h src/core/transport/transport_impl.h src/core/census/context.h src/core/httpcli/format_request.c src/core/httpcli/httpcli.c src/core/httpcli/httpcli_security_connector.c src/core/httpcli/parser.c src/core/security/base64.c src/core/security/client_auth_filter.c src/core/security/credentials.c src/core/security/credentials_metadata.c src/core/security/credentials_posix.c src/core/security/credentials_win32.c src/core/security/google_default_credentials.c src/core/security/json_token.c src/core/security/secure_endpoint.c src/core/security/secure_transport_setup.c src/core/security/security_connector.c src/core/security/security_context.c src/core/security/server_auth_filter.c src/core/security/server_secure_chttp2.c src/core/surface/init_secure.c src/core/surface/secure_channel_create.c src/core/tsi/fake_transport_security.c src/core/tsi/ssl_transport_security.c src/core/tsi/transport_security.c src/core/census/grpc_context.c src/core/channel/channel_args.c src/core/channel/channel_stack.c src/core/channel/child_channel.c src/core/channel/client_channel.c src/core/channel/client_setup.c src/core/channel/connected_channel.c src/core/channel/http_client_filter.c src/core/channel/http_server_filter.c src/core/channel/noop_filter.c src/core/compression/algorithm.c src/core/compression/message_compress.c src/core/debug/trace.c src/core/iomgr/alarm.c src/core/iomgr/alarm_heap.c src/core/iomgr/endpoint.c src/core/iomgr/endpoint_pair_posix.c src/core/iomgr/endpoint_pair_windows.c src/core/iomgr/fd_posix.c src/core/iomgr/iocp_windows.c src/core/iomgr/iomgr.c src/core/iomgr/iomgr_posix.c src/core/iomgr/iomgr_windows.c src/core/iomgr/pollset_kick_posix.c src/core/iomgr/pollset_multipoller_with_epoll.c src/core/iomgr/pollset_multipoller_with_poll_posix.c src/core/iomgr/pollset_posix.c src/core/iomgr/pollset_set_posix.c src/core/iomgr/pollset_set_windows.c src/core/iomgr/pollset_windows.c src/core/iomgr/resolve_address_posix.c src/core/iomgr/resolve_address_windows.c src/core/iomgr/sockaddr_utils.c src/core/iomgr/socket_utils_common_posix.c src/core/iomgr/socket_utils_linux.c src/core/iomgr/socket_utils_posix.c src/core/iomgr/socket_windows.c src/core/iomgr/tcp_client_posix.c src/core/iomgr/tcp_client_windows.c src/core/iomgr/tcp_posix.c src/core/iomgr/tcp_server_posix.c src/core/iomgr/tcp_server_windows.c src/core/iomgr/tcp_windows.c src/core/iomgr/time_averaged_stats.c src/core/iomgr/wakeup_fd_eventfd.c src/core/iomgr/wakeup_fd_nospecial.c src/core/iomgr/wakeup_fd_pipe.c src/core/iomgr/wakeup_fd_posix.c src/core/json/json.c src/core/json/json_reader.c src/core/json/json_string.c src/core/json/json_writer.c src/core/profiling/basic_timers.c src/core/profiling/stap_timers.c src/core/surface/byte_buffer.c src/core/surface/byte_buffer_queue.c src/core/surface/byte_buffer_reader.c src/core/surface/call.c src/core/surface/call_details.c src/core/surface/call_log_batch.c src/core/surface/channel.c src/core/surface/channel_create.c src/core/surface/client.c src/core/surface/completion_queue.c src/core/surface/event_string.c src/core/surface/init.c src/core/surface/lame_client.c src/core/surface/metadata_array.c src/core/surface/server.c src/core/surface/server_chttp2.c src/core/surface/server_create.c src/core/surface/surface_trace.c src/core/transport/chttp2/alpn.c src/core/transport/chttp2/bin_encoder.c src/core/transport/chttp2/frame_data.c src/core/transport/chttp2/frame_goaway.c src/core/transport/chttp2/frame_ping.c src/core/transport/chttp2/frame_rst_stream.c src/core/transport/chttp2/frame_settings.c src/core/transport/chttp2/frame_window_update.c src/core/transport/chttp2/hpack_parser.c src/core/transport/chttp2/hpack_table.c src/core/transport/chttp2/huffsyms.c src/core/transport/chttp2/status_conversion.c src/core/transport/chttp2/stream_encoder.c src/core/transport/chttp2/stream_map.c src/core/transport/chttp2/timeout_encoding.c src/core/transport/chttp2/varint.c src/core/transport/chttp2_transport.c src/core/transport/metadata.c src/core/transport/stream_op.c src/core/transport/transport.c src/core/transport/transport_op_string.c src/core/census/context.c src/core/census/initialize.c include/grpc/support/alloc.h include/grpc/support/atm.h include/grpc/support/atm_gcc_atomic.h include/grpc/support/atm_gcc_sync.h include/grpc/support/atm_win32.h include/grpc/support/cancellable_platform.h include/grpc/support/cmdline.h include/grpc/support/cpu.h include/grpc/support/histogram.h include/grpc/support/host_port.h include/grpc/support/log.h include/grpc/support/log_win32.h include/grpc/support/port_platform.h include/grpc/support/slice.h include/grpc/support/slice_buffer.h include/grpc/support/subprocess.h include/grpc/support/sync.h include/grpc/support/sync_generic.h include/grpc/support/sync_posix.h include/grpc/support/sync_win32.h include/grpc/support/thd.h include/grpc/support/time.h include/grpc/support/tls.h include/grpc/support/tls_gcc.h include/grpc/support/tls_msvc.h include/grpc/support/tls_pthread.h include/grpc/support/useful.h src/core/support/env.h src/core/support/file.h src/core/support/murmur_hash.h src/core/support/string.h src/core/support/string_win32.h src/core/support/thd_internal.h src/core/support/alloc.c src/core/support/cancellable.c src/core/support/cmdline.c src/core/support/cpu_iphone.c src/core/support/cpu_linux.c src/core/support/cpu_posix.c src/core/support/cpu_windows.c src/core/support/env_linux.c src/core/support/env_posix.c src/core/support/env_win32.c src/core/support/file.c src/core/support/file_posix.c src/core/support/file_win32.c src/core/support/histogram.c src/core/support/host_port.c src/core/support/log.c src/core/support/log_android.c src/core/support/log_linux.c src/core/support/log_posix.c src/core/support/log_win32.c src/core/support/murmur_hash.c src/core/support/slice.c src/core/support/slice_buffer.c src/core/support/string.c src/core/support/string_posix.c src/core/support/string_win32.c src/core/support/subprocess_posix.c src/core/support/sync.c src/core/support/sync_posix.c src/core/support/sync_win32.c src/core/support/thd.c src/core/support/thd_posix.c src/core/support/thd_win32.c src/core/support/time.c src/core/support/time_posix.c src/core/support/time_win32.c src/core/support/tls_pthread.c
+INPUT = include/grpc/grpc_security.h include/grpc/byte_buffer.h include/grpc/byte_buffer_reader.h include/grpc/grpc.h include/grpc/status.h include/grpc/census.h src/core/httpcli/format_request.h src/core/httpcli/httpcli.h src/core/httpcli/httpcli_security_connector.h src/core/httpcli/parser.h src/core/security/auth_filters.h src/core/security/base64.h src/core/security/credentials.h src/core/security/json_token.h src/core/security/secure_endpoint.h src/core/security/secure_transport_setup.h src/core/security/security_connector.h src/core/security/security_context.h src/core/tsi/fake_transport_security.h src/core/tsi/ssl_transport_security.h src/core/tsi/transport_security.h src/core/tsi/transport_security_interface.h src/core/census/grpc_context.h src/core/channel/channel_args.h src/core/channel/channel_stack.h src/core/channel/child_channel.h src/core/channel/client_channel.h src/core/channel/client_setup.h src/core/channel/connected_channel.h src/core/channel/http_client_filter.h src/core/channel/http_server_filter.h src/core/channel/noop_filter.h src/core/compression/algorithm.h src/core/compression/message_compress.h src/core/debug/trace.h src/core/iomgr/alarm.h src/core/iomgr/alarm_heap.h src/core/iomgr/alarm_internal.h src/core/iomgr/endpoint.h src/core/iomgr/endpoint_pair.h src/core/iomgr/fd_posix.h src/core/iomgr/iocp_windows.h src/core/iomgr/iomgr.h src/core/iomgr/iomgr_internal.h src/core/iomgr/iomgr_posix.h src/core/iomgr/pollset.h src/core/iomgr/pollset_kick_posix.h src/core/iomgr/pollset_posix.h src/core/iomgr/pollset_set_posix.h src/core/iomgr/pollset_set_windows.h src/core/iomgr/pollset_windows.h src/core/iomgr/resolve_address.h src/core/iomgr/sockaddr.h src/core/iomgr/sockaddr_posix.h src/core/iomgr/sockaddr_utils.h src/core/iomgr/sockaddr_win32.h src/core/iomgr/socket_utils_posix.h src/core/iomgr/socket_windows.h src/core/iomgr/tcp_client.h src/core/iomgr/tcp_posix.h src/core/iomgr/tcp_server.h src/core/iomgr/tcp_windows.h src/core/iomgr/time_averaged_stats.h src/core/iomgr/wakeup_fd_pipe.h src/core/iomgr/wakeup_fd_posix.h src/core/json/json.h src/core/json/json_common.h src/core/json/json_reader.h src/core/json/json_writer.h src/core/profiling/timers.h src/core/profiling/timers_preciseclock.h src/core/surface/byte_buffer_queue.h src/core/surface/call.h src/core/surface/channel.h src/core/surface/client.h src/core/surface/completion_queue.h src/core/surface/event_string.h src/core/surface/init.h src/core/surface/server.h src/core/surface/surface_trace.h src/core/transport/chttp2/alpn.h src/core/transport/chttp2/bin_encoder.h src/core/transport/chttp2/frame.h src/core/transport/chttp2/frame_data.h src/core/transport/chttp2/frame_goaway.h src/core/transport/chttp2/frame_ping.h src/core/transport/chttp2/frame_rst_stream.h src/core/transport/chttp2/frame_settings.h src/core/transport/chttp2/frame_window_update.h src/core/transport/chttp2/hpack_parser.h src/core/transport/chttp2/hpack_table.h src/core/transport/chttp2/http2_errors.h src/core/transport/chttp2/huffsyms.h src/core/transport/chttp2/status_conversion.h src/core/transport/chttp2/stream_encoder.h src/core/transport/chttp2/stream_map.h src/core/transport/chttp2/timeout_encoding.h src/core/transport/chttp2/varint.h src/core/transport/chttp2_transport.h src/core/transport/metadata.h src/core/transport/stream_op.h src/core/transport/transport.h src/core/transport/transport_impl.h src/core/census/context.h src/core/httpcli/format_request.c src/core/httpcli/httpcli.c src/core/httpcli/httpcli_security_connector.c src/core/httpcli/parser.c src/core/security/base64.c src/core/security/client_auth_filter.c src/core/security/credentials.c src/core/security/credentials_metadata.c src/core/security/credentials_posix.c src/core/security/credentials_win32.c src/core/security/google_default_credentials.c src/core/security/json_token.c src/core/security/secure_endpoint.c src/core/security/secure_transport_setup.c src/core/security/security_connector.c src/core/security/security_context.c src/core/security/server_auth_filter.c src/core/security/server_secure_chttp2.c src/core/surface/init_secure.c src/core/surface/secure_channel_create.c src/core/tsi/fake_transport_security.c src/core/tsi/ssl_transport_security.c src/core/tsi/transport_security.c src/core/census/grpc_context.c src/core/channel/channel_args.c src/core/channel/channel_stack.c src/core/channel/child_channel.c src/core/channel/client_channel.c src/core/channel/client_setup.c src/core/channel/connected_channel.c src/core/channel/http_client_filter.c src/core/channel/http_server_filter.c src/core/channel/noop_filter.c src/core/compression/algorithm.c src/core/compression/message_compress.c src/core/debug/trace.c src/core/iomgr/alarm.c src/core/iomgr/alarm_heap.c src/core/iomgr/endpoint.c src/core/iomgr/endpoint_pair_posix.c src/core/iomgr/endpoint_pair_windows.c src/core/iomgr/fd_posix.c src/core/iomgr/iocp_windows.c src/core/iomgr/iomgr.c src/core/iomgr/iomgr_posix.c src/core/iomgr/iomgr_windows.c src/core/iomgr/pollset_kick_posix.c src/core/iomgr/pollset_multipoller_with_epoll.c src/core/iomgr/pollset_multipoller_with_poll_posix.c src/core/iomgr/pollset_posix.c src/core/iomgr/pollset_set_posix.c src/core/iomgr/pollset_set_windows.c src/core/iomgr/pollset_windows.c src/core/iomgr/resolve_address_posix.c src/core/iomgr/resolve_address_windows.c src/core/iomgr/sockaddr_utils.c src/core/iomgr/socket_utils_common_posix.c src/core/iomgr/socket_utils_linux.c src/core/iomgr/socket_utils_posix.c src/core/iomgr/socket_windows.c src/core/iomgr/tcp_client_posix.c src/core/iomgr/tcp_client_windows.c src/core/iomgr/tcp_posix.c src/core/iomgr/tcp_server_posix.c src/core/iomgr/tcp_server_windows.c src/core/iomgr/tcp_windows.c src/core/iomgr/time_averaged_stats.c src/core/iomgr/wakeup_fd_eventfd.c src/core/iomgr/wakeup_fd_nospecial.c src/core/iomgr/wakeup_fd_pipe.c src/core/iomgr/wakeup_fd_posix.c src/core/json/json.c src/core/json/json_reader.c src/core/json/json_string.c src/core/json/json_writer.c src/core/profiling/basic_timers.c src/core/profiling/stap_timers.c src/core/surface/byte_buffer.c src/core/surface/byte_buffer_queue.c src/core/surface/byte_buffer_reader.c src/core/surface/call.c src/core/surface/call_details.c src/core/surface/call_log_batch.c src/core/surface/channel.c src/core/surface/channel_create.c src/core/surface/client.c src/core/surface/completion_queue.c src/core/surface/event_string.c src/core/surface/init.c src/core/surface/lame_client.c src/core/surface/metadata_array.c src/core/surface/server.c src/core/surface/server_chttp2.c src/core/surface/server_create.c src/core/surface/surface_trace.c src/core/transport/chttp2/alpn.c src/core/transport/chttp2/bin_encoder.c src/core/transport/chttp2/frame_data.c src/core/transport/chttp2/frame_goaway.c src/core/transport/chttp2/frame_ping.c src/core/transport/chttp2/frame_rst_stream.c src/core/transport/chttp2/frame_settings.c src/core/transport/chttp2/frame_window_update.c src/core/transport/chttp2/hpack_parser.c src/core/transport/chttp2/hpack_table.c src/core/transport/chttp2/huffsyms.c src/core/transport/chttp2/status_conversion.c src/core/transport/chttp2/stream_encoder.c src/core/transport/chttp2/stream_map.c src/core/transport/chttp2/timeout_encoding.c src/core/transport/chttp2/varint.c src/core/transport/chttp2_transport.c src/core/transport/metadata.c src/core/transport/stream_op.c src/core/transport/transport.c src/core/transport/transport_op_string.c src/core/census/context.c src/core/census/initialize.c include/grpc/support/alloc.h include/grpc/support/atm.h include/grpc/support/atm_gcc_atomic.h include/grpc/support/atm_gcc_sync.h include/grpc/support/atm_win32.h include/grpc/support/cancellable_platform.h include/grpc/support/cmdline.h include/grpc/support/cpu.h include/grpc/support/histogram.h include/grpc/support/host_port.h include/grpc/support/log.h include/grpc/support/log_win32.h include/grpc/support/port_platform.h include/grpc/support/slice.h include/grpc/support/slice_buffer.h include/grpc/support/string_util.h include/grpc/support/subprocess.h include/grpc/support/sync.h include/grpc/support/sync_generic.h include/grpc/support/sync_posix.h include/grpc/support/sync_win32.h include/grpc/support/thd.h include/grpc/support/time.h include/grpc/support/tls.h include/grpc/support/tls_gcc.h include/grpc/support/tls_msvc.h include/grpc/support/tls_pthread.h include/grpc/support/useful.h src/core/support/env.h src/core/support/file.h src/core/support/murmur_hash.h src/core/support/string.h src/core/support/string_win32.h src/core/support/thd_internal.h src/core/support/alloc.c src/core/support/cancellable.c src/core/support/cmdline.c src/core/support/cpu_iphone.c src/core/support/cpu_linux.c src/core/support/cpu_posix.c src/core/support/cpu_windows.c src/core/support/env_linux.c src/core/support/env_posix.c src/core/support/env_win32.c src/core/support/file.c src/core/support/file_posix.c src/core/support/file_win32.c src/core/support/histogram.c src/core/support/host_port.c src/core/support/log.c src/core/support/log_android.c src/core/support/log_linux.c src/core/support/log_posix.c src/core/support/log_win32.c src/core/support/murmur_hash.c src/core/support/slice.c src/core/support/slice_buffer.c src/core/support/string.c src/core/support/string_posix.c src/core/support/string_win32.c src/core/support/subprocess_posix.c src/core/support/sync.c src/core/support/sync_posix.c src/core/support/sync_win32.c src/core/support/thd.c src/core/support/thd_posix.c src/core/support/thd_win32.c src/core/support/time.c src/core/support/time_posix.c src/core/support/time_win32.c src/core/support/tls_pthread.c
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh
index 123d0615b4..b53aa98aab 100755
--- a/tools/gce_setup/grpc_docker.sh
+++ b/tools/gce_setup/grpc_docker.sh
@@ -1274,8 +1274,7 @@ grpc_cloud_prod_gen_go_cmd() {
# cmd=$($grpc_gen_test_cmd $flags)
grpc_interop_gen_java_cmd() {
local cmd_prefix="sudo docker run grpc/java";
- local test_script="/var/local/git/grpc-java/run-test-client.sh";
- local test_script+=" --use_test_ca=true --use_tls=true"
+ local test_script="/var/local/git/grpc-java/run-test-client.sh --use_test_ca=true --use_tls=true";
local the_cmd="$cmd_prefix $test_script $@";
echo $the_cmd
}
@@ -1287,13 +1286,40 @@ grpc_interop_gen_java_cmd() {
# cmd=$($grpc_gen_test_cmd $flags)
grpc_cloud_prod_gen_java_cmd() {
local cmd_prefix="sudo docker run grpc/java";
- local test_script="/var/local/git/grpc-java/run-test-client.sh";
- local test_script+=" --use_tls=true"
+ local test_script="/var/local/git/grpc-java/run-test-client.sh --use_tls=true";
local gfe_flags=$(_grpc_prod_gfe_flags)
local the_cmd="$cmd_prefix $test_script $gfe_flags $@";
echo $the_cmd
}
+# constructs the full dockerized java service_account auth interop test cmd.
+#
+# call-seq:
+# flags= .... # generic flags to include the command
+# cmd=$($grpc_gen_test_cmd $flags)
+grpc_cloud_prod_auth_service_account_creds_gen_java_cmd() {
+ local cmd_prefix="sudo docker run grpc/java";
+ local test_script="/var/local/git/grpc-java/run-test-client.sh --use_tls=true";
+ local gfe_flags=$(_grpc_prod_gfe_flags)
+ local added_gfe_flags=$(_grpc_svc_acc_test_flags)
+ local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@";
+ echo $the_cmd
+}
+
+# constructs the full dockerized java gce auth interop test cmd.
+#
+# call-seq:
+# flags= .... # generic flags to include the command
+# cmd=$($grpc_gen_test_cmd $flags)
+grpc_cloud_prod_auth_compute_engine_creds_gen_java_cmd() {
+ local cmd_prefix="sudo docker run grpc/java";
+ local test_script="/var/local/git/grpc-java/run-test-client.sh --use_tls=true";
+ local gfe_flags=$(_grpc_prod_gfe_flags)
+ local added_gfe_flags=$(_grpc_gce_test_flags)
+ local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@";
+ echo $the_cmd
+}
+
# constructs the full dockerized php interop test cmd.
#
# TODO(mlumish): update this to use the script once that's on git
diff --git a/tools/gce_setup/shared_startup_funcs.sh b/tools/gce_setup/shared_startup_funcs.sh
index a3a3b59c8a..60cd9f6897 100755
--- a/tools/gce_setup/shared_startup_funcs.sh
+++ b/tools/gce_setup/shared_startup_funcs.sh
@@ -413,6 +413,9 @@ grpc_dockerfile_install() {
[[ $image_label == "grpc/java_base" ]] && {
grpc_docker_sync_github_key $dockerfile_dir/.ssh 'java_base_ssh_key' || return 1;
}
+ [[ $image_label == "grpc/java" ]] && {
+ grpc_docker_sync_service_account $dockerfile_dir/service_account || return 1;
+ }
[[ $image_label == "grpc/ruby" ]] && {
grpc_docker_sync_roots_pem $dockerfile_dir/cacerts || return 1;
grpc_docker_sync_service_account $dockerfile_dir/service_account || return 1;
diff --git a/tools/jenkins/grpc_jenkins_slave/Dockerfile b/tools/jenkins/grpc_jenkins_slave/Dockerfile
new file mode 100644
index 0000000000..c3722457db
--- /dev/null
+++ b/tools/jenkins/grpc_jenkins_slave/Dockerfile
@@ -0,0 +1,119 @@
+# 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.
+
+# A work-in-progress Dockerfile that allows running gRPC test suites
+# inside a docker container.
+
+FROM debian:wheezy
+
+# Install Git.
+RUN apt-get update && apt-get install -y \
+ autoconf \
+ autotools-dev \
+ build-essential \
+ bzip2 \
+ curl \
+ gcc \
+ git \
+ libc6 \
+ libc6-dbg \
+ libc6-dev \
+ libgtest-dev \
+ libtool \
+ make \
+ strace \
+ python-dev \
+ python-setuptools \
+ telnet \
+ unzip \
+ wget \
+ zip && apt-get clean
+
+##################
+# C++ dependencies
+RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev
+
+#################
+# C# dependencies
+
+# Update to a newer version of mono
+RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
+RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
+
+# Install dependencies
+RUN apt-get update && apt-get install -y \
+ mono-devel \
+ nunit \
+ nunit-console \
+ monodevelop
+
+# Download NuGet
+RUN cd /var/local && wget www.nuget.org/NuGet.exe
+ENV NUGET mono /var/local/NuGet.exe
+
+# TODO(jtattermusch): add dependencies for other languages
+
+##################
+# Node dependencies
+
+# Install nvm
+RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
+RUN /bin/bash -l -c "nvm install 0.12"
+
+##################
+# Ruby dependencies
+
+# Install rvm
+RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
+RUN \curl -sSL https://get.rvm.io | bash -s stable
+
+# Install Ruby 2.1
+RUN /bin/bash -l -c "rvm install ruby-2.1"
+RUN /bin/bash -l -c "rvm use --default ruby-2.1"
+RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
+RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc"
+RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc"
+RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
+
+##################
+# Python dependencies
+
+# Install dependencies
+
+RUN apt-get update && apt-get install -y \
+ python-all-dev \
+ python3-all-dev \
+ python-pip \
+ python-virtualenv
+
+# Install Python packages from PyPI
+RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2
+
+# Define the default command.
+CMD ["bash"]
diff --git a/tools/jenkins/run_jenkins.sh b/tools/jenkins/run_jenkins.sh
new file mode 100755
index 0000000000..a95819af60
--- /dev/null
+++ b/tools/jenkins/run_jenkins.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+# 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.
+#
+# This script is invoked by Jenkins and triggers a test run based on
+# env variable settings.
+#
+# To prevent cygwin bash complaining about empty lines ending with \r
+# we set the igncr option. The option doesn't exist on Linux, so we fallback
+# to just 'set -ex' there.
+# NOTE: No empty lines should appear in this file before igncr is set!
+set -ex -o igncr || set -ex
+
+if [ "$platform" == "linux" ]
+then
+ echo "building $language on Linux"
+
+ # Run tests inside docker
+ docker run grpc/grpc_jenkins_slave bash -c -l "git clone --recursive $GIT_URL /var/local/git/grpc \
+ && cd /var/local/git/grpc && git checkout -f $GIT_COMMIT \
+ && git submodule update \
+ && nvm use 0.12 \
+ && rvm use ruby-2.1 \
+ && tools/run_tests/run_tests.py -t -l $language"
+elif [ "$platform" == "windows" ]
+then
+ echo "building $language on Windows"
+
+ # Prevent msbuild from picking up "platform" env variable, which would break the build
+ unset platform
+
+ # TODO(jtattermusch): integrate nuget restore in a nicer way.
+ /cygdrive/c/nuget/nuget.exe restore vsprojects/grpc.sln
+ /cygdrive/c/nuget/nuget.exe restore src/csharp/Grpc.sln
+
+ python tools/run_tests/run_tests.py -t -l $language
+else
+ echo "Unknown platform $platform"
+ exit 1
+fi
diff --git a/tools/run_tests/build_node.sh b/tools/run_tests/build_node.sh
index c85ecf1b25..95ffb94c6e 100755
--- a/tools/run_tests/build_node.sh
+++ b/tools/run_tests/build_node.sh
@@ -41,4 +41,4 @@ export LDFLAGS=-L`pwd`/libs/$CONFIG
cd src/node
-npm install
+npm install --unsafe-perm
diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh
index dc5baccf9f..d0f09e4d8b 100755
--- a/tools/run_tests/build_python.sh
+++ b/tools/run_tests/build_python.sh
@@ -37,6 +37,6 @@ root=`pwd`
rm -rf python2.7_virtual_environment
virtualenv -p /usr/bin/python2.7 python2.7_virtual_environment
source python2.7_virtual_environment/bin/activate
-pip install enum34==1.0.4 futures==2.2.0 protobuf==3.0.0a2
+pip install -r src/python/requirements.txt
CFLAGS=-I$root/include LDFLAGS=-L$root/libs/$CONFIG pip install src/python/src
pip install src/python/interop
diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py
index 51d61db7f6..985b7a7f16 100755
--- a/tools/run_tests/jobset.py
+++ b/tools/run_tests/jobset.py
@@ -33,7 +33,6 @@ import hashlib
import multiprocessing
import os
import platform
-import random
import signal
import subprocess
import sys
@@ -59,40 +58,6 @@ else:
signal.signal(signal.SIGALRM, alarm_handler)
-def shuffle_iteratable(it):
- """Return an iterable that randomly walks it"""
- # take a random sampling from the passed in iterable
- # we take an element with probability 1/p and rapidly increase
- # p as we take elements - this gives us a somewhat random set of values before
- # we've seen all the values, but starts producing values without having to
- # compute ALL of them at once, allowing tests to start a little earlier
- LARGE_THRESHOLD = 1000
- nextit = []
- p = 1
- for val in it:
- if random.randint(0, p) == 0:
- p = min(p*2, 100)
- yield val
- else:
- nextit.append(val)
- # if the input iterates over a large number of values (potentially
- # infinite, we'd be in the loop for a while (again, potentially forever).
- # We need to reset "nextit" every so often to, in the case of an infinite
- # iterator, avoid growing "nextit" without ever freeing it.
- if len(nextit) > LARGE_THRESHOLD:
- random.shuffle(nextit)
- for val in nextit:
- yield val
- nextit = []
- p = 1
-
- # after taking a random sampling, we shuffle the rest of the elements and
- # yield them
- random.shuffle(nextit)
- for val in nextit:
- yield val
-
-
_SUCCESS = object()
_FAILURE = object()
_RUNNING = object()
@@ -358,11 +323,6 @@ def run(cmdlines,
maxjobs if maxjobs is not None else _DEFAULT_MAX_JOBS,
newline_on_success, travis, stop_on_failure,
cache if cache is not None else NoCache())
- # We can't sort an infinite sequence of runs.
- if not travis or infinite_runs:
- cmdlines = shuffle_iteratable(cmdlines)
- else:
- cmdlines = sorted(cmdlines, key=lambda x: x.shortname)
for cmdline in cmdlines:
if not js.start(cmdline):
break
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 85885dd79f..65024795e4 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -36,16 +36,16 @@ import itertools
import json
import multiprocessing
import os
+import platform
+import random
import re
+import subprocess
import sys
import time
-import platform
-import subprocess
import jobset
import watch_dirs
-
ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
os.chdir(ROOT)
@@ -491,13 +491,21 @@ def _build_and_run(check_cancelled, newline_on_success, travis, cache):
return 1
# start antagonists
- antagonists = [subprocess.Popen(['tools/run_tests/antagonist.py'])
+ antagonists = [subprocess.Popen(['tools/run_tests/antagonist.py'])
for _ in range(0, args.antagonists)]
try:
infinite_runs = runs_per_test == 0
- # run all the tests
- runs_sequence = (itertools.repeat(one_run) if infinite_runs
- else itertools.repeat(one_run, runs_per_test))
+ # When running on travis, we want out test runs to be as similar as possible
+ # for reproducibility purposes.
+ if travis:
+ massaged_one_run = sorted(one_run, key=lambda x: x.shortname)
+ else:
+ # whereas otherwise, we want to shuffle things up to give all tests a
+ # chance to run.
+ massaged_one_run = list(one_run) # random.shuffle needs an indexable seq.
+ random.shuffle(massaged_one_run) # which it modifies in-place.
+ runs_sequence = (itertools.repeat(massaged_one_run) if infinite_runs
+ else itertools.repeat(massaged_one_run, runs_per_test))
all_runs = itertools.chain.from_iterable(runs_sequence)
if not jobset.run(all_runs, check_cancelled,
newline_on_success=newline_on_success, travis=travis,
diff --git a/vsprojects/gpr/gpr.vcxproj b/vsprojects/gpr/gpr.vcxproj
index a7e7c2754f..3e6bb2036e 100644
--- a/vsprojects/gpr/gpr.vcxproj
+++ b/vsprojects/gpr/gpr.vcxproj
@@ -161,6 +161,7 @@
<ClInclude Include="..\..\include\grpc\support\port_platform.h" />
<ClInclude Include="..\..\include\grpc\support\slice.h" />
<ClInclude Include="..\..\include\grpc\support\slice_buffer.h" />
+ <ClInclude Include="..\..\include\grpc\support\string_util.h" />
<ClInclude Include="..\..\include\grpc\support\subprocess.h" />
<ClInclude Include="..\..\include\grpc\support\sync.h" />
<ClInclude Include="..\..\include\grpc\support\sync_generic.h" />
diff --git a/vsprojects/gpr/gpr.vcxproj.filters b/vsprojects/gpr/gpr.vcxproj.filters
index 0f81ef598a..a270902236 100644
--- a/vsprojects/gpr/gpr.vcxproj.filters
+++ b/vsprojects/gpr/gpr.vcxproj.filters
@@ -159,6 +159,9 @@
<ClInclude Include="..\..\include\grpc\support\slice_buffer.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\grpc\support\string_util.h">
+ <Filter>include\grpc\support</Filter>
+ </ClInclude>
<ClInclude Include="..\..\include\grpc\support\subprocess.h">
<Filter>include\grpc\support</Filter>
</ClInclude>
diff --git a/vsprojects/grpc++/grpc++.vcxproj b/vsprojects/grpc++/grpc++.vcxproj
index 46b4a4c0eb..d233f9e3d3 100644
--- a/vsprojects/grpc++/grpc++.vcxproj
+++ b/vsprojects/grpc++/grpc++.vcxproj
@@ -221,6 +221,8 @@
</ClCompile>
<ClCompile Include="..\..\src\cpp\server\async_generic_service.cc">
</ClCompile>
+ <ClCompile Include="..\..\src\cpp\server\create_default_thread_pool.cc">
+ </ClCompile>
<ClCompile Include="..\..\src\cpp\server\insecure_server_credentials.cc">
</ClCompile>
<ClCompile Include="..\..\src\cpp\server\server.cc">
diff --git a/vsprojects/grpc++/grpc++.vcxproj.filters b/vsprojects/grpc++/grpc++.vcxproj.filters
index d5eeb71790..dd375c7238 100644
--- a/vsprojects/grpc++/grpc++.vcxproj.filters
+++ b/vsprojects/grpc++/grpc++.vcxproj.filters
@@ -49,6 +49,9 @@
<ClCompile Include="..\..\src\cpp\server\async_generic_service.cc">
<Filter>src\cpp\server</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\cpp\server\create_default_thread_pool.cc">
+ <Filter>src\cpp\server</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\cpp\server\insecure_server_credentials.cc">
<Filter>src\cpp\server</Filter>
</ClCompile>
diff --git a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj
index 026bbea51d..9b2ef9137d 100644
--- a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj
+++ b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj
@@ -215,6 +215,8 @@
</ClCompile>
<ClCompile Include="..\..\src\cpp\server\async_generic_service.cc">
</ClCompile>
+ <ClCompile Include="..\..\src\cpp\server\create_default_thread_pool.cc">
+ </ClCompile>
<ClCompile Include="..\..\src\cpp\server\insecure_server_credentials.cc">
</ClCompile>
<ClCompile Include="..\..\src\cpp\server\server.cc">
diff --git a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters
index 7221027afd..d616e336e4 100644
--- a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters
+++ b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters
@@ -43,6 +43,9 @@
<ClCompile Include="..\..\src\cpp\server\async_generic_service.cc">
<Filter>src\cpp\server</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\cpp\server\create_default_thread_pool.cc">
+ <Filter>src\cpp\server</Filter>
+ </ClCompile>
<ClCompile Include="..\..\src\cpp\server\insecure_server_credentials.cc">
<Filter>src\cpp\server</Filter>
</ClCompile>
diff --git a/vsprojects/nuget_package/grpc.native.csharp_ext.nuspec b/vsprojects/nuget_package/grpc.native.csharp_ext.nuspec
index 2527f4c415..211d747e2d 100644
--- a/vsprojects/nuget_package/grpc.native.csharp_ext.nuspec
+++ b/vsprojects/nuget_package/grpc.native.csharp_ext.nuspec
@@ -2,14 +2,14 @@
<package>
<metadata>
<id>grpc.native.csharp_ext</id>
- <version>0.9.0.0</version>
+ <version>0.9.1</version>
<authors>Google Inc.</authors>
<owners>grpc-packages</owners>
<licenseUrl>https://github.com/grpc/grpc/blob/master/LICENSE</licenseUrl>
<projectUrl>http://github.com/grpc/grpc</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Native extension needed by gRPC C# library. This is not the package you are looking for, it is only meant to be used as a dependency.</description>
- <releaseNotes>Release of gRPC C core 0.9.0 libraries.</releaseNotes>
+ <releaseNotes>Release of gRPC C core 0.9.1 libraries.</releaseNotes>
<copyright>Copyright 2015</copyright>
<title>gRPC C# Native Extension</title>
<summary>Native library required by gRPC C#</summary>
@@ -27,4 +27,4 @@
<file src="output\v100\Win32\Debug\grpc_csharp_ext.dll" target="/build/native/bin/v100\Win32\Debug\grpc_csharp_ext.dll" />
<file src="output\v120\Win32\Debug\grpc_csharp_ext.dll" target="/build/native/bin/v120\Win32\Debug\grpc_csharp_ext.dll" />
</files>
-</package> \ No newline at end of file
+</package>