mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 21:02:53 -05:00
fix webrtc file upload maybe #6309
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
@@ -5215,6 +5215,7 @@
|
||||
desk.m.mouseCursorActive(xxcurrentView == 11);
|
||||
desk.shortid = shortid;
|
||||
desk.attemptWebRTC = attemptWebRTC;
|
||||
desk.webrtcconfig = webrtcconfiguration;
|
||||
desk.onStateChanged = onMultiDesktopStateChange;
|
||||
//desk.onConsoleMessageChange = function () { console.log('CONSOLEMSG:', desk.consoleMessage); }
|
||||
desk.m.ImageType = multidesktopsettings.agentencoding; // Send 4 if WebP is supported, otherwise send 1 for JPEG.
|
||||
@@ -11020,6 +11021,7 @@
|
||||
files.contype = contype;
|
||||
files.options = { consent: consent }
|
||||
files.attemptWebRTC = attemptWebRTC;
|
||||
files.webrtcconfig = webrtcconfiguration;
|
||||
files.onStateChanged = onFilesStateChange;
|
||||
files.onConsoleMessageChange = function () {
|
||||
if (files.consoleMessage) {
|
||||
@@ -11760,7 +11762,7 @@
|
||||
if (start >= data.byteLength) {
|
||||
files.sendText(JSON.stringify({ action: 'uploaddone', reqid: uploadFile.xfilePtr }));
|
||||
} else {
|
||||
var end = uploadFile.xptr + 65565;
|
||||
var end = uploadFile.xptr + (attemptWebRTC ? 16384 : 65536);
|
||||
if (end > data.byteLength) { if (dataPriming == true) { return; } end = data.byteLength; }
|
||||
var dataslice = new Uint8Array(data.slice(start, end))
|
||||
if ((dataslice[0] == 123) || (dataslice[0] == 0)) {
|
||||
@@ -11776,7 +11778,7 @@
|
||||
} else if (uploadFile.xfile) {
|
||||
if (uploadFile.xreader != null) return; // Data reading already in process
|
||||
if (uploadFile.xptr >= uploadFile.xfile.size) return;
|
||||
var end = uploadFile.xptr + 65565;
|
||||
var end = uploadFile.xptr + (attemptWebRTC ? 16384 : 65536);
|
||||
if (end > uploadFile.xfile.size) { if (dataPriming == true) { return; } end = uploadFile.xfile.size; }
|
||||
uploadFile.xreader = new FileReader();
|
||||
uploadFile.xreader.onerror = function (err) { console.log(err); }
|
||||
|
||||
Reference in New Issue
Block a user