From 27170357abbb9609b9f0ac47c1926a7eb383ca67 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Fri, 23 Sep 2016 14:14:18 -0700 Subject: Improve ProtoReflectionDescriptorDatabase --- test/cpp/util/proto_reflection_descriptor_database.cc | 9 ++++++--- test/cpp/util/proto_reflection_descriptor_database.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'test/cpp') diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc index f0d14c686a..ae633ea7f4 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.cc +++ b/test/cpp/util/proto_reflection_descriptor_database.cc @@ -314,13 +314,16 @@ ProtoReflectionDescriptorDatabase::GetStream() { return stream_; } -void ProtoReflectionDescriptorDatabase::DoOneRequest( +bool ProtoReflectionDescriptorDatabase::DoOneRequest( const ServerReflectionRequest& request, ServerReflectionResponse& response) { + bool request_succeed = false; stream_mutex_.lock(); - GetStream()->Write(request); - GetStream()->Read(&response); + if (GetStream()->Write(request) && GetStream()->Read(&response)) { + request_succeed = true; + } stream_mutex_.unlock(); + return request_succeed; } } // namespace grpc diff --git a/test/cpp/util/proto_reflection_descriptor_database.h b/test/cpp/util/proto_reflection_descriptor_database.h index 0e69696d5f..54114f1081 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.h +++ b/test/cpp/util/proto_reflection_descriptor_database.h @@ -111,7 +111,7 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase { const std::shared_ptr GetStream(); - void DoOneRequest( + bool DoOneRequest( const grpc::reflection::v1alpha::ServerReflectionRequest& request, grpc::reflection::v1alpha::ServerReflectionResponse& response); -- cgit v1.2.3 From e529ea392824db09887f62cc00bbb46329a77003 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Tue, 27 Sep 2016 16:18:11 -0700 Subject: Rename variables --- test/cpp/util/proto_reflection_descriptor_database.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/cpp') diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc index ae633ea7f4..82d82a348d 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.cc +++ b/test/cpp/util/proto_reflection_descriptor_database.cc @@ -317,13 +317,13 @@ ProtoReflectionDescriptorDatabase::GetStream() { bool ProtoReflectionDescriptorDatabase::DoOneRequest( const ServerReflectionRequest& request, ServerReflectionResponse& response) { - bool request_succeed = false; + bool request_success = false; stream_mutex_.lock(); if (GetStream()->Write(request) && GetStream()->Read(&response)) { - request_succeed = true; + request_success = true; } stream_mutex_.unlock(); - return request_succeed; + return request_success; } } // namespace grpc -- cgit v1.2.3 From 15bc4627de675cc148989977e1f6afd3ea3c6755 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Tue, 27 Sep 2016 16:22:35 -0700 Subject: Rename variables ... again --- test/cpp/util/proto_reflection_descriptor_database.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/cpp') diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc index 82d82a348d..409b0de1b2 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.cc +++ b/test/cpp/util/proto_reflection_descriptor_database.cc @@ -317,13 +317,13 @@ ProtoReflectionDescriptorDatabase::GetStream() { bool ProtoReflectionDescriptorDatabase::DoOneRequest( const ServerReflectionRequest& request, ServerReflectionResponse& response) { - bool request_success = false; + bool success = false; stream_mutex_.lock(); if (GetStream()->Write(request) && GetStream()->Read(&response)) { - request_success = true; + success = true; } stream_mutex_.unlock(); - return request_success; + return success; } } // namespace grpc -- cgit v1.2.3 From a4aebf873e485a39084bb003c6978b3306874bf7 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 28 Sep 2016 13:20:18 -0700 Subject: Remove unused inclusion --- test/cpp/util/grpc_tool.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'test/cpp') diff --git a/test/cpp/util/grpc_tool.cc b/test/cpp/util/grpc_tool.cc index 8fb325cf76..03c33abe9f 100644 --- a/test/cpp/util/grpc_tool.cc +++ b/test/cpp/util/grpc_tool.cc @@ -52,7 +52,6 @@ #include "test/cpp/util/proto_file_parser.h" #include "test/cpp/util/proto_reflection_descriptor_database.h" #include "test/cpp/util/service_describer.h" -#include "test/cpp/util/test_config.h" namespace grpc { namespace testing { -- cgit v1.2.3