Improve ProtoReflectionDescriptorDatabase

pull/8190/head
Yuchen Zeng 8 years ago
parent 942c264861
commit 27170357ab
  1. 1
      build.yaml
  2. 9
      test/cpp/util/proto_reflection_descriptor_database.cc
  3. 2
      test/cpp/util/proto_reflection_descriptor_database.h
  4. 3
      tools/run_tests/sources_and_headers.json
  5. 3
      vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj

@ -1094,7 +1094,6 @@ libs:
deps: deps:
- grpc++_reflection - grpc++_reflection
- grpc++ - grpc++
- grpc++_test_config
- name: grpc_plugin_support - name: grpc_plugin_support
build: protoc build: protoc
language: c++ language: c++

@ -314,13 +314,16 @@ ProtoReflectionDescriptorDatabase::GetStream() {
return stream_; return stream_;
} }
void ProtoReflectionDescriptorDatabase::DoOneRequest( bool ProtoReflectionDescriptorDatabase::DoOneRequest(
const ServerReflectionRequest& request, const ServerReflectionRequest& request,
ServerReflectionResponse& response) { ServerReflectionResponse& response) {
bool request_succeed = false;
stream_mutex_.lock(); stream_mutex_.lock();
GetStream()->Write(request); if (GetStream()->Write(request) && GetStream()->Read(&response)) {
GetStream()->Read(&response); request_succeed = true;
}
stream_mutex_.unlock(); stream_mutex_.unlock();
return request_succeed;
} }
} // namespace grpc } // namespace grpc

@ -111,7 +111,7 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase {
const std::shared_ptr<ClientStream> GetStream(); const std::shared_ptr<ClientStream> GetStream();
void DoOneRequest( bool DoOneRequest(
const grpc::reflection::v1alpha::ServerReflectionRequest& request, const grpc::reflection::v1alpha::ServerReflectionRequest& request,
grpc::reflection::v1alpha::ServerReflectionResponse& response); grpc::reflection::v1alpha::ServerReflectionResponse& response);

@ -4693,8 +4693,7 @@
{ {
"deps": [ "deps": [
"grpc++", "grpc++",
"grpc++_reflection", "grpc++_reflection"
"grpc++_test_config"
], ],
"headers": [ "headers": [
"test/cpp/util/cli_call.h", "test/cpp/util/cli_call.h",

@ -176,9 +176,6 @@
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj"> <ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj">
<Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project> <Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project>
</ProjectReference> </ProjectReference>
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++_test_config\grpc++_test_config.vcxproj">
<Project>{3F7D093D-11F9-C4BC-BEB7-18EB28E3F290}</Project>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">

Loading…
Cancel
Save