remove old '500 error' hack for services.m.c during mkcol; fix applyCommands to do async right & make a listener correctly

This commit is contained in:
Dan Mills 2008-03-26 23:51:01 -07:00
Родитель 255bfe18ef
Коммит d671b0ce51
2 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -172,7 +172,7 @@ DAVCollection.prototype = {
// check if it exists first
this._makeRequest.async(this, self.cb, "GET", path2 + "/", this._defaultHeaders);
let ret = yield;
if (!(ret.status == 404 || ret.status == 500)) { // FIXME: 500 is a services.m.c oddity
if (ret.status != 404) {
this._log.trace("Skipping creation of path " + path2 +
" (got status " + ret.status + ")");
} else {

Просмотреть файл

@ -46,6 +46,9 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://weave/log4moz.js");
Cu.import("resource://weave/constants.js");
Cu.import("resource://weave/util.js");
Cu.import("resource://weave/async.js");
Function.prototype.async = Async.sugar;
/*
* Data Stores
@ -72,10 +75,12 @@ Store.prototype = {
},
applyCommands: function Store_applyCommands(commandList) {
let self = yield, timer;
let self = yield, timer, listener;
if (this._yieldDuringApply)
if (this._yieldDuringApply) {
listener = new Utils.EventListener(self.cb);
timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
}
for (var i = 0; i < commandList.length; i++) {
if (this._yieldDuringApply) {