Changed downloads from agent from 4k to 16k blocks.

Ylian Saint-Hilaire committed Jul 21, 2020 at 17:09 UTC 4c2018245b620137c67b1bc7e207bef077d90100
1 file changed +3 -3
agents/meshcore.js
+3 -3
@@ -2012,10 +2012,10 @@ function createMeshCore(agent) {
2012 // Send the next download block(s)
2013 while (sendNextBlock > 0) {
2014 sendNextBlock--;
2015 - var buf = new Buffer(4096);
2016 - var len = fs.readSync(this.filedownload.f, buf, 4, 4092, null);
2015 + var buf = new Buffer(16384);
2016 + var len = fs.readSync(this.filedownload.f, buf, 4, 16380, null);
2017 this.filedownload.ptr += len;
2018 - if (len < 4092) { buf.writeInt32BE(0x01000001, 0); fs.closeSync(this.filedownload.f); delete this.filedownload; sendNextBlock = 0; } else { buf.writeInt32BE(0x01000000, 0); }
2018 + if (len < 16380) { buf.writeInt32BE(0x01000001, 0); fs.closeSync(this.filedownload.f); delete this.filedownload; sendNextBlock = 0; } else { buf.writeInt32BE(0x01000000, 0); }
2019 this.write(buf.slice(0, len + 4)); // Write as binary
2020 }
2021 break;