From ad2953817634fd391d4081d146ca799e2a447c65 Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Tue, 8 Dec 2020 10:20:24 +0100 Subject: [PATCH] fix datagram creation --- lib/transport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/transport.js b/lib/transport.js index a869299..18021ee 100644 --- a/lib/transport.js +++ b/lib/transport.js @@ -40,7 +40,7 @@ Transport.prototype.prepareDatagrams = function (chunks, cb) { const createDatagramArray = function (msgId) { for(var i = 0; i < chunks.length; i++) { - datagrams[i] = new Buffer(gelfBytes.concat(msgId, i, length, chunks[i])); + datagrams[i] = Buffer.concat([Buffer.from(gelfBytes), msgId, Buffer.from([i, length]), chunks[i]]); } cb && cb(null, datagrams);