[Spice-devel] [PATCH 8/9] server/smartcard: don't push our own error on reader add
Alon Levy
alevy at redhat.com
Wed Feb 9 02:20:47 PST 2011
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.
---
server/smartcard.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/smartcard.c b/server/smartcard.c
index 9fbeead..a93e59d 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);
--
1.7.4
More information about the Spice-devel
mailing list