From 6a70dd5582121511136518dea325b0119cfc7d3f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 19 Mar 2014 14:35:31 -0700 Subject: [PATCH] GUAC-549: Use Guacamole.Status for ack messages. --- .../src/main/webapp/modules/ArrayBufferWriter.js | 8 +++----- guacamole-common-js/src/main/webapp/modules/Client.js | 2 +- .../src/main/webapp/modules/OutputStream.js | 4 +--- .../src/main/webapp/modules/StringWriter.js | 8 +++----- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/guacamole-common-js/src/main/webapp/modules/ArrayBufferWriter.js b/guacamole-common-js/src/main/webapp/modules/ArrayBufferWriter.js index c6d87830e..feda39017 100644 --- a/guacamole-common-js/src/main/webapp/modules/ArrayBufferWriter.js +++ b/guacamole-common-js/src/main/webapp/modules/ArrayBufferWriter.js @@ -39,9 +39,9 @@ Guacamole.ArrayBufferWriter = function(stream) { var guac_writer = this; // Simply call onack for acknowledgements - stream.onack = function(message, code) { + stream.onack = function(status) { if (guac_writer.onack) - guac_writer.onack(message, code); + guac_writer.onack(status); }; /** @@ -74,9 +74,7 @@ Guacamole.ArrayBufferWriter = function(stream) { /** * Fired for received data, if acknowledged by the server. * @event - * @param {String} message A human-readable status message related to the - * operation performed. - * @param {Number} code The error code associated with the operation. + * @param {Guacamole.Status} status The status of the operation. */ this.onack = null; diff --git a/guacamole-common-js/src/main/webapp/modules/Client.js b/guacamole-common-js/src/main/webapp/modules/Client.js index 47525a89f..1ec474317 100644 --- a/guacamole-common-js/src/main/webapp/modules/Client.js +++ b/guacamole-common-js/src/main/webapp/modules/Client.js @@ -564,7 +564,7 @@ Guacamole.Client = function(tunnel) { // Signal ack if handler defined if (stream.onack) - stream.onack(reason, code); + stream.onack(new Guacamole.Status(code, reason)); // If code is an error, invalidate stream if (code >= 0x0100) { diff --git a/guacamole-common-js/src/main/webapp/modules/OutputStream.js b/guacamole-common-js/src/main/webapp/modules/OutputStream.js index 70cebd9f9..a024005bd 100644 --- a/guacamole-common-js/src/main/webapp/modules/OutputStream.js +++ b/guacamole-common-js/src/main/webapp/modules/OutputStream.js @@ -48,9 +48,7 @@ Guacamole.OutputStream = function(client, index) { * that a stream operation has completed, or an error has occurred. * * @event - * @param {String} message A human-readable status message related to the - * operation performed. - * @param {Number} code The error code associated with the operation. + * @param {Guacamole.Status} status The status of the operation. */ this.onack = null; diff --git a/guacamole-common-js/src/main/webapp/modules/StringWriter.js b/guacamole-common-js/src/main/webapp/modules/StringWriter.js index b246d8ad6..b11c159ce 100644 --- a/guacamole-common-js/src/main/webapp/modules/StringWriter.js +++ b/guacamole-common-js/src/main/webapp/modules/StringWriter.js @@ -39,9 +39,9 @@ Guacamole.StringWriter = function(stream) { var guac_writer = this; // Simply call onack for acknowledgements - stream.onack = function(message, code) { + stream.onack = function(status) { if (guac_writer.onack) - guac_writer.onack(message, code); + guac_writer.onack(status); }; /** @@ -64,9 +64,7 @@ Guacamole.StringWriter = function(stream) { /** * Fired for received data, if acknowledged by the server. * @event - * @param {String} message A human-readable status message related to the - * operation performed. - * @param {Number} code The error code associated with the operation. + * @param {Guacamole.Status} status The status of the operation. */ this.onack = null;