compile error fixes

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-msghistory@4488 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2011-07-24 18:24:07 +00:00
parent 2f315cc0fc
commit d0d13e718f
2 changed files with 18 additions and 8 deletions

View File

@ -894,15 +894,15 @@ bool p3GroupDistrib::loadArchive(const std::string& grpId)
{ {
std::string filename; std::string filename;
msgArchMap::iterator it; msgArchMap::iterator mit;
{ {
RsStackMutex stack(distribMtx); RsStackMutex stack(distribMtx);
it = mMsgArchive.find(grpId); mit = mMsgArchive.find(grpId);
if(it != mMsgArchive.end()) if(mit != mMsgArchive.end())
{ {
filename = it->second->msgFilePath; filename = mit->second->msgFilePath;
} }
else else
{ {
@ -928,7 +928,7 @@ bool p3GroupDistrib::loadArchive(const std::string& grpId)
RsStackMutex stack(distribMtx); RsStackMutex stack(distribMtx);
if(it->second->msgFileHash != bio->gethash()) if(mit->second->msgFileHash != bio->gethash())
{ {
#ifdef DISTRIB_ARCH_DEBUG #ifdef DISTRIB_ARCH_DEBUG
std::cerr << "p3Distrib::loadArchive() Error occurred archived File's Hash invalid" << std::endl; std::cerr << "p3Distrib::loadArchive() Error occurred archived File's Hash invalid" << std::endl;
@ -942,7 +942,7 @@ bool p3GroupDistrib::loadArchive(const std::string& grpId)
for(;it!=load.end(); it++) for(;it!=load.end(); it++)
{ {
if(NULL != (rsdm = dynamic_cast<RsDistribSignedMsg*>(*it))){ if(NULL != (rsdm = dynamic_cast<RsDistribSignedMsg*>(*it))){
it->second->msgs.push_back(rsdm); mit->second->msgs.push_back(rsdm);
} }
else else
{ {
@ -951,7 +951,7 @@ bool p3GroupDistrib::loadArchive(const std::string& grpId)
} }
} }
it->second->loaded = true; mit->second->loaded = true;
return true; return true;
} }
@ -1013,7 +1013,14 @@ bool p3GroupDistrib::sendArchiveToFile(RsDistribMsgArchive* msgArch)
BinEncryptedFileInterface *bio = new BinEncryptedFileInterface(filename.c_str(), bioflags); BinEncryptedFileInterface *bio = new BinEncryptedFileInterface(filename.c_str(), bioflags);
pqiSSLstore *stream = new pqiSSLstore(setupSerialiser(), "CONFIG", bio, stream_flags); pqiSSLstore *stream = new pqiSSLstore(setupSerialiser(), "CONFIG", bio, stream_flags);
bool written = stream->encryptedSendItems(msgArch->msgs); std::list<RsItem*> sendList;
std::list<RsDistribSignedMsg*>::iterator it =
msgArch->msgs.begin();
for(; it!=msgArch->msgs.end(); it++)
sendList.push_back(*it);
bool written = stream->encryptedSendItems(sendList);
msgArch->msgFileHash = bio->gethash(); msgArch->msgFileHash = bio->gethash();

View File

@ -250,6 +250,9 @@ typedef std::pair<std::string, pugi::xml_node > grpNodePair; // (is loaded, iter
// these make up a cache list // these make up a cache list
typedef std::pair<std::string, uint16_t> pCacheId; //(pid, subid) typedef std::pair<std::string, uint16_t> pCacheId; //(pid, subid)
typedef std::pair<std::string, pCacheId> grpCachePair; // (grpid, cid) typedef std::pair<std::string, pCacheId> grpCachePair; // (grpid, cid)
class RsDistribMsgArchive;
typedef std::map<std::string, RsDistribMsgArchive* > msgArchMap; typedef std::map<std::string, RsDistribMsgArchive* > msgArchMap;
/*! /*!