From ddb24b5063e3b4c90295bd4ddaab3bfc428ae79b Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 26 Feb 2012 15:51:50 +0100 Subject: [PATCH 125/140] usb-redir: Return USB_RET_NAK when we've no data for an interrupt endpoint We should return USB_RET_NAK, rather then a 0 sized packet, when we've no data for an interrupt IN endpoint. Signed-off-by: Hans de Goede --- usb-redir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usb-redir.c b/usb-redir.c index c76e55d..629c87d 100644 --- a/usb-redir.c +++ b/usb-redir.c @@ -558,7 +558,10 @@ static int usbredir_handle_interrupt_data(USBRedirDevice *dev, /* Check interrupt_error for stream errors */ status = dev->endpoint[EP2I(ep)].interrupt_error; dev->endpoint[EP2I(ep)].interrupt_error = 0; - return usbredir_handle_status(dev, status, 0); + if (status) { + return usbredir_handle_status(dev, status, 0); + } + return USB_RET_NAK; } DPRINTF("interrupt-token-in ep %02X status %d len %d\n", ep, intp->status, intp->len); -- 1.7.9.3