diff --git a/agents/meshcore.js b/agents/meshcore.js index a192ad28b1..a0ea48e30a 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -3337,7 +3337,7 @@ function onTunnelData(data) if (cmd.sub == 'startack') { sendNextBlock = ((typeof cmd.ack == 'number') ? cmd.ack : 8); } else if (cmd.sub == 'stop') { delete this.filedownload; } else if (cmd.sub == 'ack') { sendNextBlock = 1; } } // Send the next download block(s) - while (sendNextBlock > 0) { + if (sendNextBlock > 0) { sendNextBlock--; var buf = Buffer.alloc(16384); var len = fs.readSync(this.filedownload.f, buf, 4, 16380, null);