summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtchang%redhat.com <devnull@localhost>2005-03-07 21:30:57 +0000
committerwtchang%redhat.com <devnull@localhost>2005-03-07 21:30:57 +0000
commit56fbb0493131043f16ce7b75e004ebc2784346b5 (patch)
treef40c6ad0762afc28ef0682d3998ff3f5685e106b
parent09596e9b39f4c096dfadddc48c7ca56f61c9a7ae (diff)
downloadnss-hg-56fbb0493131043f16ce7b75e004ebc2784346b5.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 Tag: NSS_3_9_BRANCH
-rw-r--r--security/nss/lib/dev/dev.h6
-rw-r--r--security/nss/lib/dev/devslot.c8
-rw-r--r--security/nss/lib/pk11wrap/pk11util.c6
3 files changed, 20 insertions, 0 deletions
diff --git a/security/nss/lib/dev/dev.h b/security/nss/lib/dev/dev.h
index 4495be2f5..a7ccdbbca 100644
--- a/security/nss/lib/dev/dev.h
+++ b/security/nss/lib/dev/dev.h
@@ -247,6 +247,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 e8fbee38d..4b7557ae8 100644
--- a/security/nss/lib/dev/devslot.c
+++ b/security/nss/lib/dev/devslot.c
@@ -239,6 +239,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 322b212f0..73a52828f 100644
--- a/security/nss/lib/pk11wrap/pk11util.c
+++ b/security/nss/lib/pk11wrap/pk11util.c
@@ -40,6 +40,7 @@
#include "pk11func.h"
#include "pki3hack.h"
#include "secerr.h"
+#include "dev.h"
/* these are for displaying error messages */
@@ -1093,6 +1094,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. */