diff --git a/mozilla/security/nss/lib/dev/dev.h b/mozilla/security/nss/lib/dev/dev.h index 8e5e061243b..b3a189ff878 100644 --- a/mozilla/security/nss/lib/dev/dev.h +++ b/mozilla/security/nss/lib/dev/dev.h @@ -44,7 +44,7 @@ */ #ifdef DEBUG -static const char DEV_CVS_ID[] = "@(#) $RCSfile: dev.h,v $ $Revision: 1.36 $ $Date: 2005-01-20 02:25:47 $"; +static const char DEV_CVS_ID[] = "@(#) $RCSfile: dev.h,v $ $Revision: 1.37 $ $Date: 2005-03-07 21:20:38 $"; #endif /* DEBUG */ #ifndef NSSCKT_H @@ -250,6 +250,12 @@ nssSlot_AddRef NSSSlot *slot ); +NSS_EXTERN void +nssSlot_ResetDelay +( + NSSSlot *slot +); + NSS_EXTERN NSSUTF8 * nssSlot_GetName ( diff --git a/mozilla/security/nss/lib/dev/devslot.c b/mozilla/security/nss/lib/dev/devslot.c index aa91764e0eb..822f186f31d 100644 --- a/mozilla/security/nss/lib/dev/devslot.c +++ b/mozilla/security/nss/lib/dev/devslot.c @@ -35,7 +35,7 @@ * ***** END LICENSE BLOCK ***** */ #ifdef DEBUG -static const char CVS_ID[] = "@(#) $RCSfile: devslot.c,v $ $Revision: 1.20 $ $Date: 2005-01-20 02:25:47 $"; +static const char CVS_ID[] = "@(#) $RCSfile: devslot.c,v $ $Revision: 1.21 $ $Date: 2005-03-07 21:20:38 $"; #endif /* DEBUG */ #ifndef NSSCKEPV_H @@ -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/mozilla/security/nss/lib/pk11wrap/pk11util.c b/mozilla/security/nss/lib/pk11wrap/pk11util.c index 70f08932559..fd7008a08f4 100644 --- a/mozilla/security/nss/lib/pk11wrap/pk11util.c +++ b/mozilla/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. */