diff options
author | runge <runge> | 2008-11-22 18:36:33 +0000 |
---|---|---|
committer | runge <runge> | 2008-11-22 18:36:33 +0000 |
commit | 6fbba525a924961083bf2e43bb841bd15671f526 (patch) | |
tree | 3ec0cf4b285fb0140294a151b801c91bc78a612e /x11vnc/cleanup.c | |
parent | 63b98dba790fa9835e970b8502d93258862a9373 (diff) | |
download | libtdevnc-6fbba525a924961083bf2e43bb841bd15671f526.tar.gz libtdevnc-6fbba525a924961083bf2e43bb841bd15671f526.zip |
x11vnc: x11vnc.desktop file. -reopen, -dhparams, -sslCRL,
-setdefer options. -rfbport PROMPT VeNCrypt and TLSVNC SSL/TLS
encryption support. Tweaks to choose_delay() algorithm.
-ssl ANON anonymouse Diffie-Hellman mode. Fix bugs in certs
management. Additions to tray=setpass naive user mode.
Diffstat (limited to 'x11vnc/cleanup.c')
-rw-r--r-- | x11vnc/cleanup.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/x11vnc/cleanup.c b/x11vnc/cleanup.c index e290977..610aa62 100644 --- a/x11vnc/cleanup.c +++ b/x11vnc/cleanup.c @@ -259,7 +259,51 @@ static int Xerror(Display *d, XErrorEvent *error) { } static int XIOerr(Display *d) { + static int reopen = 0, rmax = 1; X_UNLOCK; + + if (getenv("X11VNC_REOPEN_DISPLAY")) { + rmax = atoi(getenv("X11VNC_REOPEN_DISPLAY")); + } + +#if !NO_X11 + if (reopen < rmax && getenv("X11VNC_REOPEN_DISPLAY")) { + int db = getenv("X11VNC_REOPEN_DEBUG") ? 1 : 0; + Display *save_dpy = dpy; + char *dstr = DisplayString(save_dpy); + reopen++; + rfbLog("*** XIO error: Trying to reopen[%d/%d] display '%s'\n", reopen, rmax, dstr); + rfbLog("*** XIO error: Note the reopened state may be unstable.\n"); + usleep (3000 * 1000); + dpy = XOpenDisplay_wr(dstr); + if (dpy) { + rfbLog("*** XIO error: Reopened display '%s' successfully.\n", dstr); + if (db) rfbLog("*** XIO error: '%s' 0x%x\n", dstr, dpy); + scr = DefaultScreen(dpy); + rootwin = RootWindow(dpy, scr); + if (db) rfbLog("*** XIO error: disable_grabserver\n"); + disable_grabserver(dpy, 0); + if (db) rfbLog("*** XIO error: xrecord\n"); + zerodisp_xrecord(); + initialize_xrecord(); + if (db) rfbLog("*** XIO error: xdamage\n"); + create_xdamage_if_needed(1); + if (db) rfbLog("*** XIO error: do_new_fb\n"); + if (using_shm) { + if (db) rfbLog("*** XIO error: clean_shm\n"); + clean_shm(1); + } + do_new_fb(1); + if (db) rfbLog("*** XIO error: check_xevents\n"); + check_xevents(1); + /* sadly, we can never return... */ + if (db) rfbLog("*** XIO error: watch_loop\n"); + watch_loop(); + clean_up_exit(1); + } + } +#endif + interrupted(-1); if (d) {} /* unused vars warning: */ |