version 0.2.20
authorSomeDude <SomeDude@NuBL7aaJ6Cn4fB7GXFb9Zfi8w1FhPyW3oKgU9TweZMw>
Sun, 1 Jun 2008 07:06:00 +0000 (09:06 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Sun, 1 Jun 2008 07:06:00 +0000 (09:06 +0200)
CMakeLists.txt
include/global.h
src/freenet/messagelistinserter.cpp
src/freenet/messagelistrequester.cpp
src/freenet/messagerequester.cpp
src/freenet/siteinserter.cpp

index 986d1ba..dad91d6 100644 (file)
@@ -1,3 +1,8 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.4)\r
+IF(COMMAND CMAKE_POLICY)\r
+       CMAKE_POLICY(SET CMP0003 OLD)\r
+ENDIF(COMMAND CMAKE_POLICY)\r
+\r
 PROJECT(fms)\r
 \r
 OPTION(USE_BUNDLED_SQLITE "Use the bundled SQLite3 library." OFF)\r
index ad3e445..2bc49ce 100644 (file)
@@ -5,7 +5,7 @@
 #include <vector>\r
 #include "pthreadwrapper/thread.h"\r
 \r
-#define FMS_VERSION    "0.2.19"\r
+#define FMS_VERSION    "0.2.20"\r
 \r
 // opens database and creates tables and initial inserts if necessary\r
 void SetupDB();\r
index 833b556..eb102a1 100644 (file)
@@ -87,6 +87,10 @@ const bool MessageListInserter::HandlePutFailed(FCPMessage &message)
                // reset the last inserted xml doc to nothing so we will try to insert this one again\r
                m_lastinsertedxml[localidentityid]="";\r
        }\r
+       else\r
+       {\r
+               m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"MessageListInserter::HandlePutFailed "+message["Identifier"]);\r
+       }\r
 \r
        return true;\r
 \r
@@ -128,6 +132,10 @@ const bool MessageListInserter::HandlePutSuccessful(FCPMessage &message)
 \r
                m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"MessageListInserter::HandlePutSuccessful successfully inserted MessageList.");\r
        }\r
+       else\r
+       {\r
+               m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"MessageListInserter::HandlePutSuccessful inserted USK MessageList "+message["Identifier"]);\r
+       }\r
 \r
        return true;\r
 }\r
index 12ed511..a6d8ba9 100644 (file)
@@ -153,7 +153,7 @@ const bool MessageListRequester::HandleGetFailed(FCPMessage &message)
                st.Step();\r
                st.Finalize();\r
 \r
-               m_log->WriteLog(LogFile::LOGLEVEL_ERROR,"MessageListRequester::HandleGetFailed fatal error requesting "+message["Identifier"]);\r
+               m_log->WriteLog(LogFile::LOGLEVEL_ERROR,"MessageListRequester::HandleGetFailed fatal error code="+message["Code"]+" requesting "+message["Identifier"]);\r
        }\r
 \r
        // remove this identityid from request list\r
@@ -289,7 +289,8 @@ void MessageListRequester::StartRequest(const long &id)
                        {\r
                                st2.ResultInt(0,index);\r
                                // don't increment index here - the node will let us know if there is a new edition\r
-                               //index++;\r
+                               // 2008-05-31 - well actually the node isn't reliably retreiving the latest edition for USKs, so we DO need to increment the index\r
+                               index++;\r
                        }\r
                }\r
                st2.Finalize();\r
index f13d04d..5c95cdb 100644 (file)
@@ -415,6 +415,8 @@ void MessageRequester::PopulateIDList()
                sql+="AND (tblIdentity.LocalMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinLocalMessageTrust') OR (tblIdentity.LocalMessageTrust IS NULL AND (tblIdentity.PeerMessageTrust IS NULL OR tblIdentity.PeerMessageTrust>=(SELECT OptionValue FROM tblOption WHERE Option='MinPeerMessageTrust')))) ";\r
        }\r
        sql+="AND tblIdentity.Name <> '' ";\r
+       // sort by day descending - in case there is a bunch of messages on a day that keep timing out, we will eventually get to the next day and hopefully find messages there\r
+       sql+="ORDER BY tblMessageRequests.Day DESC ";\r
        sql+=";";\r
 \r
        SQLite3DB::Statement st=m_db->Prepare(sql);\r
index f7d9ef2..e54a28e 100644 (file)
@@ -22,6 +22,10 @@ void SiteInserter::CheckForNeededInsert()
        {\r
                DateTime date;\r
                date.SetToGMTime();\r
+               date.SetHour(0);\r
+               date.SetMinute(0);\r
+               date.SetSecond(0);\r
+               date.Normalize();\r
 \r
                SQLite3DB::Statement st=m_db->Prepare("SELECT LocalIdentityID FROM tblLocalIdentity WHERE PublishFreesite='true' AND (LastInsertedFreesite IS NULL OR LastInsertedFreesite<?);");\r
                st.Bind(0,date.Format("%Y-%m-%d"));\r
@@ -91,8 +95,7 @@ std::string SiteInserter::GenerateIndex(const std::string &htmltemplate, const l
                st.Step();\r
        }\r
 \r
-       std::string output=StringFunctions::Replace(htmltemplate,"[CONTENT]",content);\r
-       return StringFunctions::Replace(output,"[IDENTITYNAME]",SanitizeOutput(name));\r
+       return StringFunctions::Replace(htmltemplate,"[CONTENT]",content);\r
 \r
 }\r
 \r
@@ -173,6 +176,7 @@ void SiteInserter::GeneratePages(const long localidentityid, std::string &uskkey
                        htmltemplate.append(data.begin(),data.end());\r
 \r
                        htmltemplate=StringFunctions::Replace(htmltemplate,"[LINKS]",GenerateLinks(publishtrustlist,publishboardlist));\r
+                       htmltemplate=StringFunctions::Replace(htmltemplate,"[IDENTITYNAME]",SanitizeOutput(name));\r
 \r
                        pages["index.htm"]=GenerateIndex(htmltemplate,localidentityid,name);\r
                        if(publishtrustlist)\r