[git] GpgOL - branch, master, updated. gpgol-1.3.0-43-gc3b6b35

by Andre Heinecke cvs at cvs.gnupg.org
Fri Dec 18 19:02:20 CET 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".

The branch, master has been updated
       via  c3b6b357bb4636ec76fa5c7b499e1e9f99083c06 (commit)
      from  3f21373d698ce8c46f9041df0c263a1bfb45d7da (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c3b6b357bb4636ec76fa5c7b499e1e9f99083c06
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Dec 18 18:59:35 2015 +0100

    Try to get exchange address from cache first.
    
    * src/mapihelp.cpp (resolve_ex_from_address): Try cache first.
    * src/mymapi.h (MAPI_CACHE_ONLY): Define.
    
    --
    According to MSDN there is a value for MAPI_CACHE_OK which would
    basically do what we want. Look in the cache and if it's not cached
    look it up from the server. But the value is not documented
    and also not in OutlookSpy.
    
    This fixes a hang when the exchange connection is not good.

diff --git a/src/mapihelp.cpp b/src/mapihelp.cpp
index 679eca2..d4d5730 100644
--- a/src/mapihelp.cpp
+++ b/src/mapihelp.cpp
@@ -1516,9 +1516,20 @@ resolve_ex_from_address (LPMESSAGE message)
     }
 
   hr = session->OpenEntry (entryidlen,  (LPENTRYID)sender_entryid,
-                           &IID_IMailUser, MAPI_BEST_ACCESS,
+                           &IID_IMailUser,
+                           MAPI_BEST_ACCESS | MAPI_CACHE_ONLY,
                            &utype, (IUnknown**)&user);
+  if (FAILED (hr))
+    {
+      log_debug ("%s:%s: Failed to open cached entry. Fallback to uncached.",
+                 SRCNAME, __func__);
+      hr = session->OpenEntry (entryidlen,  (LPENTRYID)sender_entryid,
+                               &IID_IMailUser,
+                               MAPI_BEST_ACCESS,
+                               &utype, (IUnknown**)&user);
+    }
   RELDISP (session);
+
   if (FAILED (hr))
     {
       log_error ("%s:%s: Error: %i", SRCNAME, __func__, __LINE__);
diff --git a/src/mymapi.h b/src/mymapi.h
index 4be28c3..c9c2751 100644
--- a/src/mymapi.h
+++ b/src/mymapi.h
@@ -149,7 +149,7 @@ typedef struct MapiMessage_s *lpMapiMessage;
 
 #define MAPI_DEFERRED_ERRORS          0x00000008ul
 #define MAPI_BEST_ACCESS              0x00000010ul
-
+#define MAPI_CACHE_ONLY               0x00004000ul
 
 #define MDB_NO_DIALOG                 0x00000001ul
 #define MDB_WRITE                     0x00000004ul

-----------------------------------------------------------------------

Summary of changes:
 src/mapihelp.cpp | 13 ++++++++++++-
 src/mymapi.h     |  2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list