Exemple #1
0
static void smartcard_channel_send_item(RedChannel *channel, PipeItem *item)
{
    SmartCardChannel *smartcard_channel = (SmartCardChannel *)channel;

    red_channel_reset_send_data(channel);
    switch (item->type) {
    case PIPE_ITEM_TYPE_ERROR:
        smartcard_channel_send_error(smartcard_channel, item);
        break;
    case PIPE_ITEM_TYPE_READER_ADD_RESPONSE:
        smartcard_channel_send_reader_add_response(smartcard_channel, item);
        break;
    case PIPE_ITEM_TYPE_MSG:
        smartcard_channel_send_msg(smartcard_channel, item);
    }
}
Exemple #2
0
static void smartcard_channel_send_item(RedChannelClient *rcc, PipeItem *item)
{
    SpiceMarshaller *m = red_channel_client_get_marshaller(rcc);

    switch (item->type) {
    case PIPE_ITEM_TYPE_ERROR:
        smartcard_channel_send_error(rcc, m, item);
        break;
    case PIPE_ITEM_TYPE_SMARTCARD_DATA:
        smartcard_channel_send_msg(rcc, m, item);
        break;
    case PIPE_ITEM_TYPE_SMARTCARD_MIGRATE_DATA:
        smartcard_channel_send_migrate_data(rcc, m, item);
        break;
    default:
        spice_error("bad pipe item %d", item->type);
        free(item);
        return;
    }
    red_channel_client_begin_send_message(rcc);
}