[Spice-devel] usbredirparser: fix EAGAIN error in *_do_write()

Dmitriy Samborskiy samborsky_d at yahoo.com
Sat Oct 15 12:28:21 UTC 2016


> From your description looks like the patch is reversed.

Yes, it's reversed, sorry.

> I'm not that familiar with usbredir code but looking at the code
> if usbredirparser_do_write returns 0 the server should just loop
> again.

You are right. I found this bug when I debugged the usbredir sources for RedHat/CentOS 7 SRPM package and it had this old code
        w = parser->callb.write_func(parser->callb.priv,
                                     wbuf->buf + wbuf->pos, w);
        if (w <= 0) {
            ret = -1;
            break;
        }
where "w == 0" was treated as an erroneous case.
So, my patch is for the old code. I overlooked that this error was already fixed in 2013 the current repository.Sorry, my fault. Never mind.(Redhat 7.x packages sometimes are very old, though. This is frustrating...)

Regards,  Dmitriy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161015/414986cd/attachment.html>


More information about the Spice-devel mailing list