[Spice-commits] 2 commits - server/smartcard.c

Alon Levy alon at kemper.freedesktop.org
Thu Jun 23 04:19:12 PDT 2011


 server/smartcard.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 456ff9f8d5d27ac763e89e67a100661084695dc5
Author: Alon Levy <alevy at redhat.com>
Date:   Thu Jun 23 11:14:42 2011 +0200

    server/smartcard: don't register the channel if no hardware emulated

diff --git a/server/smartcard.c b/server/smartcard.c
index f948e5b..7830c9a 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -538,6 +538,10 @@ void smartcard_channel_init(void)
 {
     Channel *channel;
 
+    /* don't register the channel if no hardware registered */
+    if (g_smartcard_readers.num == 0) {
+        return;
+    }
     channel = spice_new0(Channel, 1);
     channel->type = SPICE_CHANNEL_SMARTCARD;
     channel->link = smartcard_link;
@@ -545,4 +549,3 @@ void smartcard_channel_init(void)
     channel->migrate = smartcard_migrate;
     reds_register_channel(channel);
 }
-
commit de82fdb9dc0696526319cb89cf4305e8f3385771
Author: Alon Levy <alevy at redhat.com>
Date:   Thu Jun 23 11:12:42 2011 +0200

    server/smartcard: handle BaseChannel messages
    
    According to spice.proto the smartcard channel can receive acks and any
    other message defined in BaseChannel. While the spicec implementation didn't
    send an ACK spice-gtk does, so handle it.

diff --git a/server/smartcard.c b/server/smartcard.c
index 888b23a..f948e5b 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -454,6 +454,12 @@ static int smartcard_channel_handle_message(RedChannel *channel, SpiceDataHeader
     VSCMsgHeader* vheader = (VSCMsgHeader*)msg;
     SmartCardChannel* smartcard_channel = (SmartCardChannel*)channel;
 
+    if (header->type != SPICE_MSGC_SMARTCARD_DATA) {
+        /* handle ack's, spicy sends them while spicec does not */
+        return red_channel_handle_message(channel, header->size, header->type,
+                                          msg);
+    }
+
     ASSERT(header->size == vheader->length + sizeof(VSCMsgHeader));
     switch (vheader->type) {
         case VSC_ReaderAdd:


More information about the Spice-commits mailing list