From: jfarrell Date: Tue, 18 Mar 2014 13:24:34 +0000 (-0400) Subject: THRIFT-2390: no close event when connection lost X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=55cd520edfc2f808da08cb22f2faf53bf04de47c;p=common%2Fthrift.git THRIFT-2390: no close event when connection lost Client: node Patch: gruzovator Github Pull Request: This closes #83 ---- commit 270183f0507afc4346486cb58b8a684174eb13db Author: gruzovator Date: 2014-03-18T12:23:21Z fix for THRIFT-2390 fix for THRIFT-2390 (no close event when connection lost) --- diff --git a/lib/nodejs/lib/thrift/connection.js b/lib/nodejs/lib/thrift/connection.js index fb9215f2..36451d55 100644 --- a/lib/nodejs/lib/thrift/connection.js +++ b/lib/nodejs/lib/thrift/connection.js @@ -168,9 +168,13 @@ Connection.prototype.connection_gone = function () { var self = this; // If a retry is already in progress, just let that happen - if (this.retry_timer || !this.max_attempts) { + if (this.retry_timer) { return; } + if (!this.max_attempts) { + self.emit("close"); + return; + } this.connected = false; this.ready = false;