when we abort a lock request because we already hold a token, reset _lockAllowed to allow further requests for locks
when we abort a lock request because we already hold a token, reset _lockAllowed to allow further requests for locks
--- a/services/sync/modules/dav.js
+++ b/services/sync/modules/dav.js
@@ -355,16 +355,17 @@ DAVCollection.prototype = {
this._log.trace("Acquiring lock");
if (!this._lockAllowed)
throw {message: "Cannot acquire lock (internal lock)"};
this._lockAllowed = false;
if (DAVLocks['default']) {
this._log.debug("Lock called, but we already hold a token");
+ this._lockAllowed = true;
self.done();
return;
}
this.LOCK("lock",
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" +
"<D:lockinfo xmlns:D=\"DAV:\">\n" +
" <D:locktype><D:write/></D:locktype>\n" +
@@ -390,17 +391,17 @@ DAVCollection.prototype = {
this._log.warn("Could not acquire lock");
this._lockAllowed = true;
self.done();
return;
}
this._log.trace("Lock acquired");
this._lockAllowed = true;
-
+
self.done(DAVLocks['default']);
},
unlock: function DC_unlock() {
let self = yield;
this._log.trace("Releasing lock");