[Spice-devel] [spice-server PATCH] display-channel: Don't disconnect when lz4 not supported

Lukas Venhoda lvenhoda at redhat.com
Wed Dec 16 05:48:49 PST 2015


Don't diconnect client, if lz4 is requested as a preferred compression,
but the server doesn't support it.
---
Sidenote:
Should server disconnect, when unsupported compression is requested?
FE if client sends unknown compression, and this switch goes to default.
Default could always return TRUE, just not set the compression.
---
 server/dcc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/dcc.c b/server/dcc.c
index b2ee7a6..7076d21 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -1351,12 +1351,13 @@ static int dcc_handle_preferred_compression(DisplayChannelClient *dcc,
         SpiceMsgcDisplayPreferredCompression *pc)
 {
     switch (pc->image_compression) {
+    case SPICE_IMAGE_COMPRESSION_LZ4:
+#ifndef USE_LZ4
+        return TRUE;
+#endif
     case SPICE_IMAGE_COMPRESSION_AUTO_LZ:
     case SPICE_IMAGE_COMPRESSION_AUTO_GLZ:
     case SPICE_IMAGE_COMPRESSION_QUIC:
-#ifdef USE_LZ4
-    case SPICE_IMAGE_COMPRESSION_LZ4:
-#endif
     case SPICE_IMAGE_COMPRESSION_LZ:
     case SPICE_IMAGE_COMPRESSION_GLZ:
     case SPICE_IMAGE_COMPRESSION_OFF:
--
2.5.0



More information about the Spice-devel mailing list