Check network errors against SEC error set as well
This commit is contained in:
parent
76da3e67fb
commit
d9ab469bc8
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue