diff options
Diffstat (limited to 'webclients/novnc/include/playback.js')
-rw-r--r-- | webclients/novnc/include/playback.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/webclients/novnc/include/playback.js b/webclients/novnc/include/playback.js index a21c7b6..7756529 100644 --- a/webclients/novnc/include/playback.js +++ b/webclients/novnc/include/playback.js @@ -1,7 +1,7 @@ /* * noVNC: HTML5 VNC client * Copyright (C) 2012 Joel Martin - * Licensed under LGPL-3 (see LICENSE.LGPL-3) + * Licensed under MPL 2.0 (see LICENSE.txt) */ "use strict"; @@ -79,10 +79,22 @@ queue_next_packet = function () { } }; +var bytes_processed = 0; + do_packet = function () { //Util.Debug("Processing frame: " + frame_idx); - var frame = VNC_frame_data[frame_idx]; - rfb.recv_message({'data' : frame.slice(frame.indexOf('{', 1) + 1)}); + var frame = VNC_frame_data[frame_idx], + start = frame.indexOf('{', 1) + 1; + bytes_processed += frame.length - start; + if (VNC_frame_encoding === 'binary') { + var u8 = new Uint8Array(frame.length - start); + for (var i = 0; i < frame.length - start; i++) { + u8[i] = frame.charCodeAt(start + i); + } + rfb.recv_message({'data' : u8}); + } else { + rfb.recv_message({'data' : frame.slice(start)}); + } frame_idx += 1; queue_next_packet(); |