[Spice-devel] [xf86-video-qxl v5] Enable smartcard support for XSpice.

Jeremy White jwhite at codeweavers.com
Mon Dec 15 14:24:31 PST 2014


>> I'll send a v6 in a bit; thanks for the review.
>
> That looks correct to me, but it's maybe better to memmove outside the
> loop,
> such that memmove is called once every read and not for every
> message processed.
> Maybe it does not matter as this was not noticed so far, so messages
> mostly come one at a time.
>
> size_t ppos = 0
> do {
>    rc = process_message(ccid, buf + ppos, pos - ppos);
>    ppos += rc
> } while (rc> 0)
> if (ppos > 0 && ppos != pos)
>    memmove(buf, buf+ppos, pos - ppos)

To be honest, I think that code will never trigger, so I think I'm going 
to keep it in the format I put forth.

I did write a psychotic set of tests that deliberately under and overran 
the buffer, and confirmed that the new code seems to behave (and the old 
code was buggy, as expected).

I'm attaching a 'v5-v6.diff' which has just the set of changes from this 
last round of comments.  I'll also send in v6.

The only open item I'm aware of is Uri's request to spin on EINTR, and 
I'm hoping to get a pass on that one.

Cheers,

Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v5-v6.diff
Type: text/x-patch
Size: 3155 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141215/41bdaf9a/attachment.bin>


More information about the Spice-devel mailing list