X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fglobal.cpp;h=a9477679f30ffd2aec00de69a612452eace6a8fe;hb=4430e7762844c66428b6f822288beb71b7f82b95;hp=291f06b3117a11a002fff64f4c0a3a12275beacf;hpb=21f835f30b4e092c847bf4569a00995774f7330e;p=fms.git diff --git a/src/global.cpp b/src/global.cpp index 291f06b..a947767 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -6,6 +6,8 @@ #include "../include/db/sqlite3db.h" #include "../include/freenet/freenetmasterthread.h" #include "../include/nntp/nntplistener.h" +#include "../include/http/httpthread.h" +#include "../include/threadcontroller.h" #ifdef _WIN32 #include @@ -15,6 +17,8 @@ #include #endif +bool wantshutdown=false; + void SetupDB() { @@ -24,6 +28,49 @@ void SetupDB() db->Open("fms.db3"); db->SetBusyTimeout(10000); // set timeout to 10 seconds db->Execute("VACUUM;"); + + // TODO remove this - temp fix for problem in 0.1.8 + db->Execute("DELETE FROM tblMessageBoard WHERE MessageID NOT IN (SELECT MessageID FROM tblMessage);"); + + db->Execute("CREATE TABLE IF NOT EXISTS tblDBVersion(\ + Major INTEGER,\ + Minor INTEGER\ + );"); + + SQLite3DB::Statement st=db->Prepare("SELECT Major,Minor FROM tblDBVersion;"); + st.Step(); + if(st.RowReturned()) + { + int major; + int minor; + st.ResultInt(0,major); + st.ResultInt(1,minor); + st.Finalize(); + if(major==1 && minor==0) + { + ConvertDB0100To0101(); + major=1; + minor=1; + } + if(major==1 && (minor==1 || minor==2)) + { + ConvertDB0101To0103(); + major=1; + minor=3; + } + if(major==1 && minor==3) + { + ConvertDB0103To0104(); + major=1; + minor=4; + } + } + else + { + db->Execute("INSERT INTO tblDBVersion(Major,Minor) VALUES(1,4);"); + } + + db->Execute("UPDATE tblDBVersion SET Major=1, Minor=4;"); db->Execute("CREATE TABLE IF NOT EXISTS tblOption(\ Option TEXT UNIQUE,\ @@ -34,8 +81,8 @@ void SetupDB() db->Execute("CREATE TABLE IF NOT EXISTS tblLocalIdentity(\ LocalIdentityID INTEGER PRIMARY KEY,\ Name TEXT,\ - PublicKey TEXT,\ - PrivateKey TEXT,\ + PublicKey TEXT UNIQUE,\ + PrivateKey TEXT UNIQUE,\ SingleUse BOOL CHECK(SingleUse IN('true','false')) DEFAULT 'false',\ PublishTrustList BOOL CHECK(PublishTrustList IN('true','false')) DEFAULT 'false',\ PublishBoardList BOOL CHECK(PublishBoardList IN('true','false')) DEFAULT 'false',\ @@ -48,7 +95,8 @@ void SetupDB() InsertingBoardList BOOL CHECK(InsertingBoardList IN('true','false')) DEFAULT 'false',\ LastInsertedBoardList DATETIME,\ InsertingMessageList BOOL CHECK(InsertingMessageList IN('true','false')) DEFAULT 'false',\ - LastInsertedMessageList DATETIME\ + LastInsertedMessageList DATETIME,\ + DateCreated DATETIME\ );"); db->Execute("CREATE TABLE IF NOT EXISTS tblLocalIdentityInserts(\ @@ -91,10 +139,10 @@ void SetupDB() PublishBoardList BOOL CHECK(PublishBoardList IN('true','false')) DEFAULT 'false',\ DateAdded DATETIME,\ LastSeen DATETIME,\ - LocalMessageTrust INTEGER CHECK(LocalMessageTrust BETWEEN 0 AND 100) DEFAULT 50,\ - PeerMessageTrust INTEGER CHECK(PeerMessageTrust BETWEEN 0 AND 100) DEFAULT 50,\ - LocalTrustListTrust INTEGER CHECK(LocalTrustListTrust BETWEEN 0 AND 100) DEFAULT 50,\ - PeerTrustListTrust INTEGER CHECK(PeerTrustListTrust BETWEEN 0 AND 100) DEFAULT 50\ + LocalMessageTrust INTEGER CHECK(LocalMessageTrust BETWEEN 0 AND 100) DEFAULT NULL,\ + PeerMessageTrust INTEGER CHECK(PeerMessageTrust BETWEEN 0 AND 100) DEFAULT NULL,\ + LocalTrustListTrust INTEGER CHECK(LocalTrustListTrust BETWEEN 0 AND 100) DEFAULT NULL,\ + PeerTrustListTrust INTEGER CHECK(PeerTrustListTrust BETWEEN 0 AND 100) DEFAULT NULL\ );"); db->Execute("CREATE TABLE IF NOT EXISTS tblIdentityRequests(\ @@ -131,16 +179,17 @@ void SetupDB() );"); db->Execute("CREATE TABLE IF NOT EXISTS tblBoard(\ - BoardID INTEGER PRIMARY KEY,\ - BoardName TEXT UNIQUE,\ - BoardDescription TEXT,\ - DateAdded DATETIME\ + BoardID INTEGER PRIMARY KEY,\ + BoardName TEXT UNIQUE,\ + BoardDescription TEXT,\ + DateAdded DATETIME,\ + SaveReceivedMessages BOOL CHECK(SaveReceivedMessages IN('true','false')) DEFAULT 'true'\ );"); - db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded) VALUES('fms','Freenet Message System','2007-12-01');"); - db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded) VALUES('freenet','Discussion about Freenet','2007-12-01');"); - db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded) VALUES('public','Public discussion','2007-12-01');"); - db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded) VALUES('test','Test board','2007-12-01');"); + db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded) VALUES('fms','Freenet Message System','2007-12-01 12:00:00');"); + db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded) VALUES('freenet','Discussion about Freenet','2007-12-01 12:00:00');"); + db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded) VALUES('public','Public discussion','2007-12-01 12:00:00');"); + db->Execute("INSERT INTO tblBoard(BoardName,BoardDescription,DateAdded) VALUES('test','Test board','2007-12-01 12:00:00');"); db->Execute("CREATE TABLE IF NOT EXISTS tblMessage(\ MessageID INTEGER PRIMARY KEY,\ @@ -151,7 +200,8 @@ void SetupDB() Subject TEXT,\ MessageUUID TEXT UNIQUE,\ ReplyBoardID INTEGER,\ - Body TEXT\ + Body TEXT,\ + MessageIndex INTEGER\ );"); db->Execute("CREATE TABLE IF NOT EXISTS tblMessageReplyTo(\ @@ -180,6 +230,8 @@ void SetupDB() Found BOOL CHECK(Found IN('true','false')) DEFAULT 'false'\ );"); + db->Execute("CREATE UNIQUE INDEX IF NOT EXISTS idxMessageRequest ON tblMessageRequests(IdentityID,Day,RequestIndex);"); + db->Execute("CREATE TABLE IF NOT EXISTS tblMessageInserts(\ LocalIdentityID INTEGER,\ Day DATE,\ @@ -196,6 +248,26 @@ void SetupDB() Inserted BOOL CHECK(Inserted IN('true','false')) DEFAULT 'false'\ );"); + db->Execute("CREATE TABLE IF NOT EXISTS tblAdministrationBoard(\ + BoardID INTEGER UNIQUE,\ + ModifyLocalMessageTrust INTEGER,\ + ModifyLocalTrustListTrust INTEGER\ + );"); + + db->Execute("CREATE TABLE IF NOT EXISTS tblBoardListInserts(\ + LocalIdentityID INTEGER,\ + Day DATE,\ + InsertIndex INTEGER,\ + Inserted BOOL CHECK(Inserted IN('true','false')) DEFAULT 'false'\ + );"); + + db->Execute("CREATE TABLE IF NOT EXISTS tblBoardListRequests(\ + IdentityID INTEGER,\ + Day DATE,\ + RequestIndex INTEGER,\ + Found BOOL CHECK(Found IN('true','false')) DEFAULT 'false'\ + );"); + // MessageInserter will insert a record into this temp table which the MessageListInserter will query for and insert a MessageList when needed db->Execute("CREATE TEMPORARY TABLE IF NOT EXISTS tmpMessageListInsert(\ LocalIdentityID INTEGER,\ @@ -203,24 +275,35 @@ void SetupDB() );"); // low / high / message count for each board - db->Execute("DROP VIEW IF EXISTS vwBoardStats; \ - CREATE VIEW IF NOT EXISTS vwBoardStats AS \ + db->Execute("CREATE VIEW IF NOT EXISTS vwBoardStats AS \ SELECT tblBoard.BoardID AS 'BoardID', IFNULL(MIN(MessageID),0) AS 'LowMessageID', IFNULL(MAX(MessageID),0) AS 'HighMessageID', COUNT(MessageID) AS 'MessageCount' \ FROM tblBoard LEFT JOIN tblMessageBoard ON tblBoard.BoardID=tblMessageBoard.BoardID \ WHERE MessageID>=0 OR MessageID IS NULL \ GROUP BY tblBoard.BoardID;"); // calculates peer trust - db->Execute("DROP VIEW IF EXISTS vwCalculatedPeerTrust; \ - CREATE VIEW IF NOT EXISTS vwCalculatedPeerTrust AS \ + // do the (MessageTrust+1)*LocalTrustListTrust/(MessageTrust+1)/100.0 - so it MessageTrust or TrustListTrust is NULL, the calc will be NULL and it won't be included at all in the average + // need the +1 so that when the values are 0 the result is not 0 + db->Execute("DROP VIEW IF EXISTS vwCalculatedPeerTrust;"); + db->Execute("CREATE VIEW IF NOT EXISTS vwCalculatedPeerTrust AS \ SELECT TargetIdentityID, \ - ROUND(SUM(MessageTrust*(LocalMessageTrust/100.0))/SUM(LocalMessageTrust/100.0),0) AS 'PeerMessageTrust', \ - ROUND(SUM(TrustListTrust*(LocalTrustListTrust/100.0))/SUM(LocalTrustListTrust/100.0),0) AS 'PeerTrustListTrust' \ + ROUND(SUM(MessageTrust*(LocalTrustListTrust/100.0))/SUM(((MessageTrust+1)*LocalTrustListTrust/(MessageTrust+1))/100.0),0) AS 'PeerMessageTrust', \ + ROUND(SUM(TrustListTrust*(LocalTrustListTrust/100.0))/SUM(((TrustListTrust+1)*LocalTrustListTrust/(TrustListTrust+1))/100.0),0) AS 'PeerTrustListTrust' \ FROM tblPeerTrust INNER JOIN tblIdentity ON tblPeerTrust.IdentityID=tblIdentity.IdentityID \ WHERE LocalTrustListTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalTrustListTrust') \ AND ( PeerTrustListTrust IS NULL OR PeerTrustListTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerTrustListTrust') ) \ GROUP BY TargetIdentityID;"); + /* + These peer trust calculations are too CPU intensive to be triggers - they were called every time a new trust list was processed + All trust levels will now be recalculated every hour in the PeriodicDBMaintenance class + */ + // drop existing triggers + db->Execute("DROP TRIGGER IF EXISTS trgDeleteOntblPeerTrust;"); + db->Execute("DROP TRIGGER IF EXISTS trgInsertOntblPeerTrust;"); + db->Execute("DROP TRIGGER IF EXISTS trgUpdateOntblPeerTrust;"); + db->Execute("DROP TRIGGER IF EXISTS trgUpdateLocalTrustLevels;"); +/* // update PeerTrustLevel when deleting a record from tblPeerTrust db->Execute("CREATE TRIGGER IF NOT EXISTS trgDeleteOntblPeerTrust AFTER DELETE ON tblPeerTrust \ FOR EACH ROW \ @@ -249,6 +332,7 @@ void SetupDB() BEGIN \ UPDATE tblIdentity SET PeerMessageTrust=(SELECT PeerMessageTrust FROM vwCalculatedPeerTrust WHERE TargetIdentityID=IdentityID), PeerTrustListTrust=(SELECT PeerTrustListTrust FROM vwCalculatedPeerTrust WHERE TargetIdentityID=IdentityID);\ END;"); +*/ db->Execute("CREATE TRIGGER IF NOT EXISTS trgDeleteMessage AFTER DELETE ON tblMessage \ FOR EACH ROW \ @@ -279,6 +363,12 @@ void SetupDB() DELETE FROM tblTrustListInserts WHERE LocalIdentityID=old.LocalIdentityID;\ END;"); + db->Execute("CREATE TRIGGER IF NOT EXISTS trgDeleteBoard AFTER DELETE ON tblBoard \ + FOR EACH ROW \ + BEGIN \ + DELETE FROM tblMessageBoard WHERE BoardID=old.BoardID;\ + END;"); + // delete introduction puzzles that were half-way inserted db->Execute("DELETE FROM tblIntroductionPuzzleInserts WHERE Day IS NULL AND InsertIndex IS NULL;"); @@ -288,10 +378,86 @@ void SetupDB() db->Execute("DELETE FROM tblIntroductionPuzzleInserts WHERE Day<='"+date.Format("%Y-%m-%d")+"';"); db->Execute("DELETE FROM tblIntroductionPuzzleRequests WHERE Day<='"+date.Format("%Y-%m-%d")+"';"); - // insert SomeDude's public key date.SetToGMTime(); - //db->Execute("INSERT INTO tblIdentity(PublicKey,DateAdded) VALUES('SSK@NuBL7aaJ6Cn4fB7GXFb9Zfi8w1FhPyW3oKgU9TweZMw,iXez4j3qCpd596TxXiJgZyTq9o-CElEuJxm~jNNZAuA,AQACAAE/','"+date.Format("%Y-%m-%d %H:%M:%S")+"');"); + // insert SomeDude's public key + db->Execute("INSERT INTO tblIdentity(PublicKey,DateAdded,LocalTrustListTrust) VALUES('SSK@NuBL7aaJ6Cn4fB7GXFb9Zfi8w1FhPyW3oKgU9TweZMw,iXez4j3qCpd596TxXiJgZyTq9o-CElEuJxm~jNNZAuA,AQACAAE/','"+date.Format("%Y-%m-%d %H:%M:%S")+"',51);"); + // insert Shadow Panther's public key + db->Execute("INSERT INTO tblIdentity(PublicKey,DateAdded) VALUES('SSK@~mimyB1kmH4f7Cgsd2wM2Qv2NxrZHRMM6IY8~7EWRVQ,fxTKkR0TYhgMYb-vEGAv55sMOxCGD2xhE4ZxWHxdPz4,AQACAAE/','"+date.Format("%Y-%m-%d %H:%M:%S")+"');"); + // insert garfield's public key + db->Execute("INSERT INTO tblIdentity(PublicKey,DateAdded) VALUES('SSK@T8l1IEGU4-PoASFzgc2GYhIgRzUvZsKdoQWeuLHuTmM,QLxAPfkGis8l5NafNpSCdbxzXhBlu9WL8svcqJw9Mpo,AQACAAE/','"+date.Format("%Y-%m-%d %H:%M:%S")+"');"); + +} + +void ConvertDB0100To0101() +{ + // added unique constraint to public and private key + SQLite3DB::DB *db=SQLite3DB::DB::Instance(); + db->Execute("CREATE TEMPORARY TABLE tblLocalIdentityTemp AS SELECT * FROM tblLocalIdentity;"); + db->Execute("DROP TABLE IF EXISTS tblLocalIdentity;"); + db->Execute("CREATE TABLE IF NOT EXISTS tblLocalIdentity(\ + LocalIdentityID INTEGER PRIMARY KEY,\ + Name TEXT,\ + PublicKey TEXT UNIQUE,\ + PrivateKey TEXT UNIQUE,\ + SingleUse BOOL CHECK(SingleUse IN('true','false')) DEFAULT 'false',\ + PublishTrustList BOOL CHECK(PublishTrustList IN('true','false')) DEFAULT 'false',\ + PublishBoardList BOOL CHECK(PublishBoardList IN('true','false')) DEFAULT 'false',\ + InsertingIdentity BOOL CHECK(InsertingIdentity IN('true','false')) DEFAULT 'false',\ + LastInsertedIdentity DATETIME,\ + InsertingPuzzle BOOL CHECK(InsertingPuzzle IN('true','false')) DEFAULT 'false',\ + LastInsertedPuzzle DATETIME,\ + InsertingTrustList BOOL CHECK(InsertingTrustList IN('true','false')) DEFAULT 'false',\ + LastInsertedTrustList DATETIME,\ + InsertingBoardList BOOL CHECK(InsertingBoardList IN('true','false')) DEFAULT 'false',\ + LastInsertedBoardList DATETIME,\ + InsertingMessageList BOOL CHECK(InsertingMessageList IN('true','false')) DEFAULT 'false',\ + LastInsertedMessageList DATETIME\ + );"); + db->Execute("INSERT INTO tblLocalIdentity SELECT * FROM tblLocalIdentityTemp;"); + db->Execute("DROP TABLE IF EXISTS tblLocalIdentityTemp;"); + db->Execute("UPDATE tblDBVersion SET Major=1, Minor=1;"); +} + +void ConvertDB0101To0103() +{ + // remove default 50 from trust fields and set default to NULL + SQLite3DB::DB *db=SQLite3DB::DB::Instance(); + db->Execute("CREATE TEMPORARY TABLE tblIdentityTemp AS SELECT * FROM tblIdentity;"); + db->Execute("DROP TABLE IF EXISTS tblIdentity;"); + db->Execute("CREATE TABLE IF NOT EXISTS tblIdentity(\ + IdentityID INTEGER PRIMARY KEY,\ + PublicKey TEXT UNIQUE,\ + Name TEXT,\ + SingleUse BOOL CHECK(SingleUse IN('true','false')) DEFAULT 'false',\ + PublishTrustList BOOL CHECK(PublishTrustList IN('true','false')) DEFAULT 'false',\ + PublishBoardList BOOL CHECK(PublishBoardList IN('true','false')) DEFAULT 'false',\ + DateAdded DATETIME,\ + LastSeen DATETIME,\ + LocalMessageTrust INTEGER CHECK(LocalMessageTrust BETWEEN 0 AND 100) DEFAULT NULL,\ + PeerMessageTrust INTEGER CHECK(PeerMessageTrust BETWEEN 0 AND 100) DEFAULT NULL,\ + LocalTrustListTrust INTEGER CHECK(LocalTrustListTrust BETWEEN 0 AND 100) DEFAULT NULL,\ + PeerTrustListTrust INTEGER CHECK(PeerTrustListTrust BETWEEN 0 AND 100) DEFAULT NULL\ + );"); + db->Execute("INSERT INTO tblIdentity SELECT * FROM tblIdentityTemp;"); + db->Execute("DROP TABLE IF EXISTS tblIdentityTemp;"); + // add SaveReceivedMessages field to tblBoard + db->Execute("ALTER TABLE tblBoard ADD COLUMN SaveReceivedMessages BOOL CHECK(SaveReceivedMessages IN('true','false')) DEFAULT 'true';"); + + db->Execute("UPDATE tblDBVersion SET Major=1, Minor=3;"); +} + +void ConvertDB0103To0104() +{ + // add MessageIndex to tblMessage + DateTime date; + SQLite3DB::DB *db=SQLite3DB::DB::Instance(); + db->Execute("ALTER TABLE tblMessage ADD COLUMN MessageIndex INTEGER;"); + db->Execute("CREATE UNIQUE INDEX IF NOT EXISTS idxMessageRequest ON tblMessageRequests(IdentityID,Day,RequestIndex);"); + db->Execute("ALTER TABLE tblLocalIdentity ADD COLUMN DateCreated DATETIME;"); + date.SetToGMTime(); + db->Execute("UPDATE tblLocalIdentity SET DateCreated='"+date.Format("%Y-%m-%d %H:%M:%S")+"' WHERE DateCreated IS NULL;"); + db->Execute("UPDATE tblDBVersion SET Major=1, Minor=4;"); } void SetupDefaultOptions() @@ -334,7 +500,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(); @@ -347,7 +525,7 @@ void SetupDefaultOptions() // FCPHost st.Bind(0,"FCPHost"); - st.Bind(1,"localhost"); + st.Bind(1,"127.0.0.1"); st.Bind(2,"Host name or address of Freenet node."); st.Step(); st.Reset(); @@ -408,19 +586,19 @@ void SetupDefaultOptions() st.Reset(); st.Bind(0,"MinPeerMessageTrust"); - st.Bind(1,"25"); + st.Bind(1,"30"); st.Bind(2,"Specifies a peer message trust level that a peer must have before its messages will be downloaded."); st.Step(); st.Reset(); st.Bind(0,"MinLocalTrustListTrust"); - st.Bind(1,"50"); + st.Bind(1,"51"); st.Bind(2,"Specifies a local trust list trust level that a peer must have before its trust list will be included in the weighted average. Any peers below this number will be excluded from the results."); st.Step(); st.Reset(); st.Bind(0,"MinPeerTrustListTrust"); - st.Bind(1,"25"); + st.Bind(1,"30"); st.Bind(2,"Specifies a peer trust list trust level that a peer must have before its trust list will be included in the weighted average. Any peers below this number will be excluded from the results."); st.Step(); st.Reset(); @@ -437,6 +615,36 @@ void SetupDefaultOptions() st.Step(); st.Reset(); + st.Bind(0,"MaxPeerMessagesPerDay"); + st.Bind(1,"200"); + st.Bind(2,"The maximum number of messages you will download from each peer on a given day."); + st.Step(); + st.Reset(); + + st.Bind(0,"MaxBoardListRequests"); + st.Bind(1,"5"); + st.Bind(2,"The maximum number of concurrent requests for new Board Lists. Set to 0 to disable."); + st.Step(); + st.Reset(); + + st.Bind(0,"MaxBoardsPerMessage"); + st.Bind(1,"8"); + st.Bind(2,"The maximum number of boards a received message may be sent to. Boards over this limit will be ignored."); + st.Step(); + st.Reset(); + + st.Bind(0,"ChangeMessageTrustOnReply"); + st.Bind(1,"0"); + st.Bind(2,"How much the local message trust level of an identity should change when you reply to one of their messages."); + st.Step(); + st.Reset(); + + st.Bind(0,"AddNewPostFromIdentities"); + st.Bind(1,"false"); + st.Bind(2,"Set to true to automatically create new identities when you send a message using a new name. If you set this to false, posting messages will fail until you manually create the identity."); + st.Step(); + st.Reset(); + } void SetupLogFile() @@ -474,6 +682,16 @@ void SetupNetwork() #endif } +void Shutdown() +{ + ThreadController::Instance()->ShutdownThreads(); + + ShutdownNetwork(); + + LogFile::Instance()->WriteLog(LogFile::LOGLEVEL_INFO,"FMS shutdown"); + LogFile::Instance()->WriteNewLine(); +} + void ShutdownNetwork() { #ifdef _WIN32 @@ -481,22 +699,18 @@ void ShutdownNetwork() #endif } +void SigHandler(int signum) +{ + Shutdown(); + exit(0); +} + +/* void ShutdownThreads(std::vector &threads) { std::vector::iterator i; for(i=threads.begin(); i!=threads.end(); i++) { -/* if((*i)->wait(1)==false) - { - try - { - (*i)->interrupt(); - } - catch(...) - { - } - } - */ (*i)->Cancel(); } @@ -516,6 +730,7 @@ void StartThreads(std::vector &threads) { std::string startfreenet; std::string startnntp; + std::string starthttp; if(Option::Instance()->Get("StartFreenetUpdater",startfreenet)==false) { @@ -529,6 +744,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 +762,11 @@ void StartThreads(std::vector &threads) threads.push_back(t); } + if(starthttp=="true") + { + PThread::Thread *t=new PThread::Thread(new HTTPThread()); + threads.push_back(t); + } + } +*/