[Spice-devel] [PATCH] Treat EAGAIN similarly to EINTR and try again.
yhalperi at redhat.com
Thu May 3 01:38:17 PDT 2012
On 05/02/2012 10:24 PM, Jeremy White wrote:
> I had a puzzling bug where I could not establish a connection
> with a spice server across an openvpn connection onto a Debian
> stable box. It turns out that the network stack in question
> apparently is very careful on non blocking sockets, and was
> returning EAGAIN on the network ping test transmission.
> The channel code appears to be clearly broken; on the EAGAIN,
> it should clearly try the write again later, just as it does
> on an EINTR return. This patch makes that change.
Why do you think it is broken? EAGAIN and EINTR have different meaning.
The EAGAIN means that the write would have blocked if the socket was
blocking. So we use watch_update_mask to watch the socket, and we make
the thread available for other tasks and try again to write only when
the socket is available again.
> server/red_channel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
More information about the Spice-devel