diff --git a/libretroshare/src/pqi/p3cfgmgr.cc b/libretroshare/src/pqi/p3cfgmgr.cc index bde9f629a..6985f1a8c 100644 --- a/libretroshare/src/pqi/p3cfgmgr.cc +++ b/libretroshare/src/pqi/p3cfgmgr.cc @@ -294,7 +294,7 @@ void p3ConfigMgr::loadConfiguration() membio->fseek(0); /* go to start */ RsSerialiser *rss = new RsSerialiser(); rss->addSerialType(new RsGeneralConfigSerialiser()); - pqistore stream(rss, "CONFIG", membio, 0); + pqistore stream(rss, "CONFIG", membio, BIN_FLAGS_READABLE); RsItem *rsitem = stream.GetItem(); diff --git a/libretroshare/src/services/p3distrib.cc b/libretroshare/src/services/p3distrib.cc index 94bca34d6..6f6da5b81 100644 --- a/libretroshare/src/services/p3distrib.cc +++ b/libretroshare/src/services/p3distrib.cc @@ -202,7 +202,7 @@ void p3GroupDistrib::loadFileGroups(std::string filename, std::string src, bool /* create the serialiser to load info */ BinInterface *bio = new BinFileInterface(filename.c_str(), BIN_FLAGS_READABLE); - pqistore *store = createStore(bio, src, 0); + pqistore *store = createStore(bio, src, BIN_FLAGS_READABLE); std::cerr << "loading file " << filename << std::endl ; @@ -266,7 +266,7 @@ void p3GroupDistrib::loadFileMsgs(std::string filename, uint16_t cacheSubId, std /* create the serialiser to load msgs */ BinInterface *bio = new BinFileInterface(filename.c_str(), BIN_FLAGS_READABLE); - pqistore *store = createStore(bio, src, 0); + pqistore *store = createStore(bio, src, BIN_FLAGS_READABLE); std::cerr << "loading file " << filename << std::endl ; @@ -745,7 +745,7 @@ void p3GroupDistrib::locked_publishPendingMsgs() std::string filenametmp = path + "/" + tmpname + ".tmp"; BinInterface *bio = new BinFileInterface(filenametmp.c_str(), BIN_FLAGS_WRITEABLE | BIN_FLAGS_HASH_DATA); - pqistore *store = createStore(bio, mOwnId, 0); /* messages are deleted! */ + pqistore *store = createStore(bio, mOwnId, BIN_FLAGS_WRITEABLE); /* messages are deleted! */ bool resave = false; std::list::iterator it; @@ -835,7 +835,7 @@ void p3GroupDistrib::publishDistribGroups() std::string filenametmp = path + "/" + tmpname + ".tmp"; BinInterface *bio = new BinFileInterface(filenametmp.c_str(), BIN_FLAGS_WRITEABLE | BIN_FLAGS_HASH_DATA); - pqistore *store = createStore(bio, mOwnId, BIN_FLAGS_NO_DELETE); + pqistore *store = createStore(bio, mOwnId, BIN_FLAGS_NO_DELETE | BIN_FLAGS_WRITEABLE); RsStackMutex stack(distribMtx); /****** STACK MUTEX LOCKED *******/ diff --git a/libretroshare/src/services/p3ranking.cc b/libretroshare/src/services/p3ranking.cc index be7581be3..afd81c371 100644 --- a/libretroshare/src/services/p3ranking.cc +++ b/libretroshare/src/services/p3ranking.cc @@ -145,7 +145,7 @@ void p3Ranking::loadRankFile(std::string filename, std::string src) uint32_t bioflags = BIN_FLAGS_HASH_DATA | BIN_FLAGS_READABLE; BinInterface *bio = new BinFileInterface(filename.c_str(), bioflags); - pqistore *store = new pqistore(rsSerialiser, src, bio, 0); + pqistore *store = new pqistore(rsSerialiser, src, bio, BIN_FLAGS_READABLE); time_t now = time(NULL); time_t min, max; @@ -259,7 +259,7 @@ void p3Ranking::publishMsgs(bool own) uint32_t bioflags = BIN_FLAGS_HASH_DATA | BIN_FLAGS_WRITEABLE; BinInterface *bio = new BinFileInterface(fname.c_str(), bioflags); - pqistore *store = new pqistore(rsSerialiser, mOwnId, bio, BIN_FLAGS_NO_DELETE); + pqistore *store = new pqistore(rsSerialiser, mOwnId, bio, BIN_FLAGS_NO_DELETE | BIN_FLAGS_WRITEABLE); { RsStackMutex stack(mRankMtx); /********** STACK LOCKED MTX ******/ @@ -1099,8 +1099,7 @@ pqistore *createStore(std::string file, std::string src, bool reading) /* bin flags: READ | WRITE | HASH_DATA */ BinInterface *bio = new BinFileInterface(file.c_str(), bioflags); /* store flags: NO_DELETE (yes) | NO_CLOSE (no) */ - pqistore *store = new pqistore(rsSerialiser, src, bio, - BIN_FLAGS_NO_DELETE); + pqistore *store = new pqistore(rsSerialiser, src, bio, BIN_FLAGS_NO_DELETE | (bioflags & BIN_FLAGS_WRITEABLE)); return store; }