Streamline ConfDb loading proceedure (#791)

* Create DatabaseConfBuilder & remove locking
* Remove all refcounting

This is part 1/n in regards to this PR's rework
* Move db conf lookup out of RunThreadPart
* Return default configuration for failed lookups
* RefPtr members & stop leaks
* fix uint comparison warning
This commit is contained in:
Michael Flaherty
2018-06-19 09:35:37 -07:00
committed by Kyle Sanderson
parent 53c63def07
commit b9b6832a11
7 changed files with 367 additions and 238 deletions
+3 -9
View File
@@ -56,20 +56,14 @@ bool ClientPrefs::SDK_OnLoad(char *error, size_t maxlength, bool late)
if (DBInfo == NULL)
{
DBInfo = dbi->FindDatabaseConf("default");
DBInfo = dbi->FindDatabaseConf("storage-local");
if (DBInfo == NULL)
{
DBInfo = dbi->FindDatabaseConf("storage-local");
ke::SafeStrcpy(error, maxlength, "Could not find any suitable database configs");
return false;
}
}
if (DBInfo == NULL)
{
ke::SafeStrcpy(error, maxlength, "Could not find any suitable database configs");
return false;
}
if (DBInfo->driver && DBInfo->driver[0] != '\0')
{
Driver = dbi->FindOrLoadDriver(DBInfo->driver);