summaryrefslogtreecommitdiffstats
path: root/x11vnc/misc
diff options
context:
space:
mode:
authorrunge <runge>2007-06-15 03:19:05 +0000
committerrunge <runge>2007-06-15 03:19:05 +0000
commitd3326942e2e7d1391da0975590dbd2c8668d9328 (patch)
tree34da35ee116fc657d51736ff65fc0b02b3826801 /x11vnc/misc
parent171db9c542cd35b6de8ad88cefd99ea145482df1 (diff)
downloadlibtdevnc-d3326942e2e7d1391da0975590dbd2c8668d9328.tar.gz
libtdevnc-d3326942e2e7d1391da0975590dbd2c8668d9328.zip
x11vnc: fix build error if libssl is missing or --without-ssl supplied.
Diffstat (limited to 'x11vnc/misc')
-rw-r--r--x11vnc/misc/enhanced_tightvnc_viewer/README46
-rwxr-xr-xx11vnc/misc/enhanced_tightvnc_viewer/bin/Darwin.Power.Macintosh/vncviewer.sh9
-rwxr-xr-xx11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc5
-rwxr-xr-xx11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd12
-rwxr-xr-xx11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl432
-rwxr-xr-xx11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle2
-rw-r--r--x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-full.patch1371
7 files changed, 975 insertions, 902 deletions
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/README b/x11vnc/misc/enhanced_tightvnc_viewer/README
index a4f5985..67a9160 100644
--- a/x11vnc/misc/enhanced_tightvnc_viewer/README
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/README
@@ -95,16 +95,21 @@ The enhanced TightVNC viewer features are:
- ZRLE VNC encoding support (RealVNC's encoding)
+ - Cursor alphablending with x11vnc at 32bpp (-alpha option)
+
+ - Option "-unixpw ..." for use with "x11vnc -unixpw" login dialogs.
+
+ - Support for UltraVNC extensions: Single Window, Disable
+ Server-side Input, 1/n Server side scaling, Text Chat (shell
+ terminal UI). Both UltraVNC and x11vnc servers support these
+ extensions
+
- Extremely low color modes: 64 and 8 colors in 8bpp
(-use64/-bgr222, -use8/-bgr111)
- Medium color mode: 16bpp mode even for 32bpp Viewer display
(-16bpp/-bgr565)
- - Cursor alphablending with x11vnc at 32bpp (-alpha option)
-
- - Maintains its own BackingStore if the X server does not
-
- x11vnc's client-side caching -ncache method cropping option
(-ycrop n). This will "hide" the large pixel buffer cache
below the actual display. Set to actual height or use -1 for
@@ -113,6 +118,14 @@ The enhanced TightVNC viewer features are:
- Scrollbar width setting: -sbwidth n, the default is very thin,
2 pixels, for less distracting -ycrop usage.
+ - Improvements to the Popup menu, all of these can now be changed
+ dynamically via the menu: ViewOnly, Toggle Bell, CursorShape
+ updates, X11 Cursor, Cursor Alphablending, Toggle Tight/ZRLE,
+ Toggle JPEG, FullColor/16bpp/8bpp (256/64/8 colors), Greyscale
+ for low color modes.
+
+ - Maintains its own BackingStore if the X server does not
+
- The default for localhost:0 connections is not raw encoding
(local machine). Default assumes you are using SSH tunnel. Use
-rawlocal to revert.
@@ -123,17 +136,6 @@ The enhanced TightVNC viewer features are:
- Fix for Popup menu positioning for old window managers
(-popupfix option).
- - Improvements to the Popup menu, all of these can now be changed
- dynamically via the menu: ViewOnly, Toggle Bell, CursorShape
- updates, X11 Cursor, Cursor Alphablending, Toggle Tight/ZRLE,
- Toggle JPEG, FullColor/16bpp/8bpp (256/64/8 colors), Greyscale
- for low color modes.
-
- - Support for UltraVNC extensions: Single Window, Disable
- Server-side Input, 1/n Server side scaling, Text Chat (shell
- terminal UI). Both UltraVNC and x11vnc servers support these
- extensions
-
- Run vncviewer -help for all options.
@@ -161,7 +163,7 @@ Unix and Mac OS X:
Unpack the archive:
- % gzip -dc ssvnc-1.0.15.tar.gz | tar xvf -
+ % gzip -dc ssvnc-1.0.18.tar.gz | tar xvf -
Run the GUI:
@@ -171,18 +173,24 @@ Unix and Mac OS X:
On MacOSX you could also click on the SSVNC app in the Finder.
- The smaller file "ssvnc_no_windows-1.0.15.tar.gz"
+ The smaller file "ssvnc_no_windows-1.0.18.tar.gz"
could have been used as well.
On MacOSX there is also a SSVNC.app directory icon you can click on
in Finder to start the application.
+ On MacOSX if you don't like the Chicken of the VNC (e.g. no local
+ cursors, no screen size rescaling, and no password prompting), and you
+ have the XDarwin X server installed, you can set DISPLAY before starting
+ ssvnc (or type DISPLAY=... in Host:Disp and hit Return). Then our
+ enhanced TightVNC viewer will be used instead of COTVNC.
+
Windows:
Unzip, using WinZip or a similar utility, the zip file:
- ssvnc-1.0.15.zip
+ ssvnc-1.0.18.zip
Run the GUI, e.g.:
@@ -194,7 +202,7 @@ Windows:
select Open, and then OK to launch it.
- The smaller file "ssvnc_windows_only-1.0.15.zip"
+ The smaller file "ssvnc_windows_only-1.0.18.zip"
could have been used as well.
You can make a Windows shortcut to this program if you want to.
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/bin/Darwin.Power.Macintosh/vncviewer.sh b/x11vnc/misc/enhanced_tightvnc_viewer/bin/Darwin.Power.Macintosh/vncviewer.sh
index 0a9c1cc..18e2f31 100755
--- a/x11vnc/misc/enhanced_tightvnc_viewer/bin/Darwin.Power.Macintosh/vncviewer.sh
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/bin/Darwin.Power.Macintosh/vncviewer.sh
@@ -5,6 +5,15 @@
dir=`dirname "$0"`
+if [ "X$SSVNC_DYLD_LIBRARY_PATH" != "X" ]; then
+ if [ "X$DYLD_LIBRARY_PATH" = "X" ] ; then
+ DYLD_LIBRARY_PATH=$SSVNC_DYLD_LIBRARY_PATH
+ else
+ DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$SSVNC_DYLD_LIBRARY_PATH
+ fi
+ export DYLD_LIBRARY_PATH
+fi
+
if [ "X$DISPLAY" != "X" ]; then
"$dir/vncviewer.x11" "$@"
else
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc b/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc
index 950b94a..8088c3f 100755
--- a/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc
@@ -126,6 +126,11 @@ fi
SSVNC_BASEDIR="$dir"
export SSVNC_BASEDIR
+if [ -f "$dir/util/ultraftp.jar" ]; then
+ SSVNC_ULTRA_FTP_JAR="$dir/util/ultraftp.jar"
+ export SSVNC_ULTRA_FTP_JAR
+fi
+
if [ "X$WISH" = "Xwish" ]; then
exec ssvnc.tcl "$@"
else
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd b/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd
index 7c76688..dde977b 100755
--- a/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/bin/ssvnc_cmd
@@ -86,6 +86,13 @@ fi
PATH=$PATH:/usr/bin:/bin
export PATH
+if [ "X$FULLNAME" = "XKarl J. Runge" ]; then
+ VNCVIEWER_POPUP_FIX=1
+ export VNCVIEWER_POPUP_FIX
+
+ PATH=`echo "$PATH" | sed -e 's,runge/bin/override,-------------,'`
+fi
+
# Set this for ss_vncviewer to pick up:
#
if [ "X$1" = "X-cotvnc" ]; then
@@ -195,6 +202,11 @@ else
PATH="$dir:$dir/$name:$dir/util:$PATH"
fi
+if [ -f "$dir/util/ultraftp.jar" ]; then
+ SSVNC_ULTRA_FTP_JAR="$dir/util/ultraftp.jar"
+ export SSVNC_ULTRA_FTP_JAR
+fi
+
base=`basename "$0"`
if [ "X$1" = "X-ssl" ]; then
shift
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl b/x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl
index b074741..ad29194 100755
--- a/x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/bin/util/ssvnc.tcl
@@ -8,7 +8,7 @@ exec wish "$0" "$@"
# ssvnc.tcl: gui wrapper to the programs in this
# package. Also sets up service port forwarding.
#
-set version 1.0.17
+set version 1.0.18
set buck_zero $argv0
@@ -187,32 +187,67 @@ proc help {} {
the Help under Options for more info.
- Proxies:
+ Proxies/Gateways:
If an intermediate proxy is needed to make the SSL connection
(e.g. web gateway out of a firewall) enter it in the "Proxy/Gateway"
- entry box, or Alternatively supply both hosts separated by spaces
- (with the proxy second) in the VNC Host:Display box:
+ entry box:
- host:number gwhost:port
+ VNC Host-Display: host:number
+ Proxy/Gateway: gw-host:port
+ e.g.:
+ VNC Host-Display: far-away.east:0
+ Proxy/Gateway: mygateway.com:8080
+
+ Or Alternatively one can supply both hosts separated by
+ spaces (with the proxy second) in the VNC Host:Display box:
+
+ VNC Host-Display: far-away.east:0 mygateway.com:8080
+
+ This looks a little strange, but it actually how SSVNC stores the
+ host info internally.
- E.g.: far-away.east:0 mygateway.com:8080
If the "double proxy" case is required (e.g. coming out of a web
- proxied firewall environment), separate them via a comma, e.g.:
+ proxied firewall environment and then into a 2nd proxy to ultimately
+ reach the VNC server), separate them via a comma, e.g.:
- far-away:0 local-proxy:8080,mygateway.com:443
+ VNC Host-Display: far-away:0
+ Proxy/Gateway: local-proxy:8080,mygateway.com:443
- (either as above, or putting the 2nd string in the "Proxy/Gateway"
- entry box).
+ (either as above, or alternatively putting both strings in Host:Display)
See the ss_vncviewer description and x11vnc FAQ for info on proxies:
http://www.karlrunge.com/x11vnc/#ss_vncviewer
http://www.karlrunge.com/x11vnc/#faq-ssl-java-viewer-proxy
- Proxies also apply to SSH mode, it is a usually a gateway machine to
- log into via SSH that is not the workstation running the VNC server.
+ SSH Proxies/Gateways:
+
+ Proxy/Gateway also applies to SSH mode, it is a usually a gateway
+ machine to log into via SSH that is not the workstation running the
+ VNC server.
+
+ For example if a company had a central login server: "ssh.company.com"
+ (accessible from the internet) and the internal workstation name was
+ "joes-pc", one could put in for the
+
+ VNC Host:Display: joes-pc:0
+ Proxy/Gateway: ssh.company.com
+
+ It is OK if the hostname "joes-pc" only resolves inside the firewall.
+
+ The 2nd leg, from ssh.company.com -> joes-pc is done by a ssh -L
+ redir and is not encrypted (but viewer -> ssh.company.com is encrypted).
+
+ To SSH encrypt both legs, try the "double gateway" using the above
+ "comma" notation:
+
+ VNC Host:Display: :0
+ Proxy/Gateway: ssh.company.com,joes-pc
+
+ this requires an SSH server running on joes-pc. Use username@host
+ (e.g. joe@joes-pc jsmith@ssh.company.com if the user name differs).
Remote SSH Command:
@@ -421,10 +456,16 @@ proc help {} {
the latter is preferred because when you reconnect with it will
find the already running one. The former one will keep creating
new X sessions if called repeatedly.
+
+ 12) You can change the X DISPLAY variable by typing DISPLAY=... into
+ VNC Host:Display and hitting Return or clicking Connect. Same for
+ HOME=. Setting SLEEP=n increases the amount of time waited before
+ starting the viewer. On Mac, you can set DYLD_LIBRARY_PATH=... too.
+ It should propagate down the the viewer.
}
global version
- set msg " SSVNC version: $version\n$msg"
+ set msg " SSVNC version: $version\n$msg"
.h.f.t insert end $msg
jiggle_text .h.f.t
@@ -443,55 +484,79 @@ proc help_certs {} {
set msg {
Description:
- *IMPORTANT*: Only with SSL Certificate verification (either manually or via
- Certificate Authority) can Man-In-The-Middle attacks be prevented. Otherwise,
- only passive network sniffing attacks are prevented.
-
- The SSL Certificate files described below can have been created externally
- (e.g. by x11vnc), you can import it via "Import Certificate" if you like.
- OR you can click on "Create Certificate ..." to use this program to generate a
- Certificate + Private Key pair. In that case you will need to distribute one
- of the generated files to the VNC Server.
-
- You can also retrieve the remote VNC Server's Cert via the "Fetch Cert" button
- on the main panel. After you check that it is the correct Cert (e.g. by
- comparing MD5 hash or other info), you can save it. It will be set as the
- "ServerCert" to verify against for the connection. To make this verification
- check permanent, you will need to save the profile via Options -> Save Profile.
-
- If "Verify All Certs" is checked, you are forced to do this check, and so the
- first time you connect to a new server you may need to follow a few dialogs to
- inspect and save the server certificate. In this case certificates are saved
- in the 'Accepted Certs' directory. When "Verify All Certs" is checked all
- hosts or profiles with "CertsDir" set to "ACCEPTED_CERTS" (and no "ServerCert"
- setting) will be check against the accepted certificates.
-
- Note that "Verify All Certs" is on by default so that users who do not
+ *IMPORTANT*: Only with SSL Certificate verification (either manually or via a
+ Certificate Authority certificate) can Man-In-The-Middle attacks be prevented.
+ Otherwise, only passive network sniffing attacks are prevented.
+
+ The SSL Certificate files described below may have been created externally
+ (e.g. by x11vnc or openssl): you can import them via "Import Certificate".
+ OR you can click on "Create Certificate ..." to use THIS program to generate
+ a Certificate + Private Key pair for you (in this case you will need to
+ distribute one of the generated files to the VNC Server).
+
+ Then you associate the Saved cert with the VNC server, see the panel entry
+ box description below, and then Connect. You will usually want to Save this
+ association in a VNC Server profile for the next time you connect.
+
+ Fetch Cert:
+
+ You can also retrieve and view the VNC Server's Cert via the "Fetch Cert"
+ button on the main panel. After you check that it is the correct Cert (e.g. by
+ comparing MD5 hash or other info), you can save it. The file it was saved
+ as will be set as the "ServerCert" to verify against for the next connection.
+ To make this verification check permanent, you will need to save the profile
+ via Options -> Save Profile.
+
+ Verify All Certs:
+
+ If "Verify All Certs" is checked on the main panel, you are always forced
+ to check unrecognized server certs, and so the first time you connect to
+ a new server you may need to follow a few dialogs to inspect and save the
+ server certificate.
+
+ Under "Verify All Certs", new certificates are saved in the 'Accepted Certs'
+ directory. When the checkbox is set all host profiles with "CertsDir" set to
+ "ACCEPTED_CERTS" (and an empty "ServerCert" setting) will be checked against
+ the pool of accepted certificates in the 'Accepted Certs' directory.
+
+ Note that we have "Verify All Certs" on by default so that users who do not
understand the SSL Man-In-The-Middle problem will not be left completely
- vulnerable to it (everyone still must make the effort to verify new certificates
- by an external method to be completely safe)
+ vulnerable to it. Everyone still must make the effort to verify new
+ certificates by an external method to be completely safe.
To have "Verify All Certs" toggled off at startup, use "ssvnc -nv" or set
SSVNC_NO_VERIFY_ALL=1 before starting. If you do not even want to see the
button, use "ssvnc -nvb" or SSVNC_NO_VERIFY_ALL_BUTTON=1.
- Note: due to a deficiency in openssl "Fetch Cert" may be slow on Windows. Also:
- "Fetch Cert" and "Verify All Certs" do not currently work in "SSH + SSL" mode.
+ Note: "Fetch Cert" and "Verify All Certs" do not currently work in "SSH +
+ SSL" mode. In this case to have server authentication "ServerCert" must be
+ set explicitly to a file (or "CertDir" to a directory).
+
+ CA:
+
+ One can make SSL VNC server authentication more "automatic" as it is in
+ Web Browsers going to HTTPS sites, by using a Certificate Authority (CA)
+ cert (e.g. a professional one like Verisign or Thawte, or one your company
+ or organization creates) for the "ServerCert". This is described in detail
+ here: http://www.karlrunge.com/x11vnc/ssl.html
+
+ CA's are not often used, but if the number of VNC Servers scales up it can
+ be very convenient because the viewers (i.e. SSVNC) only need the CA cert,
+ not all of the Server certs.
+
- One can make SSL VNC server authentication "automatic" as it is in Web
- Browsers going to HTTPS sites, by using a Certificate Authority (CA) cert
- (e.g. a professional one like Verisign or Thawte, or one your company or
- organization creates). This is described in detail here:
- http://www.karlrunge.com/x11vnc/ssl.html You simply use the CA cert in the
- entries described below.
+ Now what goes into the panel's entry boxes is described.
Your Certificate + Key:
- You can specify your own SSL certificate (PEM) file in "MyCert" in which case it
- is used to authenticate you (the viewer) to the remote VNC Server. If this fails
+ You can specify YOUR own SSL certificate (PEM) file in "MyCert" in which case it
+ is used to authenticate YOU (the viewer) to the remote VNC Server. If this fails
the remote VNC Server will drop the connection.
+ So the Server could use this method to authenticate Viewers instead of the
+ more common practice of using a VNC password or x11vnc's -unixpw mode.
+
Server Certificates:
@@ -508,6 +573,7 @@ proc help_certs {} {
The former corresponds to the "CAfile" STUNNEL parameter.
The latter corresponds to the "CApath" STUNNEL parameter.
+
See stunnel(8) or www.stunnel.org for more information.
If the remote VNC Server fails to authenticate itself with respect to the specified
@@ -517,17 +583,19 @@ proc help_certs {} {
Once selected, if you click Info or the Right Mouse button on "Browse..."
then information about the certificate will be displayed.
- If "CertsDir" is set to the token "ACCEPTED_CERTS" (and "ServerCert" is
- unset) then the certificates accumulated in the special 'Accepted Certs'
- directory will be used. "ACCEPTED_CERTS" is the default for every server
- ("Verify All Certs"). Note that if you ever need to clean this directory,
- each cert is saved in two files, for example:
+ If, as is the default, "CertsDir" is set to the token "ACCEPTED_CERTS" (and
+ "ServerCert" is unset) then the certificates accumulated in the special
+ 'Accepted Certs' directory will be used. "ACCEPTED_CERTS" is the default for
+ every server ("Verify All Certs"). Note that if you ever need to clean this
+ directory, each cert is saved in two files, for example:
bf-d0-d6-9c-68-5a-fe-24-c6-60-ba-b4-14-e6-66-14=hostname-0.crt
and
9eb7c8be.0
This is because of the way OpenSSL must use hash-based filenames in Cert dirs.
+ The file will have a "full filename:" line indicating the fingerprint and
+ hostname associated with it. Be sure to remove both files.
Notes:
@@ -546,9 +614,10 @@ proc help_certs {} {
x11vnc -ssl SAVE ...
and then copy the Server certificate to the local (viewer-side) machine.
- x11vnc prints out to the screen the Server certificate it generates.
- You can set "ServerCert" to it directly or use the "Import Certificate"
- action to save it to a file. Or use the "Fetch Cert" method.
+ x11vnc prints out to the screen the Server certificate it generates. You can
+ set "ServerCert" to it directly or use the "Import Certificate" action to
+ save it to a file. Or use the "Fetch Cert" method to retrieve it (be sure
+ to verify the MD5 fingerprint, etc).
x11vnc also has command line utilities to create server, client, and CA
(Certificate Authority) certificates. See the above URLs.
@@ -2770,7 +2839,7 @@ proc check_accepted_certs {} {
if [file exists $crt] {
mesg "OK: Certificate found in ACCEPTED_CERTS"
- after 550
+ after 750
return 1
}
@@ -2864,6 +2933,7 @@ proc check_accepted_certs {} {
VNC server that you trust (e.g. by checking the fingerprint with that
sent to you by the server administrator).
+
Should this certificate be saved in the accepted certs directory and
then used to SSL authenticate VNC servers?
@@ -2871,7 +2941,7 @@ proc check_accepted_certs {} {
to inspect the certificate before deciding to save it or not.
Choose 'Ignore Cert for One Connection' to connect one time to the
- server and not require any certificate verification.
+ server and not require ANY certificate verification.
"
if {$oth == 0} {
@@ -2947,40 +3017,51 @@ proc check_accepted_certs {} {
set fetch_cert_filename $crt
fetch_dialog $cert_text $hp $hp 1 47
+ after 100
catch {tkwait window .fetch}
after 200
catch {tkwait window .scrt}
+ after 200
+ if [winfo exists .scrt] {
+ catch {tkwait window .scrt}
+ }
set fetch_cert_filename ""
+ set accepted_cert_dialog_in_progress 0
- if [file exists $crt] {
- set ossl [get_openssl]
- set hash [exec $ossl x509 -hash -noout -in $crt]
- set hash [string trim $hash]
- if [regexp {^([0-9a-f][0-9a-f]*)} $hash mv h] {
- set hashfile "$adir/$h.0"
- if [file exists $hashfile] {
- set hashfile "$adir/$h.1"
- }
- set fh [open $crt "a"]
- if {$fh != ""} {
- puts $fh ""
- puts $fh "SSVNC info:"
- puts $fh "Host-Display: $hp"
- puts $fh "$fingerline"
- puts $fh "hash filename: $h.0"
- puts $fh "full filename: $fingerprint=$from.crt"
- close $fh
- }
- catch {file copy -force $crt $hashfile}
- if [file exists $hashfile] {
- return 1
- }
+ save_hash $crt $adir $hp $fingerline $from $fingerprint
+
+ return 1
+}
+
+proc save_hash {crt adir hp fingerline from fingerprint} {
+ if ![file exists $crt] {
+ return
+ }
+ set ossl [get_openssl]
+ set hash [exec $ossl x509 -hash -noout -in $crt]
+ set hash [string trim $hash]
+ if [regexp {^([0-9a-f][0-9a-f]*)} $hash mv h] {
+ set hashfile "$adir/$h.0"
+ if [file exists $hashfile] {
+ set hashfile "$adir/$h.1"
+ }
+ set fh [open $crt "a"]
+ if {$fh != ""} {
+ puts $fh ""
+ puts $fh "SSVNC info:"
+ puts $fh "Host-Display: $hp"
+ puts $fh "$fingerline"
+ puts $fh "hash filename: $h.0"
+ puts $fh "full filename: $fingerprint=$from.crt"
+ close $fh
+ }
+ catch {file copy -force $crt $hashfile}
+ if [file exists $hashfile] {
+ return 1
}
}
-
- return 0
}
proc tpid {} {
@@ -3680,13 +3761,51 @@ proc launch {{hp ""}} {
set hp [get_vncdisplay]
}
- if {[regexp {^HOME=} $hp] || [regexp {^SSVNC_HOME=} $hp]} {
- set t $hp
+ set hpt [string trim $hp]
+ regsub {[ ].*$} $hpt "" hpt
+
+
+ if {[regexp {^HOME=} $hpt] || [regexp {^SSVNC_HOME=} $hpt]} {
+ set t $hpt
regsub {^.*HOME=} $t "" t
+ set t [string trim $t]
set env(SSVNC_HOME) $t
mesg "set SSVNC_HOME to $t"
return 0
}
+ if {[regexp {^DISPLAY=} $hpt] || [regexp {^SSVNC_DISPLAY=} $hpt]} {
+ set t $hpt
+ regsub {^.*DISPLAY=} $t "" t
+ set t [string trim $t]
+ set env(DISPLAY) $t
+ mesg "set DISPLAY to $t"
+ global uname darwin_cotvnc
+ if {$uname == "Darwin"} {
+ if {$t != ""} {
+ set darwin_cotvnc 0
+ } else {
+ set darwin_cotvnc 1
+ }
+ }
+ return 0
+ }
+ if {[regexp {^DYLD_LIBRARY_PATH=} $hpt] || [regexp {^SSVNC_DYLD_LIBRARY_PATH=} $hpt]} {
+ set t $hpt
+ regsub {^.*DYLD_LIBRARY_PATH=} $t "" t
+ set t [string trim $t]
+ set env(DYLD_LIBRARY_PATH) $t
+ set env(SSVNC_DYLD_LIBRARY_PATH) $t
+ mesg "set DYLD_LIBRARY_PATH to $t"
+ return 0
+ }
+ if {[regexp {^SLEEP=} $hpt] || [regexp {^SSVNC_EXTRA_SLEEP=} $hpt]} {
+ set t $hpt
+ regsub {^.*SLEEP=} $t "" t
+ set t [string trim $t]
+ set env(SSVNC_EXTRA_SLEEP) $t
+ mesg "set SSVNC_EXTRA_SLEEP to $t"
+ return 0
+ }
regsub {[ ]*cmd=.*$} $hp "" tt
@@ -4944,7 +5063,7 @@ proc import_check_mode {w} {
}
}
-proc import_browse {} {
+proc import_browse {par} {
global import_file
set idir ""
@@ -4952,14 +5071,14 @@ proc import_browse {} {
set idir [get_idir_certs $import_file]
}
if {$idir != ""} {
- set t [tk_getOpenFile -parent .icrt -initialdir $idir]
+ set t [tk_getOpenFile -parent $par -initialdir $idir]
} else {
- set t [tk_getOpenFile -parent .icrt]
+ set t [tk_getOpenFile -parent $par]
}
if {$t != ""} {
set import_file $t
}
- catch {raise .icrt}
+ catch {raise $par}
update
}
@@ -4985,11 +5104,12 @@ proc import_save_browse {{par ".icrt"}} {
update
}
-proc do_save {} {
+proc do_save {par} {
global import_mode import_file import_save_file
+ global also_save_to_accepted_certs
- if {$import_save_file == ""} {
- tk_messageBox -parent .icrt -type ok -icon error \
+ if {$import_save_file == "" && ! $also_save_to_accepted_certs} {
+ tk_messageBox -parent $par -type ok -icon error \
-message "No Save File supplied" -title "Save File"
return
}
@@ -4999,10 +5119,10 @@ proc do_save {} {
global save_cert_text
set str $save_cert_text
} elseif {$import_mode == "paste"} {
- set str [.icrt.paste.t get 1.0 end]
+ set str [$par.paste.t get 1.0 end]
} else {
if {! [file exists $import_file]} {
- tk_messageBox -parent .icrt -type ok -icon error \
+ tk_messageBox -parent $par -type ok -icon error \
-message "Input file \"$import_file\" does not exist." -title "Import File"
return
}
@@ -5010,7 +5130,7 @@ proc do_save {} {
set emess ""
set rc [catch {set fh [open $import_file "r"]} emess]
if {$rc != 0 || $fh == ""} {
- tk_messageBox -parent .icrt -type ok -icon error \
+ tk_messageBox -parent $par -type ok -icon error \
-message $emess -title "Import File: $import_file"
return
}
@@ -5021,25 +5141,34 @@ proc do_save {} {
}
if {! [regexp {BEGIN CERTIFICATE} $str]} {
- tk_messageBox -parent .icrt -type ok -icon error \
+ tk_messageBox -parent $par -type ok -icon error \
-message "Import Text does not contain \"BEGIN CERTIFICATE\"" -title "Imported Text"
return
}
if {! [regexp {END CERTIFICATE} $str]} {
- tk_messageBox -parent .icrt -type ok -icon error \
+ tk_messageBox -parent $par -type ok -icon error \
-message "Import Text does not contain \"END CERTIFICATE\"" -title "Imported Text"
return
}
+ global is_windows
set fh ""
set emess ""
+ set deltmp ""
+ if {$import_save_file == ""} {
+ if {! $is_windows} {
+ set deltmp /tmp/itmp.[tpid]
+ } else {
+ set deltmp itmp.[tpid]
+ }
+ set import_save_file $deltmp
+ }
set rc [catch {set fh [open $import_save_file "w"]} emess]
if {$rc != 0 || $fh == ""} {
- tk_messageBox -parent .icrt -type ok -icon error \
+ tk_messageBox -parent $par -type ok -icon error \
-message $emess -title "Save File: $import_save_file"
return
}
- global is_windows
if {! $is_windows} {
catch {file attributes $import_save_file -permissions go-w}
if {[regexp {PRIVATE} $str] || [regexp {\.pem$} $import_save_file]} {
@@ -5048,13 +5177,59 @@ proc do_save {} {
}
puts -nonewline $fh $str
close $fh
- catch {destroy .icrt}
+
+ if {$also_save_to_accepted_certs} {
+ set ossl [get_openssl]
+ set fp_txt ""
+ set fp_txt [exec $ossl x509 -fingerprint -noout -in $import_save_file]
+
+ set adir [get_idir_certs ""]
+ set adir "$adir/accepted"
+ catch {file mkdir $adir}
+
+ set fingerprint ""
+ set fingerline ""
+
+ set i 0
+ foreach line [split $fp_txt "\n"] {
+ incr i
+ if {$i > 4} {
+ break
+ }
+ if [regexp -nocase {Fingerprint=(.*)} $line mv str] {
+ set fingerline $line
+ set fingerprint [string trim $str]
+ }
+ }
+
+ set fingerprint [string tolower $fingerprint]
+ regsub -all {:} $fingerprint "-" fingerprint
+ regsub -all {[\\/=]} $fingerprint "_" fingerprint
+
+ global vncdisplay
+ set from [get_ssh_hp $vncdisplay]
+ set hp $from
+
+ set from [string tolower $from]
+ regsub -all {^[+a-z]*://} $from "" from
+ regsub -all {:} $from "-" from
+ regsub -all {[\\/=]} $from "_" from
+
+ set crt "$adir/$fingerprint=$from.crt"
+ catch {file copy -force $import_save_file $crt}
+
+ save_hash $crt $adir $hp $fingerline $from $fingerprint
+ }
+
+ catch {destroy $par}
set p .c
if {![winfo exists .c]} {
global accepted_cert_dialog_in_progress
if {! $accepted_cert_dialog_in_progress} {
- getcerts
- update
+ if {$deltmp == ""} {
+ getcerts
+ update
+ }
}
}
if {![winfo exists .c]} {
@@ -5062,6 +5237,11 @@ proc do_save {} {
}
catch {raise .c}
catch {destroy .scrt}
+ if {$deltmp != ""} {
+ catch {file delete $deltmp}
+ set import_save_file ""
+ return;
+ }
tk_messageBox -parent $p -type ok -icon info \
-message "Saved to file: $import_save_file" -title "Save File: $import_save_file"
}
@@ -5144,7 +5324,7 @@ TCQ+tbQ/DOiTXGKx1nlcKoPdkG+QVQVJthlQcpam
set import_file ""
entry $w.e -width 40 -textvariable import_file
- button $w.b -pady 1 -anchor w -text "Browse..." -command import_browse
+ button $w.b -pady 1 -anchor w -text "Browse..." -command {import_browse .icrt}
pack $w.b -side right
pack $w.p $w.f -side left
pack $w.e -side left -expand 1 -fill x
@@ -5162,7 +5342,7 @@ TCQ+tbQ/DOiTXGKx1nlcKoPdkG+QVQVJthlQcpam
button .icrt.cancel -text "Cancel" -command {destroy .icrt; catch {raise .c}}
bind .icrt <Escape> {destroy .icrt; catch {raise .c}}
- button .icrt.save -text "Save" -command {do_save}
+ button .icrt.save -text "Save" -command {do_save .icrt}
set w .icrt.sf
frame $w
@@ -5197,15 +5377,16 @@ proc save_cert {hp} {
global scroll_text_focus
set scroll_text_focus 0
global uname
- scroll_text .scrt.f 90 17
- set scroll_text_focus 1
global accepted_cert_dialog_in_progress
if {$accepted_cert_dialog_in_progress} {
set mode "accepted"
+ scroll_text .scrt.f 90 15
} else {
set mode "normal"
+ scroll_text .scrt.f 90 20
}
+ set scroll_text_focus 1
set msg1 {
This dialog lets you import a SSL Certificate retrieved from a VNC server.
@@ -5213,16 +5394,19 @@ proc save_cert {hp} {
Be sure to have verified its authenticity via an external means (checking
the MD5 hash value sent to you by the administrator, etc)
- Set the "Save to File" name to the file where the imported certificate
- will be saved.
+ Set "Save to File" to the filename where the imported cert will be saved.
+
+ If you also want the Certificate to be saved to the pool of certs in the
+ 'Accepted Certs' directory, select the checkbox. By default all Servers are
+ verified against the certificates in this pool.
Then, click on "Save" to save the imported Certificate.
- After you have imported the Certificate it will be automatically selected
- as the "ServerCert" for this host: %HOST
+ After you have imported the Certificate it will be automatically selected as
+ the "ServerCert" for the next connection to this host: %HOST
- To make the ServerCert setting to the imported cert file PERMANENT,
- select Options -> Save Profile to save it in a profile.
+ To make the ServerCert setting to the imported cert file PERMANENT, select
+ Options -> Save Profile to save it in the profile for this host.
}
set msg2 {
@@ -5238,7 +5422,7 @@ proc save_cert {hp} {
It, and the others certs in that directory, will be used to authenticate
any VNC Server that has "ACCEPTED_CERTS" as the "CertsDir" value in the
- "Certs..." dialog.
+ "Certs..." dialog. This is the default checking policy.
}
set msg ""
@@ -5258,16 +5442,16 @@ proc save_cert {hp} {
set import_file ""
entry $w.e -width 40 -textvariable import_file
- scroll_text .scrt.paste 90 26
+ scroll_text .scrt.paste 90 23
button .scrt.cancel -text "Cancel" -command {destroy .scrt; catch {raise .c}}
bind .scrt <Escape> {destroy .scrt; catch {raise .c}}
global import_save_file
if {$mode == "normal"} {
- button .scrt.save -text "Save" -command {do_save; set svcert $import_save_file}
+ button .scrt.save -text "Save" -command {do_save .scrt; set svcert $import_save_file}
} else {
- button .scrt.save -text "Save" -command {do_save}
+ button .scrt.save -text "Save" -command {do_save .scrt}
}
set w .scrt.sf
@@ -5292,7 +5476,16 @@ proc save_cert {hp} {
pack $w.l -side left
pack $w.e -side left -expand 1 -fill x
- pack .scrt.cancel .scrt.save .scrt.sf .scrt.mf -side bottom -fill x
+ global also_save_to_accepted_certs
+ set also_save_to_accepted_certs 0
+ checkbutton .scrt.ac -anchor w -variable also_save_to_accepted_certs -text \
+ "Also Save to the 'Accepted Certs' directory" -relief raised
+
+ if {$mode == "normal"} {
+ pack .scrt.cancel .scrt.save .scrt.sf .scrt.ac .scrt.mf -side bottom -fill x
+ } else {
+ pack .scrt.cancel .scrt.save .scrt.sf .scrt.mf -side bottom -fill x
+ }
pack .scrt.paste -side bottom -fill x
pack .scrt.f -side top -fill both -expand 1
@@ -8544,6 +8737,7 @@ proc unixpw_adjust {} {
}
if {$use_unixpw} {
pack configure .fu -after .f1 -fill x
+ catch {focus .fu.e}
} else {
pack forget .fu
}
@@ -8575,7 +8769,7 @@ proc set_options {} {
incr i
checkbutton .o.b$i -anchor w -variable use_unixpw -text \
- "Unix Username & Password" -command {unixpw_adjust}
+ "Unix Username & Password" -command {unixpw_adjust; catch {destroy .o}}
if {$is_windows} {.o.b$i configure -state disabled}
if {$darwin_cotvnc} {.o.b$i configure -state disabled}
incr i
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle
index 43c8eef..3a3c522 100755
--- a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/_bundle
@@ -1,7 +1,7 @@
#!/bin/sh
rm -rf ./src/tmp/* || exit 1
-vers=1.0.17
+vers=1.0.18
cd .. || exit 1
diff --git a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-full.patch b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-full.patch
index 2c1b785..8b5c9ab 100644
--- a/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-full.patch
+++ b/x11vnc/misc/enhanced_tightvnc_viewer/src/patches/tight-vncviewer-full.patch
@@ -220,7 +220,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/Vncviewer vnc_unixsrc/vncview
+
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/vncviewer/argsresources.c
--- vnc_unixsrc.orig/vncviewer/argsresources.c 2007-02-04 17:10:31.000000000 -0500
-+++ vnc_unixsrc/vncviewer/argsresources.c 2007-05-25 23:17:25.000000000 -0400
++++ vnc_unixsrc/vncviewer/argsresources.c 2007-05-30 23:52:19.000000000 -0400
@@ -31,7 +31,7 @@
char *fallback_resources[] = {
@@ -271,7 +271,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
<KeyPress>: SendRFBEvent() HidePopup()",
- "*popupButtonCount: 8",
-+ "*popupButtonCount: 28",
++ "*popupButtonCount: 29",
"*popup*button1.label: Dismiss popup",
"*popup*button1.translations: #override\\n\
@@ -284,7 +284,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
"*popup*button3.type: toggle",
"*popup*button3.translations: #override\\n\
<Visible>: SetFullScreenState()\\n\
-@@ -115,9 +129,166 @@
+@@ -115,9 +129,172 @@
"*popup*button8.translations: #override\\n\
<Btn1Down>,<Btn1Up>: SendRFBEvent(key,F8) HidePopup()",
@@ -390,15 +390,21 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ <Visible>: SetTextChatState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleTextChat() HidePopup()",
+
-+ "*popup*button27.label: - Single Window",
++ "*popup*button27.label: - File Transfer",
+ "*popup*button27.type: toggle",
+ "*popup*button27.translations: #override\\n\
-+ <Visible>: SetSingleWindowState()\\n\
-+ <Btn1Down>,<Btn1Up>: toggle() ToggleSingleWindow() HidePopup()",
++ <Visible>: SetFileXferState()\\n\
++ <Btn1Down>,<Btn1Up>: toggle() ToggleFileXfer() HidePopup()",
+
-+ "*popup*button28.label: - Disable Remote Input",
++ "*popup*button28.label: - Single Window",
+ "*popup*button28.type: toggle",
+ "*popup*button28.translations: #override\\n\
++ <Visible>: SetSingleWindowState()\\n\
++ <Btn1Down>,<Btn1Up>: toggle() ToggleSingleWindow() HidePopup()",
++
++ "*popup*button29.label: - Disable Remote Input",
++ "*popup*button29.type: toggle",
++ "*popup*button29.translations: #override\\n\
+ <Visible>: SetServerInputState()\\n\
+ <Btn1Down>,<Btn1Up>: toggle() ToggleServerInput() HidePopup()",
+
@@ -451,7 +457,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
/*
* vncServerHost and vncServerPort are set either from the command line or
-@@ -135,6 +306,7 @@
+@@ -135,6 +312,7 @@
*/
AppData appData;
@@ -459,7 +465,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
static XtResource appDataResourceList[] = {
{"shareDesktop", "ShareDesktop", XtRBool, sizeof(Bool),
-@@ -155,14 +327,29 @@
+@@ -155,14 +333,29 @@
{"userLogin", "UserLogin", XtRString, sizeof(String),
XtOffsetOf(AppData, userLogin), XtRImmediate, (XtPointer) 0},
@@ -491,7 +497,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"nColours", "NColours", XtRInt, sizeof(int),
XtOffsetOf(AppData, nColours), XtRImmediate, (XtPointer) 256},
-@@ -179,9 +366,12 @@
+@@ -179,9 +372,12 @@
{"requestedDepth", "RequestedDepth", XtRInt, sizeof(int),
XtOffsetOf(AppData, requestedDepth), XtRImmediate, (XtPointer) 0},
@@ -505,7 +511,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"wmDecorationWidth", "WmDecorationWidth", XtRInt, sizeof(int),
XtOffsetOf(AppData, wmDecorationWidth), XtRImmediate, (XtPointer) 4},
-@@ -206,8 +396,13 @@
+@@ -206,8 +402,13 @@
{"bumpScrollPixels", "BumpScrollPixels", XtRInt, sizeof(int),
XtOffsetOf(AppData, bumpScrollPixels), XtRImmediate, (XtPointer) 20},
@@ -519,7 +525,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"qualityLevel", "QualityLevel", XtRInt, sizeof(int),
XtOffsetOf(AppData, qualityLevel), XtRImmediate, (XtPointer) 6},
-@@ -218,14 +413,52 @@
+@@ -218,14 +419,55 @@
{"useRemoteCursor", "UseRemoteCursor", XtRBool, sizeof(Bool),
XtOffsetOf(AppData, useRemoteCursor), XtRImmediate, (XtPointer) True},
@@ -569,12 +575,15 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ {"chatActive", "ChatActive", XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, chatActive), XtRImmediate, (XtPointer) False},
+
++ {"fileActive", "FileActive", XtRBool, sizeof(Bool),
++ XtOffsetOf(AppData, fileActive), XtRImmediate, (XtPointer) False},
++
+ {"popupFix", "PopupFix", XtRBool, sizeof(Bool),
+ XtOffsetOf(AppData, popupFix), XtRImmediate, (XtPointer) False}
};
-@@ -242,8 +475,22 @@
+@@ -242,8 +484,22 @@
{"-noraiseonbeep", "*raiseOnBeep", XrmoptionNoArg, "False"},
{"-passwd", "*passwordFile", XrmoptionSepArg, 0},
{"-user", "*userLogin", XrmoptionSepArg, 0},
@@ -598,7 +607,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"-owncmap", "*forceOwnCmap", XrmoptionNoArg, "True"},
{"-truecolor", "*forceTrueColour", XrmoptionNoArg, "True"},
{"-truecolour", "*forceTrueColour", XrmoptionNoArg, "True"},
-@@ -253,7 +500,19 @@
+@@ -253,7 +509,19 @@
{"-nojpeg", "*enableJPEG", XrmoptionNoArg, "False"},
{"-nocursorshape", "*useRemoteCursor", XrmoptionNoArg, "False"},
{"-x11cursor", "*useX11Cursor", XrmoptionNoArg, "True"},
@@ -619,7 +628,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
};
-@@ -268,6 +527,7 @@
+@@ -268,6 +536,7 @@
{"SendRFBEvent", SendRFBEvent},
{"ShowPopup", ShowPopup},
{"HidePopup", HidePopup},
@@ -627,7 +636,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
{"ToggleFullScreen", ToggleFullScreen},
{"SetFullScreenState", SetFullScreenState},
{"SelectionFromVNC", SelectionFromVNC},
-@@ -277,6 +537,45 @@
+@@ -277,6 +546,47 @@
{"Pause", Pause},
{"RunCommand", RunCommand},
{"Quit", Quit},
@@ -649,6 +658,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ {"ToggleServerInput", ToggleServerInput},
+ {"ToggleSingleWindow", ToggleSingleWindow},
+ {"ToggleTextChat", ToggleTextChat},
++ {"ToggleFileXfer", ToggleFileXfer},
+ {"DoServerScale", DoServerScale},
+ {"ShowScaleN", ShowScaleN},
+ {"SetScaleN", SetScaleN},
@@ -669,11 +679,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
+ {"SetRawLocalState", SetRawLocalState},
+ {"SetServerInputState", SetServerInputState},
+ {"SetSingleWindowState", SetSingleWindowState},
-+ {"SetTextChatState", SetTextChatState}
++ {"SetTextChatState", SetTextChatState},
++ {"SetFileXferState", SetFileXferState}
};
-@@ -302,8 +601,8 @@
+@@ -302,8 +612,8 @@
void
usage(void)
{
@@ -684,7 +695,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
"\n"
"Usage: %s [<OPTIONS>] [<HOST>][:<DISPLAY#>]\n"
" %s [<OPTIONS>] [<HOST>][::<PORT#>]\n"
-@@ -332,10 +631,142 @@
+@@ -332,10 +642,142 @@
" -autopass\n"
"\n"
"Option names may be abbreviated, e.g. -bgr instead of -bgr233.\n"
@@ -828,7 +839,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
/*
-@@ -350,6 +781,7 @@
+@@ -350,6 +792,7 @@
int i;
char *vncServerName, *colonPos;
int len, portOffset;
@@ -836,7 +847,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
/* Turn app resource specs into our appData structure for the rest of the
program to use */
-@@ -357,6 +789,23 @@
+@@ -357,6 +800,23 @@
XtGetApplicationResources(toplevel, &appData, appDataResourceList,
XtNumber(appDataResourceList), 0, 0);
@@ -860,7 +871,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
/* Add our actions to the actions table so they can be used in widget
resource specs */
-@@ -376,6 +825,10 @@
+@@ -376,6 +836,10 @@
return;
}
@@ -871,7 +882,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/argsresources.c vnc_unixsrc/v
if (argc == 1) {
vncServerName = DoServerDialog();
appData.passwordDialog = True;
-@@ -414,6 +867,13 @@
+@@ -414,6 +878,13 @@
if (!len || strspn(colonPos + 1, "0123456789") != len) {
usage();
}
@@ -3184,7 +3195,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/misc.c vnc_unixsrc/vncviewer/
static int
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer/popup.c
--- vnc_unixsrc.orig/vncviewer/popup.c 2000-06-11 08:00:53.000000000 -0400
-+++ vnc_unixsrc/vncviewer/popup.c 2007-05-21 02:30:10.000000000 -0400
++++ vnc_unixsrc/vncviewer/popup.c 2007-05-31 16:42:36.000000000 -0400
@@ -25,15 +25,44 @@
#include <X11/Xaw/Form.h>
@@ -3232,7 +3243,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer
XSetWMProtocols(dpy, XtWindow(popup), &wmDeleteWindow, 1);
}
-@@ -91,3 +120,230 @@
+@@ -91,3 +120,292 @@
prevButton = button;
}
}
@@ -3290,6 +3301,68 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup.c vnc_unixsrc/vncviewer
+ }
+}
+
++int filexfer_sock = -1;
++int filexfer_listen = -1;
++
++void HideFile(Widget w, XEvent *event, String *params, Cardinal *num_params) {
++ if (filexfer_sock >= 0) {
++ close(filexfer_sock);
++ filexfer_sock = -1;
++ }
++ if (filexfer_listen >= 0) {
++ close(filexfer_listen);
++ filexfer_listen = -1;
++ }
++}
++
++extern int use_loopback;
++time_t start_listen = 0;
++
++void ShowFile(Widget w, XEvent *event, String *params, Cardinal *num_params) {
++ int i, port0 = 7200, port, sock = -1;
++ char *cmd, *jar;
++ char fmt[] = "java -cp '%s' VncViewer HOST localhost PORT %d delayAuthPanel yes ignoreMSLogonCheck yes disableSSL yes ftpOnly yes graftFtp yes &";
++
++ if (getenv("SSVNC_ULTRA_FTP_JAR")) {
++ jar = getenv("SSVNC_ULTRA_FTP_JAR");
++ cmd = (char *) malloc(strlen(fmt) + strlen(jar) + 10);
++ } else {
++ fprintf(stderr, "Cannot find UltraVNC FTP jar file.\n");
++ return;
++ }
++ use_loopback = 1;
++ for (i = 0; i < 100; i++) {
++ port = port0 + i;
++ sock = ListenAtTcpPort(port);
++ if (sock >= 0) {
++ fprintf(stderr, "listening for filexfer on port: %d sock: %d\n", port, sock);
++ break;
++ }
++ }
++ use_loopback = 0;
++ if (sock >= 0) {
++ int st;
++ pid_t pid = fork();
++ if (pid < 0) {
++ free(cmd);
++ return;
++ } else if (pid == 0) {
++ int i;
++ sprintf(cmd, fmt, jar, port);
++ for (i = 3; i < 100; i++) {
++ close(i);
++ }
++ fprintf(stderr, "\n-- Experimental UltraVNC File Transfer --\n\nRunning cmd:\n\n %s\n\n", cmd);
++ system(cmd);
++ exit(0);
++ }
++ waitpid(pid, &st, 0);
++ start_listen = time(NULL);
++ }
++ free(cmd);
++ filexfer_listen = sock;
++}
++
+Widget chat, entry, text;
+
+static int chat_visible = 0;
@@ -3488,7 +3561,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/popup_ad vnc_unixsrc/vncviewe
+}
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncviewer/rfbproto.c
--- vnc_unixsrc.orig/vncviewer/rfbproto.c 2004-03-11 13:14:39.000000000 -0500
-+++ vnc_unixsrc/vncviewer/rfbproto.c 2007-05-26 21:53:48.000000000 -0400
++++ vnc_unixsrc/vncviewer/rfbproto.c 2007-06-02 20:37:25.000000000 -0400
@@ -57,6 +57,25 @@
static Bool HandleTight16(int rx, int ry, int rw, int rh);
static Bool HandleTight32(int rx, int ry, int rw, int rh);
@@ -3515,17 +3588,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
static void ReadConnFailedReason(void);
static long ReadCompactLen (void);
-@@ -68,6 +87,9 @@
+@@ -68,6 +87,10 @@
int compressedLen);
+int sent_FBU = 0;
+int skip_XtUpdate = 0;
++int skip_XtUpdateAll = 0;
+
int rfbsock;
char *desktopName;
rfbPixelFormat myFormat;
-@@ -177,6 +199,9 @@
+@@ -177,6 +200,9 @@
sig_rfbEncodingPointerPos, "Pointer position update");
CapsAdd(encodingCaps, rfbEncodingLastRect, rfbTightVncVendor,
sig_rfbEncodingLastRect, "LastRect protocol extension");
@@ -3535,7 +3609,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
-@@ -187,21 +212,21 @@
+@@ -187,21 +213,21 @@
Bool
ConnectToRFBServer(const char *hostname, int port)
{
@@ -3568,7 +3642,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
-@@ -212,211 +237,228 @@
+@@ -212,211 +238,228 @@
Bool
InitialiseRFBConnection(void)
{
@@ -3920,8 +3994,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ return rfbSecTypeTight;
+ }
+ }
-
-- free(secTypes);
++
+ /* Find first supported security type */
+ for (j = 0; j < (int)nSecTypes; j++) {
+ for (i = 0; i < nKnownSecTypes; i++) {
@@ -3938,7 +4011,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ break;
+ }
+ }
-+
+
+- free(secTypes);
+ free(secTypes);
- if (secType == rfbSecTypeInvalid)
@@ -3952,7 +4026,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
-@@ -451,6 +493,9 @@
+@@ -451,6 +494,9 @@
return True;
}
@@ -3962,7 +4036,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
/*
* Negotiate authentication scheme (protocol version 3.7t)
-@@ -459,56 +504,61 @@
+@@ -459,56 +505,61 @@
static Bool
PerformAuthenticationTight(void)
{
@@ -4066,7 +4140,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
-@@ -519,80 +569,97 @@
+@@ -519,80 +570,97 @@
static Bool
AuthenticateVNC(void)
{
@@ -4227,7 +4301,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
/*
-@@ -602,68 +669,71 @@
+@@ -602,68 +670,71 @@
static Bool
AuthenticateUnixLogin(void)
{
@@ -4351,7 +4425,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
-@@ -675,19 +745,20 @@
+@@ -675,19 +746,20 @@
static Bool
ReadInteractionCaps(void)
{
@@ -4384,7 +4458,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
-@@ -700,17 +771,18 @@
+@@ -700,17 +772,18 @@
static Bool
ReadCapabilityList(CapsContainer *caps, int count)
{
@@ -4412,7 +4486,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
-@@ -729,6 +801,10 @@
+@@ -729,6 +802,10 @@
Bool requestCompressLevel = False;
Bool requestQualityLevel = False;
Bool requestLastRectEncoding = False;
@@ -4423,7 +4497,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
spf.type = rfbSetPixelFormat;
spf.format = myFormat;
-@@ -736,6 +812,7 @@
+@@ -736,6 +813,7 @@
spf.format.greenMax = Swap16IfLE(spf.format.greenMax);
spf.format.blueMax = Swap16IfLE(spf.format.blueMax);
@@ -4431,7 +4505,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
if (!WriteExact(rfbsock, (char *)&spf, sz_rfbSetPixelFormatMsg))
return False;
-@@ -754,6 +831,12 @@
+@@ -754,6 +832,12 @@
encStrLen = strlen(encStr);
}
@@ -4444,7 +4518,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
if (strncasecmp(encStr,"raw",encStrLen) == 0) {
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRaw);
} else if (strncasecmp(encStr,"copyrect",encStrLen) == 0) {
-@@ -775,6 +858,10 @@
+@@ -775,6 +859,10 @@
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingCoRRE);
} else if (strncasecmp(encStr,"rre",encStrLen) == 0) {
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRRE);
@@ -4455,7 +4529,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
} else {
fprintf(stderr,"Unknown encoding '%.*s'\n",encStrLen,encStr);
}
-@@ -797,7 +884,7 @@
+@@ -797,7 +885,7 @@
if (appData.useRemoteCursor) {
if (se->nEncodings < MAX_ENCODINGS)
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingXCursor);
@@ -4464,7 +4538,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRichCursor);
if (se->nEncodings < MAX_ENCODINGS)
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingPointerPos);
-@@ -806,10 +893,14 @@
+@@ -806,10 +894,14 @@
if (se->nEncodings < MAX_ENCODINGS && requestLastRectEncoding) {
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingLastRect);
}
@@ -4480,7 +4554,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
fprintf(stderr,"Same machine: preferring raw encoding\n");
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingRaw);
} else {
-@@ -819,6 +910,7 @@
+@@ -819,6 +911,7 @@
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingCopyRect);
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingTight);
@@ -4488,7 +4562,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingHextile);
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingZlib);
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingCoRRE);
-@@ -844,11 +936,14 @@
+@@ -844,11 +937,14 @@
if (appData.useRemoteCursor) {
encs[se->nEncodings++] = Swap32IfLE(rfbEncodingXCursor);
@@ -4504,7 +4578,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
len = sz_rfbSetEncodingsMsg + se->nEncodings * 4;
-@@ -868,8 +963,8 @@
+@@ -868,10 +964,11 @@
Bool
SendIncrementalFramebufferUpdateRequest()
{
@@ -4514,8 +4588,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ si.framebufferHeight, True);
}
++time_t last_filexfer = 0;
-@@ -880,19 +975,26 @@
+ /*
+ * SendFramebufferUpdateRequest.
+@@ -880,19 +977,35 @@
Bool
SendFramebufferUpdateRequest(int x, int y, int w, int h, Bool incremental)
{
@@ -4528,6 +4605,17 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- fur.y = Swap16IfLE(y);
- fur.w = Swap16IfLE(w);
- fur.h = Swap16IfLE(h);
++ if (appData.fileActive) {
++ if (time(NULL) < last_filexfer + 2) {
++// fprintf(stderr, "skip SendFramebufferUpdateRequest: %d - %d\n", last_filexfer, time(NULL));
++// return True;
++ x = y = 0;
++ w = h = 1;
++ }
++ }
+
+- if (!WriteExact(rfbsock, (char *)&fur, sz_rfbFramebufferUpdateRequestMsg))
+- return False;
+ fur.type = rfbFramebufferUpdateRequest;
+ fur.incremental = incremental ? 1 : 0;
+ fur.x = Swap16IfLE(x);
@@ -4541,23 +4629,33 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ sent_FBU = 2;
+ }
-- if (!WriteExact(rfbsock, (char *)&fur, sz_rfbFramebufferUpdateRequestMsg))
-- return False;
+- return True;
+ if (!WriteExact(rfbsock, (char *)&fur, sz_rfbFramebufferUpdateRequestMsg)) {
+ return False;
+ }
-
-- return True;
++
+ return True;
}
-@@ -903,19 +1005,20 @@
+@@ -903,19 +1016,27 @@
Bool
SendPointerEvent(int x, int y, int buttonMask)
{
- rfbPointerEventMsg pe;
+ rfbPointerEventMsg pe;
++
++ if (appData.fileActive) {
++ if (time(NULL) < last_filexfer + 2) {
++ //fprintf(stderr, "skip SendPointerEvent: %d - %d\n", last_filexfer, time(NULL));
++ return True;
++ }
++ }
++
++ pe.type = rfbPointerEvent;
++ pe.buttonMask = buttonMask;
++ if (x < 0) x = 0;
++ if (y < 0) y = 0;
- pe.type = rfbPointerEvent;
- pe.buttonMask = buttonMask;
@@ -4570,11 +4668,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- pe.x = Swap16IfLE(x);
- pe.y = Swap16IfLE(y);
- return WriteExact(rfbsock, (char *)&pe, sz_rfbPointerEventMsg);
-+ pe.type = rfbPointerEvent;
-+ pe.buttonMask = buttonMask;
-+ if (x < 0) x = 0;
-+ if (y < 0) y = 0;
-+
+ if (!appData.useX11Cursor) {
+ SoftCursorMove(x, y);
+ }
@@ -4585,7 +4678,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
-@@ -926,12 +1029,12 @@
+@@ -926,12 +1047,12 @@
Bool
SendKeyEvent(CARD32 key, Bool down)
{
@@ -4603,21 +4696,12 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
}
-@@ -942,281 +1045,565 @@
+@@ -942,281 +1063,661 @@
Bool
SendClientCutText(char *str, int len)
{
- rfbClientCutTextMsg cct;
+ rfbClientCutTextMsg cct;
-+
-+ if (serverCutText) {
-+ free(serverCutText);
-+ }
-+ serverCutText = NULL;
-+
-+ if (appData.viewOnly) {
-+ return True;
-+ }
- if (serverCutText)
- free(serverCutText);
@@ -4627,58 +4711,80 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- cct.length = Swap32IfLE(len);
- return (WriteExact(rfbsock, (char *)&cct, sz_rfbClientCutTextMsg) &&
- WriteExact(rfbsock, str, len));
-+ cct.type = rfbClientCutText;
-+ cct.length = Swap32IfLE(len);
-+ return (WriteExact(rfbsock, (char *)&cct, sz_rfbClientCutTextMsg) &&
-+ WriteExact(rfbsock, str, len));
- }
+-}
++ if (serverCutText) {
++ free(serverCutText);
++ }
++ serverCutText = NULL;
-+Bool
-+SendServerScale(int nfac)
-+{
-+ rfbSetScaleMsg ssc;
-+ if (nfac < 0 || nfac > 100) {
++ if (appData.viewOnly) {
+ return True;
+ }
-/*
- * HandleRFBServerMessage.
- */
-+ ssc.type = rfbSetScale;
-+ ssc.scale = nfac;
-+ return WriteExact(rfbsock, (char *)&ssc, sz_rfbSetScaleMsg);
++ cct.type = rfbClientCutText;
++ cct.length = Swap32IfLE(len);
++ return (WriteExact(rfbsock, (char *)&cct, sz_rfbClientCutTextMsg) &&
++ WriteExact(rfbsock, str, len));
+}
Bool
-HandleRFBServerMessage()
-+SendServerInput(Bool enabled)
++SendServerScale(int nfac)
{
- rfbServerToClientMsg msg;
-+ rfbSetServerInputMsg sim;
++ rfbSetScaleMsg ssc;
++ if (nfac < 0 || nfac > 100) {
++ return True;
++ }
- if (!ReadFromRFBServer((char *)&msg, 1))
- return False;
-+ sim.type = rfbSetServerInput;
-+ sim.status = enabled;
-+ return WriteExact(rfbsock, (char *)&sim, sz_rfbSetServerInputMsg);
++ ssc.type = rfbSetScale;
++ ssc.scale = nfac;
++ return WriteExact(rfbsock, (char *)&ssc, sz_rfbSetScaleMsg);
+}
- switch (msg.type) {
+Bool
-+SendSingleWindow(int x, int y)
++SendServerInput(Bool enabled)
+{
-+ rfbSetSWMsg sw;
++ rfbSetServerInputMsg sim;
- case rfbSetColourMapEntries:
- {
- int i;
- CARD16 rgb[3];
- XColor xc;
-+ fprintf(stderr, "SendSingleWindow: %d %d\n", x, y);
++ sim.type = rfbSetServerInput;
++ sim.status = enabled;
++ return WriteExact(rfbsock, (char *)&sim, sz_rfbSetServerInputMsg);
++}
- if (!ReadFromRFBServer(((char *)&msg) + 1,
- sz_rfbSetColourMapEntriesMsg - 1))
- return False;
++Bool
++SendSingleWindow(int x, int y)
++{
++ rfbSetSWMsg sw;
+
+- msg.scme.firstColour = Swap16IfLE(msg.scme.firstColour);
+- msg.scme.nColours = Swap16IfLE(msg.scme.nColours);
++ fprintf(stderr, "SendSingleWindow: %d %d\n", x, y);
+
+- for (i = 0; i < msg.scme.nColours; i++) {
+- if (!ReadFromRFBServer((char *)rgb, 6))
+- return False;
+- xc.pixel = msg.scme.firstColour + i;
+- xc.red = Swap16IfLE(rgb[0]);
+- xc.green = Swap16IfLE(rgb[1]);
+- xc.blue = Swap16IfLE(rgb[2]);
+- xc.flags = DoRed|DoGreen|DoBlue;
+- XStoreColor(dpy, cmap, &xc);
+- }
+ if (x == -1 && y == -1) {
+ sw.type = rfbSetSW;
+ sw.x = Swap16IfLE(1);
@@ -4692,8 +4798,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ return WriteExact(rfbsock, (char *)&sw, sz_rfbSetSWMsg);
+}
-- msg.scme.firstColour = Swap16IfLE(msg.scme.firstColour);
-- msg.scme.nColours = Swap16IfLE(msg.scme.nColours);
+- break;
+- }
+Bool
+SendTextChat(char *str)
+{
@@ -4710,20 +4816,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ return WriteExact(rfbsock, str, strlen(str));
+}
-- for (i = 0; i < msg.scme.nColours; i++) {
-- if (!ReadFromRFBServer((char *)rgb, 6))
-- return False;
-- xc.pixel = msg.scme.firstColour + i;
-- xc.red = Swap16IfLE(rgb[0]);
-- xc.green = Swap16IfLE(rgb[1]);
-- xc.blue = Swap16IfLE(rgb[2]);
-- xc.flags = DoRed|DoGreen|DoBlue;
-- XStoreColor(dpy, cmap, &xc);
-- }
+- case rfbFramebufferUpdate:
+- {
+- rfbFramebufferUpdateRectHeader rect;
+- int linesToRead;
+- int bytesPerLine;
+- int i;
+- int usecs;
+extern void raiseme(void);
-- break;
-- }
+- if (!ReadFromRFBServer(((char *)&msg.fu) + 1,
+- sz_rfbFramebufferUpdateMsg - 1))
+- return False;
+Bool
+SendTextChatOpen(void)
+{
@@ -4736,13 +4840,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ return WriteExact(rfbsock, (char *)&chat, sz_rfbTextChatMsg);
+}
-- case rfbFramebufferUpdate:
-- {
-- rfbFramebufferUpdateRectHeader rect;
-- int linesToRead;
-- int bytesPerLine;
-- int i;
-- int usecs;
+- msg.fu.nRects = Swap16IfLE(msg.fu.nRects);
+Bool
+SendTextChatClose(void)
+{
@@ -4754,9 +4852,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ return WriteExact(rfbsock, (char *)&chat, sz_rfbTextChatMsg);
+}
-- if (!ReadFromRFBServer(((char *)&msg.fu) + 1,
-- sz_rfbFramebufferUpdateMsg - 1))
-- return False;
+- for (i = 0; i < msg.fu.nRects; i++) {
+- if (!ReadFromRFBServer((char *)&rect, sz_rfbFramebufferUpdateRectHeader))
+- return False;
+Bool
+SendTextChatFinished(void)
+{
@@ -4791,25 +4889,64 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ *t_old = t_now;
+ return(dt);
+}
-
-- msg.fu.nRects = Swap16IfLE(msg.fu.nRects);
++
+/* common dtime() activities: */
+double dtime0(double *t_old) {
+ *t_old = 0.0;
+ return dtime(t_old);
+}
-
-- for (i = 0; i < msg.fu.nRects; i++) {
-- if (!ReadFromRFBServer((char *)&rect, sz_rfbFramebufferUpdateRectHeader))
-- return False;
++
+double dnow(void) {
+ double t;
+ return dtime0(&t);
+}
++
++extern int filexfer_sock;
++extern int filexfer_listen;
++
++static char fxfer[65536];
++extern void CheckFileXfer(void);
++
++Bool HandleFileXfer(void) {
++ unsigned char hdr[12];
++ unsigned int len;
++
++ int rfbDirContentRequest = 1;
++ int rfbDirPacket = 2; // Full directory name or full file name.
++ int rfbFileTransferRequest = 3;
++ int rfbFileHeader = 4;
++ int rfbFilePacket = 5; // One slice of the file
++ int rfbEndOfFile = 6;
++ int rfbAbortFileTransfer = 7;
++ int rfbFileTransferOffer = 8;
++ int rfbFileAcceptHeader = 9; // The server accepts or rejects the file
++ int rfbCommand = 10;
++ int rfbCommandReturn = 11;
++ int rfbFileChecksums = 12;
++
++ int rfbRDirContent = 1; // Request a Server Directory contents
++ int rfbRDrivesList = 2; // Request the server's drives list
++
++ int rfbADirectory = 1; // Reception of a directory name
++ int rfbAFile = 2; // Reception of a file name
++ int rfbADrivesList = 3; // Reception of a list of drives
++ int rfbADirCreate = 4; // Response to a create dir command
++ int rfbADirDelete = 5; // Response to a delete dir command
++ int rfbAFileCreate = 6; // Response to a create file command
++ int rfbAFileDelete = 7; // Response to a delete file command
++
++ int rfbCDirCreate = 1; // Request the server to create the given directory
++ int rfbCDirDelete = 2; // Request the server to delete the given directory
++ int rfbCFileCreate = 3; // Request the server to create the given file
++ int rfbCFileDelete = 4; // Request the server to delete the given file
++
++ int rfbRErrorUnknownCmd = 1; // Unknown FileTransfer command.
++ int rfbRErrorCmd = 0xFFFFFFFF;
- rect.encoding = Swap32IfLE(rect.encoding);
- if (rect.encoding == rfbEncodingLastRect)
- break;
++ int db = 0;
- rect.r.x = Swap16IfLE(rect.r.x);
- rect.r.y = Swap16IfLE(rect.r.y);
@@ -4824,21 +4961,17 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- }
- continue;
- }
-+/*
-+ * HandleRFBServerMessage.
-+ */
++ last_filexfer = time(NULL);
++ //fprintf(stderr, "last_filexfer-1: %d\n", last_filexfer);
- if (rect.encoding == rfbEncodingPointerPos) {
- if (!HandleCursorPos(rect.r.x, rect.r.y)) {
- return False;
-- }
++ if (filexfer_sock < 0) {
++ return True;
+ }
- continue;
- }
-+Bool
-+HandleRFBServerMessage()
-+{
-+ int db = 0;
-+ rfbServerToClientMsg msg;
- if ((rect.r.x + rect.r.w > si.framebufferWidth) ||
- (rect.r.y + rect.r.h > si.framebufferHeight))
@@ -4846,40 +4979,101 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- fprintf(stderr,"Rect too large: %dx%d at (%d, %d)\n",
- rect.r.w, rect.r.h, rect.r.x, rect.r.y);
- return False;
-+ if (!ReadFromRFBServer((char *)&msg, 1)) {
++ hdr[0] = rfbFileTransfer;
++ skip_XtUpdateAll = 1;
++ if (!ReadFromRFBServer(&hdr[1], 11)) {
++ skip_XtUpdateAll = 0;
+ return False;
++ }
++ write(filexfer_sock, hdr, 12);
++ if (db) fprintf(stderr, "Got rfbFileTransfer hdr\n");
++ if (db) write(2, hdr, 12);
++ if (db) fprintf(stderr, "\n");
++
++ len = (hdr[8] << 24) | (hdr[9] << 16) | (hdr[10] << 8) | hdr[11];
++ if (db) fprintf(stderr, "Got rfbFileTransfer: len %d\n", len);
++ if (len > 0) {
++ if (!ReadFromRFBServer(fxfer, len)) {
++ skip_XtUpdateAll = 0;
++ return False;
++ }
++ if (db) write(2, fxfer, len);
++ if (db) fprintf(stderr, "\n");
++ write(filexfer_sock, fxfer, len);
}
++ len = (hdr[4] << 24) | (hdr[5] << 16) | (hdr[6] << 8) | hdr[7];
++ if (hdr[1] == rfbFileHeader && len != rfbRErrorCmd) {
++ if (db) fprintf(stderr, "Got rfbFileTransfer: rfbFileHeader\n");
++ len = 4;
++ if (!ReadFromRFBServer(fxfer, len)) {
++ skip_XtUpdateAll = 0;
++ return False;
++ }
++ if (db) write(2, fxfer, len);
++ if (db) fprintf(stderr, "\n");
++ write(filexfer_sock, fxfer, len);
++ }
++ if (db) fprintf(stderr, "Got rfbFileTransfer done.\n");
++ skip_XtUpdateAll = 0;
- if (rect.r.h * rect.r.w == 0) {
- fprintf(stderr,"Zero size rect - ignoring\n");
- continue;
- }
-+ switch (msg.type) {
++ CheckFileXfer();
++ return True;
++}
++
++/*
++ * HandleRFBServerMessage.
++ */
- /* If RichCursor encoding is used, we should prevent collisions
- between framebuffer updates and cursor drawing operations. */
- SoftCursorLockArea(rect.r.x, rect.r.y, rect.r.w, rect.r.h);
--
+
- switch (rect.encoding) {
++Bool
++HandleRFBServerMessage()
++{
++ int db = 0;
++ rfbServerToClientMsg msg;
+
+- case rfbEncodingRaw:
++ if (!ReadFromRFBServer((char *)&msg, 1)) {
++ return False;
++ }
+
+- bytesPerLine = rect.r.w * myFormat.bitsPerPixel / 8;
+- linesToRead = BUFFER_SIZE / bytesPerLine;
++ if (msg.type == rfbFileTransfer) {
++ return HandleFileXfer();
++ }
+
+- while (rect.r.h > 0) {
+- if (linesToRead > rect.r.h)
+- linesToRead = rect.r.h;
++ switch (msg.type) {
+
+- if (!ReadFromRFBServer(buffer,bytesPerLine * linesToRead))
+- return False;
+ case rfbSetColourMapEntries:
+ {
+ int i;
+ CARD16 rgb[3];
+ XColor xc;
-- case rfbEncodingRaw:
+- CopyDataToScreen(buffer, rect.r.x, rect.r.y, rect.r.w,
+- linesToRead);
+ if (!ReadFromRFBServer(((char *)&msg) + 1, sz_rfbSetColourMapEntriesMsg - 1)) {
+ return False;
+ }
-- bytesPerLine = rect.r.w * myFormat.bitsPerPixel / 8;
-- linesToRead = BUFFER_SIZE / bytesPerLine;
+- rect.r.h -= linesToRead;
+- rect.r.y += linesToRead;
+ msg.scme.firstColour = Swap16IfLE(msg.scme.firstColour);
+ msg.scme.nColours = Swap16IfLE(msg.scme.nColours);
-- while (rect.r.h > 0) {
-- if (linesToRead > rect.r.h)
-- linesToRead = rect.r.h;
+ for (i = 0; i < msg.scme.nColours; i++) {
+ if (!ReadFromRFBServer((char *)rgb, 6)) {
+ return False;
@@ -4896,38 +5090,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ }
+ xc.flags = DoRed|DoGreen|DoBlue;
+ XStoreColor(dpy, cmap, &xc);
-+ }
-
-- if (!ReadFromRFBServer(buffer,bytesPerLine * linesToRead))
-- return False;
-+ break;
-+ }
-
-- CopyDataToScreen(buffer, rect.r.x, rect.r.y, rect.r.w,
-- linesToRead);
-+ case rfbFramebufferUpdate:
-+ {
-+ rfbFramebufferUpdateRectHeader rect;
-+ int linesToRead;
-+ int bytesPerLine;
-+ int i;
-+ int usecs;
-+
-+ int area_copyrect = 0;
-+ int area_tight = 0;
-+ int area_zrle = 0;
-+ int area_raw = 0;
-+ if (db) fprintf(stderr, "FBU-0: %.6f\n", dnow());
-
-- rect.r.h -= linesToRead;
-- rect.r.y += linesToRead;
-+ int skip_incFBU = 0;
-+ sent_FBU = -1;
-
-+ if (!ReadFromRFBServer(((char *)&msg.fu) + 1, sz_rfbFramebufferUpdateMsg - 1)) {
-+ return False;
}
-- break;
++
+ break;
++ }
- case rfbEncodingCopyRect:
- {
@@ -4955,11 +5121,33 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- rect.r.w, rect.r.h);
- XFillRectangle(dpy, desktopWin, srcGC, cr.srcX, cr.srcY,
- rect.r.w, rect.r.h);
-- }
-+ msg.fu.nRects = Swap16IfLE(msg.fu.nRects);
++ case rfbFramebufferUpdate:
++ {
++ rfbFramebufferUpdateRectHeader rect;
++ int linesToRead;
++ int bytesPerLine;
++ int i;
++ int usecs;
++
++ int area_copyrect = 0;
++ int area_tight = 0;
++ int area_zrle = 0;
++ int area_raw = 0;
++ if (db) fprintf(stderr, "FBU-0: %.6f\n", dnow());
++
++ int skip_incFBU = 0;
++ sent_FBU = -1;
++
++ if (!ReadFromRFBServer(((char *)&msg.fu) + 1, sz_rfbFramebufferUpdateMsg - 1)) {
++ return False;
+ }
- XCopyArea(dpy, desktopWin, desktopWin, gc, cr.srcX, cr.srcY,
- rect.r.w, rect.r.h, rect.r.x, rect.r.y);
++ msg.fu.nRects = Swap16IfLE(msg.fu.nRects);
+
+- break;
+- }
+ for (i = 0; i < msg.fu.nRects; i++) {
+ if (!ReadFromRFBServer((char *)&rect, sz_rfbFramebufferUpdateRectHeader)) {
+ return False;
@@ -5256,11 +5444,6 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ return False;
+ }
-- break;
-- }
-+ /* Now we may discard "soft cursor locks". */
-+ if (db) fprintf(stderr, "FBU-SUL1 %.6f\n", dnow());
-
- case rfbEncodingRRE:
- {
- switch (myFormat.bitsPerPixel) {
@@ -5279,7 +5462,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- }
- break;
- }
-+ SoftCursorUnlockScreen();
++ /* Now we may discard "soft cursor locks". */
++ if (db) fprintf(stderr, "FBU-SUL1 %.6f\n", dnow());
- case rfbEncodingCoRRE:
- {
@@ -5296,10 +5480,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- if (!HandleCoRRE32(rect.r.x,rect.r.y,rect.r.w,rect.r.h))
- return False;
- break;
-+ if (db) fprintf(stderr, "FBU-SUL2 %.6f\n", dnow());
- }
+- }
- break;
- }
++ SoftCursorUnlockScreen();
- case rfbEncodingHextile:
- {
@@ -5316,14 +5500,11 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- if (!HandleHextile32(rect.r.x,rect.r.y,rect.r.w,rect.r.h))
- return False;
- break;
-+ if (1 || area_copyrect) {
-+ if (db) fprintf(stderr, "FBU-XSN1 %.6f\n", dnow());
-+ XSync(dpy, False);
-+ if (db) fprintf(stderr, "FBU-XSN2 %.6f\n", dnow());
++ if (db) fprintf(stderr, "FBU-SUL2 %.6f\n", dnow());
}
- break;
- }
--
+
- case rfbEncodingZlib:
- {
- switch (myFormat.bitsPerPixel) {
@@ -5339,6 +5520,29 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
- if (!HandleZlib32(rect.r.x,rect.r.y,rect.r.w,rect.r.h))
- return False;
- break;
++ if (1 || area_copyrect) {
++ if (db) fprintf(stderr, "FBU-XSN1 %.6f\n", dnow());
++ XSync(dpy, False);
++ if (db) fprintf(stderr, "FBU-XSN2 %.6f\n", dnow());
+ }
+- break;
+- }
+-
+- case rfbEncodingTight:
+- {
+- switch (myFormat.bitsPerPixel) {
+- case 8:
+- if (!HandleTight8(rect.r.x,rect.r.y,rect.r.w,rect.r.h))
+- return False;
+- break;
+- case 16:
+- if (!HandleTight16(rect.r.x,rect.r.y,rect.r.w,rect.r.h))
+- return False;
+- break;
+- case 32:
+- if (!HandleTight32(rect.r.x,rect.r.y,rect.r.w,rect.r.h))
+- return False;
+- break;
+ sent_FBU = 0;
+ /*
+ * we need to be careful since Xt events are processed
@@ -5360,25 +5564,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ si.framebufferHeight, False);
+ skip_incFBU = 1;
+ }
- }
-- break;
-- }
--
-- case rfbEncodingTight:
-- {
-- switch (myFormat.bitsPerPixel) {
-- case 8:
-- if (!HandleTight8(rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-- return False;
-- break;
-- case 16:
-- if (!HandleTight16(rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-- return False;
-- break;
-- case 32:
-- if (!HandleTight32(rect.r.x,rect.r.y,rect.r.w,rect.r.h))
-- return False;
-- break;
++ }
+ if (do_fb_update != 0.0) {
+ if (dnow() > do_fb_update + 1.1) {
+ do_fb_update = 0.0;
@@ -5401,7 +5587,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
#ifdef MITSHM
/* if using shared memory PutImage, make sure that the X server has
-@@ -1224,59 +1611,142 @@
+@@ -1224,59 +1725,149 @@
mainly to avoid copyrect using invalid screen contents - not sure
if we'd need it otherwise. */
@@ -5572,12 +5758,19 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
+ fprintf(stderr,"Unknown message type %d from VNC server\n",msg.type);
+ return False;
+ }
++ if (appData.fileActive) {
++ if (filexfer_sock < 0 && filexfer_listen < 0) {
++ appData.fileActive = False;
++ } else {
++ CheckFileXfer();
++ }
++ }
+
+ return True;
}
-@@ -1296,12 +1766,19 @@
+@@ -1296,12 +1887,19 @@
#define CONCAT2(a,b) a##b
#define CONCAT2E(a,b) CONCAT2(a,b)
@@ -5597,7 +5790,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
#undef BPP
#define BPP 16
#include "rre.c"
-@@ -1309,6 +1786,7 @@
+@@ -1309,6 +1907,7 @@
#include "hextile.c"
#include "zlib.c"
#include "tight.c"
@@ -5605,7 +5798,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
#undef BPP
#define BPP 32
#include "rre.c"
-@@ -1316,6 +1794,15 @@
+@@ -1316,6 +1915,15 @@
#include "hextile.c"
#include "zlib.c"
#include "tight.c"
@@ -5621,7 +5814,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
#undef BPP
/*
-@@ -1358,9 +1845,9 @@
+@@ -1358,9 +1966,9 @@
" %s significant bit in each byte is leftmost on the screen.\n",
(format->bigEndian ? "Most" : "Least"));
} else {
@@ -5633,7 +5826,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/rfbproto.c vnc_unixsrc/vncvie
(format->bigEndian ? "Most" : "Least"));
}
if (format->trueColour) {
-@@ -1463,3 +1950,115 @@
+@@ -1463,3 +2071,115 @@
cinfo->src = &jpegSrcManager;
}
@@ -5968,13 +6161,158 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/smake vnc_unixsrc/vncviewer/s
+fi
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/sockets.c vnc_unixsrc/vncviewer/sockets.c
--- vnc_unixsrc.orig/vncviewer/sockets.c 2001-01-14 22:54:18.000000000 -0500
-+++ vnc_unixsrc/vncviewer/sockets.c 2007-05-20 21:24:33.000000000 -0400
-@@ -63,15 +63,64 @@
++++ vnc_unixsrc/vncviewer/sockets.c 2007-05-31 22:13:52.000000000 -0400
+@@ -63,15 +63,216 @@
XtRemoveInput(*id);
}
+extern int skip_XtUpdate;
++extern int skip_XtUpdateAll;
++extern int filexfer_sock, filexfer_listen;
++extern time_t start_listen;
+extern void CheckTextInput(void);
++extern time_t last_filexfer;
++
++static char fxfer[65536];
++int fxfer_size = 65536;
++
++void CheckFileXfer() {
++ fd_set fds;
++ struct timeval tv;
++ int i, icnt = 0, igot = 0, bytes0 = 0, bytes = 0, grace = 0, n, list = 0;
++ int db = 0;
++
++ if (!appData.fileActive || (filexfer_sock < 0 && filexfer_listen < 0)) {
++ return;
++ }
++
++ if (filexfer_listen >= 0 && time(NULL) > start_listen + 10) {
++ fprintf(stderr, "filexfer closing aging listen socket.\n");
++ close(filexfer_listen);
++ filexfer_listen = -1;
++ return;
++ }
++//fprintf(stderr, "In CheckFileXfer\n");
++
++ if (filexfer_listen >=0) {
++ n = filexfer_listen;
++ list = 1;
++ } else {
++ n = filexfer_sock;
++ }
++
++ while (1) {
++ icnt++;
++ FD_ZERO(&fds);
++ FD_SET(n,&fds);
++ tv.tv_sec = 0;
++ tv.tv_usec = 0;
++ if (select(n+1, &fds, NULL, NULL, &tv) > 0) {
++ if (FD_ISSET(n, &fds)) {
++ if (list) {
++ if (filexfer_sock >= 0) {
++ fprintf(stderr, "filexfer close stale(?) filexfer_sock.\n");
++ close(filexfer_sock);
++ filexfer_sock = -1;
++ }
++ filexfer_sock = AcceptTcpConnection(filexfer_listen);
++ if (filexfer_listen >= 0) {
++ fprintf(stderr, "filexfer accept OK.\n");
++ close(filexfer_listen);
++ filexfer_listen = -1;
++ } else {
++ fprintf(stderr, "filexfer accept failed.\n");
++ }
++ break;
++ } else {
++ ssize_t rn;
++ unsigned char hdr[12];
++ unsigned int len;
++ if (db) fprintf(stderr, "try read filexfer...\n");
++#if 1
++ rn = read(n, fxfer, 1*8192);
++ if (0 || db) fprintf(stderr, "filexfer read[%d] %d.\n", icnt, rn);
++ if (rn < 0) {
++ fprintf(stderr, "filexfer bad read: %d\n", errno);
++ break;
++ } else if (rn == 0) {
++ fprintf(stderr, "filexfer gone.\n");
++ close(n);
++ filexfer_sock = -1;
++ last_filexfer = time(NULL);
++ //fprintf(stderr, "last_filexfer-2a: %d\n", last_filexfer);
++ return;
++ } else if (rn > 0) {
++ if (db) write(2, fxfer, rn);
++ if (db) fprintf(stderr, "\n");
++ bytes += rn;
++ last_filexfer = time(NULL);
++ //fprintf(stderr, "last_filexfer-2b: %d\n", last_filexfer);
++ if (!WriteExact(rfbsock, fxfer, rn)) {
++ return;
++ }
++ igot = 1;
++ }
++#else
++ // not working, not always 7 msg type.
++ rn = read(n, hdr, 12);
++ if (db) fprintf(stderr, "filexfer read %d.\n", rn);
++ if (rn == 0) {
++ fprintf(stderr, "filexfer gone.\n");
++ close(n);
++ filexfer_sock = -1;
++ last_filexfer = time(NULL);
++ return;
++ }
++ if (rn == 12) {
++ len = (hdr[8] << 24) | (hdr[9] << 16) | (hdr[10] << 8) | hdr[11];
++ if (db) fprintf(stderr, "n=%d len=%d\n", rn, len);
++ if (db) write(2, hdr, rn);
++ if (db) fprintf(stderr, "\n");
++ WriteExact(rfbsock, hdr, rn);
++ if (len > 0) {
++ rn = read(len, fxfer, len);
++ if (!WriteExact(rfbsock, fxfer, len)) {
++ last_filexfer = time(NULL);
++ return;
++ }
++ if (db) write(2, fxfer, len);
++ }
++ if (db) fprintf(stderr, "\n");
++ } else {
++ if (db) fprintf(stderr, "bad rn: %d\n", rn);
++ }
++ igot = 1;
++#endif
++ }
++ }
++ } else {
++ if (bytes >= 8192) {
++ int ok = 0;
++ if (bytes0 == 0) {
++ ok = 1;
++ } else if (bytes >= bytes0 + 12) {
++ ok = 1;
++ } else if (grace < 20) {
++ ok = 1;
++ }
++ if (ok) {
++ grace++;
++ bytes0 = bytes;
++ //fprintf(stderr, "grace: %d\n", grace);
++ usleep(10 * 1000);
++ continue;
++ }
++ }
++ break;
++ }
++ }
++ if (igot) {
++ last_filexfer = time(NULL);
++ //fprintf(stderr, "last_filexfer-2c: %d\n", last_filexfer);
++ }
++ return;
++}
+
static void
ProcessXtEvents()
@@ -5985,6 +6323,10 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/sockets.c vnc_unixsrc/vncview
- while (!rfbsockReady) {
- XtAppProcessEvent(appContext, XtIMAll);
- }
++ int y;
++ if (skip_XtUpdateAll) {
++ return;
++ }
+ if (appData.chatActive) {
+ fd_set fds;
+ struct timeval tv;
@@ -6030,21 +6372,33 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/sockets.c vnc_unixsrc/vncview
+ return;
+ }
+
++//fprintf(stderr, "XtAppAddInput: ");
+ rfbsockReady = False;
+ XtAppAddInput(appContext, rfbsock, (XtPointer)XtInputReadMask,
+ rfbsockReadyCallback, NULL);
+
+ while (!rfbsockReady) {
++//fprintf(stderr, ".");
+ XtAppProcessEvent(appContext, XtIMAll);
+ }
++//fprintf(stderr, " done.\n");
}
Bool
-@@ -283,6 +332,10 @@
+@@ -272,6 +473,8 @@
+ * ListenAtTcpPort starts listening at the given TCP port.
+ */
+
++int use_loopback = 0;
++
+ int
+ ListenAtTcpPort(int port)
+ {
+@@ -283,6 +486,10 @@
addr.sin_port = htons(port);
addr.sin_addr.s_addr = INADDR_ANY;
-+ if (getenv("VNCVIEWER_LISTEN_LOCALHOST")) {
++ if (getenv("VNCVIEWER_LISTEN_LOCALHOST") || use_loopback) {
+ addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ }
+
@@ -6106,542 +6460,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/tunnel.c vnc_unixsrc/vncviewe
}
sprintf(lastArgv, "localhost::%d", localPort);
-diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer._man vnc_unixsrc/vncviewer/vncviewer._man
---- vnc_unixsrc.orig/vncviewer/vncviewer._man 1969-12-31 19:00:00.000000000 -0500
-+++ vnc_unixsrc/vncviewer/vncviewer._man 2007-05-25 23:22:17.000000000 -0400
-@@ -0,0 +1,529 @@
-+'\" t
-+.\" ** The above line should force tbl to be a preprocessor **
-+.\" Man page for X vncviewer
-+.\"
-+.\" Copyright (C) 1998 Marcus.Brinkmann@ruhr-uni-bochum.de
-+.\" Copyright (C) 2000,2001 Red Hat, Inc.
-+.\" Copyright (C) 2001-2003 Constantin Kaplinsky <const@ce.cctpu.edu.ru>
-+.\"
-+.\" You may distribute under the terms of the GNU General Public
-+.\" License as specified in the file LICENCE.TXT that comes with the
-+.\" TightVNC distribution.
-+.\"
-+.TH vncviewer 1 "January 2003" "" "TightVNC"
-+.SH NAME
-+vncviewer \- an X viewer client for VNC
-+.SH SYNOPSIS
-+.B vncviewer
-+.RI [\| options \|]
-+.RI [\| host \|][\| :display \|]
-+.br
-+.B vncviewer
-+.RI [\| options \|]
-+.RI [\| host \|][\| ::port \|]
-+.br
-+.B vncviewer
-+.RI [\| options \|]
-+.IR \-listen
-+.RI [\| display \|]
-+.br
-+.B vncviewer
-+.IR \-help
-+.br
-+.SH DESCRIPTION
-+.B vncviewer
-+is an Xt\-based client application for the VNC (Virtual Network
-+Computing) system. It can connect to any VNC\-compatible server such
-+as \fBXvnc\fR or WinVNC, allowing you to control desktop environment
-+of a different machine.
-+
-+You can use F8 to display a pop\-up utility menu. Press F8 twice to
-+pass single F8 to the remote side.
-+.SH OPTIONS
-+.TP
-+\fB\-help\fR
-+Prints a short usage notice to stderr.
-+.TP
-+\fB\-listen\fR
-+Make the viewer listen on port 5500+\fIdisplay\fR for reverse
-+connections from a server. WinVNC supports reverse connections using
-+the "Add New Client" menu option, or the \-connect command line
-+option. \fBXvnc\fR requires the use of the helper program
-+\fBvncconnect\fR.
-+.TP
-+\fB\-via\fR \fIgateway\fR
-+Automatically create encrypted TCP tunnel to the \fIgateway\fR machine
-+before connection, connect to the \fIhost\fR through that tunnel
-+(TightVNC\-specific). By default, this option invokes SSH local port
-+forwarding, assuming that SSH client binary can be accessed as
-+/usr/bin/ssh. Note that when using the \fB\-via\fR option, the host
-+machine name should be specified as known to the gateway machine, e.g.
-+"localhost" denotes the \fIgateway\fR, not the machine where vncviewer
-+was launched. See the ENVIRONMENT section below for the information on
-+configuring the \fB\-via\fR option.
-+.TP
-+\fB\-shared\fR
-+When connecting, specify that a shared connection is requested. In
-+TightVNC, this is the default mode, allowing you to share the desktop
-+with other clients already using it.
-+.TP
-+\fB\-noshared\fR
-+When connecting, specify that the session may not be shared. This
-+would either disconnect other connected clients or refuse your
-+connection, depending on the server configuration.
-+.TP
-+\fB\-viewonly\fR
-+Disable transfer of mouse and keyboard events from the client to the
-+server.
-+.TP
-+\fB\-fullscreen\fR
-+Start in full\-screen mode. Please be aware that operating in
-+full\-screen mode may confuse X window managers. Typically, such
-+conflicts cause incorrect handling of input focus or make the viewer
-+window disappear mysteriously. See the grabKeyboard setting in the
-+RESOURCES section below for a method to solve input focus problem.
-+.TP
-+\fB\-noraiseonbeep\fR
-+By default, the viewer shows and raises its window on remote beep
-+(bell) event. This option disables such behaviour
-+(TightVNC\-specific).
-+.TP
-+\fB\-user\fR \fIusername\fR
-+User name for Unix login authentication. Default is to use current
-+Unix user name. If this option was given, the viewer will prefer Unix
-+login authentication over the standard VNC authentication.
-+.TP
-+\fB\-passwd\fR \fIpasswd\-file\fR
-+File from which to get the password (as generated by the
-+\fBvncpasswd\fR(1) program). This option affects only the standard VNC
-+authentication.
-+.TP
-+\fB\-encodings\fR \fIencoding\-list\fR
-+TightVNC supports several different compression methods to encode
-+screen updates; this option specifies a set of them to use in order of
-+preference. Encodings are specified separated with spaces, and must
-+thus be enclosed in quotes if more than one is specified. Available
-+encodings, in default order for a remote connection, are "copyrect
-+tight hextile zlib corre rre raw". For a local connection (to the same
-+machine), the default order to try is "raw copyrect tight hextile zlib
-+corre rre". Raw encoding is always assumed as a last option if no
-+other encoding can be used for some reason. For more information on
-+encodings, see the section ENCODINGS below.
-+.TP
-+\fB\-bgr233\fR
-+Always use the BGR233 format to encode pixel data. This reduces
-+network traffic, but colors may be represented inaccurately. The
-+bgr233 format is an 8\-bit "true color" format, with 2 bits blue, 3
-+bits green, and 3 bits red.
-+.TP
-+\fB\-owncmap\fR
-+Try to use a PseudoColor visual and a private colormap. This allows
-+the VNC server to control the colormap.
-+.TP
-+\fB\-truecolour\fR, \fB\-truecolor\fR
-+Try to use a TrueColor visual.
-+.TP
-+\fB\-depth\fR \fIdepth\fR
-+On an X server which supports multiple TrueColor visuals of different
-+depths, attempt to use the specified one (in bits per pixel); if
-+successful, this depth will be requested from the VNC server.
-+.TP
-+\fB\-compresslevel \fIlevel\fR
-+Use specified compression \fIlevel\fR (0..9) for "tight" and "zlib"
-+encodings (TightVNC\-specific). Level 1 uses minimum of CPU time and
-+achieves weak compression ratios, while level 9 offers best
-+compression but is slow in terms of CPU time consumption on the server
-+side. Use high levels with very slow network connections, and low
-+levels when working over high\-speed LANs. It's not recommended to use
-+compression level 0, reasonable choices start from the level 1.
-+.TP
-+\fB\-quality \fIlevel\fR
-+Use the specified JPEG quality \fIlevel\fR (0..9) for the "tight"
-+encoding (TightVNC\-specific). Quality level 0 denotes bad image
-+quality but very impressive compression ratios, while level 9 offers
-+very good image quality at lower compression ratios. Note that the
-+"tight" encoder uses JPEG to encode only those screen areas that look
-+suitable for lossy compression, so quality level 0 does not always
-+mean unacceptable image quality.
-+.TP
-+\fB\-nojpeg\fR
-+Disable lossy JPEG compression in Tight encoding (TightVNC\-specific).
-+Disabling JPEG compression is not a good idea in typical cases, as
-+that makes the Tight encoder less efficient. You might want to use
-+this option if it's absolutely necessary to achieve perfect image
-+quality (see also the \fB\-quality\fR option).
-+.TP
-+\fB\-nocursorshape\fR
-+Disable cursor shape updates, protocol extensions used to handle
-+remote cursor movements locally on the client side
-+(TightVNC\-specific). Using cursor shape updates decreases delays with
-+remote cursor movements, and can improve bandwidth usage dramatically.
-+.TP
-+\fB\-x11cursor\fR
-+Use a real X11 cursor with X-style cursor shape updates, instead of
-+drawing the remote cursor on the framebuffer. This option also
-+disables the dot cursor, and disables cursor position updates in
-+non-fullscreen mode.
-+.TP
-+\fB\-autopass\fR
-+Read a plain-text password from stdin. This option affects only the
-+standard VNC authentication.
-+
-+.SH Enhanced TightVNC Viewer (SSVNC) OPTIONS
-+.TP
-+Enhanced TightVNC Viewer (SSVNC) web page is located at:
-+.TP
-+http://www.karlrunge.com/x11vnc/ssvnc.html
-+.TP
-+Note: ZRLE encoding is now supported.
-+.TP
-+Note: F9 is shortcut to Toggle FullScreen mode.
-+.TP
-+\fB\-use64\fR
-+In \fB\-bgr233\fR mode, use 64 colors instead of 256.
-+.TP
-+\fB\-bgr222\fR
-+Same as \fB\-use64\fR.
-+.TP
-+\fB\-use8\fR
-+In \fB\-bgr233\fR mode, use 8 colors instead of 256.
-+.TP
-+\fB\-bgr111\fR
-+Same as \fB\-use8\fR.
-+.TP
-+\fB\-16bpp\fR
-+If the vnc viewer X display is depth 24 at 32bpp
-+request a 16bpp format from the VNC server to cut
-+network traffic by up to 2X, then tranlate the
-+pixels to 32bpp locally.
-+.TP
-+\fB\-bgr565\fR
-+Same as \fB\-16bpp\fR.
-+.TP
-+\fB\-grey\fR
-+Use a grey scale for the 16- and 8\fB\-bpp\fR modes.
-+.TP
-+\fB\-alpha\fR
-+Use alphablending transparency for local cursors
-+requires: x11vnc server, both client and server
-+must be 32bpp and same endianness.
-+.TP
-+\fB\-ycrop\fR n
-+Only show the top n rows of the framebuffer. For
-+use with x11vnc \fB\-ncache\fR client caching option
-+to help "hide" the pixel cache region.
-+Use a negative value (e.g. \fB\-1\fR) for autodetection.
-+Autodetection will always take place if the remote
-+fb height is more than 2 times the width.
-+.TP
-+\fB\-sbwidth\fR n
-+Scrollbar width for x11vnc \fB\-ncache\fR mode (\fB\-ycrop\fR),
-+default is very narrow: 2 pixels, it is narrow to
-+avoid distraction in \fB\-ycrop\fR mode.
-+.TP
-+\fB\-nobell\fR
-+Disable bell.
-+.TP
-+\fB\-rawlocal\fR
-+Prefer raw encoding for localhost, default is
-+no, i.e. assumes you have a SSH tunnel instead.
-+.TP
-+\fB\-graball\fR
-+Grab the entire X server when in fullscreen mode,
-+needed by some old window managers like fvwm2.
-+.TP
-+\fB\-popupfix\fR
-+Warp the popup back to the pointer position,
-+needed by some old window managers like fvwm2.
-+.TP
-+\fB\-grabkbd\fR
-+Grab the X keyboard when in fullscreen mode,
-+needed by some window managers. Same as \fB\-grabkeyboard\fR.
-+\fB\-grabkbd\fR is the default, use \fB\-nograbkbd\fR to disable.
-+.TP
-+\fB\-bs\fR, \fB\-nobs\fR
-+Whether or not to use X server Backingstore for the
-+main viewer window. The default is to not, mainly
-+because most Linux, etc, systems X servers disable
-+*all* Backingstore by default. To re\fB\-enable\fR it put
-+Option "Backingstore"
-+in the Device section of /etc/X11/xorg.conf.
-+In \fB\-bs\fR mode with no X server backingstore, whenever an
-+area of the screen is re\fB\-exposed\fR it must go out to the
-+VNC server to retrieve the pixels. This is too slow.
-+In \fB\-nobs\fR mode, memory is allocated by the viewer to
-+provide its own backing of the main viewer window. This
-+actually makes some activities faster (changes in large
-+regions) but can appear to "flash" too much.
-+.TP
-+\fB\-noshm\fR
-+Disable use of MIT shared memory extension (not recommended)
-+.TP
-+\fB\-termchat\fR
-+Do the UltraVNC chat in the terminal vncviewer is in
-+instead of in an independent window.
-+.TP
-+\fB\-unixpw str\fR
-+Useful for logging into x11vnc in -unixpw mode. "str" is a
-+string that allows many ways to enter the Unix Username
-+and Unix Password. These characters: username, newline,
-+password, newline are sent to the VNC server after any VNC
-+authentication has taken place. Under x11vnc they are
-+used for the -unixpw login. Other VNC servers could do
-+something similar.
-+You can also indicate "str" via the environment
-+variable SSVNC_UNIXPW.
-+Note that the Escape key is actually sent first to tell
-+x11vnc to not echo the Unix Username back to the VNC
-+viewer. Set SSVNC_UNIXPW_NOESC=1 to override this.
-+If str is ".", then you are prompted at the command line
-+for the username and password in the normal way. If str is
-+"-" the stdin is read via getpass(3) for username@password.
-+Otherwise if str is a file, it is opened and the first line
-+read is taken as the Unix username and the 2nd as the
-+password. If str prefixed by "rm:" the file is removed
-+after reading. Otherwise, if str has a "@" character,
-+it is taken as username@password. Otherwise, the program
-+exits with an error. Got all that?
-+.TP
-+\fB New Popup actions:\fR
-+
-+ ViewOnly: ~ -viewonly
-+ Disable Bell: ~ -nobell
-+ Cursor Shape: ~ -nocursorshape
-+ X11 Cursor: ~ -x11cursor
-+ Cursor Alphablend: ~ -alpha
-+ Toggle Tight/ZRLE: ~ -encodings ...
-+ Disable JPEG: ~ -nojpeg
-+ Full Color as many colors as local screen allows.
-+ Grey scale (16 & 8-bpp) ~ -grey, for low colors 16/8bpp modes only.
-+ 16 bit color (BGR565) ~ -16bpp / -bgr565
-+ 8 bit color (BGR233) ~ -bgr233
-+ 256 colors ~ -bgr233 default # of colors.
-+ 64 colors ~ -bgr222 / -use64
-+ 8 colors ~ -bgr111 / -use8
-+
-+ UltraVNC Extensions:
-+ Disable Remote Input Ultravnc ext. Try to prevent input and
-+ viewing of monitor at physical display.
-+ Single Window Ultravnc ext. Grab and view a single window.
-+ (click on the window you want).
-+ Set 1/n Server Scale Ultravnc ext. Scale desktop by 1/n.
-+ prompt is from the terminal.
-+ Text Chat Ultravnc ext. Do Text Chat.
-+
-+ Note: the Ultravnc extensions only apply to servers that support
-+ them. x11vnc/libvncserver supports some of them.
-+
-+.SH ENCODINGS
-+The server supplies information in whatever format is desired by the
-+client, in order to make the client as easy as possible to implement.
-+If the client represents itself as able to use multiple formats, the
-+server will choose one.
-+
-+.I Pixel format
-+refers to the representation of an individual pixel. The most common
-+formats are 24 and 16 bit "true\-color" values, and 8\-bit "color map"
-+representations, where an arbitrary map converts the color number to
-+RGB values.
-+
-+.I Encoding
-+refers to how a rectangle of pixels are sent (all pixel information in
-+VNC is sent as rectangles). All rectangles come with a header giving
-+the location and size of the rectangle and an encoding type used by
-+the data which follows. These types are listed below.
-+.TP
-+.B Raw
-+The raw encoding simply sends width*height pixel values. All clients
-+are required to support this encoding type. Raw is also the fastest
-+when the server and viewer are on the same machine, as the connection
-+speed is essentially infinite and raw encoding minimizes processing
-+time.
-+.TP
-+.B CopyRect
-+The Copy Rectangle encoding is efficient when something is being
-+moved; the only data sent is the location of a rectangle from which
-+data should be copied to the current location. Copyrect could also be
-+used to efficiently transmit a repeated pattern.
-+.TP
-+.B RRE
-+The Rise\-and\-Run\-length\-Encoding is basically a 2D version of
-+run\-length encoding (RLE). In this encoding, a sequence of identical
-+pixels are compressed to a single value and repeat count. In VNC, this
-+is implemented with a background color, and then specifications of an
-+arbitrary number of subrectangles and color for each. This is an
-+efficient encoding for large blocks of constant color.
-+.TP
-+.B CoRRE
-+This is a minor variation on RRE, using a maximum of 255x255 pixel
-+rectangles. This allows for single\-byte values to be used, reducing
-+packet size. This is in general more efficient, because the savings
-+from sending 1\-byte values generally outweighs the losses from the
-+(relatively rare) cases where very large regions are painted the same
-+color.
-+.TP
-+.B Hextile
-+Here, rectangles are split up in to 16x16 tiles, which are sent in a
-+predetermined order. The data within the tiles is sent either raw or
-+as a variant on RRE. Hextile encoding is usually the best choice for
-+using in high\-speed network environments (e.g. Ethernet local\-area
-+networks).
-+.TP
-+.B Zlib
-+Zlib is a very simple encoding that uses zlib library to compress raw
-+pixel data. This encoding achieves good compression, but consumes a
-+lot of CPU time. Support for this encoding is provided for
-+compatibility with VNC servers that might not understand Tight
-+encoding which is more efficient than Zlib in nearly all real\-life
-+situations.
-+.TP
-+.B Tight
-+Like Zlib encoding, Tight encoding uses zlib library to compress the
-+pixel data, but it pre\-processes data to maximize compression ratios,
-+and to minimize CPU usage on compression. Also, JPEG compression may
-+be used to encode color\-rich screen areas (see the description of
-+\-quality and \-nojpeg options above). Tight encoding is usually the
-+best choice for low\-bandwidth network environments (e.g. slow modem
-+connections).
-+.SH RESOURCES
-+X resources that \fBvncviewer\fR knows about, aside from the
-+normal Xt resources, are as follows:
-+.TP
-+.B shareDesktop
-+Equivalent of \fB\-shared\fR/\fB\-noshared\fR options. Default true.
-+.TP
-+.B viewOnly
-+Equivalent of \fB\-viewonly\fR option. Default false.
-+.TP
-+.B fullScreen
-+Equivalent of \fB\-fullscreen\fR option. Default false.
-+.TP
-+.B grabKeyboard
-+Grab keyboard in full-screen mode. This can help to solve problems
-+with losing keyboard focus. Default false.
-+.TP
-+.B raiseOnBeep
-+Equivalent of \fB\-noraiseonbeep\fR option, when set to false. Default
-+true.
-+.TP
-+.B passwordFile
-+Equivalent of \fB\-passwd\fR option.
-+.TP
-+.B userLogin
-+Equivalent of \fB\-user\fR option.
-+.TP
-+.B passwordDialog
-+Whether to use a dialog box to get the password (true) or get it from
-+the tty (false). Irrelevant if \fBpasswordFile\fR is set. Default
-+false.
-+.TP
-+.B encodings
-+Equivalent of \fB\-encodings\fR option.
-+.TP
-+.B compressLevel
-+Equivalent of \fB\-compresslevel\fR option (TightVNC\-specific).
-+.TP
-+.B qualityLevel
-+Equivalent of \fB\-quality\fR option (TightVNC\-specific).
-+.TP
-+.B enableJPEG
-+Equivalent of \fB\-nojpeg\fR option, when set to false. Default true.
-+.TP
-+.B useRemoteCursor
-+Equivalent of \fB\-nocursorshape\fR option, when set to false
-+(TightVNC\-specific). Default true.
-+.TP
-+.B useBGR233
-+Equivalent of \fB\-bgr233\fR option. Default false.
-+.TP
-+.B nColours
-+When using BGR233, try to allocate this many "exact" colors from the
-+BGR233 color cube. When using a shared colormap, setting this resource
-+lower leaves more colors for other X clients. Irrelevant when using
-+truecolor. Default is 256 (i.e. all of them).
-+.TP
-+.B useSharedColours
-+If the number of "exact" BGR233 colors successfully allocated is less
-+than 256 then the rest are filled in using the "nearest" colors
-+available. This resource says whether to only use the "exact" BGR233
-+colors for this purpose, or whether to use other clients' "shared"
-+colors as well. Default true (i.e. use other clients' colors).
-+.TP
-+.B forceOwnCmap
-+Equivalent of \fB\-owncmap\fR option. Default false.
-+.TP
-+.B forceTrueColour
-+Equivalent of \fB\-truecolour\fR option. Default false.
-+.TP
-+.B requestedDepth
-+Equivalent of \fB\-depth\fR option.
-+.TP
-+.B useSharedMemory
-+Use MIT shared memory extension if on the same machine as the X
-+server. Default true.
-+.TP
-+.B wmDecorationWidth, wmDecorationHeight
-+The total width and height taken up by window manager decorations.
-+This is used to calculate the maximum size of the VNC viewer window.
-+Default is width 4, height 24.
-+.TP
-+.B bumpScrollTime, bumpScrollPixels
-+When in full screen mode and the VNC desktop is bigger than the X
-+display, scrolling happens whenever the mouse hits the edge of the
-+screen. The maximum speed of scrolling is bumpScrollPixels pixels
-+every bumpScrollTime milliseconds. The actual speed of scrolling will
-+be slower than this, of course, depending on how fast your machine is.
-+Default 20 pixels every 25 milliseconds.
-+.TP
-+.B popupButtonCount
-+The number of buttons in the popup window. See the README file for
-+more information on how to customize the buttons.
-+.TP
-+.B debug
-+For debugging. Default false.
-+.TP
-+.B rawDelay, copyRectDelay
-+For debugging, see the README file for details. Default 0 (off).
-+.SH ENVIRONMENT
-+When started with the \fB\-via\fR option, vncviewer reads the
-+\fBVNC_VIA_CMD\fR environment variable, expands patterns beginning
-+with the "%" character, and executes result as a command assuming that
-+it would create TCP tunnel that should be used for VNC connection. If
-+not set, this environment variable defaults to "/usr/bin/ssh -f -L
-+%L:%H:%R %G sleep 20".
-+
-+The following patterns are recognized in the \fBVNC_VIA_CMD\fR (note
-+that all the patterns %G, %H, %L and %R must be present in the command
-+template):
-+.TP
-+.B %%
-+A literal "%";
-+.TP
-+.B %G
-+gateway host name;
-+.TP
-+.B %H
-+remote VNC host name, as known to the gateway;
-+.TP
-+.B %L
-+local TCP port number;
-+.TP
-+.B %R
-+remote TCP port number.
-+.SH SEE ALSO
-+\fBvncserver\fR(1), \fBXvnc\fR(1), \fBvncpasswd\fR(1),
-+\fBvncconnect\fR(1), \fBssh\fR(1)
-+.SH AUTHORS
-+Original VNC was developed in AT&T Laboratories Cambridge. TightVNC
-+additions was implemented by Constantin Kaplinsky. Many other people
-+participated in development, testing and support.
-+
-+\fBMan page authors:\fR
-+.br
-+Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>,
-+.br
-+Terran Melconian <terran@consistent.org>,
-+.br
-+Tim Waugh <twaugh@redhat.com>,
-+.br
-+Constantin Kaplinsky <const@ce.cctpu.edu.ru>
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncviewer/vncviewer.c
--- vnc_unixsrc.orig/vncviewer/vncviewer.c 2004-01-13 09:22:05.000000000 -0500
-+++ vnc_unixsrc/vncviewer/vncviewer.c 2007-05-27 11:58:44.000000000 -0400
++++ vnc_unixsrc/vncviewer/vncviewer.c 2007-05-31 15:18:09.000000000 -0400
@@ -22,6 +22,7 @@
*/
@@ -6821,7 +6642,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
/* The -listen option is used to make us a daemon process which listens for
incoming connections from servers, rather than actively connecting to a
-@@ -45,89 +203,813 @@
+@@ -45,89 +203,834 @@
listenForIncomingConnections() returns, setting the listenSpecified
flag. */
@@ -7337,11 +7158,9 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+Bool _sw2_ = False;
+Bool _sw3_ = False;
+Bool selectingSingleWindow = False;
-
-- Cleanup();
++
+extern Cursor bogoCursor;
-
-- return 0;
++
+void
+ToggleSingleWindow(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
@@ -7396,6 +7215,18 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ }
+}
+
++void
++ToggleFileXfer(Widget w, XEvent *ev, String *params, Cardinal *num_params)
++{
++ if (appData.fileActive) {
++ HideFile(w, ev, params, num_params);
++ appData.fileActive= False;
++ } else {
++ ShowFile(w, ev, params, num_params);
++ appData.fileActive = True;
++ }
++}
++
+static int fooHandler(Display *dpy, XErrorEvent *error) {
+ return 0;
+}
@@ -7532,7 +7363,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ XtVaSetValues(w, XtNstate, False, NULL);
+ }
+}
-+
+
+- Cleanup();
+void
+SetFullColorState(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
@@ -7544,7 +7376,8 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ if (b16 != NULL) XtVaSetValues(b16, XtNstate, False, NULL);
+ }
+}
-+
+
+- return 0;
+void
+Set256ColorsState(Widget w, XEvent *ev, String *params, Cardinal *num_params)
+{
@@ -7670,11 +7503,20 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ XtVaSetValues(w, XtNstate, True, NULL);
+ else
+ XtVaSetValues(w, XtNstate, False, NULL);
++}
++
++void
++SetFileXferState(Widget w, XEvent *ev, String *params, Cardinal *num_params)
++{
++ if (appData.fileActive)
++ XtVaSetValues(w, XtNstate, True, NULL);
++ else
++ XtVaSetValues(w, XtNstate, False, NULL);
}
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncviewer/vncviewer.h
--- vnc_unixsrc.orig/vncviewer/vncviewer.h 2004-03-11 13:14:40.000000000 -0500
-+++ vnc_unixsrc/vncviewer/vncviewer.h 2007-05-27 11:53:21.000000000 -0400
-@@ -68,51 +68,72 @@
++++ vnc_unixsrc/vncviewer/vncviewer.h 2007-05-30 23:52:07.000000000 -0400
+@@ -68,51 +68,73 @@
/* argsresources.c */
typedef struct {
@@ -7780,6 +7622,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
+ Bool singleWindow;
+ int serverScale;
+ Bool chatActive;
++ Bool fileActive;
} AppData;
@@ -7788,7 +7631,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern char *fallback_resources[];
extern char vncServerHost[];
-@@ -130,10 +151,11 @@
+@@ -130,10 +152,11 @@
/* colour.c */
extern unsigned long BGR233ToPixel[];
@@ -7801,7 +7644,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern void SetVisualAndCmap();
-@@ -157,11 +179,18 @@
+@@ -157,11 +180,18 @@
extern void DesktopInitBeforeRealization();
extern void DesktopInitAfterRealization();
@@ -7820,7 +7663,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* dialogs.c */
extern void ServerDialogDone(Widget w, XEvent *event, String *params,
-@@ -207,6 +236,10 @@
+@@ -207,6 +237,10 @@
Cardinal *num_params);
extern void CreatePopup();
@@ -7831,7 +7674,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* rfbproto.c */
extern int rfbsock;
-@@ -229,6 +262,15 @@
+@@ -229,6 +263,15 @@
extern Bool SendClientCutText(char *str, int len);
extern Bool HandleRFBServerMessage();
@@ -7847,7 +7690,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
extern void PrintPixelFormat(rfbPixelFormat *format);
/* selection.c */
-@@ -241,8 +283,9 @@
+@@ -241,8 +284,9 @@
/* shm.c */
@@ -7858,7 +7701,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
/* sockets.c */
-@@ -271,3 +314,48 @@
+@@ -271,3 +315,50 @@
extern XtAppContext appContext;
extern Display* dpy;
extern Widget toplevel;
@@ -7886,6 +7729,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
+extern void ShowScaleN(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetScaleN(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void ToggleTextChat(Widget w, XEvent *ev, String *params, Cardinal *num_params);
++extern void ToggleFileXfer(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void ToggleTermTextChat(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+
+extern void SetViewOnlyState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
@@ -7907,6 +7751,7 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.h vnc_unixsrc/vncvi
+extern void SetSingleWindowState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetTextChatState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
+extern void SetTermTextChatState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
++extern void SetFileXferState(Widget w, XEvent *ev, String *params, Cardinal *num_params);
diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.man vnc_unixsrc/vncviewer/vncviewer.man
--- vnc_unixsrc.orig/vncviewer/vncviewer.man 2004-03-11 13:14:40.000000000 -0500
+++ vnc_unixsrc/vncviewer/vncviewer.man 2007-05-25 23:22:17.000000000 -0400