diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-13 08:49:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-13 08:49:06 +0000 |
commit | 1456f2f9d1a79d7da925551b8947ff1e6140feed (patch) | |
tree | b260290f11c492285491696767a3602a1b7aec34 /plugins/Db3x_mmap | |
parent | c7feb50e8f5dafca69cd3825bbf139b83a6278e3 (diff) |
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
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r-- | plugins/Db3x_mmap/src/dbsettings.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
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();
|