Fix writing the pbstream via gRPC. (#973)
parent
daa35d3bc8
commit
2fe1867221
|
@ -100,7 +100,6 @@ void MapBuilderStub::SerializeState(io::ProtoStreamWriterInterface* writer) {
|
||||||
CHECK(client.Write(request));
|
CHECK(client.Write(request));
|
||||||
proto::WriteStateResponse response;
|
proto::WriteStateResponse response;
|
||||||
while (client.Read(&response)) {
|
while (client.Read(&response)) {
|
||||||
// writer->WriteProto(response);
|
|
||||||
switch (response.state_chunk_case()) {
|
switch (response.state_chunk_case()) {
|
||||||
case proto::WriteStateResponse::kPoseGraph:
|
case proto::WriteStateResponse::kPoseGraph:
|
||||||
writer->WriteProto(response.pose_graph());
|
writer->WriteProto(response.pose_graph());
|
||||||
|
@ -115,7 +114,6 @@ void MapBuilderStub::SerializeState(io::ProtoStreamWriterInterface* writer) {
|
||||||
LOG(FATAL) << "Unhandled message type";
|
LOG(FATAL) << "Unhandled message type";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CHECK(writer->Close());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapBuilderStub::LoadState(io::ProtoStreamReaderInterface* reader,
|
void MapBuilderStub::LoadState(io::ProtoStreamReaderInterface* reader,
|
||||||
|
|
|
@ -52,6 +52,7 @@ void WriteStateHandler::OnRequest(const google::protobuf::Empty& request) {
|
||||||
});
|
});
|
||||||
GetContext<MapBuilderContextInterface>()->map_builder().SerializeState(
|
GetContext<MapBuilderContextInterface>()->map_builder().SerializeState(
|
||||||
&proto_stream_writer);
|
&proto_stream_writer);
|
||||||
|
proto_stream_writer.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace handlers
|
} // namespace handlers
|
||||||
|
|
Loading…
Reference in New Issue