From bb99780c2c6d6798605a5820b5312f5e765317e3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Feb 2020 14:09:01 +0300 Subject: =?UTF-8?q?fixes=20#2139=20(=D0=9F=D1=80=D0=B8=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B2=D0=BE=D0=BC=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA?= =?UTF-8?q?=D0=B5=20=D0=B4=D1=80=D0=B0=D0=B9=D0=B2=D0=B5=D1=80=20=D0=B1?= =?UTF-8?q?=D0=B0=D0=B7=D1=8B=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B0=D0=B5?= =?UTF-8?q?=D1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Dbx_mdbx/src/dbsettings.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'plugins') 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)) { -- cgit v1.2.3