From f1636ac455230ecc2c1ee0b945880ea3e2898753 Mon Sep 17 00:00:00 2001
From: mcmlxxix <>
Date: Thu, 9 Aug 2012 23:19:29 +0000
Subject: [PATCH] do not throw an exception duplicate subscriptions or invalid
 subscriptions

---
 exec/load/json-db.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/exec/load/json-db.js b/exec/load/json-db.js
index 5e42c9d85c..d769b69bd4 100644
--- a/exec/load/json-db.js
+++ b/exec/load/json-db.js
@@ -132,8 +132,9 @@ function JSONdb (fileName) {
 			record.subtime = Date.now();
 			send_subscriber_updates(client,record,"SUBSCRIBE");
 		}
-		else {
-			this.error(client,errors.DUPLICATE_SUB);
+		else if(this.subscriptions[client.id][record.location]) {
+			log(LOG_WARNING,"duplicate subscription: " + client.id + "@" + record.location);
+			//this.error(client,errors.DUPLICATE_SUB);
 		}
 		return true;
     };
@@ -149,7 +150,8 @@ function JSONdb (fileName) {
 			send_subscriber_updates(client,record,"UNSUBSCRIBE");
 		}
 		else {
-			this.error(client,errors.INVALID_REQUEST);
+			log(LOG_WARNING,"invalid subscription: " + client.id + "@" + record.location);
+			//this.error(client,errors.INVALID_REQUEST);
 		}
 		return true;
     };
-- 
GitLab