X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=main.cpp;h=c42fd19cf200fcd60e16e1890d58b8dbf303a3dd;hp=c626f46aa26060aab8b09eb2b43c8dfaf269c539;hb=534764f026b82b144e974882c8e53c4cd8d21b68;hpb=3b8ad87137cff7522ed12f4675d5ff26933bc94a diff --git a/main.cpp b/main.cpp index c626f46..c42fd19 100644 --- a/main.cpp +++ b/main.cpp @@ -341,8 +341,21 @@ start: // Deserialize the streams. for (int i = 0; i < loaded_state.streams_size(); ++i) { - servers->add_stream_from_serialized(loaded_state.streams(i)); - deserialized_stream_ids.insert(loaded_state.streams(i).stream_id()); + const StreamProto &stream = loaded_state.streams(i); + + vector data_fds; + for (int j = 0; j < stream.data_fds_size(); ++j) { + data_fds.push_back(stream.data_fds(j)); + } + + // Older versions stored the data once in the protobuf instead of + // sending around file descriptors. + if (data_fds.empty() && stream.has_data()) { + data_fds.push_back(make_tempfile(stream.data())); + } + + servers->add_stream_from_serialized(stream, data_fds); + deserialized_stream_ids.insert(stream.stream_id()); } // Deserialize the inputs. Note that we don't actually add them to any stream yet.