- 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 HttpServerSocket(ServerInstance, bindip, port, true, 0, index);
- httpsocks.push_back(http);
- }
+ void OnRequest(Request& request)
+ {
+ if (strcmp(request.id, "HTTP-DOC") != 0)
+ return;
+ HTTPDocumentResponse& resp = static_cast<HTTPDocumentResponse&>(request);
+ claimed = true;
+ resp.src.sock->Page(resp.document, resp.responsecode, &resp.headers);