x11vnc: add zeroconf external helpers (avahi-publish and

dns-sd).  Alias -zeroconf.  Close pipeinput_fh on exit.
Kludge to make -solid work on MacOSX console.  Attempt at
cpp macros to disable newer libvncserver interfaces.
pull/1/head
runge 16 years ago
parent cb67ada73b
commit 63b98dba79

@ -1,3 +1,9 @@
2008-11-09 Karl Runge <runge@karlrunge.com>
* x11vnc: add zeroconf external helpers (avahi-publish and
dns-sd). Alias -zeroconf. Close pipeinput_fh on exit.
Kludge to make -solid work on MacOSX console. Attempt at
cpp macros to disable newer libvncserver interfaces.
2008-10-29 Karl Runge <runge@karlrunge.com> 2008-10-29 Karl Runge <runge@karlrunge.com>
* x11vnc: -http_oneport for single port HTTP and VNC. * x11vnc: -http_oneport for single port HTTP and VNC.
Improve find_display wrt lsof blocking with -b. Improve find_display wrt lsof blocking with -b.

File diff suppressed because it is too large Load Diff

@ -7,18 +7,122 @@ void avahi_advertise(const char *name, const char *host, const uint16_t port);
void avahi_reset(void); void avahi_reset(void);
void avahi_cleanup(void); void avahi_cleanup(void);
static pid_t avahi_pid = 0;
static void kill_avahi_pid(void) {
if (avahi_pid != 0) {
kill(avahi_pid, SIGTERM);
avahi_pid = 0;
}
}
static int try_avahi_helper(const char *name, const char *host, const uint16_t port) {
#if LIBVNCSERVER_HAVE_FORK
char *cmd, *p, *path = getenv("PATH"), portstr[32];
int i;
/* avahi-publish */
if (no_external_cmds || !cmd_ok("zeroconf")) {
return 0;
}
if (!path) {
return 0;
}
path = strdup(path);
cmd = (char *) malloc(strlen(path) + 100);
sprintf(portstr, "%d", (int) port);
p = strtok(path, ":");
while (p) {
struct stat sbuf;
sprintf(cmd, "%s/avahi-publish", p);
if (stat(cmd, &sbuf) == 0) {
break;
}
sprintf(cmd, "%s/dns-sd", p);
if (stat(cmd, &sbuf) == 0) {
break;
}
sprintf(cmd, "%s/mDNS", p);
if (stat(cmd, &sbuf) == 0) {
break;
}
cmd[0] = '\0';
p = strtok(NULL, ":");
}
free(path);
if (!strcmp(cmd, "")) {
free(cmd);
rfbLog("Could not find an external avahi/zeroconf helper program.\n");
return 0;
}
avahi_pid = fork();
if (avahi_pid < 0) {
rfbLogPerror("fork");
avahi_pid = 0;
free(cmd);
return 0;
}
if (avahi_pid != 0) {
int status;
usleep(500 * 1000);
waitpid(avahi_pid, &status, WNOHANG);
if (kill(avahi_pid, 0) != 0) {
waitpid(avahi_pid, &status, WNOHANG);
avahi_pid = 0;
free(cmd);
return 0;
}
if (! quiet) {
rfbLog("%s helper pid is: %d\n", cmd, (int) avahi_pid);
}
free(cmd);
return 1;
}
for (i=3; i<256; i++) {
close(i);
}
if (strstr(cmd, "/avahi-publish")) {
execlp(cmd, cmd, "-s", name, "_rfb._tcp", portstr, (char *) NULL);
} else {
execlp(cmd, cmd, "-R", name, "_rfb._tcp", ".", portstr, (char *) NULL);
}
exit(1);
#else
if (!name || !host || !port) {}
return 0;
#endif
}
#if !defined(LIBVNCSERVER_HAVE_AVAHI) || !defined(LIBVNCSERVER_HAVE_LIBPTHREAD) #if !defined(LIBVNCSERVER_HAVE_AVAHI) || !defined(LIBVNCSERVER_HAVE_LIBPTHREAD)
void avahi_initialise(void) { void avahi_initialise(void) {
rfbLog("avahi_initialise: no Avahi support at buildtime.\n"); rfbLog("avahi_initialise: no Avahi support at buildtime.\n");
} }
void avahi_advertise(const char *name, const char *host, const uint16_t port) { void avahi_advertise(const char *name, const char *host, const uint16_t port) {
if (!name || !host || !port) {} if (!try_avahi_helper(name, host, port)) {
rfbLog("avahi_advertise: no Avahi support at buildtime.\n"); rfbLog("avahi_advertise: no Avahi support at buildtime.\n");
}
} }
void avahi_reset(void) { void avahi_reset(void) {
kill_avahi_pid();
rfbLog("avahi_reset: no Avahi support at buildtime.\n"); rfbLog("avahi_reset: no Avahi support at buildtime.\n");
} }
void avahi_cleanup(void) { void avahi_cleanup(void) {
kill_avahi_pid();
rfbLog("avahi_cleanup: no Avahi support at buildtime.\n"); rfbLog("avahi_cleanup: no Avahi support at buildtime.\n");
} }
#else #else

@ -30,7 +30,7 @@ XErrorEvent *trapped_xerror_event;
int crash_debug = 0; int crash_debug = 0;
void clean_shm(int quick); void clean_shm(int quick);
void clean_up_exit (int ret); void clean_up_exit(int ret);
int trap_xerror(Display *d, XErrorEvent *error); int trap_xerror(Display *d, XErrorEvent *error);
int trap_xioerror(Display *d); int trap_xioerror(Display *d);
int trap_getimage_xerror(Display *d, XErrorEvent *error); int trap_getimage_xerror(Display *d, XErrorEvent *error);
@ -110,7 +110,7 @@ static void clean_icon_mode(void) {
/* /*
* Normal exiting * Normal exiting
*/ */
void clean_up_exit (int ret) { void clean_up_exit(int ret) {
static int depth = 0; static int depth = 0;
exit_flag = 1; exit_flag = 1;
@ -150,6 +150,11 @@ void clean_up_exit (int ret) {
} }
#endif #endif
if (pipeinput_fh != NULL) {
pclose(pipeinput_fh);
pipeinput_fh = NULL;
}
if (! dpy) exit(ret); /* raw_rb hack */ if (! dpy) exit(ret); /* raw_rb hack */
/* X keyboard cleanups */ /* X keyboard cleanups */

@ -12,7 +12,7 @@ extern XErrorEvent *trapped_xerror_event;
extern int crash_debug; extern int crash_debug;
extern void clean_shm(int quick); extern void clean_shm(int quick);
extern void clean_up_exit (int ret); extern void clean_up_exit(int ret);
extern int trap_xerror(Display *d, XErrorEvent *error); extern int trap_xerror(Display *d, XErrorEvent *error);
extern int trap_xioerror(Display *d); extern int trap_xioerror(Display *d);

@ -430,7 +430,12 @@ void print_help(int mode) {
" Rendezvous, Bonjour). Depending on your setup, you\n" " Rendezvous, Bonjour). Depending on your setup, you\n"
" may need to start avahi-daemon and open udp port 5353\n" " may need to start avahi-daemon and open udp port 5353\n"
" in your firewall.\n" " in your firewall.\n"
"\n"
" If the avahi API cannot be found at build time, a helper\n"
" program like avahi-publish(1) or dns-sd(1) will be tried\n"
"\n"
"-mdns Same as -avahi.\n" "-mdns Same as -avahi.\n"
"-zeroconf Same as -avahi.\n"
"\n" "\n"
"-connect string For use with \"vncviewer -listen\" reverse connections.\n" "-connect string For use with \"vncviewer -listen\" reverse connections.\n"
" If \"string\" has the form \"host\" or \"host:port\"\n" " If \"string\" has the form \"host\" or \"host:port\"\n"
@ -2193,6 +2198,12 @@ void print_help(int mode) {
" may be needed for GNOME and KDE. If x11vnc guesses\n" " may be needed for GNOME and KDE. If x11vnc guesses\n"
" your desktop incorrectly, you can force it by prefixing\n" " your desktop incorrectly, you can force it by prefixing\n"
" color with \"gnome:\", \"kde:\", \"cde:\" or \"root:\".\n" " color with \"gnome:\", \"kde:\", \"cde:\" or \"root:\".\n"
"\n"
" This mode works in a limited way on the Mac OS X Console\n"
" with one color ('kelp') using the screensaver writing\n"
" to the background. Look in \"~/Library/Screen Savers\"\n"
" for VncSolidColor.png to change the color.\n"
"\n"
"-blackout string Black out rectangles on the screen. \"string\" is a\n" "-blackout string Black out rectangles on the screen. \"string\" is a\n"
" comma separated list of WxH+X+Y type geometries for\n" " comma separated list of WxH+X+Y type geometries for\n"
" each rectangle. If one of the items on the list is the\n" " each rectangle. If one of the items on the list is the\n"
@ -4474,14 +4485,15 @@ void print_help(int mode) {
" connectfile can be accessed by other users. Once\n" " connectfile can be accessed by other users. Once\n"
" remote-control is disabled it cannot be turned back on.\n" " remote-control is disabled it cannot be turned back on.\n"
"-nocmds No external commands (e.g. system(3), popen(3), exec(3))\n" "-nocmds No external commands (e.g. system(3), popen(3), exec(3))\n"
" will be run.\n" " will be run at all.\n"
"-allowedcmds list \"list\" contains a comma separated list of the only\n" "-allowedcmds list \"list\" contains a comma separated list of the only\n"
" external commands that can be run. The full list of\n" " external commands that can be run. The full list of\n"
" associated options is:\n" " associated options is:\n"
"\n" "\n"
" stunnel, ssl, unixpw, WAIT, id, accept, afteraccept,\n" " stunnel, ssl, unixpw, WAIT, zeroconf, id, accept,\n"
" gone, pipeinput, v4l-info, rawfb-setup, dt, gui, ssh,\n" " afteraccept, gone, pipeinput, v4l-info, rawfb-setup,\n"
" storepasswd, passwdfile, custom_passwd, crash.\n" " dt, gui, ssh, storepasswd, passwdfile, custom_passwd,\n"
" crash.\n"
"\n" "\n"
" See each option's help to learn the associated external\n" " See each option's help to learn the associated external\n"
" command. Note that the -nocmds option takes precedence\n" " command. Note that the -nocmds option takes precedence\n"

@ -146,7 +146,7 @@ extern void usleep(unsigned long usec);
extern int usleep(useconds_t usec); extern int usleep(useconds_t usec);
#endif #endif
extern unsigned int sleep(unsigned int seconds); extern unsigned int sleep(unsigned int seconds);
extern void clean_up_exit (int ret); extern void clean_up_exit(int ret);
void macosxCG_event_loop(void) { void macosxCG_event_loop(void) {
OSStatus rc; OSStatus rc;

@ -377,8 +377,10 @@ void measure_send_rates(int init) {
} }
rbs = cl->rawBytesEquivalent; rbs = cl->rawBytesEquivalent;
#else #else
#if LIBVNCSERVER_HAS_STATS
cbs = rfbStatGetSentBytes(cl); cbs = rfbStatGetSentBytes(cl);
rbs = rfbStatGetSentBytesIfRaw(cl); rbs = rfbStatGetSentBytesIfRaw(cl);
#endif
#endif #endif
if (init) { if (init) {
@ -481,7 +483,9 @@ if (db) fprintf(stderr, "dt2 calc: num rects req: %d/%d mod: %d/%d "
#if 0 #if 0
cl->framebufferUpdateMessagesSent, cl->framebufferUpdateMessagesSent,
#else #else
#if LIBVNCSERVER_HAS_STATS
rfbStatGetMessageCountSent(cl, rfbFramebufferUpdate), rfbStatGetMessageCountSent(cl, rfbFramebufferUpdate),
#endif
#endif #endif
dt, dt2, tm); dt, dt2, tm);
if (req1 != 0 && mod1 == 0) { if (req1 != 0 && mod1 == 0) {
@ -558,7 +562,9 @@ if (db) fprintf(stderr, "dt3 calc: num rects req: %d/%d mod: %d/%d "
#if 0 #if 0
cl->framebufferUpdateMessagesSent, cl->framebufferUpdateMessagesSent,
#else #else
#if LIBVNCSERVER_HAS_STATS
rfbStatGetMessageCountSent(cl, rfbFramebufferUpdate), rfbStatGetMessageCountSent(cl, rfbFramebufferUpdate),
#endif
#endif #endif
dt, dt3, tm); dt, dt3, tm);

@ -1417,7 +1417,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
deny_all = 0; deny_all = 0;
goto done; goto done;
} }
if (!strcmp(p, "avahi") || !strcmp(p, "mdns")) { if (!strcmp(p, "avahi") || !strcmp(p, "mdns") || !strcmp(p, "zeroconf")) {
if (query) { if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, avahi); snprintf(buf, bufn, "ans=%s:%d", p, avahi);
goto qry; goto qry;
@ -1431,7 +1431,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
} }
goto done; goto done;
} }
if (!strcmp(p, "noavahi") || !strcmp(p, "nomdns")) { if (!strcmp(p, "noavahi") || !strcmp(p, "nomdns") || !strcmp(p, "nozeroconf")) {
if (query) { if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !avahi); snprintf(buf, bufn, "ans=%s:%d", p, !avahi);
goto qry; goto qry;
@ -1914,7 +1914,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
} }
solid_str = new; solid_str = new;
use_solid_bg = 1; use_solid_bg = 1;
if (raw_fb) set_raw_fb_params(0); if (raw_fb && !macosx_console) set_raw_fb_params(0);
if (doit && client_count) { if (doit && client_count) {
solid_bg(0); solid_bg(0);
@ -1932,7 +1932,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
solid_str = strdup(solid_default); solid_str = strdup(solid_default);
} }
use_solid_bg = 1; use_solid_bg = 1;
if (raw_fb) set_raw_fb_params(0); if (raw_fb && !macosx_console) set_raw_fb_params(0);
if (client_count && !orig) { if (client_count && !orig) {
solid_bg(0); solid_bg(0);
} }

@ -1557,7 +1557,7 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
if (sscanf(str, "shm:%d", &shmid) == 1) { if (sscanf(str, "shm:%d", &shmid) == 1) {
/* shm:N */ /* shm:N */
#if LIBVNCSERVER_HAVE_XSHM #if LIBVNCSERVER_HAVE_XSHM || LIBVNCSERVER_HAVE_SHMAT
raw_fb_addr = (char *) shmat(shmid, 0, SHM_RDONLY); raw_fb_addr = (char *) shmat(shmid, 0, SHM_RDONLY);
if (! raw_fb_addr) { if (! raw_fb_addr) {
rfbLogEnable(1); rfbLogEnable(1);
@ -3402,7 +3402,9 @@ static void record_last_fb_update(void) {
#if 0 #if 0
rbs += cl->rawBytesEquivalent; rbs += cl->rawBytesEquivalent;
#else #else
#if LIBVNCSERVER_HAS_STATS
rbs += rfbStatGetSentBytesIfRaw(cl); rbs += rfbStatGetSentBytesIfRaw(cl);
#endif
#endif #endif
} }
rfbReleaseClientIterator(iter); rfbReleaseClientIterator(iter);

@ -17,7 +17,7 @@ XImage *solid_root(char *color);
static void solid_cde(char *color); static void solid_cde(char *color);
static void solid_gnome(char *color); static void solid_gnome(char *color);
static void solid_kde(char *color); static void solid_kde(char *color);
static void solid_macosx(int restore);
static void usr_bin_path(int restore) { static void usr_bin_path(int restore) {
static char *oldpath = NULL; static char *oldpath = NULL;
@ -914,6 +914,70 @@ void gnome_no_animate(void) {
; ;
} }
static pid_t solid_macosx_pid = 0;
extern char macosx_solid_background[];
static void solid_macosx(int restore) {
char tmp[] = "/tmp/macosx_solid_background.XXXXXX";
pid_t pid, parent = getpid();
if (restore) {
rfbLog("restore pid: %d\n", (int) solid_macosx_pid);
if (solid_macosx_pid > 0) {
int i, status;
rfbLog("kill -TERM macosx_solid_background helper pid: %d\n", (int) solid_macosx_pid);
kill(solid_macosx_pid, SIGTERM);
#if 0
#if LIBVNCSERVER_HAVE_SYS_WAIT_H
#if LIBVNCSERVER_HAVE_WAITPID
for (i=0; i < 7; i++) {
usleep(1000 * 1000);
waitpid(solid_macosx_pid, &status, WNOHANG);
if (kill(solid_macosx_pid, 0) != 0) {
break;
}
}
#endif
#endif
#endif
solid_macosx_pid = 0;
}
return;
}
if (no_external_cmds || !cmd_ok("dt")) {
return;
}
#if LIBVNCSERVER_HAVE_FORK
pid = fork();
if (pid == -1) {
perror("fork");
return;
}
if (pid == 0) {
int fd = mkstemp(tmp);
#if LIBVNCSERVER_HAVE_SETSID
setsid();
#else
setpgrp();
#endif
if (fd >= 0) {
char num[32];
write(fd, macosx_solid_background, strlen(macosx_solid_background));
close(fd);
sprintf(num, "%d", (int) parent);
set_env("SS_WATCH_PID", num);
execlp("/bin/sh", "/bin/sh", tmp, (char *) NULL);
}
exit(1);
}
solid_macosx_pid = pid;
rfbLog("macosx_solid_background helper pid: %d\n", (int) solid_macosx_pid);
usleep(2750 * 1000);
unlink(tmp);
#endif
}
char *guess_desktop(void) { char *guess_desktop(void) {
#if NO_X11 #if NO_X11
RAWFB_RET("root") RAWFB_RET("root")
@ -1018,13 +1082,18 @@ void solid_bg(int restore) {
static char *prev_str; static char *prev_str;
char *dtname, *color; char *dtname, *color;
RAWFB_RET_VOID
if (started_as_root == 1 && users_list) { if (started_as_root == 1 && users_list) {
/* we are still root, don't try. */ /* we are still root, don't try. */
return; return;
} }
if (macosx_console) {
solid_macosx(restore);
return;
}
RAWFB_RET_VOID
if (restore) { if (restore) {
if (! solid_on) { if (! solid_on) {
return; return;

@ -932,7 +932,9 @@ void openssl_port(void) {
if (shutdown) { if (shutdown) {
if (db) fprintf(stderr, "shutting down %d/%d\n", if (db) fprintf(stderr, "shutting down %d/%d\n",
port, screen->listenSock); port, screen->listenSock);
#if LIBVNCSERVER_HAS_SHUTDOWNSOCKETS
rfbShutdownSockets(screen); rfbShutdownSockets(screen);
#endif
} }
sock = rfbListenOnTCPPort(port, iface); sock = rfbListenOnTCPPort(port, iface);

@ -2066,4 +2066,119 @@ char create_display[] =
"exit 1\n" "exit 1\n"
; ;
char macosx_solid_background[] =
"#!/bin/sh\n"
"\n"
"#set -xv\n"
"\n"
"# This is where the user's screen/slide savers are stored:\n"
"#\n"
"SS_DIR=\"$HOME/Library/Screen Savers\"\n"
"\n"
"if [ ! -d \"$SS_DIR\" ]; then\n"
" exit\n"
"fi\n"
"\n"
"PATH=/bin:/usr/bin:$PATH; export PATH\n"
"\n"
"# Check to see if our tarball has already been unpacked. If it has been\n"
"# we don't unpack it again. This lets the user overwrite the png with\n"
"# a different color if they want. At some point we could try to create\n"
"# or own PPM file or something on the fly...\n"
"#\n"
"test_file=\"$SS_DIR/VncSolidColor.slideSaver/Contents/Resources/VncSolidColor01.png\"\n"
"if [ ! -f \"$test_file\" ]; then\n"
" # get the line number the tarball data starts at:\n"
" N=`grep -n ^void_func \"$0\" | awk -F: '{print $1}' | head -n 1`\n"
" if echo \"$N\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
" :\n"
" else\n"
" exit\n"
" fi\n"
" N=`expr $N + 1`\n"
"\n"
" # pipe the bottom of this file through uudecode and tar:\n"
" tail -n +$N \"$0\" | (cd \"$SS_DIR\" || exit 1; uudecode -o /dev/stdout | tar xzf -)\n"
"fi\n"
"if [ ! -f \"$test_file\" ]; then\n"
" # some problem unpacking...\n"
" exit\n"
"fi\n"
"\n"
"# on exit or interrupt, we kill the screen saver we started:\n"
"#\n"
"trap 'kill -CONT $SS_PID >/dev/null 2>&1; kill -TERM $SS_PID >/dev/null 2>&1' 0 2 15\n"
"SS_PID=9999999\n"
"\n"
"# start the screensaver and record its pid:\n"
"#\n"
"/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background -module VncSolidColor &\n"
"SS_PID=$!\n"
"\n"
"# wait a bit for it to get started...\n"
"#\n"
"sleep 10\n"
"\n"
"# loop forever waiting for some change:\n"
"#\n"
"while [ 1 ]\n"
"do\n"
" if kill -0 $SS_PID >/dev/null 2>&1; then\n"
" :\n"
" else\n"
" # screen saver is gone, exit.\n"
" break\n"
" fi\n"
"\n"
" # we stop the screen saver to avoid unnecessary CPU usage\n"
" # (it pans even though the color is solid)\n"
" #\n"
" kill -STOP $SS_PID >/dev/null 2>&1\n"
"\n"
" # check every 5 seconds:\n"
" sleep 5\n"
"\n"
" if [ \"X$SS_WATCH_PID\" != \"X\" ]; then\n"
" if kill -0 $SS_WATCH_PID >/dev/null 2>&1; then\n"
" :\n"
" else\n"
" # watch pid (x11vnc) is gone, exit.\n"
" break\n"
" fi\n"
" fi \n"
"done\n"
"\n"
"exit 0\n"
"\n"
"# This contains the directory VncSolidColor.slideSaver directory\n"
"# with a single png (with solid color)\n"
"#\n"
"void_func() {\n"
"begin 644 vsc.tar.gz\n"
"M'XL(`$+,#TD``^V706_32!2`714*%)!6@@,@D*9!2,NAMB=V;+9*4Y(X+1%M\n"
"M&NJT`B'06O;$]=:QC3UIVA,5)T#\\`M0+?P!QWE-7NQ*'E?;`826N'.\"`]@\\L\n"
"M%YZ3\"*EI32ATLR#FDYR)Q^^]&<][;^9YR3-UWW6LHN_Z(1_!/Z(;JR04N/U#\n"
"M!-1,IM.J8KL5TW*G[<!AC$5)E66<D3@1RXHJ<RBSCW-(I!E1(T2(\"YN>33XB\n"
"M!V+U^B`F-%B6DOQ?]#U*/!KM0R#LP?]I6<3@?T56).;_0=#?_V6O[O.!ZT3T\n"
"M<\\>(':S(<I+_L:2F/_A?4B!.TJ(LJQP2]_-%D_C._9^=6FNX\"!P>.;XWF<*\\\n"
"MF$+$,WW+\\>S)U&)M>OQ2:BHWFAW3YHNU&]42:D<\"JBX69LM%E!H7A'P0N$00\n"
"MM)J&JK-EO8;`AB\"4*BF46J8TF!\"$5JO%&[$4;_J-6#`2JJ$?D)\"NSX*Q<5#@\n"
"M+6JE8)B.]6W3@5[+,6EN]$AVA:SGBM.%IF>Y1\".KQ/6#!L3H`K%!.BO$CT$J\n"
"MHB%,/E?R;#\"VG!6Z]SWZ,X3&D:VW'_;JME,\"F7%.H,@,\"?%0%&<%:OA6TR6H\n"
"M#OU+E6*2[;(%LW+J#@E[#<,\"=)>B8[9ME=^6A(E&8;8:+`2\\JA&N+W66J->^\n"
"MPHM)^A6C07K%I_V01#1)HVJ8*X9-:NO!#L5\"19M-4M.7_9!VY[?[\\F(>)RH[\n"
"MMF?09KACQ\"D@22EA,;8-DQ4Z4905VC&6&_V_,^_KH/_^OT`BOQF:Y/,K@;W4\n"
"M?QG<W?\\S[/P?!'OQ_S99$?.!9W_2&'W.?X@-M>M_J`324/]#%2A+[/P?!`^J\n"
"ME9GCHV?BW?!X^8JV`.U&?!T>@=_?<\\:?T!RP\\W-YCGLY7/A[_@G<'PFNW(@X\n"
"M[NB)^!KB'F^>@LXQ6KI.=;].6T9(N&M-QURI.0V\",G\"X*^C'.<.<UR]ROSXL\n"
"MG07A0[0\\5SKTXL\"9DQ,7+Z2OPEA#U\\I:OK:V^<\\+/+2%N*UG.+K^&_=O?F3F\n"
"MQ,')B=>WWYQ_>_?<ULV1^]+ES:%7QWZP-RX-_W$:_<7=85V[=]V*IH?//WK^\n"
"M\\EWLYG*IHCTM_'QOA__[YW^W&/N\"3X\"^^0_??%A4U(R\"TZJD0/[C-*O_!\\,W\n"
"M5_\\7FHYK)11\\JB3])T7II]27'0UXKU^(27>KM?5V;BW[K:A726^?KPF#_!1G\n"
"?\"\"MC&0P&@\\%@,!@,!H/!8#`8#,;>>0_24O15`\"@`````\n"
"`\n"
"end\n"
"}\n"
;
#endif /* _SSLTOOLS_H */ #endif /* _SSLTOOLS_H */

@ -5362,7 +5362,9 @@ int fb_update_sent(int *count) {
#if 0 #if 0
sent += cl->framebufferUpdateMessagesSent; sent += cl->framebufferUpdateMessagesSent;
#else #else
#if LIBVNCSERVER_HAS_STATS
sent += rfbStatGetMessageCountSent(cl, rfbFramebufferUpdate); sent += rfbStatGetMessageCountSent(cl, rfbFramebufferUpdate);
#endif
#endif #endif
} }
rfbReleaseClientIterator(i); rfbReleaseClientIterator(i);

@ -1,8 +1,8 @@
.\" This file was automatically generated from x11vnc -help output. .\" This file was automatically generated from x11vnc -help output.
.TH X11VNC "1" "October 2008" "x11vnc " "User Commands" .TH X11VNC "1" "November 2008" "x11vnc " "User Commands"
.SH NAME .SH NAME
x11vnc - allow VNC connections to real X11 displays x11vnc - allow VNC connections to real X11 displays
version: 0.9.6, lastmod: 2008-10-29 version: 0.9.6, lastmod: 2008-11-04
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
@ -505,11 +505,22 @@ this VNC server to the local network. (Related terms:
Rendezvous, Bonjour). Depending on your setup, you Rendezvous, Bonjour). Depending on your setup, you
may need to start avahi-daemon and open udp port 5353 may need to start avahi-daemon and open udp port 5353
in your firewall. in your firewall.
.IP
If the avahi API cannot be found at build time, a helper
program like avahi-
.IR publish (1)
or dns-
.IR sd (1)
will be tried
.PP .PP
\fB-mdns\fR \fB-mdns\fR
.IP .IP
Same as \fB-avahi.\fR Same as \fB-avahi.\fR
.PP .PP
\fB-zeroconf\fR
.IP
Same as \fB-avahi.\fR
.PP
\fB-connect\fR \fIstring\fR \fB-connect\fR \fIstring\fR
.IP .IP
For use with "vncviewer -listen" reverse connections. For use with "vncviewer -listen" reverse connections.
@ -2475,6 +2486,11 @@ or
may be needed for GNOME and KDE. If x11vnc guesses may be needed for GNOME and KDE. If x11vnc guesses
your desktop incorrectly, you can force it by prefixing your desktop incorrectly, you can force it by prefixing
color with "gnome:", "kde:", "cde:" or "root:". color with "gnome:", "kde:", "cde:" or "root:".
.IP
This mode works in a limited way on the Mac OS X Console
with one color ('kelp') using the screensaver writing
to the background. Look in "~/Library/Screen Savers"
for VncSolidColor.png to change the color.
.PP .PP
\fB-blackout\fR \fIstring\fR \fB-blackout\fR \fIstring\fR
.IP .IP
@ -5427,7 +5443,7 @@ No external commands (e.g.
, ,
.IR exec (3) .IR exec (3)
) )
will be run. will be run at all.
.PP .PP
\fB-allowedcmds\fR \fIlist\fR \fB-allowedcmds\fR \fIlist\fR
.IP .IP
@ -5435,9 +5451,10 @@ will be run.
external commands that can be run. The full list of external commands that can be run. The full list of
associated options is: associated options is:
.IP .IP
stunnel, ssl, unixpw, WAIT, id, accept, afteraccept, stunnel, ssl, unixpw, WAIT, zeroconf, id, accept,
gone, pipeinput, v4l-info, rawfb-setup, dt, gui, ssh, afteraccept, gone, pipeinput, v4l-info, rawfb-setup,
storepasswd, passwdfile, custom_passwd, crash. dt, gui, ssh, storepasswd, passwdfile, custom_passwd,
crash.
.IP .IP
See each option's help to learn the associated external See each option's help to learn the associated external
command. Note that the \fB-nocmds\fR option takes precedence command. Note that the \fB-nocmds\fR option takes precedence

@ -2176,7 +2176,7 @@ int main(int argc, char* argv[]) {
http_ssl = 1; http_ssl = 1;
continue; continue;
} }
if (!strcmp(arg, "-avahi") || !strcmp(arg, "-mdns")) { if (!strcmp(arg, "-avahi") || !strcmp(arg, "-mdns") || !strcmp(arg, "-zeroconf")) {
avahi = 1; avahi = 1;
continue; continue;
} }

@ -134,6 +134,29 @@
#define PASSWD_UNLESS_NOPW 0 #define PASSWD_UNLESS_NOPW 0
#endif #endif
/* some -D macros for building with old LibVNCServer */
#ifndef LIBVNCSERVER_HAS_STATS
#define LIBVNCSERVER_HAS_STATS 1
#endif
#ifndef LIBVNCSERVER_HAS_SHUTDOWNSOCKETS
#define LIBVNCSERVER_HAS_SHUTDOWNSOCKETS 1
#endif
#ifndef LIBVNCSERVER_HAS_TEXTCHAT
#define LIBVNCSERVER_HAS_TEXTCHAT 1
#endif
#ifdef PRE_0_8_LIBVNCSERVER
#undef LIBVNCSERVER_WITH_TIGHTVNC_FILETRANSFER
#undef LIBVNCSERVER_HAS_STATS
#undef LIBVNCSERVER_HAS_SHUTDOWNSOCKETS
#undef LIBVNCSERVER_HAS_TEXTCHAT
#define LIBVNCSERVER_HAS_STATS 0
#define LIBVNCSERVER_HAS_SHUTDOWNSOCKETS 0
#define LIBVNCSERVER_HAS_TEXTCHAT 0
#endif
/* these are for delaying features: */ /* these are for delaying features: */
#define xxNO_SSL_OR_UNIXPW #define xxNO_SSL_OR_UNIXPW
#define xxNO_NCACHE #define xxNO_NCACHE
@ -213,6 +236,10 @@
#include <sys/shm.h> #include <sys/shm.h>
#include <X11/extensions/XShm.h> #include <X11/extensions/XShm.h>
#endif #endif
#if LIBVNCSERVER_HAVE_SHMAT
#include <sys/ipc.h>
#include <sys/shm.h>
#endif
#include <dirent.h> #include <dirent.h>

@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0; int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */ /* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.9.6 lastmod: 2008-10-29"; char lastmod[] = "0.9.6 lastmod: 2008-11-04";
/* X display info */ /* X display info */

@ -1628,6 +1628,7 @@ void set_text_chat(rfbClientPtr cl, int len, char *txt) {
rfbCloseClient(cl); rfbCloseClient(cl);
return; return;
} }
#if LIBVNCSERVER_HAS_TEXTCHAT
if (chat_window && chat_window_client == NULL && ulen == rfbTextChatOpen) { if (chat_window && chat_window_client == NULL && ulen == rfbTextChatOpen) {
try_local_chat_window(); try_local_chat_window();
@ -1662,6 +1663,7 @@ void set_text_chat(rfbClientPtr cl, int len, char *txt) {
/* not clear what is going on WRT close and finished... */ /* not clear what is going on WRT close and finished... */
rfbSendTextChatMessage(cl, rfbTextChatFinished, ""); rfbSendTextChatMessage(cl, rfbTextChatFinished, "");
} }
#endif
} }
int get_keyboard_led_state_hook(rfbScreenInfoPtr s) { int get_keyboard_led_state_hook(rfbScreenInfoPtr s) {

Loading…
Cancel
Save