提交 ea01e5fd 编写于 作者: B balrog

Fix spurious VNC disconnects on Win32 (Hervé Poussineau).


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4251 c046a42c-6fe2-441c-8c8c-71466251a162
上级 171cd1cd
...@@ -633,8 +633,18 @@ static void buffer_append(Buffer *buffer, const void *data, size_t len) ...@@ -633,8 +633,18 @@ static void buffer_append(Buffer *buffer, const void *data, size_t len)
static int vnc_client_io_error(VncState *vs, int ret, int last_errno) static int vnc_client_io_error(VncState *vs, int ret, int last_errno)
{ {
if (ret == 0 || ret == -1) { if (ret == 0 || ret == -1) {
if (ret == -1 && (last_errno == EINTR || last_errno == EAGAIN)) if (ret == -1) {
return 0; switch (last_errno) {
case EINTR:
case EAGAIN:
#ifdef _WIN32
case WSAEWOULDBLOCK:
#endif
return 0;
default:
break;
}
}
VNC_DEBUG("Closing down client sock %d %d\n", ret, ret < 0 ? last_errno : 0); VNC_DEBUG("Closing down client sock %d %d\n", ret, ret < 0 ? last_errno : 0);
qemu_set_fd_handler2(vs->csock, NULL, NULL, NULL, NULL); qemu_set_fd_handler2(vs->csock, NULL, NULL, NULL, NULL);
...@@ -2086,10 +2096,10 @@ int vnc_display_open(DisplayState *ds, const char *display) ...@@ -2086,10 +2096,10 @@ int vnc_display_open(DisplayState *ds, const char *display)
struct sockaddr_in iaddr; struct sockaddr_in iaddr;
#ifndef _WIN32 #ifndef _WIN32
struct sockaddr_un uaddr; struct sockaddr_un uaddr;
const char *p;
#endif #endif
int reuse_addr, ret; int reuse_addr, ret;
socklen_t addrlen; socklen_t addrlen;
const char *p;
VncState *vs = ds ? (VncState *)ds->opaque : vnc_state; VncState *vs = ds ? (VncState *)ds->opaque : vnc_state;
const char *options; const char *options;
int password = 0; int password = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册