summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-05-15 11:38:46 +0200
committerRoland Reichwein <mail@reichwein.it>2020-05-15 11:38:46 +0200
commitd264bba053041486bb1e19b4b5f39223253da7ce (patch)
tree177263f4c9b5a184321487ba0237aad1ab04b96b
parent10e77782b117600abfc7e8619f190af6b05ecdeb (diff)
Fix missing serve_site list config (was not parsed)
-rw-r--r--config.cpp7
-rw-r--r--webserver.conf6
2 files changed, 10 insertions, 3 deletions
diff --git a/config.cpp b/config.cpp
index bc09af9..2ece1ef 100644
--- a/config.cpp
+++ b/config.cpp
@@ -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);
}
diff --git a/webserver.conf b/webserver.conf
index 4901578..7aba1a7 100644
--- a/webserver.conf
+++ b/webserver.conf
@@ -116,10 +116,10 @@
<address>127.0.0.1</address>
<port>8080</port>
<protocol>http</protocol>
- <!--
+
<site>antcom.de</site>
- <site>reichwein.it</site>
- -->
+ <site>marx</site>
+
</socket>
<socket>
<address>::1</address>