X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Ffreenetmasterthread.cpp;h=c0feb6a691789fea40f2e183bb22cf58aada445c;hb=e662ea47fba8715474851ceebacba400984ee433;hp=b957c50087e2867c33efa3e678a528939c6a687a;hpb=cd75427de26fc2ebc9baad558b1c0a081faa3b43;p=fms.git diff --git a/src/freenet/freenetmasterthread.cpp b/src/freenet/freenetmasterthread.cpp index b957c50..c0feb6a 100644 --- a/src/freenet/freenetmasterthread.cpp +++ b/src/freenet/freenetmasterthread.cpp @@ -4,6 +4,7 @@ #include "../../include/freenet/unkeyedidcreator.h" #include "../../include/freenet/identityinserter.h" #include "../../include/freenet/identityrequester.h" +#include "../../include/freenet/unknownidentityrequester.h" #include "../../include/freenet/introductionpuzzleinserter.h" #include "../../include/freenet/identityintroductionrequester.h" #include "../../include/freenet/introductionpuzzlerequester.h" @@ -11,6 +12,7 @@ #include "../../include/freenet/trustlistinserter.h" #include "../../include/freenet/trustlistrequester.h" #include "../../include/freenet/messagelistrequester.h" +#include "../../include/freenet/inactivemessagelistrequester.h" #include "../../include/freenet/messagelistinserter.h" #include "../../include/freenet/messagerequester.h" #include "../../include/freenet/messageinserter.h" @@ -34,24 +36,24 @@ FreenetMasterThread::FreenetMasterThread() { - std::string fcpport; if(Option::Instance()->Get("FCPHost",m_fcphost)==false) { m_fcphost="localhost"; Option::Instance()->Set("FCPHost",m_fcphost); } - if(Option::Instance()->Get("FCPPort",fcpport)==false) + if(Option::Instance()->GetInt("FCPPort",m_fcpport)==false) { - fcpport="9481"; - Option::Instance()->Set("FCPPort",fcpport); + m_fcpport=9481; + Option::Instance()->Set("FCPPort",m_fcpport); } - - // convert fcp port to long, and make sure it's within the valid port range - if(StringFunctions::Convert(fcpport,m_fcpport)==false) + else { - m_fcpport=9481; - Option::Instance()->Set("FCPPort","9481"); + if(m_fcpport<1 || m_fcpport>65535) + { + m_fcpport=9481; + Option::Instance()->Set("FCPPort",m_fcpport); + } } m_receivednodehello=false; @@ -123,6 +125,7 @@ const bool FreenetMasterThread::HandleMessage(FCPMessage &message) if(m_receivednodehello==true) { bool handled=false; + std::vector::iterator i=m_fcpmessagehandlers.begin(); while(handled==false && i!=m_fcpmessagehandlers.end()) { @@ -148,7 +151,7 @@ const bool FreenetMasterThread::HandleMessage(FCPMessage &message) { m_fcp.Update(1); } - if(m_fcp.Connected()) + if(m_fcp.Connected() && length>0) { char *data=new char[length]; m_fcp.ReceiveRaw(data,length); @@ -295,6 +298,7 @@ void FreenetMasterThread::Setup() m_registrables.push_back(new UnkeyedIDCreator(&m_fcp)); m_registrables.push_back(new IdentityInserter(&m_fcp)); m_registrables.push_back(new IdentityRequester(&m_fcp)); + m_registrables.push_back(new UnknownIdentityRequester(&m_fcp)); m_registrables.push_back(new IntroductionPuzzleInserter(&m_fcp)); m_registrables.push_back(new IdentityIntroductionRequester(&m_fcp)); m_registrables.push_back(new IntroductionPuzzleRequester(&m_fcp)); @@ -303,6 +307,7 @@ void FreenetMasterThread::Setup() m_registrables.push_back(new TrustListRequester(&m_fcp)); m_registrables.push_back(new MessageListInserter(&m_fcp)); m_registrables.push_back(new MessageListRequester(&m_fcp)); + m_registrables.push_back(new InactiveMessageListRequester(&m_fcp)); m_registrables.push_back(new MessageInserter(&m_fcp)); m_registrables.push_back(new MessageRequester(&m_fcp)); m_registrables.push_back(new BoardListInserter(&m_fcp));