mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-19 03:18:15 -04:00
Secured the output of .cfg files and cache files. Now closing RS or serializing errors while saving these files cannot corrupt them anymore.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1090 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
207983a9e5
commit
631e3b303e
4 changed files with 50 additions and 32 deletions
|
@ -143,6 +143,8 @@ int pqiarchive::SendItem(RsItem *si)
|
|||
return -1;
|
||||
}
|
||||
|
||||
// std::cerr << "SendItem: si->PeerId()=" << si->PeerId() << std::endl ;
|
||||
|
||||
int ret = writePkt(si);
|
||||
return ret; /* 0 - failure, 1 - success*/
|
||||
}
|
||||
|
@ -246,6 +248,7 @@ int pqiarchive::status()
|
|||
|
||||
int pqiarchive::writePkt(RsItem *pqi)
|
||||
{
|
||||
// std::cerr << "writePkt, pqi->peerId()=" << pqi->PeerId() << std::endl ;
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << "pqiarchive::writePkt()";
|
||||
|
@ -310,6 +313,8 @@ int pqiarchive::writePkt(RsItem *pqi)
|
|||
std::ostringstream out;
|
||||
out << "pqiarchive::writePkt() Invalid peerId Length!";
|
||||
out << std::endl;
|
||||
out << "Found " << pqi->PeerId().length() << " instead of " << PQI_PEERID_LENGTH << std::endl ;
|
||||
out << "pqi->PeerId() = " << pqi->PeerId() << std::endl ;
|
||||
out << "Caused By: " << std::endl;
|
||||
pqi -> print(out);
|
||||
pqioutput(PQL_ALERT, pqiarchivezone, out.str());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue