diff options
Diffstat (limited to 'config.cpp')
-rw-r--r-- | config.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -138,6 +138,13 @@ void Config::readConfigfile(std::string filename) socket_struct.protocol = SocketProtocol::HTTPS; else throw std::runtime_error("Unknown protocol: "s + x.second.data()); + } else if (x.first == "site"s) { + std::string site {x.second.data()}; + if (std::find(socket_struct.serve_sites.begin(), socket_struct.serve_sites.end(), site) == socket_struct.serve_sites.end()) { + socket_struct.serve_sites.push_back(site); + } else { + throw std::runtime_error("Site "s + site + " already defined for "s + socket_struct.address + " port " + socket_struct.port); + } } else throw std::runtime_error("Unknown element: "s + x.first); } |