From 1456f2f9d1a79d7da925551b8947ff1e6140feed Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 13 Nov 2012 08:49:06 +0000 Subject: quick fix for the old piece of crap in dbx_mmap git-svn-id: http://svn.miranda-ng.org/main/trunk@2304 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbsettings.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'plugins/Db3x_mmap/src') diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index bd93a0ffa0..73e2043245 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -95,12 +95,16 @@ int CDb3Base::GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING *dbcgs strcpy(dbcgs->pValue->pszVal,pCachedValue->pszVal); } } - else - memcpy( dbcgs->pValue, pCachedValue, sizeof( DBVARIANT )); + else memcpy( dbcgs->pValue, pCachedValue, sizeof( DBVARIANT )); log2("get cached %s (%p)", printVariant(dbcgs->pValue), pCachedValue); return ( pCachedValue->type == DBVT_DELETED ) ? 1 : 0; - } } + } + + // never look db for the resident variable + if (szCachedSettingName[-1] != 0) + return 1; + } ofsModuleName = GetModuleNameOfs(dbcgs->szModule); if (hContact == NULL) ofsContact = m_dbHeader.ofsUser; @@ -164,11 +168,11 @@ int CDb3Base::GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING *dbcgs /**** add to cache **********************/ if ( dbcgs->pValue->type != DBVT_BLOB ) { DBVARIANT* pCachedValue = m_cache->GetCachedValuePtr( hContact, szCachedSettingName, 1 ); - if ( pCachedValue != NULL ) + if ( pCachedValue != NULL ) { m_cache->SetCachedVariant(dbcgs->pValue, pCachedValue); + log3("set cached [%08p] %s (%p)", hContact, szCachedSettingName, pCachedValue); + } } - - logg(); return 0; } NeedBytes(1); @@ -195,8 +199,10 @@ int CDb3Base::GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING *dbcgs if ( dbcgs->pValue->type != DBVT_BLOB ) { DBVARIANT* pCachedValue = m_cache->GetCachedValuePtr( hContact, szCachedSettingName, 1 ); - if ( pCachedValue != NULL ) + if ( pCachedValue != NULL ) { pCachedValue->type = DBVT_DELETED; + log3("set missing [%08p] %s (%p)", hContact, szCachedSettingName, pCachedValue); + } } logg(); -- cgit v1.2.3