1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Stability improvements.

This commit is contained in:
Ylian Saint-Hilaire 2018-02-13 12:28:11 -08:00
parent 0c3c0973bc
commit 205c7d96e0
13 changed files with 28 additions and 29 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -660,17 +660,10 @@ function createMeshCore(agent) {
while (sendNextBlock > 0) {
sendNextBlock--;
var buf = new Buffer(4096);
buf.writeInt32BE(0x01020304, 0);
var len = fs.readSync(this.filedownload.f, buf, 4, 4092, null);
this.filedownload.ptr += len;
if (len > 0) {
this.write(buf.slice(0, len + 4)); // Write as binary
} else {
fs.closeSync(this.filedownload.f);
this.write({ action: 'download', sub: 'done', id: this.filedownload.id });
delete this.filedownload;
sendNextBlock = 0;
}
if (len < 4092) { 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;
}

View file

@ -107,7 +107,7 @@ DownloadAgent() {
# initd
wget $url/meshagents?script=2 -q --no-check-certificate -O /etc/init.d/meshagent
chmod +x /etc/init.d/meshagent
update-rc.d meshagent default # creates symlinks for rc.d
update-rc.d meshagent defaults # creates symlinks for rc.d
service meshagent start
else
# upstart / others (???)