From b91b8386be7be131e0c2ead8651e07b52fefedba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Vial?= Date: Tue, 11 Aug 2015 19:11:29 +0200 Subject: [PATCH] Small fix fot the large buffer problem. Now node-ipc is able to handle large messages --- lib/client.js | 2 +- lib/socketServer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client.js b/lib/client.js index 202d4b1..4532425 100644 --- a/lib/client.js +++ b/lib/client.js @@ -132,7 +132,7 @@ function connect(){ data=(this.ipcBuffer+=data); - if(data.slice(-1)!=eventParser.delimiter){ + if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){ client.log('Implementing larger buffer for this socket message. You may want to consider smaller messages'.notice); return; } diff --git a/lib/socketServer.js b/lib/socketServer.js index a3d0110..842bbf8 100644 --- a/lib/socketServer.js +++ b/lib/socketServer.js @@ -172,7 +172,7 @@ function init(path,config,log,port){ data=(this.ipcBuffer+=data); - if(data.slice(-1)!=eventParser.delimiter){ + if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){ server.log('Implementing larger buffer for this socket message. You may want to consider smaller messages'.notice); return; }