Switched configuration back from 'Archive' Format to the standard

RsItem Packets.... but used an alterative streamer similar to pqiarchive.

This will cause problems, and delete the configuration for those
who have upgraded in the last month .... but will maintain compatibility
with previous stable release.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1201 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2009-05-09 00:19:54 +00:00
parent 65e02ba4de
commit 2f1a8700ac
6 changed files with 457 additions and 13 deletions

View file

@ -28,7 +28,7 @@
#include "pqi/p3cfgmgr.h"
#include "pqi/p3authmgr.h"
#include "pqi/pqibin.h"
#include "pqi/pqiarchive.h"
#include "pqi/pqistore.h"
#include "pqi/pqistreamer.h"
#include "pqi/pqinotify.h"
#include <errno.h>
@ -402,7 +402,7 @@ bool p3Config::loadConfiguration(std::string &loadHash)
uint32_t stream_flags = BIN_FLAGS_READABLE;
BinInterface *bio = new BinFileInterface(fname.c_str(), bioflags);
pqiarchive stream(setupSerialiser(), bio, stream_flags);
pqistore stream(setupSerialiser(), bio, stream_flags);
RsItem *item = NULL;
while(NULL != (item = stream.GetItem()))
@ -473,7 +473,7 @@ bool p3Config::saveConfiguration()
stream_flags |= BIN_FLAGS_NO_DELETE;
BinInterface *bio = new BinFileInterface(fnametmp.c_str(), bioflags);
pqiarchive *stream = new pqiarchive(setupSerialiser(), bio, stream_flags);
pqistore *stream = new pqistore(setupSerialiser(), bio, stream_flags);
std::list<RsItem *>::iterator it;
@ -487,9 +487,6 @@ bool p3Config::saveConfiguration()
(*it)->print(std::cerr, 0);
std::cerr << std::endl;
#endif
if( (*it)->PeerId().length() == 0 ) // this is required by pqiarchive.
(*it)->PeerId(rsPeers->getOwnId()) ;
written = written && stream->SendItem(*it);
// std::cerr << "written = " << written << std::endl ;