X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fidentityintroductionrequester.cpp;h=951e12dc85f308e3a53786afcfe253bd01ba2320;hb=c0ebc7b53a977885ebc2d3a679c586ae20c0bc4a;hp=65527704dfdbbcdc55362b11f2e214f0e0c3a69a;hpb=76805933f794915a72b7f0a21b12af6654759f4f;p=fms.git diff --git a/src/freenet/identityintroductionrequester.cpp b/src/freenet/identityintroductionrequester.cpp index 6552770..951e12d 100644 --- a/src/freenet/identityintroductionrequester.cpp +++ b/src/freenet/identityintroductionrequester.cpp @@ -61,10 +61,13 @@ const bool IdentityIntroductionRequester::HandleAllData(FCPMessage &message) // receive the file data.resize(datalength); - m_fcp->ReceiveRaw(&data[0],datalength); + if(data.size()>0) + { + m_fcp->ReceiveRaw(&data[0],datalength); + } // parse file into xml and update the database - if(xml.ParseXML(std::string(data.begin(),data.end()))==true) + if(data.size()>0 && xml.ParseXML(std::string(data.begin(),data.end()))==true) { ssk.SetPublicKey(xml.GetIdentity()); @@ -181,17 +184,16 @@ const bool IdentityIntroductionRequester::HandleMessage(FCPMessage &message) void IdentityIntroductionRequester::Initialize() { - std::string tempval=""; - Option::Instance()->Get("MaxIdentityIntroductionRequests",tempval); - StringFunctions::Convert(tempval,m_maxrequests); + m_maxrequests=0; + Option::Instance()->GetInt("MaxIdentityIntroductionRequests",m_maxrequests); if(m_maxrequests<1) { m_maxrequests=1; - m_log->error("Option MaxIdentityIntroductionRequests is currently set at "+tempval+". It must be 1 or greater."); + m_log->error("Option MaxIdentityIntroductionRequests is currently less than 1. It must be 1 or greater."); } if(m_maxrequests>100) { - m_log->warning("Option MaxIdentityIntroductionRequests is currently set at "+tempval+". This value might be incorrectly configured."); + m_log->warning("Option MaxIdentityIntroductionRequests is currently set at more than 100. This value might be incorrectly configured."); } Option::Instance()->Get("MessageBase",m_messagebase); m_tempdate=Poco::Timestamp();