* ---------------------------------------------------
*/
+#include "inspircd.h"
#include <algorithm>
#include "modules.h"
-#include "inspircd.h"
#include "httpd.h"
/* $ModDesc: Provides HTTP serving facilities to modules */
if (headers.str().find("\r\n\r\n") != std::string::npos)
{
- if (request_type == "")
+ if (request_type.empty())
{
headers >> request_type;
headers >> uri;
if ((InternalState == HTTP_SERVE_WAIT_REQUEST) && (request_type == "POST"))
{
/* Do we need to fetch postdata? */
- postdata = "";
+ postdata.clear();
InternalState = HTTP_SERVE_RECV_POSTDATA;
std::string header_item;
while (headers >> header_item)
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);
}
}
- ModuleHttpServer(InspIRCd* Me) : Module::Module(Me)
+ ModuleHttpServer(InspIRCd* Me) : Module(Me)
{
ReadConfig();
}
};
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
{
return new ModuleHttpServerFactory;
}