From 7a1ba787de0dd9adc9d9a30cdef25f9e09110b27 Mon Sep 17 00:00:00 2001
From: mcmlxxix <>
Date: Sun, 12 Aug 2012 23:58:10 +0000
Subject: [PATCH] fix subscription checking bug, increase client wait() timeout
 to 30 seconds

---
 exec/load/json-client.js | 2 +-
 exec/load/json-db.js     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/exec/load/json-client.js b/exec/load/json-client.js
index 7dd978a218..3e31b5ceda 100644
--- a/exec/load/json-client.js
+++ b/exec/load/json-client.js
@@ -77,7 +77,7 @@ function JSONClient(serverAddr,serverPort) {
 		CONNECTION_TIMEOUT:		10,
 		PING_INTERVAL:			60*1000,
 		PING_TIMEOUT:			10*1000,
-		SOCK_TIMEOUT:			10*1000,
+		SOCK_TIMEOUT:			30*1000,
 		TIMEOUT:				-1
 	};
         
diff --git a/exec/load/json-db.js b/exec/load/json-db.js
index d769b69bd4..1286e05446 100644
--- a/exec/load/json-db.js
+++ b/exec/load/json-db.js
@@ -142,7 +142,7 @@ function JSONdb (fileName) {
     /* unsubscribe a client from an object */
     this.unsubscribe = function(request,record) {
 		var client = request.client;
-		if(this.subscriptions[client.id][record.location]) {
+		if(this.subscriptions[client.id] && this.subscriptions[client.id][record.location]) {
 			delete record.shadow[record.property]._subscribers[client.id];
 			delete this.subscriptions[client.id][record.location];
 			if(count(this.subscriptions[client.id]) == 0)
-- 
GitLab