mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
Only use encoding for write flags if it is numeric
This commit is contained in:
parent
ff25af0163
commit
ccb6cbe501
@ -86,7 +86,11 @@ function _write(chunk, encoding, callback) {
|
||||
/* jshint validthis: true */
|
||||
var batch = {};
|
||||
var message = this.serialize(chunk);
|
||||
message.grpcWriteFlags = encoding;
|
||||
if (_.isFinite(encoding)) {
|
||||
/* Attach the encoding if it is a finite number. This is the closest we
|
||||
* can get to checking that it is valid flags */
|
||||
message.grpcWriteFlags = encoding;
|
||||
}
|
||||
batch[grpc.opType.SEND_MESSAGE] = message;
|
||||
this.call.startBatch(batch, function(err, event) {
|
||||
if (err) {
|
||||
|
||||
@ -270,7 +270,11 @@ function _write(chunk, encoding, callback) {
|
||||
this.call.metadataSent = true;
|
||||
}
|
||||
var message = this.serialize(chunk);
|
||||
message.grpcWriteFlags = encoding;
|
||||
if (_.isFinite(encoding)) {
|
||||
/* Attach the encoding if it is a finite number. This is the closest we
|
||||
* can get to checking that it is valid flags */
|
||||
message.grpcWriteFlags = encoding;
|
||||
}
|
||||
batch[grpc.opType.SEND_MESSAGE] = message;
|
||||
this.call.startBatch(batch, function(err, value) {
|
||||
if (err) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user