diff --git a/core/decoders/raw.js b/core/decoders/raw.js index d7a77ec9..e8ea178e 100644 --- a/core/decoders/raw.js +++ b/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/tests/test.copyrect.js b/tests/test.copyrect.js index c67caeb5..90ba0c68 100644 --- a/tests/test.copyrect.js +++ b/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/tests/test.hextile.js b/tests/test.hextile.js index a703100f..a7034f05 100644 --- a/tests/test.hextile.js +++ b/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/tests/test.raw.js b/tests/test.raw.js index 13b3502c..bc7adc78 100644 --- a/tests/test.raw.js +++ b/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/tests/test.rre.js b/tests/test.rre.js index 15760520..8e006f87 100644 --- a/tests/test.rre.js +++ b/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/tests/test.tight.js b/tests/test.tight.js index 4aa47d70..cc5db36b 100644 --- a/tests/test.tight.js +++ b/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/tests/test.tightpng.js b/tests/test.tightpng.js index 857cd84c..cb36e99c 100644 --- a/tests/test.tightpng.js +++ b/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(); }