From 2f3143a9059dee08c6672c5473257ed8094e2d4c Mon Sep 17 00:00:00 2001 From: Matthias Seidl Date: Wed, 21 Oct 2015 12:48:22 +0200 Subject: [PATCH] fixed issue #5 using mirc style transfer of files larger 4GB --- lib/xdcc.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/xdcc.js b/lib/xdcc.js index bc91861..47d0fb1 100644 --- a/lib/xdcc.js +++ b/lib/xdcc.js @@ -61,7 +61,14 @@ irc.Client.prototype.getXdcc = function(hostUser, hostCommand, path, isFile) { client.on('data', function(data) { file.write(data); received += data.length; - sendBuffer.writeUInt32BE(received, 0); + if(received > 0xffffffff) + { + sendBuffer.writeUInt32BE(received-0xffffffff,0); + } + else + { + sendBuffer.writeUInt32BE(received, 0); + } client.write(sendBuffer); self.emit('xdcc-data', received, details); });