THRIFT-4480 - Handle seqid = 0
Client: js
This closes #1487
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 @@
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 @@
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.writeMessageEnd = function() {
- if (this._seqid) {
+ if (this._seqid !== null) {
this._seqid = null;
} else {
log.warning('No seqid to unset');