From 8dbe2ef0a0b5a7baf3ce9fe7df6a246f855d6599 Mon Sep 17 00:00:00 2001 From: Brian Forbis Date: Wed, 31 Jan 2018 00:34:55 -0500 Subject: [PATCH] THRIFT-4480 - Handle seqid = 0 --- lib/nodejs/lib/thrift/binary_protocol.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/nodejs/lib/thrift/binary_protocol.js b/lib/nodejs/lib/thrift/binary_protocol.js index 0c0ee50be66..b57c8c57635 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');