X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Ffreenet%2Ffreenetmasterthread.cpp;fp=src%2Ffreenet%2Ffreenetmasterthread.cpp;h=c23ee2719c4c5cf4ca3c3874b6e3984337f3024f;hp=b957c50087e2867c33efa3e678a528939c6a687a;hb=278ee758050cb7772cd95946688c5b40104f4d8b;hpb=dabd19d7f764b8275c9c8370c7b89675b6a78243 diff --git a/src/freenet/freenetmasterthread.cpp b/src/freenet/freenetmasterthread.cpp index b957c50..c23ee27 100644 --- a/src/freenet/freenetmasterthread.cpp +++ b/src/freenet/freenetmasterthread.cpp @@ -34,24 +34,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;