Repository: thrift
Updated Branches:
  refs/heads/master 860a5f1ff -> b4f22ff30


THRIFT-4480 - Handle seqid = 0
Client: js

This closes #1487


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

Branch: refs/heads/master
Commit: b4f22ff30119ea5cadf9b16e97afdcabefe06696
Parents: 860a5f1
Author: Brian Forbis <bfor...@athenahealth.com>
Authored: Wed Jan 31 00:34:55 2018 -0500
Committer: James E. King III <jk...@apache.org>
Committed: Tue Mar 6 18:27:59 2018 -0500

----------------------------------------------------------------------
 lib/nodejs/lib/thrift/binary_protocol.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/b4f22ff3/lib/nodejs/lib/thrift/binary_protocol.js
----------------------------------------------------------------------
diff --git a/lib/nodejs/lib/thrift/binary_protocol.js 
b/lib/nodejs/lib/thrift/binary_protocol.js
index 0c0ee50..b57c8c5 100644
--- a/lib/nodejs/lib/thrift/binary_protocol.js
+++ b/lib/nodejs/lib/thrift/binary_protocol.js
@@ -37,6 +37,7 @@ function TBinaryProtocol(trans, strictRead, strictWrite) {
   this.trans = trans;
   this.strictRead = (strictRead !== undefined ? strictRead : false);
   this.strictWrite = (strictWrite !== undefined ? strictWrite : true);
+  this._seqid = null;
 };
 
 TBinaryProtocol.prototype.flush = function() {
@@ -54,7 +55,7 @@ TBinaryProtocol.prototype.writeMessageBegin = function(name, 
type, seqid) {
       this.writeI32(seqid);
     }
     // Record client seqid to find callback again
-    if (this._seqid) {
+    if (this._seqid !== null) {
       log.warning('SeqId already set', { 'name': name });
     } else {
       this._seqid = seqid;
@@ -63,7 +64,7 @@ TBinaryProtocol.prototype.writeMessageBegin = function(name, 
type, seqid) {
 };
 
 TBinaryProtocol.prototype.writeMessageEnd = function() {
-    if (this._seqid) {
+    if (this._seqid !== null) {
         this._seqid = null;
     } else {
         log.warning('No seqid to unset');

Reply via email to