From e00ad4b063b61ae162ccdc603b29f40853490250 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Mar 2020 18:23:45 +0300 Subject: Dbx_mdbx: fix for a nasty problem with message ids --- plugins/Dbx_mdbx/src/dbevents.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/Dbx_mdbx/src/dbevents.cpp b/plugins/Dbx_mdbx/src/dbevents.cpp index c720609e25..78d1531a29 100644 --- a/plugins/Dbx_mdbx/src/dbevents.cpp +++ b/plugins/Dbx_mdbx/src/dbevents.cpp @@ -435,7 +435,12 @@ MEVENT CDbxMDBX::GetEventById(LPCSTR szModule, LPCSTR szId) if (mdbx_get(txn, m_dbEventIds, &key, &data) != MDBX_SUCCESS) return 0; - return *(MEVENT*)data.iov_base; + MEVENT hDbEvent = *(MEVENT *)data.iov_base; + MDBX_val key2 = { &hDbEvent, sizeof(MEVENT) }, data2; + if (mdbx_get(txn, m_dbEvents, &key2, &data2) != MDBX_SUCCESS) + return 0; + + return hDbEvent; } BOOL CDbxMDBX::SetEventId(LPCSTR szModule, MEVENT hDbEvent, LPCSTR szId) -- cgit v1.2.3