Fix bug 874654 - Infinite loop at refresh when Caldav server is up but calendar is not available. r=philipp,a=Standard8,a=philipp
authorMick Guessan <mguessan@free.fr>
Tue, 16 Jul 2013 14:21:00 +0200
changeset 15837 cd19366c9f9397e9ae104616dbbfbfd2568fb23f
parent 15836 dfdbe6c067b1dfbb62bb119a3f8a578917dbdabd
child 15838 c5e4ae270dc3105a3a394609c7909928a84a4288
push id942
push userbugzilla@standard8.plus.com
push dateMon, 05 Aug 2013 19:15:38 +0000
treeherdercomm-beta@0e1a1c4a9f0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp, Standard8, philipp
bugs874654
Fix bug 874654 - Infinite loop at refresh when Caldav server is up but calendar is not available. r=philipp,a=Standard8,a=philipp
calendar/providers/caldav/calDavCalendar.js
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -1639,16 +1639,23 @@ calDavCalendar.prototype = {
             } catch (ex) {
                 cal.LOG("CalDAV: Error without status on initial PROPFIND for calendar " +
                         thisCalendar.name);
                 thisCalendar.completeCheckServerInfo(aChangeLogListener,
                                                      Components.interfaces.calIErrors.DAV_NOT_DAV);
                 return;
             }
 
+            if (request.responseStatus >= 500 && request.responseStatus < 600) {
+                // Calendar not available
+                cal.LOG("CalDAV: Server not available " + request.responseStatus + ", abort sync for calendar " + thisCalendar.name);
+                thisCalendar.completeCheckServerInfo(aChangeLogListener, Components.results.NS_ERROR_ABORT);
+                return;
+            }
+
             if (request.responseStatus == 401 || request.responseStatus == 403) {
                 // Auth was cancelled, disable this calendar with auto-enable
                 thisCalendar.setProperty("disabled", "true");
                 thisCalendar.setProperty("auto-enabled", "true");
                 thisCalendar.completeCheckServerInfo(aChangeLogListener, Components.results.NS_ERROR_ABORT);
                 return;
             }