From 8fbada6c7542d233afb4677c19a0395f77d32519 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 15 May 2020 19:36:52 +0200 Subject: Speed up GetPath() with look up table --- config.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config.h') 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 serve_sites; // if empty, automatically expand to all configured sites + + std::unordered_map 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; -- cgit v1.2.3