summaryrefslogtreecommitdiffstats
path: root/x11vnc/misc/enhanced_tightvnc_viewer/src/patches
diff options
context:
space:
mode:
authorrunge <runge>2006-09-14 02:20:57 +0000
committerrunge <runge>2006-09-14 02:20:57 +0000
commit130cf391b60b93f187152cc10f389106caf1cbeb (patch)
treea6a4853e054137b0e37c2243d41947ee9c6c9640 /x11vnc/misc/enhanced_tightvnc_viewer/src/patches
parent94501cdcfaeecf09c42584589a4d419ce6ecf8aa (diff)
downloadlibtdevnc-130cf391b60b93f187152cc10f389106caf1cbeb.tar.gz
libtdevnc-130cf391b60b93f187152cc10f389106caf1cbeb.zip
x11vnc: enhanced_tightvnc_viewer files, ssh -t keystroke response improvement.
Diffstat (limited to 'x11vnc/misc/enhanced_tightvnc_viewer/src/patches')
-rw-r--r--x11vnc/misc/enhanced_tightvnc_viewer/src/patches/README6
-rwxr-xr-xx11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle33
-rwxr-xr-xx11vnc/misc/enhanced_tightvnc_viewer/src/patches/_getpatches3
-rwxr-xr-xx11vnc/misc/enhanced_tightvnc_viewer/src/patches/_vncpatchapplied6
-rw-r--r--x11vnc/misc/enhanced_tightvnc_viewer/src/patches/stunnel-maxconn.patch124
-rw-r--r--x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fullscreen.patch42
-rw-r--r--x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-newfbsize.patch285
7 files changed, 499 insertions, 0 deletions
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/README b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/README
new file mode 100644
index 0000000..9451e7e
--- /dev/null
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/README
@@ -0,0 +1,6 @@
+All of the patch files and scripts in this directory are
+
+ Copyright (c) 2006 by Karl J. Runge <[email protected]>
+
+and are licensed by the GPL. See the README and COPYING files two
+directories up for more information.
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle
new file mode 100755
index 0000000..c2eec84
--- /dev/null
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+rm -rf ./src/tmp/* || exit 1
+vers=1.0.3
+
+cd .. || exit 1
+
+if [ -f enhanced_tightvnc_viewer-$vers.zip ]; then
+ mv enhanced_tightvnc_viewer-$vers.zip enhanced_tightvnc_viewer-$vers.zip~
+fi
+rm -f enhanced_tightvnc_viewer_all-$vers.zip
+rm -f enhanced_tightvnc_viewer-$vers.zip
+zip -9 -r enhanced_tightvnc_viewer_all-$vers.zip enhanced_tightvnc_viewer
+zip -9 -r enhanced_tightvnc_viewer-$vers.zip enhanced_tightvnc_viewer -x '*.zip' '*.tar.gz'
+tar cvf - --exclude='*.zip' --exclude='*.tar.gz' enhanced_tightvnc_viewer | gzip -9 > enhanced_tightvnc_viewer-$vers.tar.gz
+tar cvf - --exclude='*.zip' --exclude='*.tar.gz' --exclude='*.dll' --exclude='*.exe' --exclude enhanced_tightvnc_viewer/Windows/util enhanced_tightvnc_viewer | gzip -9 > enhanced_tightvnc_viewer_no_windows-$vers.tar.gz
+
+ls -l enhanced_tightvnc_viewer*-$vers.*
+
+###########################################
+
+rm -rf enhanced_tightvnc_viewer_windows_only-${vers}*
+
+cp -pR enhanced_tightvnc_viewer enhanced_tightvnc_viewer_windows_only-$vers
+rm -rf enhanced_tightvnc_viewer_windows_only-$vers/{src,bin,man}/*
+rm -rf enhanced_tightvnc_viewer_windows_only-$vers/bin/.linkin
+cp -p enhanced_tightvnc_viewer/bin/util/ssl_tightvncviewer.tcl enhanced_tightvnc_viewer_windows_only-$vers/Windows/util
+
+rm -f enhanced_tightvnc_viewer_windows_only-$vers.zip
+zip -9 -r enhanced_tightvnc_viewer_windows_only-$vers.zip enhanced_tightvnc_viewer_windows_only-$vers
+
+ls -l enhanced_tightvnc_viewer_windows_only-$vers.zip
+rm -rf enhanced_tightvnc_viewer_windows_only-${vers}
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_getpatches b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_getpatches
new file mode 100755
index 0000000..8fa3645
--- /dev/null
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_getpatches
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+cp -p /dist/src/apps/VNC/tight_vnc_1.3dev5/tight-vncviewer*patch .
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_vncpatchapplied b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_vncpatchapplied
new file mode 100755
index 0000000..0ff1931
--- /dev/null
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_vncpatchapplied
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+make clean
+rm -f *.o
+cd ../..
+tar -cvf ../../zips/vnc_unixsrc_vncviewer.patched.tar vnc_unixsrc/vncviewer
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/stunnel-maxconn.patch b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/stunnel-maxconn.patch
new file mode 100644
index 0000000..7067a7c
--- /dev/null
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/stunnel-maxconn.patch
@@ -0,0 +1,124 @@
+diff -Naur stunnel.orig/src/client.c stunnel/src/client.c
+--- stunnel.orig/src/client.c 2005-10-24 14:00:56.000000000 -0400
++++ stunnel/src/client.c 2006-07-31 21:51:37.000000000 -0400
+@@ -126,6 +126,10 @@
+ s_log(LOG_DEBUG, "%s finished (%d left)", c->opt->servname,
+ --num_clients);
+ leave_critical_section(CRIT_CLIENTS);
++ if (num_clients <= 0 && options.maxconn > 0 && num_conn >= options.maxconn) {
++ s_log(LOG_NOTICE, "client() finished: exceeded maxconn");
++ exit(0);
++ }
+ #endif
+ free(c);
+ #ifdef DEBUG_STACK_SIZE
+diff -Naur stunnel.orig/src/network.c stunnel/src/network.c
+--- stunnel.orig/src/network.c 2005-10-30 16:35:42.000000000 -0500
++++ stunnel/src/network.c 2006-07-31 21:53:49.000000000 -0400
+@@ -329,6 +329,10 @@
+ /* no logging is possible in a signal handler */
+ #ifdef USE_FORK
+ num_clients--; /* one client less */
++ if (num_clients <= 0 && options.maxconn > 0 && num_conn >= options.maxconn) {
++ s_log(LOG_NOTICE, "sigchld_handler() finished: exceeded maxconn");
++ exit(0);
++ }
+ #endif /* USE_FORK */
+ }
+ #else /* __sgi */
+@@ -375,6 +379,10 @@
+ if((pid=wait(&status))>0) {
+ num_clients--; /* one client less */
+ #endif
++ if (num_clients <= 0 && options.maxconn > 0 && num_conn >= options.maxconn) {
++ s_log(LOG_NOTICE, "client_status() finished: exceeded maxconn");
++ exit(0);
++ }
+ #ifdef WIFSIGNALED
+ if(WIFSIGNALED(status)) {
+ s_log(LOG_DEBUG, "Process %d terminated on signal %d (%d left)",
+diff -Naur stunnel.orig/src/options.c stunnel/src/options.c
+--- stunnel.orig/src/options.c 2005-10-20 03:12:07.000000000 -0400
++++ stunnel/src/options.c 2006-07-31 22:49:57.000000000 -0400
+@@ -665,6 +665,24 @@
+ break;
+ }
+
++ /* maxconn */
++ switch(cmd) {
++ case CMD_INIT:
++ options.maxconn=0;
++ break;
++ case CMD_EXEC:
++ if(strcasecmp(opt, "maxconn"))
++ break;
++ options.maxconn=atoi(arg);
++ return NULL; /* OK */
++ case CMD_DEFAULT:
++ log_raw("%-15s = 0", "maxconn");
++ break;
++ case CMD_HELP:
++ log_raw("%-15s = maximum number of accepted connections", "maxconn");
++ break;
++ }
++
+ if(cmd==CMD_EXEC)
+ return option_not_found;
+ return NULL; /* OK */
+diff -Naur stunnel.orig/src/prototypes.h stunnel/src/prototypes.h
+--- stunnel.orig/src/prototypes.h 2005-10-27 05:41:28.000000000 -0400
++++ stunnel/src/prototypes.h 2006-07-31 22:49:36.000000000 -0400
+@@ -44,6 +44,7 @@
+ /**************************************** Prototypes for stunnel.c */
+
+ extern int num_clients;
++extern int num_conn;
+
+ void main_initialize(char *, char *);
+ void main_execute(void);
+@@ -113,6 +114,7 @@
+ long session_timeout;
+ int verify_level;
+ int verify_use_only_my;
++ int maxconn;
+ long ssl_options;
+
+ /* some global data for stunnel.c */
+diff -Naur stunnel.orig/src/stunnel.c stunnel/src/stunnel.c
+--- stunnel.orig/src/stunnel.c 2005-11-02 15:18:42.000000000 -0500
++++ stunnel/src/stunnel.c 2006-07-31 21:40:04.000000000 -0400
+@@ -53,6 +53,7 @@
+ #endif
+
+ int num_clients=0; /* Current number of clients */
++int num_conn=0; /* Total number of connections */
+
+ /* Functions */
+
+@@ -138,6 +139,7 @@
+ }
+
+ num_clients=0;
++ num_conn=0;
+
+ /* bind local ports */
+ for(opt=local_options.next; opt; opt=opt->next) {
+@@ -222,6 +224,18 @@
+ return; /* error */
+ }
+ }
++ num_conn++;
++fprintf(stderr, "num_conn: %d\n", num_conn);
++ if (options.maxconn > 0 && num_conn > options.maxconn) {
++ s_log(LOG_WARNING, "Connection rejected: exceeded maxconn (%d>%d)",
++ num_conn, options.maxconn);
++ closesocket(s);
++ if (num_clients == 0) {
++ s_log(LOG_WARNING, "Finished via maxconn.");
++ exit(0);
++ }
++ return;
++ }
+ s_ntop(from_address, &addr);
+ s_log(LOG_DEBUG, "%s accepted FD=%d from %s",
+ opt->servname, s, from_address);
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fullscreen.patch b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fullscreen.patch
new file mode 100644
index 0000000..97494ee
--- /dev/null
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-fullscreen.patch
@@ -0,0 +1,42 @@
+--- vnc_unixsrc.orig/vncviewer/fullscreen.c 2003-10-09 05:23:49.000000000 -0400
++++ vnc_unixsrc/vncviewer/fullscreen.c 2004-12-26 21:21:44.000000000 -0500
+@@ -173,9 +173,15 @@
+ XtVaSetValues(popup, XtNoverrideRedirect, True, NULL);
+
+ /* Try to get the input focus. */
+-
++
++#if 0
+ XSetInputFocus(dpy, DefaultRootWindow(dpy), RevertToPointerRoot,
+ CurrentTime);
++#else
++ XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot,
++ CurrentTime);
++#endif
++
+
+ /* Optionally, grab the keyboard. */
+
+@@ -184,6 +190,10 @@
+ GrabModeAsync, CurrentTime) != GrabSuccess) {
+ fprintf(stderr, "XtGrabKeyboard() failed.\n");
+ }
++if (getenv("VNCVIEWER_GRAB_SERVER") != NULL) { /* runge bot of FullScreenOn */
++ fprintf(stderr, "calling XGrabServer(dpy)\n");
++ XGrabServer(dpy);
++}
+ }
+
+
+@@ -210,6 +220,11 @@
+
+ appData.fullScreen = False;
+
++if (getenv("VNCVIEWER_GRAB_SERVER") != NULL) { /* runge top of FullScreenOff */
++ fprintf(stderr, "calling XUngrabServer(dpy)\n");
++ XUngrabServer(dpy);
++}
++
+ if (appData.grabKeyboard)
+ XtUngrabKeyboard(desktop, CurrentTime);
+
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-newfbsize.patch b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-newfbsize.patch
new file mode 100644
index 0000000..d9eb114
--- /dev/null
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-newfbsize.patch
@@ -0,0 +1,285 @@
+--- vnc_unixsrc.orig/vncviewer/desktop.c 2004-05-28 13:29:29.000000000 -0400
++++ vnc_unixsrc/vncviewer/desktop.c 2006-07-27 11:30:01.000000000 -0400
+@@ -50,6 +50,30 @@
+ },
+ };
+
++void create_image() {
++ image = NULL;
++
++#ifdef MITSHM
++ if (appData.useShm) {
++ image = CreateShmImage();
++ if (!image)
++ appData.useShm = False;
++ }
++#endif
++
++ if (!image) {
++ image = XCreateImage(dpy, vis, visdepth, ZPixmap, 0, NULL,
++ si.framebufferWidth, si.framebufferHeight,
++ BitmapPad(dpy), 0);
++
++ image->data = malloc(image->bytes_per_line * image->height);
++ if (!image->data) {
++ fprintf(stderr,"malloc failed\n");
++ exit(1);
++ }
++ }
++}
++
+
+ /*
+ * DesktopInitBeforeRealization creates the "desktop" widget and the viewport
+@@ -82,30 +106,9 @@
+ for (i = 0; i < 256; i++)
+ modifierPressed[i] = False;
+
+- image = NULL;
+-
+-#ifdef MITSHM
+- if (appData.useShm) {
+- image = CreateShmImage();
+- if (!image)
+- appData.useShm = False;
+- }
+-#endif
+-
+- if (!image) {
+- image = XCreateImage(dpy, vis, visdepth, ZPixmap, 0, NULL,
+- si.framebufferWidth, si.framebufferHeight,
+- BitmapPad(dpy), 0);
+-
+- image->data = malloc(image->bytes_per_line * image->height);
+- if (!image->data) {
+- fprintf(stderr,"malloc failed\n");
+- exit(1);
+- }
+- }
++ create_image();
+ }
+
+-
+ /*
+ * DesktopInitAfterRealization does things which require the X windows to
+ * exist. It creates some GCs and sets the dot cursor.
+@@ -460,3 +463,69 @@
+ break;
+ }
+ }
++
++static void reset_image(void) {
++ if (UsingShm()) {
++ ShmCleanup();
++ } else {
++ if (image && image->data) {
++ free(image->data);
++ XDestroyImage(image);
++ image = NULL;
++ }
++ }
++ create_image();
++ XFlush(dpy);
++}
++
++void ReDoDesktop(void) {
++ int w, h, x, y, dw, dh;
++
++ if (appData.fullScreen) {
++ if (image && image->data) {
++ int len;
++ int h = image->height;
++ int w = image->width;
++ len = image->bytes_per_line * image->height;
++ /* black out window first: */
++ memset(image->data, 0, len);
++ XPutImage(dpy, XtWindow(desktop), gc, image, 0, 0, 0, 0, w, h);
++ XFlush(dpy);
++ }
++ XtResizeWidget(desktop, si.framebufferWidth, si.framebufferHeight, 0);
++ XSync(dpy, False);
++ usleep(100*1000);
++ FullScreenOn();
++ XSync(dpy, False);
++ usleep(100*1000);
++ reset_image();
++ return;
++ }
++
++ dw = appData.wmDecorationWidth;
++ dh = appData.wmDecorationHeight;
++
++ w = si.framebufferWidth;
++ h = si.framebufferHeight;
++
++ if (w + dw >= dpyWidth) {
++ w = dpyWidth - dw;
++ }
++ if (h + dh >= dpyHeight) {
++ h = dpyHeight - dh;
++ }
++
++ XtVaSetValues(toplevel, XtNmaxWidth, w, XtNmaxHeight, h, NULL);
++
++ XtVaSetValues(desktop, XtNwidth, si.framebufferWidth,
++ XtNheight, si.framebufferHeight, NULL);
++
++ x = (dpyWidth - w - dw)/2;
++ y = (dpyHeight - h - dh)/2;
++
++ XtResizeWidget(desktop, si.framebufferWidth, si.framebufferHeight, 0);
++
++ XtConfigureWidget(toplevel, x + dw, y + dh, w, h, 0);
++
++ reset_image();
++}
+--- vnc_unixsrc.orig/vncviewer/fullscreen.c 2003-10-09 05:23:49.000000000 -0400
++++ vnc_unixsrc/vncviewer/fullscreen.c 2006-07-27 14:36:06.000000000 -0400
+@@ -85,10 +85,13 @@
+ Dimension oldViewportWidth, oldViewportHeight, clipWidth, clipHeight;
+ Position viewportX, viewportY;
+
++ Bool fsAlready = appData.fullScreen, toobig = False;
++
+ appData.fullScreen = True;
+
+ if (si.framebufferWidth > dpyWidth || si.framebufferHeight > dpyHeight) {
+
++ toobig = True;
+ XtVaSetValues(viewport, XtNforceBars, True, NULL);
+ XtVaGetValues(viewport, XtNwidth, &oldViewportWidth,
+ XtNheight, &oldViewportHeight, NULL);
+@@ -129,6 +132,7 @@
+ reparenting our window to the root. The window manager will get a
+ ReparentNotify and hopefully clean up its frame window. */
+
++if (! fsAlready) {
+ XtVaSetValues(toplevel, XtNoverrideRedirect, True, NULL);
+
+ XReparentWindow(dpy, XtWindow(toplevel), DefaultRootWindow(dpy), 0, 0);
+@@ -164,10 +168,22 @@
+
+ XtManageChild(viewport);
+
+- /* Now we can set "toplevel" to its proper size. */
++} else {
++ XSync(dpy, False);
++}
+
++ /* Now we can set "toplevel" to its proper size. */
+ XtResizeWidget(toplevel, toplevelWidth, toplevelHeight, 0);
+
++if (fsAlready) {
++ XtResizeWidget(viewport, viewportWidth, viewportHeight, 0);
++ if (! toobig) {
++ XtVaSetValues(viewport, XtNforceBars, False, NULL);
++ }
++ XMoveWindow(dpy, XtWindow(viewport), viewportX, viewportY);
++ XSync(dpy, False);
++}
++
+ /* Set the popup to overrideRedirect too */
+
+ XtVaSetValues(popup, XtNoverrideRedirect, True, NULL);
+--- vnc_unixsrc.orig/vncviewer/rfbproto.c 2004-03-11 13:14:39.000000000 -0500
++++ vnc_unixsrc/vncviewer/rfbproto.c 2006-07-25 21:51:20.000000000 -0400
+@@ -177,6 +177,9 @@
+ sig_rfbEncodingPointerPos, "Pointer position update");
+ CapsAdd(encodingCaps, rfbEncodingLastRect, rfbTightVncVendor,
+ sig_rfbEncodingLastRect, "LastRect protocol extension");
++
++ CapsAdd(encodingCaps, rfbEncodingNewFBSize, rfbTightVncVendor,
++ sig_rfbEncodingNewFBSize, "New FB size protocol extension");
+ }
+
+
+@@ -729,6 +732,7 @@
+ Bool requestCompressLevel = False;
+ Bool requestQualityLevel = False;
+ Bool requestLastRectEncoding = False;
++ Bool requestNewFBSizeEncoding = True;
+
+ spf.type = rfbSetPixelFormat;
+ spf.format = myFormat;
+@@ -806,6 +810,10 @@
+ if (se->nEncodings < MAX_ENCODINGS && requestLastRectEncoding) {
+ encs[se->nEncodings++] = Swap32IfLE(rfbEncodingLastRect);
+ }
++
++ if (se->nEncodings < MAX_ENCODINGS && requestNewFBSizeEncoding) {
++ encs[se->nEncodings++] = Swap32IfLE(rfbEncodingNewFBSize);
++ }
+ }
+ else {
+ if (SameMachine(rfbsock)) {
+@@ -849,6 +857,7 @@
+ }
+
+ encs[se->nEncodings++] = Swap32IfLE(rfbEncodingLastRect);
++ encs[se->nEncodings++] = Swap32IfLE(rfbEncodingNewFBSize);
+ }
+
+ len = sz_rfbSetEncodingsMsg + se->nEncodings * 4;
+@@ -1038,6 +1047,16 @@
+ }
+ continue;
+ }
++ if (rect.encoding == rfbEncodingNewFBSize) {
++ fprintf(stderr,"New Size: %dx%d at (%d, %d)\n",
++ rect.r.w, rect.r.h, rect.r.x, rect.r.y);
++ si.framebufferWidth = rect.r.w;
++ si.framebufferHeight = rect.r.h;
++ fprintf(stderr, "si: %d %d\n", si.framebufferWidth, si.framebufferHeight);
++ ReDoDesktop();
++
++ continue;
++ }
+
+ if ((rect.r.x + rect.r.w > si.framebufferWidth) ||
+ (rect.r.y + rect.r.h > si.framebufferHeight))
+--- vnc_unixsrc.orig/vncviewer/shm.c 2000-06-11 08:00:53.000000000 -0400
++++ vnc_unixsrc/vncviewer/shm.c 2006-07-26 23:30:42.000000000 -0400
+@@ -41,6 +41,10 @@
+ }
+ }
+
++Bool UsingShm() {
++ return needShmCleanup;
++}
++
+ static int
+ ShmCreationXErrorHandler(Display *dpy, XErrorEvent *error)
+ {
+--- vnc_unixsrc.orig/vncviewer/vncviewer.h 2004-03-11 13:14:40.000000000 -0500
++++ vnc_unixsrc/vncviewer/vncviewer.h 2006-07-26 23:31:25.000000000 -0400
+@@ -162,6 +162,8 @@
+ extern void CopyDataToScreen(char *buf, int x, int y, int width, int height);
+ extern void SynchroniseScreen();
+
++extern void ReDoDesktop();
++
+ /* dialogs.c */
+
+ extern void ServerDialogDone(Widget w, XEvent *event, String *params,
+@@ -243,6 +245,7 @@
+
+ extern XImage *CreateShmImage();
+ extern void ShmCleanup();
++extern Bool UsingShm();
+
+ /* sockets.c */
+
+--- vnc_unixsrc.orig/vncviewer/vncviewer.c 2004-01-13 09:22:05.000000000 -0500
++++ vnc_unixsrc/vncviewer/vncviewer.c 2006-07-27 19:00:25.000000000 -0400
+@@ -57,6 +57,11 @@
+ }
+ }
+
++ if (argc > 1 && strstr(argv[1], "-h") == argv[1]) {
++ usage();
++ return 0;
++ }
++
+ /* Call the main Xt initialisation function. It parses command-line options,
+ generating appropriate resource specs, and makes a connection to the X
+ display. */