/[winpt]/trunk/Src/wptKeyCache.cpp
ViewVC logotype

Diff of /trunk/Src/wptKeyCache.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 133 by twoaday, Mon Jan 9 09:15:29 2006 UTC revision 147 by twoaday, Fri Jan 13 14:21:16 2006 UTC
# Line 501  keycache_reload_photo (gpg_keycache_t ct Line 501  keycache_reload_photo (gpg_keycache_t ct
501  }  }
502    
503    
504    /* Return the next key which was updated. Before it is
505       returned the update flag is cleared.
506       Return value: 0 on success. */
507    gpgme_error_t
508    gpg_keycache_next_updated_key (gpg_keycache_t ctx,
509                                   struct keycache_s **r_obj)
510    {
511        struct keycache_s *c;
512    
513        for (c = ctx->item; c; c = c->next) {
514            if (c->flags == 1) {
515                c->flags = 0;
516                *r_obj = c;
517                return 0;
518            }
519        }
520        return gpg_error (GPG_ERR_NOT_FOUND);
521    }
522    
523    
524    
525  gpgme_error_t  gpgme_error_t
526  gpg_keycache_update_key (gpg_keycache_t ctx, int is_sec,  gpg_keycache_update_key (gpg_keycache_t ctx, int is_sec,
527                           void *opaque, const char *keyid)                           void *opaque, const char *keyid)
# Line 523  gpg_keycache_update_key (gpg_keycache_t Line 544  gpg_keycache_update_key (gpg_keycache_t
544          log_debug ("keycache update: keyid=%s %p\r\n", keyid, pub);          log_debug ("keycache update: keyid=%s %p\r\n", keyid, pub);
545          gpgme_key_release (fndkey);          gpgme_key_release (fndkey);
546          c->key = key;          c->key = key;
547          c->flags = 0;          c->flags = 1;
548          if (is_sec && pub != NULL &&          if (is_sec && pub != NULL &&
549              !gpg_keycache_find_key (pub, keyid, 0, &fndkey)) {              !gpg_keycache_find_key (pub, keyid, 0, &fndkey)) {
550              log_debug ("keycache update: set public part %p\r\n", fndkey);              log_debug ("keycache update: set public part %p\r\n", fndkey);
# Line 546  gpg_keycache_update_key (gpg_keycache_t Line 567  gpg_keycache_update_key (gpg_keycache_t
567                  c->gloflags.divert_to_card = c_new->gloflags.divert_to_card;                  c->gloflags.divert_to_card = c_new->gloflags.divert_to_card;
568              }              }
569          }          }
570            if (c)
571                c->flags = 1;
572      }      }
573      return 0;      return 0;
574  }  }

Legend:
Removed from v.133  
changed lines
  Added in v.147

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26