From d9ab469bc849f913db63e7f9ae85d978d2cc0ee6 Mon Sep 17 00:00:00 2001 From: aurimasv Date: Fri, 8 Nov 2013 02:33:20 -0600 Subject: [PATCH] Check network errors against SEC error set as well --- chrome/content/zotero/xpcom/storage/webdav.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index a1dbf9eb9c..58cd3f0601 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -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; }