- vector<int> 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()));
+ if (deleted_urls.count(stream.url()) != 0) {
+ // Delete the stream backlogs.
+ for (int j = 0; j < stream.data_fds_size(); ++j) {
+ safe_close(stream.data_fds(j));
+ }
+ } else {
+ vector<int> 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_urls.insert(stream.url());
+
+ stream_headers_for_url.insert(make_pair(stream.url(), stream.stream_header()));