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