X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fglobal.cpp;h=6430d852ead64baaca3b739ad13a1b7de878a3e4;hb=d8ccfe2b3944adf07d35534459cdda19d15217c8;hp=291f06b3117a11a002fff64f4c0a3a12275beacf;hpb=21f835f30b4e092c847bf4569a00995774f7330e;p=fms.git diff --git a/src/global.cpp b/src/global.cpp index 291f06b..6430d85 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -6,6 +6,7 @@ #include "../include/db/sqlite3db.h" #include "../include/freenet/freenetmasterthread.h" #include "../include/nntp/nntplistener.h" +#include "../include/http/httpthread.h" #ifdef _WIN32 #include @@ -334,7 +335,19 @@ void SetupDefaultOptions() // StartNNTP st.Bind(0,"StartNNTP"); st.Bind(1,"true"); - st.Bind(2,"Start NNTP service."); + st.Bind(2,"Start NNTP server."); + st.Step(); + st.Reset(); + + st.Bind(0,"StartHTTP"); + st.Bind(1,"true"); + st.Bind(2,"Start HTTP server."); + st.Step(); + st.Reset(); + + st.Bind(0,"HTTPListenPort"); + st.Bind(1,"8080"); + st.Bind(2,"Port HTTP server will listen on."); st.Step(); st.Reset(); @@ -516,6 +529,7 @@ void StartThreads(std::vector &threads) { std::string startfreenet; std::string startnntp; + std::string starthttp; if(Option::Instance()->Get("StartFreenetUpdater",startfreenet)==false) { @@ -529,6 +543,12 @@ void StartThreads(std::vector &threads) Option::Instance()->Set("StartNNTP","true"); } + if(Option::Instance()->Get("StartHTTP",starthttp)==false) + { + starthttp="true"; + Option::Instance()->Set("StartHTTP","true"); + } + if(startfreenet=="true") { PThread::Thread *t=new PThread::Thread(new FreenetMasterThread()); @@ -541,4 +561,10 @@ void StartThreads(std::vector &threads) threads.push_back(t); } + if(starthttp=="true") + { + PThread::Thread *t=new PThread::Thread(new HTTPThread()); + threads.push_back(t); + } + }