summaryrefslogtreecommitdiffstats
path: root/server/smartcard.c
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-02-09 12:09:43 +0200
committerAlon Levy <alevy@redhat.com>2011-02-09 12:11:51 +0200
commit51da06793c33ff30b45154ccfc6e28d6d0d35db6 (patch)
tree1fb735d7e8d4826cb344640b79b4b7a7106bae6f /server/smartcard.c
parent91bf99a1e98623905485089ff0b7886e30c369a4 (diff)
downloadspice-51da06793c33ff30b45154ccfc6e28d6d0d35db6.tar.gz
spice-51da06793c33ff30b45154ccfc6e28d6d0d35db6.tar.xz
spice-51da06793c33ff30b45154ccfc6e28d6d0d35db6.zip
server/smartcard: don't push our own error on reader add
The device already sends one. There are actually two connections going on: server to client - this is the smartcard channel, it reuses the VSC protocol. server to device - this is an internal connection using VSC too. We generally just passthrough all messages from the client to the device, and from the device to the client. We only rewrite the reader_id because the device knows about a single id (it is actually a card id), and we may manage more then one in the future. Bottom line is that there was an extra VSC_Error message reaching the client.
Diffstat (limited to 'server/smartcard.c')
-rw-r--r--server/smartcard.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/smartcard.c b/server/smartcard.c
index 9fbeead9..a93e59d7 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -393,12 +393,12 @@ static void smartcard_add_reader(SmartCardChannel *smartcard_channel, uint8_t *n
// TODO - save name somewhere
SpiceCharDeviceInstance *char_device =
smartcard_readers_get_unattached();
- SmartCardDeviceState *state;
if (char_device != NULL) {
- state = SPICE_CONTAINEROF(char_device->st, SmartCardDeviceState, base);
smartcard_char_device_attach(char_device, smartcard_channel);
- smartcard_push_error(smartcard_channel, state->reader_id, VSC_SUCCESS);
+ // The device sends a VSC_Error message, we will let it through, no
+ // need to send our own. We already set the correct reader_id, from
+ // our SmartCardDeviceState.
} else {
smartcard_push_error(smartcard_channel, VSCARD_UNDEFINED_READER_ID,
VSC_CANNOT_ADD_MORE_READERS);