diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2011-12-28 11:26:03 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2012-01-16 11:34:04 +0100 |
commit | b2567999c81f65f3a925b1202c7477bd7d0a6d58 (patch) | |
tree | 520db8d352d524b9f3d204d288eb52ab753c2a51 | |
parent | 2be44bf123bf5c5793b89ab50790f1c190da9248 (diff) |
Add support for mini header: an header without sub list & without serial
-Add SpiceMiniDataHeader.
-Introduce capability SPICE_COMMON_CAP_MINI_HEADER.
The advantage of using a header without sub list is to spare the 4 bytes that were sent
for a lot of messages without sublist.
Instead, messages that previously contained sub lists, will be split to two msgs.
The first one will be SPICE_MSG_LIST, holding the sub list, and the second will be the
main msg.
When most of the messages do not contain sub lists, the overhead of the additional 10 bytes
for the header of SPICE_MSG_LIST is negligible. In addition, if there is
only one message in the list, it can be sent independently.
Instead of sending the serial number of the messages, the client and
the server will increment local counters upon sending/receiving a
message.
-rw-r--r-- | spice/protocol.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spice/protocol.h b/spice/protocol.h index ddfe84b..5c7f286 100644 --- a/spice/protocol.h +++ b/spice/protocol.h @@ -37,7 +37,7 @@ #define SPICE_MAGIC (*(uint32_t*)"REDQ") #define SPICE_VERSION_MAJOR 2 -#define SPICE_VERSION_MINOR 1 +#define SPICE_VERSION_MINOR 2 // Encryption & Ticketing Parameters #define SPICE_MAX_PASSWORD_LENGTH 60 @@ -55,6 +55,7 @@ enum { SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION, SPICE_COMMON_CAP_AUTH_SPICE, SPICE_COMMON_CAP_AUTH_SASL, + SPICE_COMMON_CAP_MINI_HEADER, }; typedef struct SPICE_ATTR_PACKED SpiceLinkMess { @@ -89,6 +90,11 @@ typedef struct SPICE_ATTR_PACKED SpiceDataHeader { uint32_t sub_list; //offset to SpiceSubMessageList[] } SpiceDataHeader; +typedef struct SPICE_ATTR_PACKED SpiceMiniDataHeader { + uint16_t type; + uint32_t size; +} SpiceMiniDataHeader; + typedef struct SPICE_ATTR_PACKED SpiceSubMessage { uint16_t type; uint32_t size; |