X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Ffreenet%2Fidentityinserter.cpp;fp=src%2Ffreenet%2Fidentityinserter.cpp;h=a18aa0e22e08bf5057ce4b0a4eb224e056cfb7b4;hp=85fe2f4ef10f291c6a3a6656cb34b4b48f5b9cd6;hb=9ae3b1434e51788e6feb72e1415ec800d05c535a;hpb=ed0732b2550c23c05fc9faf925620e87ee6dee12 diff --git a/src/freenet/identityinserter.cpp b/src/freenet/identityinserter.cpp index 85fe2f4..a18aa0e 100644 --- a/src/freenet/identityinserter.cpp +++ b/src/freenet/identityinserter.cpp @@ -79,15 +79,15 @@ const bool IdentityInserter::HandleMessage(FCPv2::Message &message) if(message.GetName()=="PutSuccessful") { - // a little hack here - if we just inserted index yesterday and it is now the next day - we would have inserted todays date not yesterdays as LastInsertedIdentity. - // If this is the case, we will skip updating LastInsertedIdentity so that we can insert this identity again for today - Poco::DateTime lastdate; - int tzdiff=0; - Poco::DateTimeParser::tryParse("%Y-%m-%d",idparts[4],lastdate,tzdiff); // do check to make sure this is the non-editioned SSK - we ignore failure/success for editioned SSK for now if(message["Identifier"].find(".xml")!=std::string::npos) { + // a little hack here - if we just inserted index yesterday and it is now the next day - we would have inserted todays date not yesterdays as LastInsertedIdentity. + // If this is the case, we will skip updating LastInsertedIdentity so that we can insert this identity again for today + Poco::DateTime lastdate; + int tzdiff=0; + Poco::DateTimeParser::tryParse("%Y-%m-%d",idparts[4],lastdate,tzdiff); if(lastdate.day()==now.day()) { m_db->Execute("UPDATE tblLocalIdentity SET InsertingIdentity='false', LastInsertedIdentity='"+Poco::DateTimeFormatter::format(now,"%Y-%m-%d %H:%M:%S")+"' WHERE LocalIdentityID="+idparts[1]+";"); @@ -255,7 +255,7 @@ void IdentityInserter::StartInsert(const long localidentityid) // test insert as editioned SSK mess.Clear(); mess.SetName("ClientPut"); - mess["URI"]=privatekey+messagebase+"|"+Poco::DateTimeFormatter::format(now,"%Y-%m-%d")+"|Identity|-"+indexstr; + mess["URI"]=privatekey+messagebase+"|"+Poco::DateTimeFormatter::format(now,"%Y-%m-%d")+"|Identity-"+indexstr; mess["Identifier"]="IdentityInserter|"+mess["URI"]; mess["UploadFrom"]="direct"; mess["DataLength"]=datasizestr;