X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fidentityrequester.cpp;h=af52a59d58675b5dcc3ae03ebca60f25692f18cd;hb=c0ebc7b53a977885ebc2d3a679c586ae20c0bc4a;hp=3375f1d0ef7edc759c8056394a03f47cb0daf697;hpb=dec33c63afafabf83c3039e916725cac6faef9b3;p=fms.git diff --git a/src/freenet/identityrequester.cpp b/src/freenet/identityrequester.cpp index 3375f1d..af52a59 100644 --- a/src/freenet/identityrequester.cpp +++ b/src/freenet/identityrequester.cpp @@ -54,10 +54,13 @@ const bool IdentityRequester::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) { st=m_db->Prepare("UPDATE tblIdentity SET Name=?, SingleUse=?, LastSeen=?, PublishTrustList=?, PublishBoardList=?, FreesiteEdition=? WHERE IdentityID=?"); @@ -166,18 +169,16 @@ const bool IdentityRequester::HandleGetFailed(FCPMessage &message) void IdentityRequester::Initialize() { - std::string tempval=""; m_fcpuniquename="IdentityRequester"; - Option::Instance()->Get("MaxIdentityRequests",tempval); - StringFunctions::Convert(tempval,m_maxrequests); + Option::Instance()->GetInt("MaxIdentityRequests",m_maxrequests); if(m_maxrequests<1) { m_maxrequests=1; - m_log->error("Option MaxIdentityRequests is currently set at "+tempval+". It must be 1 or greater."); + m_log->error("Option MaxIdentityRequests is currently set at less than 1. It must be 1 or greater."); } if(m_maxrequests>100) { - m_log->warning("Option MaxIdentityRequests is currently set at "+tempval+". This value might be incorrectly configured."); + m_log->warning("Option MaxIdentityRequests is currently set at more than 100. This value might be incorrectly configured."); } }