Repository: thrift
Updated Branches:
  refs/heads/master 1c99e7079 -> 55cd520ed


THRIFT-2390: no close event when connection lost
Client: node
Patch: gruzovator <gruzova...@gmail.com>

Github Pull Request: This closes #83
----
commit 270183f0507afc4346486cb58b8a684174eb13db
Author: gruzovator <gruzova...@gmail.com>
Date:   2014-03-18T12:23:21Z

    fix for THRIFT-2390

    fix for THRIFT-2390 (no close event when connection lost)


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/55cd520e
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/55cd520e
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/55cd520e

Branch: refs/heads/master
Commit: 55cd520edfc2f808da08cb22f2faf53bf04de47c
Parents: 1c99e70
Author: jfarrell <jfarr...@apache.org>
Authored: Tue Mar 18 09:24:34 2014 -0400
Committer: jfarrell <jfarr...@apache.org>
Committed: Tue Mar 18 09:24:34 2014 -0400

----------------------------------------------------------------------
 lib/nodejs/lib/thrift/connection.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/55cd520e/lib/nodejs/lib/thrift/connection.js
----------------------------------------------------------------------
diff --git a/lib/nodejs/lib/thrift/connection.js 
b/lib/nodejs/lib/thrift/connection.js
index fb9215f..36451d5 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;

Reply via email to