Skip to content
Snippets Groups Projects
Commit e002bdf9 authored by mcmlxxix's avatar mcmlxxix
Browse files

fix db record unlock on disconnect as discovered by faddit, FADDIT!

parent 845165ba
No related branches found
No related tags found
No related merge requests found
......@@ -452,7 +452,7 @@ function JSONdb (fileName) {
case errors.DUPLICATE_LOCK:
error_desc="Duplicate record lock request";
break;
case errors.DUPLICATE_SUBSCRIPTION:
case errors.DUPLICATE_SUB:
error_desc="Duplicate record subscription request";
break;
case errors.NON_ARRAY:
......@@ -524,8 +524,8 @@ function JSONdb (fileName) {
/* release any locks or subscriptions held by a disconnected client */
this.release = function(client) {
free_prisoners(client,this.shadow);
for (var s in this.subscriptions[client.id]) {
free_prisoners(client,this.shadow);
cancel_subscriptions(client,this.subscriptions[client.id]);
delete this.subscriptions[client.id];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment