forked from pool/xorg-x11-server
Stefan Dirsch
ebb11289e1
- VNC patches completely redone by Egbert Eich (N-VNC-*) - Xvnc-pthread.diff: small buildfix required for factory - removed obsolete patches * EXA-mixed-ModifyPixmapHeader-pitch-fixes.-bug-33929.patch * Replace-malloc-with-calloc-to-initialize-the-buffers.patch * U_xserver_fix-pixmaps-lifetime-tracking.patch * commit-5c6a2f9.diff * pad-size-of-system-memory-copy-for-1x1-pixmaps * record-avoid-crash-when-calling-RecordFlushReplyBuff.patch * xorg-server-stop-cpu-eating.diff - adjusted patches * bug534768-prefer_local_symbols.patch * zap_warning_xserver.diff - disabled patches for now * 0001-Xinput-Catch-missing-configlayout-when-deleting-dev.patch * cache-xkbcomp-output-for-fast-start-up.patch * xserver-bg-none-root.patch * 0001-Prevent-XSync-Alarms-from-senslessly-calling-CheckTr.patch OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=352
75 lines
1.9 KiB
Diff
75 lines
1.9 KiB
Diff
From: Egbert Eich <eich@freedesktop.org>
|
|
Date: Tue, 6 Sep 2011 07:02:11 +0200
|
|
Subject: [PATCH 2/6] VNC: Readd timeout when vnc viewer connection breaks.
|
|
Patch-Mainline: Currently no upstream project.
|
|
Git-commit: 759b49ed1c4ea03e45433c92c2fb8c44a60db34a
|
|
Signed-off: Egbert Eich <eich@suse.de>
|
|
References: bnc #441935, bnc #403901
|
|
|
|
This prevents Xvnc busy loop forever waiting for a viewer that no longer
|
|
response due to network or other issues.
|
|
|
|
Signed-off-by: Egbert Eich <eich@freedesktop.org>
|
|
---
|
|
hw/vnc/sockets.c | 19 +++++--------------
|
|
1 files changed, 5 insertions(+), 14 deletions(-)
|
|
|
|
diff --git a/hw/vnc/sockets.c b/hw/vnc/sockets.c
|
|
index 39eb88a..ae43ed0 100644
|
|
--- a/hw/vnc/sockets.c
|
|
+++ b/hw/vnc/sockets.c
|
|
@@ -442,9 +442,7 @@ WriteExact(int sock, char *buf, int len)
|
|
int n;
|
|
fd_set fds;
|
|
struct timeval tv;
|
|
-#if 0
|
|
int totalTimeWaited = 0;
|
|
-#endif
|
|
|
|
while (len > 0) {
|
|
n = write(sock, buf, len);
|
|
@@ -464,7 +462,6 @@ WriteExact(int sock, char *buf, int len)
|
|
return n;
|
|
}
|
|
|
|
-#if 0
|
|
/* Retry every 5 seconds until we exceed rfbMaxClientWait. We
|
|
need to do this because select doesn't necessarily return
|
|
immediately when the other end has gone away */
|
|
@@ -473,19 +470,14 @@ WriteExact(int sock, char *buf, int len)
|
|
FD_SET(sock, &fds);
|
|
tv.tv_sec = 5;
|
|
tv.tv_usec = 0;
|
|
-#else
|
|
- /* We're in the WakeupHandler now, so don't wait */
|
|
|
|
- FD_ZERO(&fds);
|
|
- FD_SET(sock, &fds);
|
|
- tv.tv_sec = 0;
|
|
- tv.tv_usec = 0;
|
|
-#endif
|
|
n = select(sock+1, NULL, &fds, NULL, &tv);
|
|
-#if 0
|
|
+
|
|
if (n < 0) {
|
|
- rfbLogPerror("WriteExact: select");
|
|
- return n;
|
|
+ if (errno != EINTR) {
|
|
+ rfbLogPerror("WriteExact: select");
|
|
+ return n;
|
|
+ }
|
|
}
|
|
if (n == 0) {
|
|
totalTimeWaited += 5000;
|
|
@@ -496,7 +488,6 @@ WriteExact(int sock, char *buf, int len)
|
|
} else {
|
|
totalTimeWaited = 0;
|
|
}
|
|
-#endif
|
|
}
|
|
}
|
|
return 1;
|
|
--
|
|
1.7.3.4
|
|
|