Commit 30e53963 authored by Joel Martin's avatar Joel Martin

Less debug output.

parent a4807656
...@@ -88,7 +88,7 @@ ctxDisable: function (e) { ...@@ -88,7 +88,7 @@ ctxDisable: function (e) {
init: function (id, width, height, true_color, keyDown, keyUp, init: function (id, width, height, true_color, keyDown, keyUp,
mouseDown, mouseUp, mouseMove, mouseWheel) { mouseDown, mouseUp, mouseMove, mouseWheel) {
console.log(">> Canvas.init"); //console.log(">> Canvas.init");
Canvas.id = id; Canvas.id = id;
...@@ -126,7 +126,7 @@ init: function (id, width, height, true_color, keyDown, keyUp, ...@@ -126,7 +126,7 @@ init: function (id, width, height, true_color, keyDown, keyUp,
Canvas.prefer_js = true; Canvas.prefer_js = true;
} }
console.log("<< Canvas.init"); //console.log("<< Canvas.init");
}, },
clear: function () { clear: function () {
......
...@@ -108,7 +108,7 @@ load: function () { ...@@ -108,7 +108,7 @@ load: function () {
console.log("Using native WebSockets"); console.log("Using native WebSockets");
RFB.updateState('disconnected', 'Disconnected'); RFB.updateState('disconnected', 'Disconnected');
} else { } else {
console.log("Using web-socket-js flash bridge"); console.warn("Using web-socket-js flash bridge");
if ((! Browser.Plugins.Flash) || if ((! Browser.Plugins.Flash) ||
(Browser.Plugins.Flash.version < 9)) { (Browser.Plugins.Flash.version < 9)) {
RFB.updateState('failed', "WebSockets or Adobe Flash is required"); RFB.updateState('failed', "WebSockets or Adobe Flash is required");
...@@ -137,7 +137,7 @@ load: function () { ...@@ -137,7 +137,7 @@ load: function () {
}, },
connect: function (host, port, password, encrypt, true_color) { connect: function (host, port, password, encrypt, true_color) {
console.log(">> connect"); //console.log(">> connect");
RFB.host = host; RFB.host = host;
RFB.port = port; RFB.port = port;
...@@ -168,12 +168,12 @@ connect: function (host, port, password, encrypt, true_color) { ...@@ -168,12 +168,12 @@ connect: function (host, port, password, encrypt, true_color) {
RFB.init_ws(); RFB.init_ws();
RFB.updateState('ProtocolVersion'); RFB.updateState('ProtocolVersion');
console.log("<< connect"); //console.log("<< connect");
}, },
disconnect: function () { disconnect: function () {
console.log(">> disconnect"); //console.log(">> disconnect");
if ((RFB.ws) && (RFB.ws.readyState === WebSocket.OPEN)) { if ((RFB.ws) && (RFB.ws.readyState === WebSocket.OPEN)) {
RFB.updateState('closed'); RFB.updateState('closed');
RFB.ws.onmessage = function (e) { return; }; RFB.ws.onmessage = function (e) { return; };
...@@ -187,7 +187,7 @@ disconnect: function () { ...@@ -187,7 +187,7 @@ disconnect: function () {
} }
RFB.updateState('disconnected', 'Disconnected'); RFB.updateState('disconnected', 'Disconnected');
console.log("<< disconnect"); //console.log("<< disconnect");
}, },
clipboardPasteFrom: function (text) { clipboardPasteFrom: function (text) {
...@@ -277,7 +277,7 @@ mouse_arr : [], ...@@ -277,7 +277,7 @@ mouse_arr : [],
/* RFB/VNC initialisation */ /* RFB/VNC initialisation */
init_msg: function () { init_msg: function () {
console.log(">> init_msg [RFB.state '" + RFB.state + "']"); //console.log(">> init_msg [RFB.state '" + RFB.state + "']");
var RQ = RFB.RQ, strlen, reason, reason_len, var RQ = RFB.RQ, strlen, reason, reason_len,
sversion, cversion, types, num_types, challenge, response, sversion, cversion, types, num_types, challenge, response,
...@@ -345,11 +345,11 @@ init_msg: function () { ...@@ -345,11 +345,11 @@ init_msg: function () {
// Fall through // Fall through
case 'Authentication' : case 'Authentication' :
console.log("Security auth scheme: " + RFB.auth_scheme); //console.log("Security auth scheme: " + RFB.auth_scheme);
switch (RFB.auth_scheme) { switch (RFB.auth_scheme) {
case 0: // connection failed case 0: // connection failed
if (RQ.length < 4) { if (RQ.length < 4) {
console.log(" waiting for auth reason bytes"); //console.log(" waiting for auth reason bytes");
return; return;
} }
strlen = RQ.shift32(); strlen = RQ.shift32();
...@@ -367,7 +367,7 @@ init_msg: function () { ...@@ -367,7 +367,7 @@ init_msg: function () {
return; return;
} }
if (RQ.length < 16) { if (RQ.length < 16) {
console.log(" waiting for auth challenge bytes"); //console.log(" waiting for auth challenge bytes");
return; return;
} }
challenge = RQ.shiftBytes(16); challenge = RQ.shiftBytes(16);
...@@ -378,7 +378,7 @@ init_msg: function () { ...@@ -378,7 +378,7 @@ init_msg: function () {
//console.log("Response: " + response + //console.log("Response: " + response +
// " (" + response.length + ")"); // " (" + response.length + ")");
console.log("Sending DES encrypted auth response"); //console.log("Sending DES encrypted auth response");
RFB.send_array(response); RFB.send_array(response);
RFB.updateState('SecurityResult'); RFB.updateState('SecurityResult');
break; break;
...@@ -491,7 +491,7 @@ normal_msg: function () { ...@@ -491,7 +491,7 @@ normal_msg: function () {
if (FBU.rects === 0) { if (FBU.rects === 0) {
if (RQ.length < 3) { if (RQ.length < 3) {
RQ.unshift(msg_type); RQ.unshift(msg_type);
console.log(" waiting for FBU header bytes"); //console.log(" waiting for FBU header bytes");
return false; return false;
} }
RQ.shift8(); RQ.shift8();
...@@ -508,7 +508,7 @@ normal_msg: function () { ...@@ -508,7 +508,7 @@ normal_msg: function () {
while ((FBU.rects > 0) && (RQ.length >= FBU.bytes)) { while ((FBU.rects > 0) && (RQ.length >= FBU.bytes)) {
if (FBU.bytes === 0) { if (FBU.bytes === 0) {
if (RQ.length < 12) { if (RQ.length < 12) {
console.log(" waiting for rect header bytes"); //console.log(" waiting for rect header bytes");
return false; return false;
} }
/* New FramebufferUpdate */ /* New FramebufferUpdate */
...@@ -599,7 +599,7 @@ normal_msg: function () { ...@@ -599,7 +599,7 @@ normal_msg: function () {
} }
if (RFB.cuttext === 'header') { if (RFB.cuttext === 'header') {
if (RQ.length < 7) { if (RQ.length < 7) {
console.log("waiting for ServerCutText header"); //console.log("waiting for ServerCutText header");
return false; return false;
} }
RQ.shiftBytes(3); // Padding RQ.shiftBytes(3); // Padding
...@@ -607,7 +607,7 @@ normal_msg: function () { ...@@ -607,7 +607,7 @@ normal_msg: function () {
} }
RFB.cuttext = 'bytes'; RFB.cuttext = 'bytes';
if (RQ.length < RFB.ct_length) { if (RQ.length < RFB.ct_length) {
console.log("waiting for ServerCutText bytes"); //console.log("waiting for ServerCutText bytes");
return false; return false;
} }
RFB.clipboardCopyTo(RQ.shiftStr(RFB.ct_length)); RFB.clipboardCopyTo(RQ.shiftStr(RFB.ct_length));
...@@ -726,7 +726,7 @@ display_hextile: function() { ...@@ -726,7 +726,7 @@ display_hextile: function() {
while (FBU.tiles > 0) { while (FBU.tiles > 0) {
FBU.bytes = 1; FBU.bytes = 1;
if (RQ.length < FBU.bytes) { if (RQ.length < FBU.bytes) {
console.log(" waiting for HEXTILE subencoding byte"); //console.log(" waiting for HEXTILE subencoding byte");
return; return;
} }
subencoding = RQ[0]; // Peek subencoding = RQ[0]; // Peek
...@@ -760,7 +760,7 @@ display_hextile: function() { ...@@ -760,7 +760,7 @@ display_hextile: function() {
FBU.bytes++; // Since we aren't shifting it off FBU.bytes++; // Since we aren't shifting it off
if (RQ.length < FBU.bytes) { if (RQ.length < FBU.bytes) {
/* Wait for subrects byte */ /* Wait for subrects byte */
console.log(" waiting for hextile subrects header byte"); //console.log(" waiting for hextile subrects header byte");
return; return;
} }
subrects = RQ[FBU.bytes-1]; // Peek subrects = RQ[FBU.bytes-1]; // Peek
...@@ -859,7 +859,7 @@ display_tight_png: function() { ...@@ -859,7 +859,7 @@ display_tight_png: function() {
FBU.bytes = 1; // compression-control byte FBU.bytes = 1; // compression-control byte
if (RQ.length < FBU.bytes) { if (RQ.length < FBU.bytes) {
console.log(" waiting for TIGHT compression-control byte"); //console.log(" waiting for TIGHT compression-control byte");
return; return;
} }
...@@ -893,7 +893,7 @@ display_tight_png: function() { ...@@ -893,7 +893,7 @@ display_tight_png: function() {
} }
if (RQ.length < FBU.bytes) { if (RQ.length < FBU.bytes) {
console.log(" waiting for TIGHT " + cmode + " bytes"); //console.log(" waiting for TIGHT " + cmode + " bytes");
return; return;
} }
...@@ -1027,7 +1027,7 @@ clientEncodings: function () { ...@@ -1027,7 +1027,7 @@ clientEncodings: function () {
for (i=0; i<RFB.encodings.length; i++) { for (i=0; i<RFB.encodings.length; i++) {
arr.push32(RFB.encodings[i][1]); arr.push32(RFB.encodings[i][1]);
} }
console.log("<< clientEncodings: " + arr); //console.log("<< clientEncodings: " + arr);
return arr; return arr;
}, },
...@@ -1372,9 +1372,7 @@ updateState: function(state, statusMsg) { ...@@ -1372,9 +1372,7 @@ updateState: function(state, statusMsg) {
func = function(msg) { console.error(msg); }; func = function(msg) { console.error(msg); };
break; break;
case 'normal': case 'normal':
break;
case 'disconnected': case 'disconnected':
break;
default: default:
func = function(msg) { console.warn(msg); }; func = function(msg) { console.warn(msg); };
break; break;
...@@ -1398,7 +1396,7 @@ updateState: function(state, statusMsg) { ...@@ -1398,7 +1396,7 @@ updateState: function(state, statusMsg) {
*/ */
init_ws: function () { init_ws: function () {
console.log(">> init_ws"); //console.log(">> init_ws");
var uri = "", vars = []; var uri = "", vars = [];
if (RFB.encrypt) { if (RFB.encrypt) {
...@@ -1421,7 +1419,7 @@ init_ws: function () { ...@@ -1421,7 +1419,7 @@ init_ws: function () {
RFB.ws.onmessage = RFB.recv_message; RFB.ws.onmessage = RFB.recv_message;
RFB.ws.onopen = function(e) { RFB.ws.onopen = function(e) {
console.log(">> WebSocket.onopen"); //console.log(">> WebSocket.onopen");
RFB.updateState('ProtocolVersion', "Starting VNC handshake"); RFB.updateState('ProtocolVersion', "Starting VNC handshake");
RFB.sendID = setInterval(function() { RFB.sendID = setInterval(function() {
/* /*
...@@ -1437,13 +1435,13 @@ init_ws: function () { ...@@ -1437,13 +1435,13 @@ init_ws: function () {
console.log("Delaying send"); console.log("Delaying send");
} }
}, 50); }, 50);
console.log("<< WebSocket.onopen"); //console.log("<< WebSocket.onopen");
}; };
RFB.ws.onclose = function(e) { RFB.ws.onclose = function(e) {
console.log(">> WebSocket.onclose"); //console.log(">> WebSocket.onclose");
clearInterval(RFB.sendID); clearInterval(RFB.sendID);
RFB.updateState('disconnected', 'VNC disconnected'); RFB.updateState('disconnected', 'VNC disconnected');
console.log("<< WebSocket.onclose"); //console.log("<< WebSocket.onclose");
}; };
RFB.ws.onerror = function(e) { RFB.ws.onerror = function(e) {
console.error(">> WebSocket.onerror"); console.error(">> WebSocket.onerror");
...@@ -1451,7 +1449,7 @@ init_ws: function () { ...@@ -1451,7 +1449,7 @@ init_ws: function () {
console.error("<< WebSocket.onerror"); console.error("<< WebSocket.onerror");
}; };
console.log("<< init_ws"); //console.log("<< init_ws");
}, },
init_vars: function () { init_vars: function () {
......
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