mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
Update onerror for client. Add onerror for output stream. Handle abort instruction. Track streams by index.
This commit is contained in:
@@ -1104,12 +1104,21 @@ GuacUI.Client.attach = function(guac) {
|
||||
// Open file for writing
|
||||
var stream = GuacUI.Client.attachedClient.createFileStream(file.type, file.name);
|
||||
|
||||
var valid = true;
|
||||
var bytes = new Uint8Array(reader.result);
|
||||
var offset = 0;
|
||||
|
||||
// Invalidate stream on all errors
|
||||
stream.onerror = function() {
|
||||
valid = false;
|
||||
};
|
||||
|
||||
// Create upload callback
|
||||
function continueUpload() {
|
||||
|
||||
// Abort upload if stream is invalid
|
||||
if (!valid) return false;
|
||||
|
||||
// Encode packet as base64
|
||||
var slice = bytes.subarray(offset, offset+4096);
|
||||
var base64 = _get_base64(slice);
|
||||
|
Reference in New Issue
Block a user