Commit fb007628 authored by Joel Martin's avatar Joel Martin

Add Javascript variable container to record data.

- This allows the recorded data to be immediately usable by
  tests/vnc_playback.html
parent 1a5dd77d
...@@ -140,7 +140,11 @@ ...@@ -140,7 +140,11 @@
//message("Processing frame: " + frame_idx); //message("Processing frame: " + frame_idx);
if (frame) { if (frame) {
if (frame === 'EOF') {
//message("Found EOF");
} else {
rfb.recv_message({'data' : frame.slice(frame.indexOf('{', 1)+1)}); rfb.recv_message({'data' : frame.slice(frame.indexOf('{', 1)+1)});
}
frame_idx++; frame_idx++;
} }
......
...@@ -105,7 +105,8 @@ def proxy_handler(client): ...@@ -105,7 +105,8 @@ def proxy_handler(client):
if settings['record']: if settings['record']:
print "Opening record file: %s" % settings['record'] print "Opening record file: %s" % settings['record']
rec = open(settings['record'], 'a') rec = open(settings['record'], 'w+')
rec.write("var VNC_frame_data = [\n")
print "Connecting to: %s:%s" % (target_host, target_port) print "Connecting to: %s:%s" % (target_host, target_port)
tsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) tsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
...@@ -117,7 +118,9 @@ def proxy_handler(client): ...@@ -117,7 +118,9 @@ def proxy_handler(client):
do_proxy(client, tsock) do_proxy(client, tsock)
except: except:
if tsock: tsock.close() if tsock: tsock.close()
if rec: rec.close() if rec:
rec.write("'EOF']\n")
rec.close()
raise raise
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment