From 545198b37873de6d2811390c077336e1c2f60a65 Mon Sep 17 00:00:00 2001 From: vedmalex Date: Thu, 29 Mar 2012 16:44:35 +0400 Subject: [PATCH] fixed: issue with error loop in pipe code so this code make error recurrung call and as the result stack overflow when come things wrong with connection lost connection or dns lookup failed var cleartext = pair.cleartext; cleartext.socket = socket; function onerror(e) { if (cleartext._controlReleased) cleartext.socket.emit('error', e);// in this line we call emit error event in recurring way. } socket.on('error', onerror);// this code the same as cleartext.socket.on('error', onerror) --- imap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imap.js b/imap.js index 624ef4e..f7857da 100644 --- a/imap.js +++ b/imap.js @@ -1695,7 +1695,7 @@ function pipe(pair, socket) { function onerror(e) { if (cleartext._controlReleased) - cleartext.socket.emit('error', e); + cleartext.emit('error', e); } function onclose() {