diff options
author | wtchang%redhat.com <devnull@localhost> | 2005-03-07 21:20:38 +0000 |
---|---|---|
committer | wtchang%redhat.com <devnull@localhost> | 2005-03-07 21:20:38 +0000 |
commit | 5276e7eecf5746749930b81960e7d7a67cf103ce (patch) | |
tree | 5ad6beab7d57190653a23d7b81cf2288ce7f1c39 | |
parent | a6ee061805e32a9a1a92a32043d56f771ae88ad8 (diff) | |
download | nss-hg-5276e7eecf5746749930b81960e7d7a67cf103ce.tar.gz |
Bugzilla Bug 284839: checked in Bob Relyea's patch to improve the
responsiveness of SECMOD_WaitForAnyTokenEvent. r=wtc,nelsonb.
Modified Files: lib/dev/dev.h lib/dev/devslot.c lib/pk11wrap/pk11util.c
-rw-r--r-- | security/nss/lib/dev/dev.h | 6 | ||||
-rw-r--r-- | security/nss/lib/dev/devslot.c | 8 | ||||
-rw-r--r-- | security/nss/lib/pk11wrap/pk11util.c | 6 |
3 files changed, 20 insertions, 0 deletions
diff --git a/security/nss/lib/dev/dev.h b/security/nss/lib/dev/dev.h index c2c2ad142..262d934bc 100644 --- a/security/nss/lib/dev/dev.h +++ b/security/nss/lib/dev/dev.h @@ -250,6 +250,12 @@ nssSlot_AddRef NSSSlot *slot ); +NSS_EXTERN void +nssSlot_ResetDelay +( + NSSSlot *slot +); + NSS_EXTERN NSSUTF8 * nssSlot_GetName ( diff --git a/security/nss/lib/dev/devslot.c b/security/nss/lib/dev/devslot.c index 79885679d..9f51c6a35 100644 --- a/security/nss/lib/dev/devslot.c +++ b/security/nss/lib/dev/devslot.c @@ -242,6 +242,14 @@ nssSlot_GetTokenName ( return nssToken_GetName(slot->token); } +NSS_IMPLEMENT void +nssSlot_ResetDelay ( + NSSSlot *slot +) +{ + slot->lastTokenPing = 0; +} + static PRBool within_token_delay_period(NSSSlot *slot) { diff --git a/security/nss/lib/pk11wrap/pk11util.c b/security/nss/lib/pk11wrap/pk11util.c index 70f089325..fd7008a08 100644 --- a/security/nss/lib/pk11wrap/pk11util.c +++ b/security/nss/lib/pk11wrap/pk11util.c @@ -44,6 +44,7 @@ #include "pk11func.h" #include "pki3hack.h" #include "secerr.h" +#include "dev.h" /* these are for displaying error messages */ @@ -1097,6 +1098,11 @@ SECMOD_WaitForAnyTokenEvent(SECMODModule *mod, unsigned long flags, SECMOD_UpdateSlotList(mod); slot = SECMOD_FindSlotByID(mod, id); } + /* if we are in the delay period for the "isPresent" call, reset + * the delay since we know things have probably changed... */ + if (slot && slot->nssToken && slot->nssToken->slot) { + nssSlot_ResetDelay(slot->nssToken->slot); + } return slot; /* must be called with the lock on. */ |