From d298701bd765357905705aa133c3fdb2d1a4835c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 9 Jul 2018 16:12:31 +0200 Subject: aptwebserver: Prefetch compressors to avoid thread crashes If multiple threads act on requests (like if connection comes from a webbrowser) a thread might request the supported compressors while another thread is still working on creating the list to be stored in the static cache variable. As the price to pay for atomic and co seems to high for the fringe usecase of manual usage of aptwebserver the patch just makes a call to generate the list while still single threaded. Gbp-Dch: Ignore --- test/interactive-helper/aptwebserver.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc index 4bc344178..461484f6e 100644 --- a/test/interactive-helper/aptwebserver.cc +++ b/test/interactive-helper/aptwebserver.cc @@ -956,6 +956,7 @@ int main(int const argc, const char * argv[]) _config->CndSet("aptwebserver::response-header::Server", "APT webserver"); _config->CndSet("aptwebserver::response-header::Accept-Ranges", "bytes"); _config->CndSet("aptwebserver::directoryindex", "index.html"); + APT::Configuration::getCompressors(); size_t id = 0; while (true) -- cgit v1.2.3