diff options
author | Yuchen Zeng <y-zeng@users.noreply.github.com> | 2016-10-05 13:39:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-05 13:39:02 -0700 |
commit | a2e50c5b85b4c0d4d7a5f9624eb40856198ef508 (patch) | |
tree | de2775003729a50fe795b18fb8920e1211400528 /test/cpp/util/proto_reflection_descriptor_database.cc | |
parent | 998dbc0492a1c95cc895a3a8f723faaf815942e4 (diff) | |
parent | d7c8c2bf947d620f257a00e1ce5c37aab3d50951 (diff) |
Merge pull request #8190 from y-zeng/proto_db
Improve ProtoReflectionDescriptorDatabase
Diffstat (limited to 'test/cpp/util/proto_reflection_descriptor_database.cc')
-rw-r--r-- | test/cpp/util/proto_reflection_descriptor_database.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc index b60f447e37..54790be496 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 success = false; stream_mutex_.lock(); - GetStream()->Write(request); - GetStream()->Read(&response); + if (GetStream()->Write(request) && GetStream()->Read(&response)) { + success = true; + } stream_mutex_.unlock(); + return success; } } // namespace grpc |