version 0.3.28
[fms.git] / src / freenet / identityintroductioninserter.cpp
index 7537c91..78a0f93 100644 (file)
@@ -15,7 +15,7 @@ IdentityIntroductionInserter::IdentityIntroductionInserter()
        Initialize();\r
 }\r
 \r
-IdentityIntroductionInserter::IdentityIntroductionInserter(FCPv2 *fcp):IFCPConnected(fcp)\r
+IdentityIntroductionInserter::IdentityIntroductionInserter(FCPv2::Connection *fcp):IFCPConnected(fcp)\r
 {\r
        Initialize();\r
 }\r
@@ -42,7 +42,7 @@ void IdentityIntroductionInserter::FCPDisconnected()
 \r
 }\r
 \r
-const bool IdentityIntroductionInserter::HandleMessage(FCPMessage &message)\r
+const bool IdentityIntroductionInserter::HandleMessage(FCPv2::Message &message)\r
 {\r
 \r
        if(message["Identifier"].find("IdentityIntroductionInserter")==0)\r
@@ -115,12 +115,11 @@ void IdentityIntroductionInserter::RegisterWithThread(FreenetMasterThread *threa
 \r
 void IdentityIntroductionInserter::StartInsert(const long localidentityid, const std::string &day, const std::string &UUID, const std::string &solution)\r
 {\r
-       FCPMessage message;\r
+       FCPv2::Message message;\r
        IdentityIntroductionXML xml;\r
        std::string publickey;\r
        std::string data;\r
        std::string datasizestr;\r
-//     std::vector<unsigned char> hash;\r
        std::string encodedhash;\r
        \r
        SQLite3DB::Statement st=m_db->Prepare("SELECT PublicKey FROM tblLocalIdentity WHERE PublicKey IS NOT NULL AND PublicKey<>'' AND LocalIdentityID=?;");\r
@@ -140,18 +139,14 @@ void IdentityIntroductionInserter::StartInsert(const long localidentityid, const
                encodedhash=Poco::DigestEngine::digestToHex(sha1.digest());\r
                StringFunctions::UpperCase(encodedhash,encodedhash);\r
 \r
-//             hash.resize(20);\r
-//             sha1((unsigned char *)solution.c_str(),solution.size(),&hash[0]);\r
-//             Hex::Encode(hash,encodedhash);\r
-\r
                message.SetName("ClientPut");\r
                message["URI"]="KSK@"+m_messagebase+"|"+day+"|"+UUID+"|"+encodedhash+".xml";\r
                message["Identifier"]="IdentityIntroductionInserter|"+message["URI"];\r
                message["UploadFrom"]="direct";\r
                message["DataLength"]=datasizestr;\r
 \r
-               m_fcp->SendMessage(message);\r
-               m_fcp->SendRaw(data.c_str(),data.size());\r
+               m_fcp->Send(message);\r
+               m_fcp->Send(std::vector<char>(data.begin(),data.end()));\r
 \r
                m_inserting=true;\r
        }\r