diff --git a/WORKSPACE b/WORKSPACE index 37dfd50ce..a2798b7f0 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -26,7 +26,7 @@ # # A Bazel (http://bazel.io) workspace for the Google Cloud Endpoints runtime. -ISTIO_PROXY = "76355366e4adc6d4002d69d5aafa57e1606338ee" +ISTIO_PROXY = "6e372fc510de08da504c2dd21060c09255c1aee7" git_repository( name = "nginx", diff --git a/src/grpc/proxy_flow.cc b/src/grpc/proxy_flow.cc index 009f37491..811a13cb9 100644 --- a/src/grpc/proxy_flow.cc +++ b/src/grpc/proxy_flow.cc @@ -31,6 +31,7 @@ #include "grpc/support/alloc.h" extern "C" { +#include "src/core/lib/iomgr/exec_ctx.h" #include "src/core/lib/security/util/b64.h" } @@ -130,6 +131,8 @@ namespace { Status ProcessDownstreamHeaders( const std::multimap &headers, ::grpc::ClientContext *context) { + static grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + for (const auto &it : headers) { // GRPC runtime libraries use "-bin" suffix to detect binary headers and // properly apply base64 encoding & decoding as headers are sent and @@ -140,8 +143,8 @@ Status ProcessDownstreamHeaders( continue; } ::grpc::Slice value_slice( - grpc_base64_decode_with_len(it.second.c_str(), it.second.length(), - false), + grpc_base64_decode_with_len(&exec_ctx, it.second.c_str(), + it.second.length(), false), ::grpc::Slice::STEAL_REF); std::string binary_value( reinterpret_cast(value_slice.begin()), diff --git a/src/nginx/t/grpc_api_key.t b/src/nginx/t/grpc_api_key.t index 7c25cfe7f..7a2a31c82 100644 --- a/src/nginx/t/grpc_api_key.t +++ b/src/nginx/t/grpc_api_key.t @@ -135,8 +135,8 @@ my $expected_report_body = ServiceControl::gen_report_body({ 'http_method' => 'POST', 'log_message' => 'Method: test.grpc.Test.Echo', 'response_code' => '200', - 'request_size' => ($^O eq 'darwin' ? 313 : 315), - 'request_bytes' => ($^O eq 'darwin' ? 313 : 315), + 'request_size' => ($^O eq 'darwin' ? 305 : 307), + 'request_bytes' => ($^O eq 'darwin' ? 305 : 307), 'streaming_request_message_counts' => 1, 'streaming_response_message_counts' => 1, }); diff --git a/src/nginx/t/grpc_interop_metadata.t b/src/nginx/t/grpc_interop_metadata.t index 8d8b57114..88c4f2731 100644 --- a/src/nginx/t/grpc_interop_metadata.t +++ b/src/nginx/t/grpc_interop_metadata.t @@ -89,6 +89,7 @@ my @test_cases = ( ); foreach my $case (@test_cases) { + <>; my $result = &ApiManager::run_grpc_interop_test($t, $Http2NginxPort, $case, '--api_key', 'api-key'); is($result, 0, "${case} test completed as expected."); diff --git a/src/nginx/t/grpc_streaming.t b/src/nginx/t/grpc_streaming.t index 77336b09f..fcf3c0004 100644 --- a/src/nginx/t/grpc_streaming.t +++ b/src/nginx/t/grpc_streaming.t @@ -138,8 +138,8 @@ my $expected_report_body = ServiceControl::gen_report_body({ 'http_method' => 'POST', 'log_message' => 'Method: test.grpc.Test.EchoStream', 'response_code' => '200', - 'request_size' => ($^O eq 'darwin' ? 499 : 501), - 'request_bytes' => ($^O eq 'darwin' ? 499 : 501), + 'request_size' => ($^O eq 'darwin' ? 491 : 493), + 'request_bytes' => ($^O eq 'darwin' ? 491 : 493), 'streaming_request_message_counts' => 10, 'streaming_response_message_counts' => 10, }); diff --git a/test/grpc/BUILD b/test/grpc/BUILD index b477fab32..64556bc49 100644 --- a/test/grpc/BUILD +++ b/test/grpc/BUILD @@ -93,6 +93,7 @@ cc_library( deps = [ ":grpc-test_proto", "//external:api_manager_utils", + "//external:grpc++", ], ) @@ -121,7 +122,10 @@ cc_binary( name = "grpc-test-server", testonly = 1, srcs = ["grpc-test-server.cc"], - deps = [":grpc-test_proto"], + deps = [ + ":grpc-test_proto", + "//external:grpc++", + ], ) load( diff --git a/test/transcoding/BUILD b/test/transcoding/BUILD index a24998fe0..dfc50e2d1 100644 --- a/test/transcoding/BUILD +++ b/test/transcoding/BUILD @@ -45,7 +45,10 @@ cc_binary( name = "bookstore-server", testonly = 1, srcs = ["bookstore-server.cc"], - deps = [":bookstore"], + deps = [ + ":bookstore", + "//external:grpc++", + ], ) cc_binary( @@ -57,6 +60,7 @@ cc_binary( ":bookstore", "//external:protobuf", "//external:gflags", + "//external:grpc++", ], )