+
+ // Deserialize the inputs. Note that we don't actually add them to any stream yet.
+ for (int i = 0; i < loaded_state.inputs_size(); ++i) {
+ InputProto serialized_input = loaded_state.inputs(i);
+
+ // Older versions did not store the stream header in the input,
+ // only in each stream. We need to have the stream header in the
+ // input as well, in case we create a new stream reusing the same input.
+ // Thus, we put it into place here if it's missing.
+ if (!serialized_input.has_stream_header() &&
+ stream_headers_for_url.count(serialized_input.url()) != 0) {
+ serialized_input.set_stream_header(stream_headers_for_url[serialized_input.url()]);
+ }
+
+ InputWithRefcount iwr;
+ iwr.input = create_input(serialized_input);
+ iwr.refcount = 0;
+ inputs.insert(make_pair(serialized_input.url(), iwr));
+ }
+
+ // Deserialize the acceptors.
+ for (int i = 0; i < loaded_state.acceptors_size(); ++i) {
+ deserialized_acceptors.insert(make_pair(
+ loaded_state.acceptors(i).port(),
+ new Acceptor(loaded_state.acceptors(i))));