summaryrefslogtreecommitdiffhomepage
path: root/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'config.h')
-rw-r--r--config.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/config.h b/config.h
index 46cd267..e60bba5 100644
--- a/config.h
+++ b/config.h
@@ -18,7 +18,7 @@ struct Path
struct Site
{
- std::string name;
+ // std::string name; is the index in the m_sites map
std::unordered_set<std::string> hosts;
std::vector<Path> paths;
fs::path cert_path;
@@ -36,7 +36,7 @@ struct Socket
std::string address;
std::string port;
SocketProtocol protocol;
- std::vector<std::string> serve_sites; // if empty, automatically expand to all configured sites
+ std::unordered_set<std::string> serve_sites; // if empty, automatically expand to all configured sites
};
class Config
@@ -44,12 +44,13 @@ class Config
const std::string default_filename{"/etc/webserver.conf"};
void readConfigfile(std::string filename);
+ void validate();
std::string m_user;
std::string m_group;
int m_threads;
std::vector<std::string> m_plugin_directories;
- std::vector<Site> m_sites;
+ std::unordered_map<std::string, Site> m_sites;
std::vector<Socket> m_sockets;
public:
@@ -62,7 +63,7 @@ class Config
int Threads() const;
const std::vector<std::string>& PluginDirectories() const;
- const std::vector<Site>& Sites() const;
+ const std::unordered_map<std::string, Site>& Sites() const;
const std::vector<Socket>& Sockets() const;
//