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); });