version 0.2.1
[fms.git] / src / http / httpthread.cpp
index a58044c..22fc930 100644 (file)
@@ -29,6 +29,9 @@ HTTPThread::HTTPThread()
        Option::Instance()->Get("HTTPListenPort",portstr);\r
        StringFunctions::Convert(portstr,port);\r
 \r
+       std::string aclstr;\r
+       Option::Instance()->Get("HTTPAccessControl",aclstr);\r
+\r
        // set template\r
        templatestr="<html><head></head><body><a href=\"home.htm\">Home</a><br><h1>Could not find template.htm!  Place in program directory and restart!</h1><br>[CONTENT]</body></html>";\r
        FILE *infile=fopen("template.htm","r+b");\r
@@ -64,8 +67,9 @@ HTTPThread::HTTPThread()
        m_pagehandlers.push_back(new HomePage(templatestr));\r
 \r
        m_ctx=0;\r
-       m_ctx=shttpd_init(NULL,"listen_ports",portstr.c_str(),NULL);\r
-       shttpd_listen(m_ctx,port,false);\r
+       m_ctx=shttpd_init();\r
+       shttpd_set_option(m_ctx,"ports",portstr.c_str());\r
+       shttpd_set_option(m_ctx,"acl",aclstr.c_str());\r
 \r
        shttpd_register_uri(m_ctx,"*",HTTPThread::PageCallback,this);\r
 \r