X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Ffreenet%2Fintroductionpuzzleinserter.cpp;h=089e4acb4ddbbb1a3c54f406ca5387673135e9ea;hp=5ccb25e37de6d0f09b45ecea185e7e5bf89c3ec6;hb=4e96d123460d6363cf7274e36bd9357768eb86ad;hpb=e662ea47fba8715474851ceebacba400984ee433 diff --git a/src/freenet/introductionpuzzleinserter.cpp b/src/freenet/introductionpuzzleinserter.cpp index 5ccb25e..089e4ac 100644 --- a/src/freenet/introductionpuzzleinserter.cpp +++ b/src/freenet/introductionpuzzleinserter.cpp @@ -22,7 +22,7 @@ IntroductionPuzzleInserter::IntroductionPuzzleInserter():IIndexInserter() Initialize(); } -IntroductionPuzzleInserter::IntroductionPuzzleInserter(FCPv2 *fcp):IIndexInserter(fcp) +IntroductionPuzzleInserter::IntroductionPuzzleInserter(FCPv2::Connection *fcp):IIndexInserter(fcp) { Initialize(); } @@ -106,7 +106,7 @@ void IntroductionPuzzleInserter::GenerateCaptcha(std::string &encodeddata, std:: } -const bool IntroductionPuzzleInserter::HandlePutFailed(FCPMessage &message) +const bool IntroductionPuzzleInserter::HandlePutFailed(FCPv2::Message &message) { SQLite3DB::Statement st; std::vector idparts; @@ -132,7 +132,7 @@ const bool IntroductionPuzzleInserter::HandlePutFailed(FCPMessage &message) return true; } -const bool IntroductionPuzzleInserter::HandlePutSuccessful(FCPMessage &message) +const bool IntroductionPuzzleInserter::HandlePutSuccessful(FCPv2::Message &message) { Poco::DateTime now; SQLite3DB::Statement st; @@ -187,7 +187,7 @@ const bool IntroductionPuzzleInserter::StartInsert(const long &localidentityid) IntroductionPuzzleXML xml; std::string encodedpuzzle=""; std::string solutionstring=""; - FCPMessage message; + FCPv2::Message message; std::string xmldata=""; std::string xmldatasizestr=""; std::string privatekey=""; @@ -257,11 +257,11 @@ const bool IntroductionPuzzleInserter::StartInsert(const long &localidentityid) message["Identifier"]=m_fcpuniquename+"|"+idstring+"|"+indexstr+"|"+xml.GetUUID()+"|"+message["URI"]; message["UploadFrom"]="direct"; message["DataLength"]=xmldatasizestr; - m_fcp->SendMessage(message); - m_fcp->SendRaw(xmldata.c_str(),xmldata.size()); + m_fcp->Send(message); + m_fcp->Send(std::vector(xmldata.begin(),xmldata.end())); // insert to USK - message.Reset(); + message.Clear(); message.SetName("ClientPutComplexDir"); message["URI"]="USK"+privatekey.substr(3)+messagebase+"|"+Poco::DateTimeFormatter::format(now,"%Y.%m.%d")+"|IntroductionPuzzle/0/"; message["Identifier"]=m_fcpuniquename+"USK|"+message["URI"]; @@ -269,8 +269,8 @@ const bool IntroductionPuzzleInserter::StartInsert(const long &localidentityid) message["Files.0.Name"]="IntroductionPuzzle.xml"; message["Files.0.UplaodFrom"]="direct"; message["Files.0.DataLength"]=xmldatasizestr; - m_fcp->SendMessage(message); - m_fcp->SendRaw(xmldata.c_str(),xmldata.size()); + m_fcp->Send(message); + m_fcp->Send(std::vector(xmldata.begin(),xmldata.end())); m_db->Execute("INSERT INTO tblIntroductionPuzzleInserts(UUID,Type,MimeType,LocalIdentityID,PuzzleData,PuzzleSolution) VALUES('"+xml.GetUUID()+"','captcha','image/bmp',"+idstring+",'"+encodedpuzzle+"','"+solutionstring+"');");