1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix split character in TCP Request node

This commit is contained in:
Nathanaël Lécaudé 2016-08-02 11:09:41 -04:00
parent 3f86b660ed
commit 6cbc1afb9b

View File

@ -393,8 +393,11 @@ module.exports = function(RED) {
this.splitc = n.splitc; this.splitc = n.splitc;
if (this.out != "char") { this.splitc = Number(this.splitc); } if (this.out != "char") { this.splitc = Number(this.splitc); }
else { this.splitc = this.splitc.replace("\\n",0x0A).replace("\\r",0x0D).replace("\\t",0x09).replace("\\e",0x1B).replace("\\f",0x0C).replace("\\0",0x00); } // jshint ignore:line else {
this.splitc = this.splitc.replace("\\n",0x0A).replace("\\r",0x0D).replace("\\t",0x09).replace("\\e",0x1B).replace("\\f",0x0C).replace("\\0",0x00);
if (typeof this.splitc == "string") { this.splitc = this.splitc.charCodeAt(0); }
} // jshint ignore:line
var buf; var buf;
if (this.out == "count") { if (this.out == "count") {
if (this.splitc === 0) { buf = new Buffer(1); } if (this.splitc === 0) { buf = new Buffer(1); }