version 0.2.20
[fms.git] / src / freenet / messagerequester.cpp
index 70a5dba..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
@@ -494,7 +496,7 @@ void MessageRequester::StartRequest(const std::string &requestid)
                message["Identifier"]=m_fcpuniquename+"|"+requestid+"|"+parts[0]+"|"+parts[1]+"|"+parts[2]+"|"+message["URI"];\r
                message["ReturnType"]="direct";\r
                message["MaxSize"]="1000000";           // 1 MB\r
-               message["MaxRetries"]="-1";                     // use new ULPR since we are fairly sure message exists since the author says it does\r
+               message["MaxRetries"]="-1";                     // use ULPR since we are fairly sure message exists since the author says it does\r
 \r
                m_fcp->SendMessage(message);\r
 \r