Fixed MeshCtrl file upload.

This commit is contained in:
Ylian Saint-Hilaire 2020-10-20 12:10:05 -07:00
parent b53cbc67a5
commit 91830f89a3

View File

@ -1349,6 +1349,7 @@ function serverConnect() {
case 'addusertousergroup': case 'addusertousergroup':
case 'removeuserfromusergroup': case 'removeuserfromusergroup':
case 'userbroadcast': { // BROADCAST case 'userbroadcast': { // BROADCAST
if (settings.cmd == 'upload') return;
if ((settings.multiresponse != null) && (settings.multiresponse > 1)) { settings.multiresponse--; break; } if ((settings.multiresponse != null) && (settings.multiresponse > 1)) { settings.multiresponse--; break; }
if (data.responseid == 'meshctrl') { if (data.responseid == 'meshctrl') {
if (data.meshid) { console.log(data.result, data.meshid); } if (data.meshid) { console.log(data.result, data.meshid); }
@ -1660,7 +1661,7 @@ function connectTunnel(url) {
settings.uploadSize = require('fs').statSync(args.file).size; settings.uploadSize = require('fs').statSync(args.file).size;
settings.uploadFile = require('fs').openSync(args.file, 'r'); settings.uploadFile = require('fs').openSync(args.file, 'r');
settings.uploadPtr = 0; settings.uploadPtr = 0;
settings.tunnelws.send(JSON.stringify({ action: 'upload', reqid: 'up', path: require('path').dirname(args.target), name: require('path').basename(args.file), size: settings.uploadSize })); settings.tunnelws.send(JSON.stringify({ action: 'upload', reqid: 'up', path: args.target, name: require('path').basename(args.file), size: settings.uploadSize }));
} }
}); });
} else if (settings.cmd == 'download') { } else if (settings.cmd == 'download') {