THRIFT-2390: no close event when connection lost
Client: node
Patch: gruzovator <gruzovator@gmail.com>
Github Pull Request: This closes #83
----
commit 270183f0507afc4346486cb58b8a684174eb13db
Author: gruzovator <gruzovator@gmail.com>
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 fb9215f..36451d5 100644
--- a/lib/nodejs/lib/thrift/connection.js
+++ b/lib/nodejs/lib/thrift/connection.js
@@ -168,9 +168,13 @@
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;