- std::vector<HttpListener *> httplisteners;
- public:
-
- void ReadConfig()
- {
- int port;
- std::string host;
- std::string bindip;
- std::string indexfile;
- FileReader* index;
- HttpListener *http;
- ConfigReader c(ServerInstance);
-
- httpsocks.clear(); // XXX this will BREAK if this module is made rehashable
- httplisteners.clear();
-
- for (int i = 0; i < c.Enumerate("http"); i++)
- {
- host = c.ReadValue("http", "host", i);
- bindip = c.ReadValue("http", "ip", i);
- port = c.ReadInteger("http", "port", i, true);
- indexfile = c.ReadValue("http", "index", i);
- index = new FileReader(ServerInstance, indexfile);
- if (!index->Exists())
- throw ModuleException("Can't read index file: "+indexfile);
- http = new HttpListener(ServerInstance, index, port, (char *)bindip.c_str()); // XXX this cast SUCKS.
- httplisteners.push_back(http);
- }
- }