summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2018-07-09 16:12:31 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2018-08-19 17:25:26 +0200
commitd298701bd765357905705aa133c3fdb2d1a4835c (patch)
tree3cd21f34853b6b16958ac2e2b2dc6236172a5cee
parent9a521ed76019fc7bdad1bf09c063bd3550536ef0 (diff)
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
-rw-r--r--test/interactive-helper/aptwebserver.cc1
1 files changed, 1 insertions, 0 deletions
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)