Check network errors against SEC error set as well

This commit is contained in:
aurimasv 2013-11-08 02:33:20 -06:00
parent 76da3e67fb
commit d9ab469bc8

View file

@ -583,10 +583,13 @@ Zotero.Sync.Storage.WebDAV = (function () {
// Check if the error we encountered is really an SSL error
// Logic borrowed from https://developer.mozilla.org/en-US/docs/How_to_check_the_security_state_of_an_XMLHTTPRequest_over_SSL
// and http://mxr.mozilla.org/mozilla-central/source/security/nss/lib/ssl/sslerr.h
// http://mxr.mozilla.org/mozilla-central/source/security/nss/lib/ssl/sslerr.h
// http://mxr.mozilla.org/mozilla-central/source/security/nss/lib/util/secerr.h
var secErrLimit = Ci.nsINSSErrorsService.NSS_SEC_ERROR_LIMIT - Ci.nsINSSErrorsService.NSS_SEC_ERROR_BASE;
var secErr = Math.abs(Ci.nsINSSErrorsService.NSS_SEC_ERROR_BASE) - (channel.status & 0xffff);
var sslErrLimit = Ci.nsINSSErrorsService.NSS_SSL_ERROR_LIMIT - Ci.nsINSSErrorsService.NSS_SSL_ERROR_BASE;
var sslErr = Math.abs(Ci.nsINSSErrorsService.NSS_SSL_ERROR_BASE) - (channel.status & 0xffff);
if(sslErr < 0 || sslErr > sslErrLimit) {
if( (secErr < 0 || secErr > secErrLimit) && (sslErr < 0 || sslErr > sslErrLimit) ) {
return;
}