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

TCP-request node - only write payload

to close #1869
This commit is contained in:
Dave Conway-Jones 2018-08-30 20:47:39 +01:00
parent c0e7d6d826
commit 8e9815fb91
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4

View File

@ -33,9 +33,7 @@ module.exports = function(RED) {
*/
const enqueue = (queue, item) => {
// drop msgs from front of queue if size is going to be exceeded
if (queue.size() === msgQueueSize) {
queue.shift();
}
if (queue.size() === msgQueueSize) { queue.shift(); }
queue.push(item);
return queue;
};
@ -646,7 +644,7 @@ module.exports = function(RED) {
}
else if (!clients[connection_id].connecting && clients[connection_id].connected) {
if (clients[connection_id] && clients[connection_id].client) {
clients[connection_id].client.write(dequeue(clients[connection_id].msgQueue));
clients[connection_id].client.write(dequeue(clients[connection_id].msgQueue).payload);
}
}
});