summaryrefslogtreecommitdiffhomepage
path: root/config.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-05-15 19:36:52 +0200
committerRoland Reichwein <mail@reichwein.it>2020-05-15 19:36:52 +0200
commit8fbada6c7542d233afb4677c19a0395f77d32519 (patch)
tree574e5576352510cc52df82d9629d6e3dfc767518 /config.h
parent48908fb0bba69404dfd86d1af3b9ace1e0d598c9 (diff)
Speed up GetPath() with look up table
Diffstat (limited to 'config.h')
-rw-r--r--config.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/config.h b/config.h
index e60bba5..a021c80 100644
--- a/config.h
+++ b/config.h
@@ -37,6 +37,8 @@ struct Socket
std::string port;
SocketProtocol protocol;
std::unordered_set<std::string> serve_sites; // if empty, automatically expand to all configured sites
+
+ std::unordered_map <std::string, Site*> host_lut; // look up table for fast server decision in GetPath()
};
class Config
@@ -44,7 +46,9 @@ class Config
const std::string default_filename{"/etc/webserver.conf"};
void readConfigfile(std::string filename);
+ void expand_socket_sites();
void validate();
+ void create_look_up_table();
std::string m_user;
std::string m_group;