From 4ee55e01266769ea0711f74464162ba190a7e3a9 Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Wed, 6 Jan 2016 13:26:26 -0500 Subject: [PATCH] Fixed vnc_perf.html This commit updates vnc_perf.html so that it works with the current version of noVNC. It also introduces a utility to convert noVNC session recordings recorded in base64-mode to binary-mode recordings, since noVNC no longer supports base64-mode. Fixes #479. --- tests/vnc_perf.html | 24 ++++++++++++++---------- tests/vnc_playback.html | 2 +- utils/b64-to-binary.pl | 17 +++++++++++++++++ 3 files changed, 32 insertions(+), 11 deletions(-) create mode 100755 utils/b64-to-binary.pl diff --git a/tests/vnc_perf.html b/tests/vnc_perf.html index 51295789..9acea882 100644 --- a/tests/vnc_perf.html +++ b/tests/vnc_perf.html @@ -38,17 +38,23 @@ - - + diff --git a/tests/vnc_playback.html b/tests/vnc_playback.html index f36f1e65..cfc5953b 100644 --- a/tests/vnc_playback.html +++ b/tests/vnc_playback.html @@ -40,7 +40,7 @@ diff --git a/utils/b64-to-binary.pl b/utils/b64-to-binary.pl new file mode 100755 index 00000000..280e28c9 --- /dev/null +++ b/utils/b64-to-binary.pl @@ -0,0 +1,17 @@ +#!/usr/bin/env perl +use MIME::Base64; + +for (<>) { + unless (/^'([{}])(\d+)\1(.+?)',$/) { + print; + next; + } + + my ($dir, $amt, $b64) = ($1, $2, $3); + + my $decoded = MIME::Base64::decode($b64) or die "Could not base64-decode line `$_`"; + + my $decoded_escaped = join "", map { "\\x$_" } unpack("(H2)*", $decoded); + + print "'${dir}${amt}${dir}${decoded_escaped}',\n"; +}