Skip to content

Commit

Permalink
lost change
Browse files Browse the repository at this point in the history
  • Loading branch information
kkamkou committed Nov 6, 2018
1 parent a593638 commit c749803
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/adapter/udp.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ var _ = require('lodash'),
dgram = require('dgram'),
abstract = require('./abstract');

// compatibility
var buffer = require('../compatibility/buffer');

/**
* [1] /src/main/java/org/graylog2/inputs/codecs/gelf/GELFMessageChunk.java
* at https://github.com/Graylog2/graylog2-server/blob/master/graylog2-server
Expand Down Expand Up @@ -109,8 +112,9 @@ adapter.send = function (message, callback) {
}

var chunk = chunks[idx],
bytes = self.specification.magicBytes.concat(packetId, idx, chunksCount, chunk),
packet = Buffer.from ? Buffer.from(bytes) : new Buffer(bytes);
packet = buffer.from(
self.specification.magicBytes.concat(packetId, idx, chunksCount, chunk)
);
client.send(
packet, 0, packet.length, self.options.port, self.options.host,
function (err, bytesSent) {
Expand Down

0 comments on commit c749803

Please sign in to comment.