Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12829
Modified Files:
ESC.js
Log Message:
If first attempt at getting issuer info from token fails, try a few more times. Bug #
234884.
Index: ESC.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/ESC.js,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ESC.js 3 Apr 2007 20:25:09 -0000 1.12
+++ ESC.js 5 Apr 2007 18:39:52 -0000 1.13
@@ -3351,10 +3351,25 @@
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- url = netkey.GetCoolKeyIssuerInfo(keyType, keyID);
+
+ var tries = 0;
+ while(tries < 3)
+ {
+ url = netkey.GetCoolKeyIssuerInfo(keyType, keyID);
+
+ if(url.length < 10) // Check for bogus junk
+ {
+ recordMessage("Bogus url found ....");
+ url = null;
+ Sleep(150);
+ recordMessage("Going to try again... ");
+ }
+ else
+ break;
+
+ tries ++;
+ }
- if(url.length < 10) // Check for bogus junk
- url = null;
if(url)
{
@@ -3362,7 +3377,26 @@
var result = DoCoolKeySetConfigValue(issuer_config_value,url);
}
} catch (e) {
- ReportException(getBundleString("errorIssuerInfo") + " " , e);
+ recordMessage("Exception attempting to get token issuer info.");
+
+ var tries = 0;
+ while(tries < 3)
+ {
+ url = netkey.GetCoolKeyIssuerInfo(keyType, keyID);
+
+ if(url.length < 10) // Check for bogus junk
+ {
+ recordMessage("Bogus url found from exception....");
+ url = null;
+ sleep(150);
+ recordMessage("From exception. Going to try again... ");
+ }
+ else
+ break;
+
+ tries ++;
+ }
+ recordMessage("From exception returning " + url);
return url;
}
Show replies by thread