From 963892913fd31cf177c074b12615f238e334cced Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 21 Jan 2016 15:06:40 +0100 Subject: [PATCH] Fixed: Crash in backup service --HG-- branch : develop --- .../server/src/backup_service/backup_file_access.cpp | 4 ++-- code/ryzom/server/src/backup_service/backup_service.cpp | 4 ++-- code/ryzom/server/src/backup_service/commands.cpp | 8 ++++---- code/ryzom/server/src/backup_service/web_connection.cpp | 9 +++++---- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/code/ryzom/server/src/backup_service/backup_file_access.cpp b/code/ryzom/server/src/backup_service/backup_file_access.cpp index ebb63b926..12b45c7a5 100644 --- a/code/ryzom/server/src/backup_service/backup_file_access.cpp +++ b/code/ryzom/server/src/backup_service/backup_file_access.cpp @@ -36,7 +36,7 @@ NLMISC::CVariable BSFileSubst("backup", "BSFileSubst", "file read/w NLMISC::CVariable VerboseLog("backup", "VerboseLog", "Activate verbose logging of BS activity", false); NLMISC::CVariable UseTempFile("backup", "UseTempFile", "Flag the use of temporary file for safe write or append operation", true, true); -extern NLMISC::CVariable SaveShardRootBackupService; +extern NLMISC::CVariable SaveShardRootGameShare; bool bsstrincmp(const char* s1, const char* s2, int n) { @@ -48,7 +48,7 @@ bool bsstrincmp(const char* s1, const char* s2, int n) std::string getBackupFileName(const std::string& filename) { - return SaveShardRootBackupService.get() + filename; + return SaveShardRootGameShare.get() + filename; /* // BSFilePrefix and BSFileSubst are deprecated if (BSFilePrefix.get().empty()) return filename; diff --git a/code/ryzom/server/src/backup_service/backup_service.cpp b/code/ryzom/server/src/backup_service/backup_service.cpp index 61538f3e4..711a245a3 100644 --- a/code/ryzom/server/src/backup_service/backup_service.cpp +++ b/code/ryzom/server/src/backup_service/backup_service.cpp @@ -62,7 +62,7 @@ struct CBackupMsgSaveFileRecv extern CDirectoryRateStat DirStats; -extern NLMISC::CVariable SaveShardRootBackupService; +extern NLMISC::CVariable SaveShardRootGameShare; using namespace NLNET; using namespace NLMISC; @@ -542,7 +542,7 @@ static CMessage getFileClassImp( CMessage& msgin) } } // In case something like getPathContent() has returned full paths, make paths relative to match the requested filenames - fdc.stripFilename(SaveShardRootBackupService.get()); + fdc.stripFilename(SaveShardRootGameShare.get()); // compose the output message CMessage msgout("BS_FILE_CLASS"); diff --git a/code/ryzom/server/src/backup_service/commands.cpp b/code/ryzom/server/src/backup_service/commands.cpp index 312643418..2ea28c024 100644 --- a/code/ryzom/server/src/backup_service/commands.cpp +++ b/code/ryzom/server/src/backup_service/commands.cpp @@ -30,7 +30,7 @@ using namespace NLNET; CDirectoryRateStat DirStats; -extern CVariable SaveShardRootBackupService; +extern CVariable SaveShardRootGameShare; NLMISC_COMMAND(displayFileStats, "display file read/write stats for the last minute", "") @@ -74,9 +74,9 @@ NLMISC_COMMAND ( dumpCharacterFile, "dump the content of the save file for a cha { // just output the list of available shard id vector shards; - CPath::getPathContent(SaveShardRootBackupService, false, true, false, shards); + CPath::getPathContent(SaveShardRootGameShare, false, true, false, shards); - log.displayNL("Listing %u available shard id in path '%s':", shards.size(), SaveShardRootBackupService.c_str()); + log.displayNL("Listing %u available shard id in path '%s':", shards.size(), SaveShardRootGameShare.c_str()); for (uint i=0; i IncrementalBackupDirectory("backup", "IncrementalBackupDirectory", "Directory to find incremental backuped archives", "", 0, true); -CVariable SaveShardRootBackupService("backup", "SaveShardRoot", "Root directory of all saved data by BS", "/home/nevrax/save_shard", 0, true, cbOnSaveShardRootModified); // (SaveShardRoot from game_share/backup_service_interface.cpp is not instanciated because the nothing is used from that file) +//CVariable SaveShardRootBackupService("backup", "SaveShardRoot", "Root directory of all saved data by BS", "/home/nevrax/save_shard", 0, true, cbOnSaveShardRootModified); // (SaveShardRoot from game_share/backup_service_interface.cpp is not instanciated because the nothing is used from that file) +extern CVariable SaveShardRootGameShare; CVariable SaveTemplatePath("backup", "SaveTemplatePath", "Directory to find saves (with shard and account replacement strings)", "$shard/characters/account_$userid_$charid$ext", 0, true); CVariable SaveExtList("backup", "SaveExtList", "List of possible extensions for save files (space separated)", "_pdr.bin _pdr.xml .bin", 0, true); @@ -209,7 +210,7 @@ void cbGetSaveList(CMemStream &msgin, TSockId host) explode(str, string("%%"), params, true); string incrementalDir = IncrementalBackupDirectory.get(); - string saveShardRoot = SaveShardRootBackupService.get(); + string saveShardRoot = SaveShardRootGameShare.get(); string templatePath = SaveTemplatePath.get(); string extList = SaveExtList.get(); @@ -292,7 +293,7 @@ void cbRestoreSave(CMemStream &msgin, TSockId host) explode(str, string("%%"), params, true); - string saveShardRoot = SaveShardRootBackupService.get(); + string saveShardRoot = SaveShardRootGameShare.get(); string templatePath = SaveTemplatePath.get(); string shard; @@ -367,7 +368,7 @@ void cbCopyOverSave(CMemStream &msgin, TSockId host) explode(str, string("%%"), params, true); - string saveShardRoot = SaveShardRootBackupService.get(); + string saveShardRoot = SaveShardRootGameShare.get(); string templatePath = SaveTemplatePath.get(); string extList = SaveExtList.get();