servers->create_tls_context_for_acceptor(acceptor);
}
}
+
+ // Allocate strings for the short responses.
+ vector<shared_ptr<const string>> short_response_pool;
+ for (const ShortResponsePool &str : loaded_state.short_response_pool()) {
+ short_response_pool.emplace_back(new string(str.header_or_short_response()));
+ }
// Put back the existing clients. It doesn't matter which server we
// allocate them to, so just do round-robin. However, we need to sort them
if (all_urls.count(loaded_state.clients(i).url()) == 0) {
safe_close(loaded_state.clients(i).sock());
} else {
- servers->add_client_from_serialized(loaded_state.clients(i));
+ servers->add_client_from_serialized(loaded_state.clients(i), short_response_pool);
}
}
+ short_response_pool.clear(); // No longer needed; the clients have their own refcounts now.
+
servers->run();
// Now delete all inputs that are longer in use, and start the others.