From 60c7937bfbedad43f56f8e50f463f1f3077b69a3 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 21 Jul 2020 17:09:11 -0700 Subject: [PATCH] Changed downloads from agent from 4k to 16k blocks. --- agents/meshcore.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index 2ff2e4ec..80e67bdf 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -2012,10 +2012,10 @@ function createMeshCore(agent) { // Send the next download block(s) while (sendNextBlock > 0) { sendNextBlock--; - var buf = new Buffer(4096); - var len = fs.readSync(this.filedownload.f, buf, 4, 4092, null); + var buf = new Buffer(16384); + var len = fs.readSync(this.filedownload.f, buf, 4, 16380, null); this.filedownload.ptr += len; - if (len < 4092) { buf.writeInt32BE(0x01000001, 0); fs.closeSync(this.filedownload.f); delete this.filedownload; sendNextBlock = 0; } else { buf.writeInt32BE(0x01000000, 0); } + if (len < 16380) { buf.writeInt32BE(0x01000001, 0); fs.closeSync(this.filedownload.f); delete this.filedownload; sendNextBlock = 0; } else { buf.writeInt32BE(0x01000000, 0); } this.write(buf.slice(0, len + 4)); // Write as binary } break;