aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-09-08 07:16:34 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-09-08 07:16:34 -0700
commitebfcd97940e6688a37c36cdeac87da3196ce1a9b (patch)
treefa284a70c6857e2cbb9aa127d109ba9f7e434798 /src
parent9717e5fe93a5b6d0042b43369655bb696a86bb9f (diff)
parent47b2961638328d29577361c3cb4dec5ab5bab537 (diff)
Merge remote-tracking branch 'upstream/master' into max_send_size_filter
Diffstat (limited to 'src')
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.c13
-rw-r--r--src/core/ext/transport/chttp2/transport/frame.h2
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_encoder.c10
-rw-r--r--src/core/ext/transport/chttp2/transport/hpack_encoder.h1
-rw-r--r--src/core/ext/transport/chttp2/transport/internal.h2
-rw-r--r--src/core/ext/transport/chttp2/transport/writing.c12
-rw-r--r--src/core/lib/channel/http_client_filter.c1
-rw-r--r--src/core/lib/support/percent_encoding.c180
-rw-r--r--src/core/lib/support/percent_encoding.h78
-rw-r--r--src/cpp/client/channel_cc.cc (renamed from src/cpp/client/channel.cc)0
-rw-r--r--src/cpp/client/credentials_cc.cc (renamed from src/cpp/client/credentials.cc)0
-rw-r--r--src/cpp/common/completion_queue_cc.cc (renamed from src/cpp/common/completion_queue.cc)0
-rw-r--r--src/cpp/server/server_cc.cc (renamed from src/cpp/server/server.cc)0
-rw-r--r--src/cpp/util/byte_buffer_cc.cc (renamed from src/cpp/util/byte_buffer.cc)0
-rw-r--r--src/cpp/util/slice_cc.cc (renamed from src/cpp/util/slice.cc)0
-rw-r--r--src/cpp/util/time_cc.cc (renamed from src/cpp/util/time.cc)0
-rw-r--r--src/csharp/Grpc.Auth/Grpc.Auth.csproj18
-rw-r--r--src/csharp/Grpc.Auth/packages.config7
-rw-r--r--src/csharp/Grpc.Auth/project.json9
-rw-r--r--src/csharp/Grpc.Core/project.json3
-rw-r--r--src/csharp/Grpc.Examples.MathClient/project.json3
-rw-r--r--src/csharp/Grpc.Examples.MathServer/project.json3
-rw-r--r--src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj6
-rw-r--r--src/csharp/Grpc.Examples.Tests/packages.config4
-rw-r--r--src/csharp/Grpc.Examples/Grpc.Examples.csproj7
-rw-r--r--src/csharp/Grpc.Examples/packages.config4
-rw-r--r--src/csharp/Grpc.Examples/project.json5
-rw-r--r--src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj6
-rw-r--r--src/csharp/Grpc.HealthCheck.Tests/packages.config2
-rw-r--r--src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj7
-rw-r--r--src/csharp/Grpc.HealthCheck/packages.config2
-rw-r--r--src/csharp/Grpc.HealthCheck/project.json5
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj18
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Client/packages.config7
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Client/project.json3
-rw-r--r--src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json3
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj18
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Server/packages.config7
-rw-r--r--src/csharp/Grpc.IntegrationTesting.Server/project.json3
-rw-r--r--src/csharp/Grpc.IntegrationTesting.StressClient/project.json3
-rw-r--r--src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs3
-rw-r--r--src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj37
-rw-r--r--src/csharp/Grpc.IntegrationTesting/packages.config14
-rw-r--r--src/csharp/Grpc.IntegrationTesting/project.json9
-rw-r--r--src/csharp/ext/grpc_csharp_ext.c6
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m5
-rw-r--r--src/objective-c/GRPCClient/private/GRPCWrappedCall.m5
-rw-r--r--src/php/lib/Grpc/BaseStub.php11
-rwxr-xr-xsrc/php/tests/interop/interop_client.php2
-rw-r--r--src/proto/grpc/testing/echo.proto2
-rw-r--r--src/python/grpcio/grpc/__init__.py4
-rw-r--r--src/python/grpcio/grpc_core_dependencies.py1
-rw-r--r--src/python/grpcio_tests/setup.py4
-rw-r--r--src/ruby/ext/grpc/extconf.rb4
-rw-r--r--src/ruby/lib/grpc/grpc.rb11
55 files changed, 451 insertions, 119 deletions
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
index 93d21c07d2..00b7fc4cc2 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
@@ -399,6 +399,19 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
push_setting(exec_ctx, t, GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE,
(uint32_t)value);
}
+ } else if (0 == strcmp(channel_args->args[i].key,
+ GRPC_ARG_HTTP2_MAX_FRAME_SIZE)) {
+ if (channel_args->args[i].type != GRPC_ARG_INTEGER) {
+ gpr_log(GPR_ERROR, "%s: must be an integer",
+ GRPC_ARG_HTTP2_MAX_FRAME_SIZE);
+ } else if (channel_args->args[i].value.integer < 16384 ||
+ channel_args->args[i].value.integer > 16777215) {
+ gpr_log(GPR_ERROR, "%s: must be between 16384 and 16777215",
+ GRPC_ARG_HTTP2_MAX_FRAME_SIZE);
+ } else {
+ push_setting(exec_ctx, t, GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE,
+ (uint32_t)channel_args->args[i].value.integer);
+ }
}
}
}
diff --git a/src/core/ext/transport/chttp2/transport/frame.h b/src/core/ext/transport/chttp2/transport/frame.h
index 7776609367..507aae4100 100644
--- a/src/core/ext/transport/chttp2/transport/frame.h
+++ b/src/core/ext/transport/chttp2/transport/frame.h
@@ -52,8 +52,6 @@ typedef struct grpc_chttp2_transport_parsing grpc_chttp2_transport_parsing;
#define GRPC_CHTTP2_FRAME_GOAWAY 7
#define GRPC_CHTTP2_FRAME_WINDOW_UPDATE 8
-#define GRPC_CHTTP2_MAX_PAYLOAD_LENGTH ((1 << 14) - 1)
-
#define GRPC_CHTTP2_DATA_FLAG_END_STREAM 1
#define GRPC_CHTTP2_FLAG_ACK 1
#define GRPC_CHTTP2_DATA_FLAG_END_HEADERS 4
diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.c b/src/core/ext/transport/chttp2/transport/hpack_encoder.c
index 2cb8205d94..581471ba02 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_encoder.c
+++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.c
@@ -78,6 +78,8 @@ typedef struct {
uint32_t stream_id;
gpr_slice_buffer *output;
grpc_transport_one_way_stats *stats;
+ /* maximum size of a frame */
+ size_t max_frame_size;
} framer_state;
/* fills p (which is expected to be 9 bytes long) with a data frame header */
@@ -123,7 +125,7 @@ static void begin_frame(framer_state *st) {
needed */
static void ensure_space(framer_state *st, size_t need_bytes) {
if (st->output->length - st->output_length_at_start_of_frame + need_bytes <=
- GRPC_CHTTP2_MAX_PAYLOAD_LENGTH) {
+ st->max_frame_size) {
return;
}
finish_frame(st, 0, 0);
@@ -149,8 +151,8 @@ static void add_header_data(framer_state *st, gpr_slice slice) {
size_t len = GPR_SLICE_LENGTH(slice);
size_t remaining;
if (len == 0) return;
- remaining = GRPC_CHTTP2_MAX_PAYLOAD_LENGTH +
- st->output_length_at_start_of_frame - st->output->length;
+ remaining = st->max_frame_size + st->output_length_at_start_of_frame -
+ st->output->length;
if (len <= remaining) {
st->stats->header_bytes += len;
gpr_slice_buffer_add(st->output, slice);
@@ -542,6 +544,7 @@ void grpc_chttp2_hpack_compressor_set_max_table_size(
void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor *c,
uint32_t stream_id,
grpc_metadata_batch *metadata, int is_eof,
+ size_t max_frame_size,
grpc_transport_one_way_stats *stats,
gpr_slice_buffer *outbuf) {
framer_state st;
@@ -555,6 +558,7 @@ void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor *c,
st.output = outbuf;
st.is_first_frame = 1;
st.stats = stats;
+ st.max_frame_size = max_frame_size;
/* Encode a metadata batch; store the returned values, representing
a metadata element that needs to be unreffed back into the metadata
diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h
index 0f7b0b063a..4c3a931549 100644
--- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h
+++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h
@@ -91,6 +91,7 @@ void grpc_chttp2_hpack_compressor_set_max_usable_size(
void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor *c, uint32_t id,
grpc_metadata_batch *metadata, int is_eof,
+ size_t max_frame_size,
grpc_transport_one_way_stats *stats,
gpr_slice_buffer *outbuf);
diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h
index e1dcf5262a..d67c014e54 100644
--- a/src/core/ext/transport/chttp2/transport/internal.h
+++ b/src/core/ext/transport/chttp2/transport/internal.h
@@ -223,6 +223,8 @@ typedef struct {
uint8_t is_client;
/** callback for when writing is done */
grpc_closure done_cb;
+ /** maximum frame size */
+ uint32_t max_frame_size;
} grpc_chttp2_transport_writing;
struct grpc_chttp2_transport_parsing {
diff --git a/src/core/ext/transport/chttp2/transport/writing.c b/src/core/ext/transport/chttp2/transport/writing.c
index 8f7a1f55c6..311b26e354 100644
--- a/src/core/ext/transport/chttp2/transport/writing.c
+++ b/src/core/ext/transport/chttp2/transport/writing.c
@@ -51,6 +51,10 @@ int grpc_chttp2_unlocking_check_writes(
GPR_TIMER_BEGIN("grpc_chttp2_unlocking_check_writes", 0);
+ transport_writing->max_frame_size =
+ transport_global->settings[GRPC_ACKED_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE];
+
/* simple writes are queued to qbuf, and flushed here */
gpr_slice_buffer_swap(&transport_global->qbuf, &transport_writing->outbuf);
GPR_ASSERT(transport_global->qbuf.count == 0);
@@ -206,14 +210,15 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx,
while (
grpc_chttp2_list_pop_writing_stream(transport_writing, &stream_writing)) {
uint32_t max_outgoing =
- (uint32_t)GPR_MIN(GRPC_CHTTP2_MAX_PAYLOAD_LENGTH,
+ (uint32_t)GPR_MIN(transport_writing->max_frame_size,
GPR_MIN(stream_writing->outgoing_window,
transport_writing->outgoing_window));
/* send initial metadata if it's available */
if (stream_writing->send_initial_metadata != NULL) {
grpc_chttp2_encode_header(
&transport_writing->hpack_compressor, stream_writing->id,
- stream_writing->send_initial_metadata, 0, &stream_writing->stats,
+ stream_writing->send_initial_metadata, 0,
+ transport_writing->max_frame_size, &stream_writing->stats,
&transport_writing->outbuf);
stream_writing->send_initial_metadata = NULL;
stream_writing->sent_initial_metadata = 1;
@@ -303,7 +308,8 @@ static void finalize_outbuf(grpc_exec_ctx *exec_ctx,
} else {
grpc_chttp2_encode_header(
&transport_writing->hpack_compressor, stream_writing->id,
- stream_writing->send_trailing_metadata, 1, &stream_writing->stats,
+ stream_writing->send_trailing_metadata, 1,
+ transport_writing->max_frame_size, &stream_writing->stats,
&transport_writing->outbuf);
}
if (!transport_writing->is_client && !stream_writing->read_closed) {
diff --git a/src/core/lib/channel/http_client_filter.c b/src/core/lib/channel/http_client_filter.c
index ef68cc86ea..edcc741ff6 100644
--- a/src/core/lib/channel/http_client_filter.c
+++ b/src/core/lib/channel/http_client_filter.c
@@ -233,7 +233,6 @@ static void hc_mutate_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
if (method == GRPC_MDELEM_METHOD_GET) {
/* allocate memory to hold the entire payload */
calld->payload_bytes = gpr_malloc(op->send_message->length);
- GPR_ASSERT(calld->payload_bytes);
/* read slices of send_message and copy into payload_bytes */
calld->send_op = *op;
diff --git a/src/core/lib/support/percent_encoding.c b/src/core/lib/support/percent_encoding.c
new file mode 100644
index 0000000000..3c19f264f9
--- /dev/null
+++ b/src/core/lib/support/percent_encoding.c
@@ -0,0 +1,180 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "src/core/lib/support/percent_encoding.h"
+
+#include <grpc/support/log.h>
+
+const uint8_t gpr_url_percent_encoding_unreserved_bytes[256 / 8] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xff, 0x03, 0xfe, 0xff, 0xff,
+ 0x87, 0xfe, 0xff, 0xff, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+const uint8_t gpr_compatible_percent_encoding_unreserved_bytes[256 / 8] = {
+ 0x00, 0x00, 0x00, 0x00, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static bool is_unreserved_character(uint8_t c,
+ const uint8_t *unreserved_bytes) {
+ return ((unreserved_bytes[c / 8] >> (c % 8)) & 1) != 0;
+}
+
+gpr_slice gpr_percent_encode_slice(gpr_slice slice,
+ const uint8_t *unreserved_bytes) {
+ static const uint8_t hex[] = "0123456789ABCDEF";
+
+ // first pass: count the number of bytes needed to output this string
+ size_t output_length = 0;
+ const uint8_t *slice_start = GPR_SLICE_START_PTR(slice);
+ const uint8_t *slice_end = GPR_SLICE_END_PTR(slice);
+ const uint8_t *p;
+ bool any_reserved_bytes = false;
+ for (p = slice_start; p < slice_end; p++) {
+ bool unres = is_unreserved_character(*p, unreserved_bytes);
+ output_length += unres ? 1 : 3;
+ any_reserved_bytes |= !unres;
+ }
+ // no unreserved bytes: return the string unmodified
+ if (!any_reserved_bytes) {
+ return gpr_slice_ref(slice);
+ }
+ // second pass: actually encode
+ gpr_slice out = gpr_slice_malloc(output_length);
+ uint8_t *q = GPR_SLICE_START_PTR(out);
+ for (p = slice_start; p < slice_end; p++) {
+ if (is_unreserved_character(*p, unreserved_bytes)) {
+ *q++ = *p;
+ } else {
+ *q++ = '%';
+ *q++ = hex[*p >> 4];
+ *q++ = hex[*p & 15];
+ }
+ }
+ GPR_ASSERT(q == GPR_SLICE_END_PTR(out));
+ return out;
+}
+
+static bool valid_hex(const uint8_t *p, const uint8_t *end) {
+ if (p >= end) return false;
+ return (*p >= '0' && *p <= '9') || (*p >= 'a' && *p <= 'f') ||
+ (*p >= 'A' && *p <= 'F');
+}
+
+static uint8_t dehex(uint8_t c) {
+ if (c >= '0' && c <= '9') return (uint8_t)(c - '0');
+ if (c >= 'A' && c <= 'F') return (uint8_t)(c - 'A' + 10);
+ if (c >= 'a' && c <= 'f') return (uint8_t)(c - 'a' + 10);
+ GPR_UNREACHABLE_CODE(return 255);
+}
+
+bool gpr_strict_percent_decode_slice(gpr_slice slice_in,
+ const uint8_t *unreserved_bytes,
+ gpr_slice *slice_out) {
+ const uint8_t *p = GPR_SLICE_START_PTR(slice_in);
+ const uint8_t *in_end = GPR_SLICE_END_PTR(slice_in);
+ size_t out_length = 0;
+ bool any_percent_encoded_stuff = false;
+ while (p != in_end) {
+ if (*p == '%') {
+ if (!valid_hex(++p, in_end)) return false;
+ if (!valid_hex(++p, in_end)) return false;
+ p++;
+ out_length++;
+ any_percent_encoded_stuff = true;
+ } else if (is_unreserved_character(*p, unreserved_bytes)) {
+ p++;
+ out_length++;
+ } else {
+ return false;
+ }
+ }
+ if (!any_percent_encoded_stuff) {
+ *slice_out = gpr_slice_ref(slice_in);
+ return true;
+ }
+ p = GPR_SLICE_START_PTR(slice_in);
+ *slice_out = gpr_slice_malloc(out_length);
+ uint8_t *q = GPR_SLICE_START_PTR(*slice_out);
+ while (p != in_end) {
+ if (*p == '%') {
+ *q++ = (uint8_t)(dehex(p[1]) << 4) | (dehex(p[2]));
+ p += 3;
+ } else {
+ *q++ = *p++;
+ }
+ }
+ GPR_ASSERT(q == GPR_SLICE_END_PTR(*slice_out));
+ return true;
+}
+
+gpr_slice gpr_permissive_percent_decode_slice(gpr_slice slice_in) {
+ const uint8_t *p = GPR_SLICE_START_PTR(slice_in);
+ const uint8_t *in_end = GPR_SLICE_END_PTR(slice_in);
+ size_t out_length = 0;
+ bool any_percent_encoded_stuff = false;
+ while (p != in_end) {
+ if (*p == '%') {
+ if (!valid_hex(p + 1, in_end) || !valid_hex(p + 2, in_end)) {
+ p++;
+ out_length++;
+ } else {
+ p += 3;
+ out_length++;
+ any_percent_encoded_stuff = true;
+ }
+ } else {
+ p++;
+ out_length++;
+ }
+ }
+ if (!any_percent_encoded_stuff) {
+ return gpr_slice_ref(slice_in);
+ }
+ p = GPR_SLICE_START_PTR(slice_in);
+ gpr_slice out = gpr_slice_malloc(out_length);
+ uint8_t *q = GPR_SLICE_START_PTR(out);
+ while (p != in_end) {
+ if (*p == '%') {
+ if (!valid_hex(p + 1, in_end) || !valid_hex(p + 2, in_end)) {
+ *q++ = *p++;
+ } else {
+ *q++ = (uint8_t)(dehex(p[1]) << 4) | (dehex(p[2]));
+ p += 3;
+ }
+ } else {
+ *q++ = *p++;
+ }
+ }
+ GPR_ASSERT(q == GPR_SLICE_END_PTR(out));
+ return out;
+}
diff --git a/src/core/lib/support/percent_encoding.h b/src/core/lib/support/percent_encoding.h
new file mode 100644
index 0000000000..000bf14ede
--- /dev/null
+++ b/src/core/lib/support/percent_encoding.h
@@ -0,0 +1,78 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_SUPPORT_PERCENT_ENCODING_H
+#define GRPC_CORE_LIB_SUPPORT_PERCENT_ENCODING_H
+
+/* Percent encoding and decoding of slices.
+ Transforms arbitrary strings into safe-for-transmission strings by using
+ variants of percent encoding (RFC 3986).
+ Two major variants are supplied: one that strictly matches URL encoding,
+ and another which applies percent encoding only to non-http2 header
+ bytes (the 'compatible' variant) */
+
+#include <stdbool.h>
+
+#include <grpc/support/slice.h>
+
+/* URL percent encoding spec bitfield (usabel as 'unreserved_bytes' in
+ gpr_percent_encode_slice, gpr_strict_percent_decode_slice).
+ Flags [A-Za-z0-9-_.~] as unreserved bytes for the percent encoding routines
+ */
+extern const uint8_t gpr_url_percent_encoding_unreserved_bytes[256 / 8];
+/* URL percent encoding spec bitfield (usabel as 'unreserved_bytes' in
+ gpr_percent_encode_slice, gpr_strict_percent_decode_slice).
+ Flags ascii7 non-control characters excluding '%' as unreserved bytes for the
+ percent encoding routines */
+extern const uint8_t gpr_compatible_percent_encoding_unreserved_bytes[256 / 8];
+
+/* Percent-encode a slice, returning the new slice (this cannot fail):
+ unreserved_bytes is a bitfield indicating which bytes are considered
+ unreserved and thus do not need percent encoding */
+gpr_slice gpr_percent_encode_slice(gpr_slice slice,
+ const uint8_t *unreserved_bytes);
+/* Percent-decode a slice, strictly.
+ If the input is legal (contains no unreserved bytes, and legal % encodings),
+ returns true and sets *slice_out to the decoded slice.
+ If the input is not legal, returns false and leaves *slice_out untouched.
+ unreserved_bytes is a bitfield indicating which bytes are considered
+ unreserved and thus do not need percent encoding */
+bool gpr_strict_percent_decode_slice(gpr_slice slice_in,
+ const uint8_t *unreserved_bytes,
+ gpr_slice *slice_out);
+/* Percent-decode a slice, permissively.
+ If a % triplet can not be decoded, pass it through verbatim.
+ This cannot fail. */
+gpr_slice gpr_permissive_percent_decode_slice(gpr_slice slice_in);
+
+#endif /* GRPC_CORE_LIB_SUPPORT_PERCENT_ENCODING_H */
diff --git a/src/cpp/client/channel.cc b/src/cpp/client/channel_cc.cc
index 43b3875cb3..43b3875cb3 100644
--- a/src/cpp/client/channel.cc
+++ b/src/cpp/client/channel_cc.cc
diff --git a/src/cpp/client/credentials.cc b/src/cpp/client/credentials_cc.cc
index e6a4f81b0d..e6a4f81b0d 100644
--- a/src/cpp/client/credentials.cc
+++ b/src/cpp/client/credentials_cc.cc
diff --git a/src/cpp/common/completion_queue.cc b/src/cpp/common/completion_queue_cc.cc
index 00cc102f92..00cc102f92 100644
--- a/src/cpp/common/completion_queue.cc
+++ b/src/cpp/common/completion_queue_cc.cc
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server_cc.cc
index a693ce9b8e..a693ce9b8e 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server_cc.cc
diff --git a/src/cpp/util/byte_buffer.cc b/src/cpp/util/byte_buffer_cc.cc
index 91ed66b766..91ed66b766 100644
--- a/src/cpp/util/byte_buffer.cc
+++ b/src/cpp/util/byte_buffer_cc.cc
diff --git a/src/cpp/util/slice.cc b/src/cpp/util/slice_cc.cc
index 7e88423b6c..7e88423b6c 100644
--- a/src/cpp/util/slice.cc
+++ b/src/cpp/util/slice_cc.cc
diff --git a/src/cpp/util/time.cc b/src/cpp/util/time_cc.cc
index c43d848cc6..c43d848cc6 100644
--- a/src/cpp/util/time.cc
+++ b/src/cpp/util/time_cc.cc
diff --git a/src/csharp/Grpc.Auth/Grpc.Auth.csproj b/src/csharp/Grpc.Auth/Grpc.Auth.csproj
index 7a6955311a..a44aaf1fdd 100644
--- a/src/csharp/Grpc.Auth/Grpc.Auth.csproj
+++ b/src/csharp/Grpc.Auth/Grpc.Auth.csproj
@@ -49,14 +49,26 @@
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
+ <Reference Include="log4net">
+ <HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
+ </Reference>
<Reference Include="Google.Apis.Core">
- <HintPath>..\packages\Google.Apis.Core.1.15.0\lib\net45\Google.Apis.Core.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Zlib.Portable">
+ <HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.PlatformServices">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth">
- <HintPath>..\packages\Google.Apis.Auth.1.15.0\lib\net45\Google.Apis.Auth.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices">
- <HintPath>..\packages\Google.Apis.Auth.1.15.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
diff --git a/src/csharp/Grpc.Auth/packages.config b/src/csharp/Grpc.Auth/packages.config
index 738d3e6f3b..11c6375c63 100644
--- a/src/csharp/Grpc.Auth/packages.config
+++ b/src/csharp/Grpc.Auth/packages.config
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
- <package id="Google.Apis.Auth" version="1.15.0" targetFramework="net45" />
- <package id="Google.Apis.Core" version="1.15.0" targetFramework="net45" />
+ <package id="Google.Apis" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
+ <package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
+ <package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.Auth/project.json b/src/csharp/Grpc.Auth/project.json
index 30f0944693..595e29f50a 100644
--- a/src/csharp/Grpc.Auth/project.json
+++ b/src/csharp/Grpc.Auth/project.json
@@ -23,18 +23,13 @@
},
"dependencies": {
"Grpc.Core": "1.1.0-dev",
- "Google.Apis.Auth": "1.15.0"
+ "Google.Apis.Auth": "1.16.0"
},
"frameworks": {
"net45": { },
"netstandard1.5": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
- "Microsoft.NETCore.Portable.Compatibility": "1.0.1",
- "NETStandard.Library": "1.6.0",
- "System.Threading.Tasks": "4.0.11"
+ "NETStandard.Library": "1.6.0"
}
}
}
diff --git a/src/csharp/Grpc.Core/project.json b/src/csharp/Grpc.Core/project.json
index f7e21a25dd..50c328abe1 100644
--- a/src/csharp/Grpc.Core/project.json
+++ b/src/csharp/Grpc.Core/project.json
@@ -36,9 +36,6 @@
"frameworks": {
"net45": { },
"netstandard1.5": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
"NETStandard.Library": "1.6.0",
"System.Threading.Thread": "4.0.0"
diff --git a/src/csharp/Grpc.Examples.MathClient/project.json b/src/csharp/Grpc.Examples.MathClient/project.json
index ad319478ab..c0725a1468 100644
--- a/src/csharp/Grpc.Examples.MathClient/project.json
+++ b/src/csharp/Grpc.Examples.MathClient/project.json
@@ -56,9 +56,6 @@
"frameworks": {
"net45": { },
"netcoreapp1.0": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
diff --git a/src/csharp/Grpc.Examples.MathServer/project.json b/src/csharp/Grpc.Examples.MathServer/project.json
index ad319478ab..c0725a1468 100644
--- a/src/csharp/Grpc.Examples.MathServer/project.json
+++ b/src/csharp/Grpc.Examples.MathServer/project.json
@@ -56,9 +56,6 @@
"frameworks": {
"net45": { },
"netcoreapp1.0": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
index c8801a9413..a114d96127 100644
--- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
+++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
@@ -36,9 +36,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
- <Reference Include="Google.Protobuf">
- <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
- </Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
@@ -48,6 +45,9 @@
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.Examples.Tests/packages.config b/src/csharp/Grpc.Examples.Tests/packages.config
index cc473eb34c..f14517d2e2 100644
--- a/src/csharp/Grpc.Examples.Tests/packages.config
+++ b/src/csharp/Grpc.Examples.Tests/packages.config
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
- <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" />
+ <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj
index 4521649b6f..dcbef5fc0b 100644
--- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj
+++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj
@@ -37,10 +37,6 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
- </Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
@@ -50,6 +46,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll</HintPath>
</Reference>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.Examples/packages.config b/src/csharp/Grpc.Examples/packages.config
index 8985ae4c77..d17347f08f 100644
--- a/src/csharp/Grpc.Examples/packages.config
+++ b/src/csharp/Grpc.Examples/packages.config
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
- <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
+ <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.Examples/project.json b/src/csharp/Grpc.Examples/project.json
index 98bd5d852c..ce0cfa860d 100644
--- a/src/csharp/Grpc.Examples/project.json
+++ b/src/csharp/Grpc.Examples/project.json
@@ -11,7 +11,7 @@
"Grpc.Core": {
"target": "project"
},
- "Google.Protobuf": "3.0.0-beta3"
+ "Google.Protobuf": "3.0.0"
},
"frameworks": {
"net45": {
@@ -21,9 +21,6 @@
}
},
"netcoreapp1.0": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
"NETStandard.Library": "1.6.0"
diff --git a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
index aefacfbcc0..93c3b3a55f 100644
--- a/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
+++ b/src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
@@ -44,15 +44,15 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
- <Reference Include="Google.Protobuf">
- <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
- </Reference>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.2.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.HealthCheck.Tests/packages.config b/src/csharp/Grpc.HealthCheck.Tests/packages.config
index 2bcfec8829..e796d6b135 100644
--- a/src/csharp/Grpc.HealthCheck.Tests/packages.config
+++ b/src/csharp/Grpc.HealthCheck.Tests/packages.config
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
index e13416cc1a..54a2984964 100644
--- a/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
+++ b/src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
@@ -38,10 +38,6 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Interactive.Async, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -53,6 +49,9 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Grpc.Core\Version.cs">
diff --git a/src/csharp/Grpc.HealthCheck/packages.config b/src/csharp/Grpc.HealthCheck/packages.config
index 063094f775..f8e353bf26 100644
--- a/src/csharp/Grpc.HealthCheck/packages.config
+++ b/src/csharp/Grpc.HealthCheck/packages.config
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.HealthCheck/project.json b/src/csharp/Grpc.HealthCheck/project.json
index 7c062a7e40..9d631229d8 100644
--- a/src/csharp/Grpc.HealthCheck/project.json
+++ b/src/csharp/Grpc.HealthCheck/project.json
@@ -23,7 +23,7 @@
},
"dependencies": {
"Grpc.Core": "1.1.0-dev",
- "Google.Protobuf": "3.0.0-beta3"
+ "Google.Protobuf": "3.0.0"
},
"frameworks": {
"net45": {
@@ -33,9 +33,6 @@
}
},
"netstandard1.5": {
- "imports": [
- "portable-net45"
- ],
"dependencies": {
"NETStandard.Library": "1.6.0"
}
diff --git a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
index 6816b5c5a2..ae58073b52 100644
--- a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
+++ b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
@@ -49,14 +49,26 @@
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
+ <Reference Include="log4net">
+ <HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
+ </Reference>
<Reference Include="Google.Apis.Core">
- <HintPath>..\packages\Google.Apis.Core.1.15.0\lib\net45\Google.Apis.Core.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Zlib.Portable">
+ <HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.PlatformServices">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth">
- <HintPath>..\packages\Google.Apis.Auth.1.15.0\lib\net45\Google.Apis.Auth.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices">
- <HintPath>..\packages\Google.Apis.Auth.1.15.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
diff --git a/src/csharp/Grpc.IntegrationTesting.Client/packages.config b/src/csharp/Grpc.IntegrationTesting.Client/packages.config
index 738d3e6f3b..11c6375c63 100644
--- a/src/csharp/Grpc.IntegrationTesting.Client/packages.config
+++ b/src/csharp/Grpc.IntegrationTesting.Client/packages.config
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
- <package id="Google.Apis.Auth" version="1.15.0" targetFramework="net45" />
- <package id="Google.Apis.Core" version="1.15.0" targetFramework="net45" />
+ <package id="Google.Apis" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
+ <package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
+ <package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.IntegrationTesting.Client/project.json b/src/csharp/Grpc.IntegrationTesting.Client/project.json
index 287950720f..e54b5bd296 100644
--- a/src/csharp/Grpc.IntegrationTesting.Client/project.json
+++ b/src/csharp/Grpc.IntegrationTesting.Client/project.json
@@ -59,8 +59,7 @@
"net45": { },
"netcoreapp1.0": {
"imports": [
- "portable-net45",
- "net45"
+ "portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
diff --git a/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json b/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json
index 287950720f..e54b5bd296 100644
--- a/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json
+++ b/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json
@@ -59,8 +59,7 @@
"net45": { },
"netcoreapp1.0": {
"imports": [
- "portable-net45",
- "net45"
+ "portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
diff --git a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
index 987387ca25..d5c40ba948 100644
--- a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
+++ b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
@@ -49,14 +49,26 @@
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
+ <Reference Include="log4net">
+ <HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
+ </Reference>
<Reference Include="Google.Apis.Core">
- <HintPath>..\packages\Google.Apis.Core.1.15.0\lib\net45\Google.Apis.Core.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Zlib.Portable">
+ <HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.PlatformServices">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth">
- <HintPath>..\packages\Google.Apis.Auth.1.15.0\lib\net45\Google.Apis.Auth.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices">
- <HintPath>..\packages\Google.Apis.Auth.1.15.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
diff --git a/src/csharp/Grpc.IntegrationTesting.Server/packages.config b/src/csharp/Grpc.IntegrationTesting.Server/packages.config
index 738d3e6f3b..11c6375c63 100644
--- a/src/csharp/Grpc.IntegrationTesting.Server/packages.config
+++ b/src/csharp/Grpc.IntegrationTesting.Server/packages.config
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
- <package id="Google.Apis.Auth" version="1.15.0" targetFramework="net45" />
- <package id="Google.Apis.Core" version="1.15.0" targetFramework="net45" />
+ <package id="Google.Apis" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
+ <package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
+ <package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.IntegrationTesting.Server/project.json b/src/csharp/Grpc.IntegrationTesting.Server/project.json
index 287950720f..e54b5bd296 100644
--- a/src/csharp/Grpc.IntegrationTesting.Server/project.json
+++ b/src/csharp/Grpc.IntegrationTesting.Server/project.json
@@ -59,8 +59,7 @@
"net45": { },
"netcoreapp1.0": {
"imports": [
- "portable-net45",
- "net45"
+ "portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
diff --git a/src/csharp/Grpc.IntegrationTesting.StressClient/project.json b/src/csharp/Grpc.IntegrationTesting.StressClient/project.json
index 287950720f..e54b5bd296 100644
--- a/src/csharp/Grpc.IntegrationTesting.StressClient/project.json
+++ b/src/csharp/Grpc.IntegrationTesting.StressClient/project.json
@@ -59,8 +59,7 @@
"net45": { },
"netcoreapp1.0": {
"imports": [
- "portable-net45",
- "net45"
+ "portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
diff --git a/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs b/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
index c17ede7561..ac6c8d0740 100644
--- a/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
+++ b/src/csharp/Grpc.IntegrationTesting/GeneratedClientTest.cs
@@ -48,8 +48,6 @@ namespace Grpc.IntegrationTesting
{
TestService.TestServiceClient unimplementedClient = new UnimplementedTestServiceClient();
- // TODO: replace Moq by some mocking library with CoreCLR support.
-#if !NETCOREAPP1_0
[Test]
public void ExpandedParamOverloadCanBeMocked()
{
@@ -72,7 +70,6 @@ namespace Grpc.IntegrationTesting
Assert.AreSame(expected, mockClient.Object.UnaryCall(new SimpleRequest(), new CallOptions()));
}
-#endif
[Test]
public void DefaultMethodStubThrows_UnaryCall()
diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
index e030b21eec..afd85fb484 100644
--- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
+++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
@@ -38,9 +38,6 @@
<AssemblyOriginatorKeyFile>..\keys\Grpc.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Moq">
- <HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
@@ -48,9 +45,6 @@
<Reference Include="BouncyCastle.Crypto">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
</Reference>
- <Reference Include="Google.Protobuf">
- <HintPath>..\packages\Google.Protobuf.3.0.0-beta3\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll</HintPath>
- </Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
@@ -63,17 +57,38 @@
<Reference Include="nunitlite">
<HintPath>..\packages\NUnitLite.3.2.0\lib\net45\nunitlite.dll</HintPath>
</Reference>
+ <Reference Include="CommandLineParser.Unofficial">
+ <HintPath>..\packages\CommandLineParser.Unofficial.2.0.275\lib\net45\CommandLineParser.Unofficial.dll</HintPath>
+ </Reference>
+ <Reference Include="log4net">
+ <HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
+ </Reference>
<Reference Include="Google.Apis.Core">
- <HintPath>..\packages\Google.Apis.Core.1.15.0\lib\net45\Google.Apis.Core.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Core.1.16.0\lib\net45\Google.Apis.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Zlib.Portable">
+ <HintPath>..\packages\Zlib.Portable.Signed.1.11.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.dll</HintPath>
+ </Reference>
+ <Reference Include="Google.Apis.PlatformServices">
+ <HintPath>..\packages\Google.Apis.1.16.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth">
- <HintPath>..\packages\Google.Apis.Auth.1.15.0\lib\net45\Google.Apis.Auth.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.dll</HintPath>
</Reference>
<Reference Include="Google.Apis.Auth.PlatformServices">
- <HintPath>..\packages\Google.Apis.Auth.1.15.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
+ <HintPath>..\packages\Google.Apis.Auth.1.16.0\lib\net45\Google.Apis.Auth.PlatformServices.dll</HintPath>
</Reference>
- <Reference Include="CommandLineParser.Unofficial">
- <HintPath>..\packages\CommandLineParser.Unofficial.2.0.275\lib\net45\CommandLineParser.Unofficial.dll</HintPath>
+ <Reference Include="Google.Protobuf">
+ <HintPath>..\packages\Google.Protobuf.3.0.0\lib\net45\Google.Protobuf.dll</HintPath>
+ </Reference>
+ <Reference Include="Castle.Core">
+ <HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Moq">
+ <HintPath>..\packages\Moq.4.6.38-alpha\lib\net45\Moq.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
diff --git a/src/csharp/Grpc.IntegrationTesting/packages.config b/src/csharp/Grpc.IntegrationTesting/packages.config
index 8bf9dd4937..a39fb3a23e 100644
--- a/src/csharp/Grpc.IntegrationTesting/packages.config
+++ b/src/csharp/Grpc.IntegrationTesting/packages.config
@@ -1,13 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.7.0" targetFramework="net45" />
+ <package id="Castle.Core" version="3.3.3" targetFramework="net45" />
<package id="CommandLineParser.Unofficial" version="2.0.275" targetFramework="net45" />
- <package id="Google.Apis.Auth" version="1.15.0" targetFramework="net45" />
- <package id="Google.Apis.Core" version="1.15.0" targetFramework="net45" />
- <package id="Google.Protobuf" version="3.0.0-beta3" targetFramework="net45" />
- <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
- <package id="Moq" version="4.2.1510.2205" targetFramework="net45" />
+ <package id="Google.Apis" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Auth" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Apis.Core" version="1.16.0" targetFramework="net45" />
+ <package id="Google.Protobuf" version="3.0.0" targetFramework="net45" />
+ <package id="log4net" version="2.0.3" targetFramework="net45" />
+ <package id="Moq" version="4.6.38-alpha" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" />
+ <package id="System.Interactive.Async" version="3.0.0" targetFramework="net45" />
+ <package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/csharp/Grpc.IntegrationTesting/project.json b/src/csharp/Grpc.IntegrationTesting/project.json
index 9d706510b2..abc217b092 100644
--- a/src/csharp/Grpc.IntegrationTesting/project.json
+++ b/src/csharp/Grpc.IntegrationTesting/project.json
@@ -57,16 +57,14 @@
"Grpc.Core": {
"target": "project"
},
- "Google.Protobuf": "3.0.0-beta3",
+ "Google.Protobuf": "3.0.0",
"CommandLineParser.Unofficial": "2.0.275",
+ "Moq": "4.6.38-alpha",
"NUnit": "3.2.0",
"NUnitLite": "3.2.0-*"
},
"frameworks": {
"net45": {
- "dependencies": {
- "Moq": "4.2.1510.2205"
- },
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": ""
@@ -74,8 +72,7 @@
},
"netcoreapp1.0": {
"imports": [
- "portable-net45",
- "net45"
+ "portable-net45"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0",
diff --git a/src/csharp/ext/grpc_csharp_ext.c b/src/csharp/ext/grpc_csharp_ext.c
index 3d0947c03d..068bf709b8 100644
--- a/src/csharp/ext/grpc_csharp_ext.c
+++ b/src/csharp/ext/grpc_csharp_ext.c
@@ -255,8 +255,10 @@ GPR_EXPORT intptr_t GPR_CALLTYPE grpcsharp_batch_context_recv_message_length(
}
GPR_ASSERT(grpc_byte_buffer_reader_init(&reader, ctx->recv_message));
+ intptr_t result = (intptr_t)grpc_byte_buffer_length(reader.buffer_out);
+ grpc_byte_buffer_reader_destroy(&reader);
- return (intptr_t)grpc_byte_buffer_length(reader.buffer_out);
+ return result;
}
/*
@@ -279,6 +281,8 @@ GPR_EXPORT void GPR_CALLTYPE grpcsharp_batch_context_recv_message_to_buffer(
offset += len;
gpr_slice_unref(slice);
}
+
+ grpc_byte_buffer_reader_destroy(&reader);
}
GPR_EXPORT grpc_status_code GPR_CALLTYPE
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index 05a1d10f6d..eecda4c03a 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -103,6 +103,11 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey";
@synthesize state = _state;
+// TODO(jcanizales): If grpc_init is idempotent, this should be changed from load to initialize.
++ (void)load {
+ grpc_init();
+}
+
- (instancetype)init {
return [self initWithHost:nil path:nil requestsWriter:nil];
}
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
index 97f6b89340..1339429660 100644
--- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
+++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
@@ -245,11 +245,6 @@
}
if (self = [super init]) {
- static dispatch_once_t initialization;
- dispatch_once(&initialization, ^{
- grpc_init();
- });
-
// Each completion queue consumes one thread. There's a trade to be made between creating and
// consuming too many threads and having contention of multiple calls in a single completion
// queue. Currently we use a singleton queue.
diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php
index 2fec1bd9cc..d850eebc78 100644
--- a/src/php/lib/Grpc/BaseStub.php
+++ b/src/php/lib/Grpc/BaseStub.php
@@ -41,6 +41,7 @@ namespace Grpc;
class BaseStub
{
private $hostname;
+ private $hostname_override;
private $channel;
// a callback function
@@ -75,6 +76,9 @@ class BaseStub
} else {
$opts['grpc.primary_user_agent'] = '';
}
+ if (!empty($opts['grpc.ssl_target_name_override'])) {
+ $this->hostname_override = $opts['grpc.ssl_target_name_override'];
+ }
$opts['grpc.primary_user_agent'] .=
'grpc-php/'.$package_config['version'];
if (!array_key_exists('credentials', $opts)) {
@@ -173,7 +177,12 @@ class BaseStub
}
$service_name = substr($method, 0, $last_slash_idx);
- return 'https://'.$this->hostname.$service_name;
+ if ($this->hostname_override) {
+ $hostname = $this->hostname_override;
+ } else {
+ $hostname = $this->hostname;
+ }
+ return 'https://'.$hostname.$service_name;
}
/**
diff --git a/src/php/tests/interop/interop_client.php b/src/php/tests/interop/interop_client.php
index c94ba61296..94ceeda02c 100755
--- a/src/php/tests/interop/interop_client.php
+++ b/src/php/tests/interop/interop_client.php
@@ -108,7 +108,7 @@ function performLargeUnary($stub, $fillUsername = false, $fillOauthScope = false
$request->setFillUsername($fillUsername);
$request->setFillOauthScope($fillOauthScope);
- $options = false;
+ $options = [];
if ($callback) {
$options['call_credentials_callback'] = $callback;
}
diff --git a/src/proto/grpc/testing/echo.proto b/src/proto/grpc/testing/echo.proto
index c596aabfcc..ca60a41b4f 100644
--- a/src/proto/grpc/testing/echo.proto
+++ b/src/proto/grpc/testing/echo.proto
@@ -42,7 +42,7 @@ service EchoTestService {
rpc Unimplemented(EchoRequest) returns (EchoResponse);
}
-service UnimplementedService {
+service UnimplementedEchoService {
rpc Unimplemented(EchoRequest) returns (EchoResponse);
}
diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py
index 513839df7d..faf3ab5f0d 100644
--- a/src/python/grpcio/grpc/__init__.py
+++ b/src/python/grpcio/grpc/__init__.py
@@ -1078,7 +1078,7 @@ def access_token_call_credentials(access_token):
Args:
access_token: A string to place directly in the http request
- authorization header, ie "Authorization: Bearer <access_token>".
+ authorization header, ie "authorization: Bearer <access_token>".
Returns:
A CallCredentials.
@@ -1193,7 +1193,7 @@ def insecure_channel(target, options=None):
def secure_channel(target, credentials, options=None):
- """Creates an insecure Channel to a server.
+ """Creates a secure Channel to a server.
Args:
target: The target to which to connect.
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index 461ec052f7..f9c0722222 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -51,6 +51,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/support/log_posix.c',
'src/core/lib/support/log_windows.c',
'src/core/lib/support/murmur_hash.c',
+ 'src/core/lib/support/percent_encoding.c',
'src/core/lib/support/slice.c',
'src/core/lib/support/slice_buffer.c',
'src/core/lib/support/stack_lockfree.c',
diff --git a/src/python/grpcio_tests/setup.py b/src/python/grpcio_tests/setup.py
index 3524355cbf..7384206602 100644
--- a/src/python/grpcio_tests/setup.py
+++ b/src/python/grpcio_tests/setup.py
@@ -31,13 +31,9 @@
import os
import os.path
-import shutil
import sys
-from distutils import core as _core
-from distutils import extension as _extension
import setuptools
-from setuptools.command import egg_info
import grpc.tools.command
diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb
index 6d65db8306..66c54aa3e0 100644
--- a/src/ruby/ext/grpc/extconf.rb
+++ b/src/ruby/ext/grpc/extconf.rb
@@ -91,6 +91,10 @@ if grpc_config == 'gcov'
$LDFLAGS << ' -fprofile-arcs -ftest-coverage -rdynamic'
end
+if grpc_config == 'dbg'
+ $CFLAGS << ' -O0'
+end
+
$LDFLAGS << ' -Wl,-wrap,memcpy' if RUBY_PLATFORM =~ /linux/
$LDFLAGS << ' -static' if windows
diff --git a/src/ruby/lib/grpc/grpc.rb b/src/ruby/lib/grpc/grpc.rb
index b60a828d66..f46710dc74 100644
--- a/src/ruby/lib/grpc/grpc.rb
+++ b/src/ruby/lib/grpc/grpc.rb
@@ -28,7 +28,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
begin
- require_relative "#{RUBY_VERSION.sub(/\.\d$/, '')}/grpc_c"
-rescue LoadError
- require_relative 'grpc_c'
+ ruby_version_dirname = /(\d+\.\d+)/.match(RUBY_VERSION).to_s
+ distrib_lib_dir = File.expand_path(ruby_version_dirname,
+ File.dirname(__FILE__))
+ if File.directory?(distrib_lib_dir)
+ require_relative "#{distrib_lib_dir}/grpc_c"
+ else
+ require_relative 'grpc_c'
+ end
end