summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-02-02 14:09:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-02-02 14:09:07 +0300
commitbb99780c2c6d6798605a5820b5312f5e765317e3 (patch)
tree227214ae926389374b3fd45f790ea1d25a67149c /plugins/Dbx_mdbx/src
parentc2d82dcebe9fafd742986c9f120795b1a1f3311e (diff)
fixes #2139 (При первом запуске драйвер базы зависает)
Diffstat (limited to 'plugins/Dbx_mdbx/src')
-rw-r--r--plugins/Dbx_mdbx/src/dbsettings.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/Dbx_mdbx/src/dbsettings.cpp b/plugins/Dbx_mdbx/src/dbsettings.cpp
index e87581c7cf..5b031325ee 100644
--- a/plugins/Dbx_mdbx/src/dbsettings.cpp
+++ b/plugins/Dbx_mdbx/src/dbsettings.cpp
@@ -82,21 +82,22 @@ LBL_Seek:
if (szCachedSettingName[-1] != 0)
return 1;
+ DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : nullptr;
+
+ DBSettingKey *keyVal = (DBSettingKey *)_alloca(sizeof(DBSettingKey) + settingNameLen);
+ keyVal->hContact = contactID;
+ keyVal->dwModuleId = GetModuleID(szModule);
+ memcpy(&keyVal->szSettingName, szSetting, settingNameLen + 1);
+
int res;
const BYTE *pBlob;
- DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : nullptr;
{
txn_ptr_ro trnlck(m_txn_ro);
-
- DBSettingKey *keyVal = (DBSettingKey *)_alloca(sizeof(DBSettingKey) + settingNameLen);
- keyVal->hContact = contactID;
- keyVal->dwModuleId = GetModuleID(szModule);
- memcpy(&keyVal->szSettingName, szSetting, settingNameLen + 1);
-
MDBX_val key = { keyVal, sizeof(DBSettingKey) + settingNameLen }, data;
res = mdbx_get(trnlck, m_dbSettings, &key, &data);
pBlob = (const BYTE*)data.iov_base;
}
+
if (res != MDBX_SUCCESS) {
// try to get the missing mc setting from the active sub
if (cc && cc->IsMeta() && ValidLookupName(szModule, szSetting)) {