#include "../include/db/sqlite3db.h"\r
#include "../include/freenet/freenetmasterthread.h"\r
#include "../include/nntp/nntplistener.h"\r
+#include "../include/http/httpthread.h"\r
\r
#ifdef _WIN32\r
#include <winsock2.h>\r
);");\r
\r
// low / high / message count for each board\r
- db->Execute("DROP VIEW IF EXISTS vwBoardStats; \\r
- CREATE VIEW IF NOT EXISTS vwBoardStats AS \\r
+ db->Execute("CREATE VIEW IF NOT EXISTS vwBoardStats AS \\r
SELECT tblBoard.BoardID AS 'BoardID', IFNULL(MIN(MessageID),0) AS 'LowMessageID', IFNULL(MAX(MessageID),0) AS 'HighMessageID', COUNT(MessageID) AS 'MessageCount' \\r
FROM tblBoard LEFT JOIN tblMessageBoard ON tblBoard.BoardID=tblMessageBoard.BoardID \\r
WHERE MessageID>=0 OR MessageID IS NULL \\r
GROUP BY tblBoard.BoardID;");\r
\r
// calculates peer trust\r
- db->Execute("DROP VIEW IF EXISTS vwCalculatedPeerTrust; \\r
- CREATE VIEW IF NOT EXISTS vwCalculatedPeerTrust AS \\r
+ db->Execute("CREATE VIEW IF NOT EXISTS vwCalculatedPeerTrust AS \\r
SELECT TargetIdentityID, \\r
ROUND(SUM(MessageTrust*(LocalMessageTrust/100.0))/SUM(LocalMessageTrust/100.0),0) AS 'PeerMessageTrust', \\r
ROUND(SUM(TrustListTrust*(LocalTrustListTrust/100.0))/SUM(LocalTrustListTrust/100.0),0) AS 'PeerTrustListTrust' \\r
\r
// insert SomeDude's public key\r
date.SetToGMTime();\r
-// db->Execute("INSERT INTO tblIdentity(PublicKey,DateAdded) VALUES('SSK@NuBL7aaJ6Cn4fB7GXFb9Zfi8w1FhPyW3oKgU9TweZMw,iXez4j3qCpd596TxXiJgZyTq9o-CElEuJxm~jNNZAuA,AQACAAE/','"+date.Format("%Y-%m-%d %H:%M:%S")+"');");\r
+ db->Execute("INSERT INTO tblIdentity(PublicKey,DateAdded) VALUES('SSK@NuBL7aaJ6Cn4fB7GXFb9Zfi8w1FhPyW3oKgU9TweZMw,iXez4j3qCpd596TxXiJgZyTq9o-CElEuJxm~jNNZAuA,AQACAAE/','"+date.Format("%Y-%m-%d %H:%M:%S")+"');");\r
\r
}\r
\r
// StartNNTP\r
st.Bind(0,"StartNNTP");\r
st.Bind(1,"true");\r
- st.Bind(2,"Start NNTP service.");\r
+ st.Bind(2,"Start NNTP server.");\r
+ st.Step();\r
+ st.Reset();\r
+\r
+ st.Bind(0,"StartHTTP");\r
+ st.Bind(1,"true");\r
+ st.Bind(2,"Start HTTP server.");\r
+ st.Step();\r
+ st.Reset();\r
+\r
+ st.Bind(0,"HTTPListenPort");\r
+ st.Bind(1,"8080");\r
+ st.Bind(2,"Port HTTP server will listen on.");\r
st.Step();\r
st.Reset();\r
\r
\r
// FCPHost\r
st.Bind(0,"FCPHost");\r
- st.Bind(1,"localhost");\r
+ st.Bind(1,"127.0.0.1");\r
st.Bind(2,"Host name or address of Freenet node.");\r
st.Step();\r
st.Reset();\r
st.Reset();\r
\r
st.Bind(0,"MinPeerMessageTrust");\r
- st.Bind(1,"25");\r
+ st.Bind(1,"30");\r
st.Bind(2,"Specifies a peer message trust level that a peer must have before its messages will be downloaded.");\r
st.Step();\r
st.Reset();\r
st.Reset();\r
\r
st.Bind(0,"MinPeerTrustListTrust");\r
- st.Bind(1,"25");\r
+ st.Bind(1,"30");\r
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.");\r
st.Step();\r
st.Reset();\r
\r
st.Bind(0,"MessageDownloadMaxDaysBackward");\r
- st.Bind(1,"3");\r
+ st.Bind(1,"5");\r
st.Bind(2,"The maximum number of days backward that messages will be downloaded from each identity");\r
st.Step();\r
st.Reset();\r
\r
st.Bind(0,"MessageListDaysBackward");\r
- st.Bind(1,"3");\r
+ st.Bind(1,"5");\r
st.Bind(2,"The number of days backward that messages you have inserted will appear in your MessageLists");\r
st.Step();\r
st.Reset();\r
{\r
std::string startfreenet;\r
std::string startnntp;\r
+ std::string starthttp;\r
\r
if(Option::Instance()->Get("StartFreenetUpdater",startfreenet)==false)\r
{\r
Option::Instance()->Set("StartNNTP","true");\r
}\r
\r
+ if(Option::Instance()->Get("StartHTTP",starthttp)==false)\r
+ {\r
+ starthttp="true";\r
+ Option::Instance()->Set("StartHTTP","true");\r
+ }\r
+\r
if(startfreenet=="true")\r
{\r
PThread::Thread *t=new PThread::Thread(new FreenetMasterThread());\r
threads.push_back(t);\r
}\r
\r
+ if(starthttp=="true")\r
+ {\r
+ PThread::Thread *t=new PThread::Thread(new HTTPThread());\r
+ threads.push_back(t);\r
+ }\r
+\r
}\r