summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-02-09 12:09:43 +0200
committerAlon Levy <alevy@redhat.com>2011-02-10 10:34:53 +0200
commit5ed405099293061ab8adb6dc79c9fcc58e42f731 (patch)
tree2e4236366b29059dbee6360e45ba9d8c76747abc
parent17ba06da2c767cf7e0f378ebe2833ad263f774c3 (diff)
downloadspice-5ed405099293061ab8adb6dc79c9fcc58e42f731.tar.gz
spice-5ed405099293061ab8adb6dc79c9fcc58e42f731.tar.xz
spice-5ed405099293061ab8adb6dc79c9fcc58e42f731.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.
-rw-r--r--server/smartcard.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/smartcard.c b/server/smartcard.c
index 916d2f1d..1698a38d 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);