[Spice-devel] [PATCH spice 09/10] client/red_channel.cpp: support SPICE_MSG_LIST

Yonit Halperin yhalperi at redhat.com
Wed Dec 28 09:15:18 PST 2011


SPICE_MSG_LIST body is SpiceSubMessageList
---
 client/red_channel.h |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/client/red_channel.h b/client/red_channel.h
index ee5b185..3b77ff3 100644
--- a/client/red_channel.h
+++ b/client/red_channel.h
@@ -305,10 +305,17 @@ void MessageHandlerImp<HandlerClass, channel_id>::handle_message(RedPeer::Compou
 	}
     }
 
-    if (message.sub_list()) {
+    if (message.type() == SPICE_MSG_LIST || message.sub_list()) {
         SpiceSubMessageList *sub_list;
         sub_list = (SpiceSubMessageList *)(message.data() + message.sub_list());
         for (int i = 0; i < sub_list->size; i++) {
+            uint8_t *msg;
+            uint8_t *parsed;
+            uint16_t type;
+            uint32_t size;
+            size_t parsed_size;
+            message_destructor_t parsed_free;
+
             SpiceSubMessage *sub = (SpiceSubMessage *)(message.data() + sub_list->sub_messages[i]);
             msg = (uint8_t *)(sub + 1);
             type = sub->type;
@@ -326,6 +333,10 @@ void MessageHandlerImp<HandlerClass, channel_id>::handle_message(RedPeer::Compou
         }
     }
 
+    if (message.type() == SPICE_MSG_LIST) {
+        return;
+    }
+
     msg = message.data();
     type = message.type();
     size = message.size();
-- 
1.7.6.4



More information about the Spice-devel mailing list