From 2fe1867221dbd65930617279521968b60cc8745c Mon Sep 17 00:00:00 2001 From: Alexander Belyaev <32522095+pifon2a@users.noreply.github.com> Date: Fri, 9 Mar 2018 16:26:03 +0100 Subject: [PATCH] Fix writing the pbstream via gRPC. (#973) --- cartographer/cloud/client/map_builder_stub.cc | 2 -- cartographer/cloud/internal/handlers/write_state_handler.cc | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cartographer/cloud/client/map_builder_stub.cc b/cartographer/cloud/client/map_builder_stub.cc index 35cd1e5..f26922c 100644 --- a/cartographer/cloud/client/map_builder_stub.cc +++ b/cartographer/cloud/client/map_builder_stub.cc @@ -100,7 +100,6 @@ void MapBuilderStub::SerializeState(io::ProtoStreamWriterInterface* writer) { CHECK(client.Write(request)); proto::WriteStateResponse response; while (client.Read(&response)) { - // writer->WriteProto(response); switch (response.state_chunk_case()) { case proto::WriteStateResponse::kPoseGraph: writer->WriteProto(response.pose_graph()); @@ -115,7 +114,6 @@ void MapBuilderStub::SerializeState(io::ProtoStreamWriterInterface* writer) { LOG(FATAL) << "Unhandled message type"; } } - CHECK(writer->Close()); } void MapBuilderStub::LoadState(io::ProtoStreamReaderInterface* reader, diff --git a/cartographer/cloud/internal/handlers/write_state_handler.cc b/cartographer/cloud/internal/handlers/write_state_handler.cc index 0f7cb1f..88a2adc 100644 --- a/cartographer/cloud/internal/handlers/write_state_handler.cc +++ b/cartographer/cloud/internal/handlers/write_state_handler.cc @@ -52,6 +52,7 @@ void WriteStateHandler::OnRequest(const google::protobuf::Empty& request) { }); GetContext()->map_builder().SerializeState( &proto_stream_writer); + proto_stream_writer.Close(); } } // namespace handlers