[Spice-devel] [PATCH spice-server] smartcard: Optimise sending data

Frediano Ziglio fziglio at redhat.com
Fri Dec 2 16:18:50 UTC 2016


As data is packae in a single piece of memory send it
altogether.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/smartcard-channel-client.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/server/smartcard-channel-client.c b/server/smartcard-channel-client.c
index 35327dc..95be310 100644
--- a/server/smartcard-channel-client.c
+++ b/server/smartcard-channel-client.c
@@ -212,10 +212,7 @@ void smartcard_channel_client_send_data(RedChannelClient *rcc,
     spice_assert(rcc);
     spice_assert(vheader);
     red_channel_client_init_send_data(rcc, SPICE_MSG_SMARTCARD_DATA, item);
-    spice_marshaller_add_ref(m, (uint8_t*)vheader, sizeof(VSCMsgHeader));
-    if (vheader->length > 0) {
-        spice_marshaller_add_ref(m, (uint8_t*)(vheader+1), vheader->length);
-    }
+    spice_marshaller_add_ref(m, (uint8_t*)vheader, sizeof(VSCMsgHeader) + vheader->length);
 }
 
 void smartcard_channel_client_send_error(RedChannelClient *rcc, SpiceMarshaller *m, RedPipeItem *item)
-- 
2.9.3



More information about the Spice-devel mailing list