diff --git a/kasmweb/core/decoders/raw.js b/kasmweb/core/decoders/raw.js index 4d84d7d..f47300f 100644 --- a/kasmweb/core/decoders/raw.js +++ b/kasmweb/core/decoders/raw.js @@ -13,6 +13,10 @@ export default class RawDecoder { } decodeRect(x, y, width, height, sock, display, depth) { + if ((width === 0) || (height === 0)) { + return true; + } + if (this._lines === 0) { this._lines = height; } diff --git a/kasmweb/tests/test.copyrect.js b/kasmweb/tests/test.copyrect.js index afb778f..20abc7e 100644 --- a/kasmweb/tests/test.copyrect.js +++ b/kasmweb/tests/test.copyrect.js @@ -17,7 +17,13 @@ function testDecodeRect(decoder, x, y, width, height, data, display, depth) { decoder.decodeRect(x, y, width, height, sock, display, depth); }); - sock._websocket._receiveData(new Uint8Array(data)); + // Empty messages are filtered at multiple layers, so we need to + // do a direct call + if (data.length === 0) { + decoder.decodeRect(x, y, width, height, sock, display, depth); + } else { + sock._websocket._receiveData(new Uint8Array(data)); + } display.flip(); } diff --git a/kasmweb/tests/test.hextile.js b/kasmweb/tests/test.hextile.js index bac415f..4d41dc9 100644 --- a/kasmweb/tests/test.hextile.js +++ b/kasmweb/tests/test.hextile.js @@ -17,7 +17,13 @@ function testDecodeRect(decoder, x, y, width, height, data, display, depth) { decoder.decodeRect(x, y, width, height, sock, display, depth); }); - sock._websocket._receiveData(new Uint8Array(data)); + // Empty messages are filtered at multiple layers, so we need to + // do a direct call + if (data.length === 0) { + decoder.decodeRect(x, y, width, height, sock, display, depth); + } else { + sock._websocket._receiveData(new Uint8Array(data)); + } display.flip(); } diff --git a/kasmweb/tests/test.raw.js b/kasmweb/tests/test.raw.js index 4830bbb..71a2b87 100644 --- a/kasmweb/tests/test.raw.js +++ b/kasmweb/tests/test.raw.js @@ -17,7 +17,13 @@ function testDecodeRect(decoder, x, y, width, height, data, display, depth) { decoder.decodeRect(x, y, width, height, sock, display, depth); }); - sock._websocket._receiveData(new Uint8Array(data)); + // Empty messages are filtered at multiple layers, so we need to + // do a direct call + if (data.length === 0) { + decoder.decodeRect(x, y, width, height, sock, display, depth); + } else { + sock._websocket._receiveData(new Uint8Array(data)); + } display.flip(); } diff --git a/kasmweb/tests/test.rre.js b/kasmweb/tests/test.rre.js index 583cd5a..48ef844 100644 --- a/kasmweb/tests/test.rre.js +++ b/kasmweb/tests/test.rre.js @@ -17,7 +17,13 @@ function testDecodeRect(decoder, x, y, width, height, data, display, depth) { decoder.decodeRect(x, y, width, height, sock, display, depth); }); - sock._websocket._receiveData(new Uint8Array(data)); + // Empty messages are filtered at multiple layers, so we need to + // do a direct call + if (data.length === 0) { + decoder.decodeRect(x, y, width, height, sock, display, depth); + } else { + sock._websocket._receiveData(new Uint8Array(data)); + } display.flip(); } diff --git a/kasmweb/tests/test.tight.js b/kasmweb/tests/test.tight.js index 4aa47d7..cc5db36 100644 --- a/kasmweb/tests/test.tight.js +++ b/kasmweb/tests/test.tight.js @@ -17,7 +17,13 @@ function testDecodeRect(decoder, x, y, width, height, data, display, depth) { decoder.decodeRect(x, y, width, height, sock, display, depth); }); - sock._websocket._receiveData(new Uint8Array(data)); + // Empty messages are filtered at multiple layers, so we need to + // do a direct call + if (data.length === 0) { + decoder.decodeRect(x, y, width, height, sock, display, depth); + } else { + sock._websocket._receiveData(new Uint8Array(data)); + } display.flip(); } diff --git a/kasmweb/tests/test.tightpng.js b/kasmweb/tests/test.tightpng.js index 857cd84..cb36e99 100644 --- a/kasmweb/tests/test.tightpng.js +++ b/kasmweb/tests/test.tightpng.js @@ -17,7 +17,13 @@ function testDecodeRect(decoder, x, y, width, height, data, display, depth) { decoder.decodeRect(x, y, width, height, sock, display, depth); }); - sock._websocket._receiveData(new Uint8Array(data)); + // Empty messages are filtered at multiple layers, so we need to + // do a direct call + if (data.length === 0) { + decoder.decodeRect(x, y, width, height, sock, display, depth); + } else { + sock._websocket._receiveData(new Uint8Array(data)); + } display.flip(); }