Commit d3326942 authored by runge's avatar runge

x11vnc: fix build error if libssl is missing or --without-ssl supplied.

parent 171db9c5
2007-06-14 Karl Runge <runge@karlrunge.com>
* configure.ac: add a note on what you must do if you want to
re-run autoconf from the LibVNCServer-X.Y.Z.tar.gz tarball.
2007-05-26 Karl Runge <runge@karlrunge.com>
* configure.ac, Makefile.am, x11vnc/Makefile.am: change
configure to make more of a split between libvncserver and
......
......@@ -20,6 +20,7 @@ $USER's $DESKTOP desktop ($DISPLAY)
<param name=PORT value=$PORT>
<param name="Open New Window" value=yes>
<param name="ignoreMSLogonCheck" value=yes>
<param name="delayAuthPanel" value=yes>
$PARAMS
</APPLET>
<BR>
......
......@@ -20,6 +20,7 @@ $USER's $DESKTOP desktop ($DISPLAY)
<param name=PORT value=$PORT>
<param name="Open New Window" value=yes>
<param name="ignoreMSLogonCheck" value=yes>
<param name="delayAuthPanel" value=yes>
$PARAMS
</APPLET>
<BR>
......
diff -Naur JavaViewer.orig/ButtonPanel.java JavaViewer/ButtonPanel.java
--- JavaViewer.orig/ButtonPanel.java 2004-12-12 20:51:02.000000000 -0500
+++ JavaViewer/ButtonPanel.java 2007-05-18 15:19:53.000000000 -0400
@@ -163,9 +163,16 @@
+++ JavaViewer/ButtonPanel.java 2007-05-31 15:40:45.000000000 -0400
@@ -43,30 +43,36 @@
viewer = v;
setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
- disconnectButton = new Button("Disconnect");
+ if (v.ftpOnly) {
+ disconnectButton = new Button("Quit");
+ } else {
+ disconnectButton = new Button("Close");
+ }
disconnectButton.setEnabled(false);
add(disconnectButton);
disconnectButton.addActionListener(this);
- optionsButton = new Button("Options");
- add(optionsButton);
- optionsButton.addActionListener(this);
- clipboardButton = new Button("Clipboard");
- clipboardButton.setEnabled(false);
- add(clipboardButton);
- clipboardButton.addActionListener(this);
- if (viewer.rec != null) {
- recordButton = new Button("Record");
- add(recordButton);
- recordButton.addActionListener(this);
- }
- ctrlAltDelButton = new Button("Send Ctrl-Alt-Del");
- ctrlAltDelButton.setEnabled(false);
- add(ctrlAltDelButton);
- ctrlAltDelButton.addActionListener(this);
- refreshButton = new Button("Refresh");
- refreshButton.setEnabled(false);
- add(refreshButton);
- refreshButton.addActionListener(this);
+ if (!v.ftpOnly) {
+ optionsButton = new Button("Options");
+ add(optionsButton);
+ optionsButton.addActionListener(this);
+ clipboardButton = new Button("Clipboard");
+ clipboardButton.setEnabled(false);
+ add(clipboardButton);
+ clipboardButton.addActionListener(this);
+ if (viewer.rec != null) {
+ recordButton = new Button("Record");
+ add(recordButton);
+ recordButton.addActionListener(this);
+ }
+ ctrlAltDelButton = new Button("Send Ctrl-Alt-Del");
+ ctrlAltDelButton.setEnabled(false);
+ add(ctrlAltDelButton);
+ ctrlAltDelButton.addActionListener(this);
+ refreshButton = new Button("Refresh");
+ refreshButton.setEnabled(false);
+ add(refreshButton);
+ refreshButton.addActionListener(this);
+ }
ftpButton = new Button("File Transfer");
ftpButton.setEnabled(false);
add(ftpButton);
@@ -79,9 +85,10 @@
public void enableButtons() {
disconnectButton.setEnabled(true);
+ ftpButton.setEnabled(true);
+ if (viewer.ftpOnly) {return;}
clipboardButton.setEnabled(true);
refreshButton.setEnabled(true);
- ftpButton.setEnabled(true);
}
//
@@ -89,6 +96,9 @@
//
public void disableButtonsOnDisconnect() {
+ ftpButton.setEnabled(false);
+ if (viewer.ftpOnly) {return;}
+
remove(disconnectButton);
disconnectButton = new Button("Hide desktop");
disconnectButton.setEnabled(true);
@@ -99,7 +109,6 @@
clipboardButton.setEnabled(false);
ctrlAltDelButton.setEnabled(false);
refreshButton.setEnabled(false);
- ftpButton.setEnabled(false);
validate();
}
@@ -110,6 +119,7 @@
//
public void enableRemoteAccessControls(boolean enable) {
+ if (viewer.ftpOnly) {return;}
ctrlAltDelButton.setEnabled(enable);
}
@@ -163,9 +173,19 @@
}
else if (evt.getSource() == ftpButton)
{
- viewer.ftp.setVisible(!viewer.ftp.isVisible());
+// begin runge/x11vnc
+ if (viewer.ftpOnly) {
+ viewer.vncFrame.setVisible(false);
+ }
+ viewer.ftp.setSavedLocations();
+ if (viewer.ftp.isVisible()) {
+ viewer.ftp.doClose();
......@@ -22,9 +121,12 @@ diff -Naur JavaViewer.orig/ButtonPanel.java JavaViewer/ButtonPanel.java
}
diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
--- JavaViewer.orig/FTPFrame.java 2005-03-15 23:53:14.000000000 -0500
+++ JavaViewer/FTPFrame.java 2007-05-18 21:50:06.000000000 -0400
@@ -26,6 +26,10 @@
+++ JavaViewer/FTPFrame.java 2007-06-02 23:24:32.000000000 -0400
@@ -24,8 +24,13 @@
import java.io.*;
import java.util.ArrayList;
import java.util.Vector;
+import java.util.Date;
import javax.swing.*;
+// begin runge/x11vnc
......@@ -34,7 +136,15 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
/*
* Created on Feb 25, 2004
@@ -80,6 +84,17 @@
@@ -74,12 +79,27 @@
public javax.swing.JTextField connectionStatus = null;
public boolean updateDriveList;
private Vector remoteList = null;
+ private Vector remoteListInfo = null;
private Vector localList = null;
+ private Vector localListInfo = null;
private File currentLocalDirectory = null; // Holds the current local Directory
private File currentRemoteDirectory = null; // Holds the current remote Directory
private File localSelection = null; // Holds the currently selected local file
private String remoteSelection = null; // Holds the currently selected remote file
public String selectedTable = null;
......@@ -48,16 +158,19 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
+ public long saveRemoteDirectoryTime = 0;
+ public int saveRemoteDirectoryCount = 0;
+ private boolean localCurrentIsDir = true;
+ private int lastRemoteIndex = -1;
+ private int lastLocalIndex = -1;
+// end runge/x11vnc
// sf@2004 - Separate directories and files for better lisibility
private ArrayList DirsList;
@@ -125,11 +140,59 @@
@@ -125,11 +145,60 @@
void refreshRemoteLocation()
{
+
remoteList.clear();
+ remoteListInfo.clear();
remoteFileTable.setListData(remoteList);
+System.out.println("refreshRemoteLocation '" + remoteLocation.getText() + "'"); // runge/x11vnc
viewer.rfb.readServerDirectory(remoteLocation.getText());
......@@ -79,7 +192,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
+
+ private File saveLocalHack(File dir) {
+ saveLocalDirectoryCount++;
+System.out.println("L " + saveLocalDirectoryCount + " dt: " + (System.currentTimeMillis() - saveLocalDirectoryTime) + " - " + saveLocalDirectory);
+//System.out.println("L " + saveLocalDirectoryCount + " dt: " + (System.currentTimeMillis() - saveLocalDirectoryTime) + " - " + saveLocalDirectory);
+ if (System.currentTimeMillis() > saveLocalDirectoryTime + 2000 || saveLocalDirectoryCount > 2) {
+ saveLocalDirectory = null;
+ }
......@@ -94,7 +207,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
+
+ private String saveRemoteHack(String indrive) {
+ saveRemoteDirectoryCount++;
+System.out.println("R " + saveRemoteDirectoryCount + " - " + saveRemoteDirectory);
+//System.out.println("R " + saveRemoteDirectoryCount + " - " + saveRemoteDirectory);
+ if (saveRemoteDirectory != null && saveRemoteDirectoryCount > 1) {
+ saveRemoteDirectory = null;
+ }
......@@ -112,7 +225,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
/*
* Prints the list of drives on the remote directory and returns a String[].
* str takes as string like A:fC:lD:lE:lF:lG:cH:c
@@ -185,6 +248,7 @@
@@ -185,6 +254,7 @@
stopButton.setVisible(true);
stopButton.setEnabled(true);
receiveButton.setEnabled(false);
......@@ -120,7 +233,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
remoteTopButton.setEnabled(false);
sendButton.setEnabled(false);
remoteFileTable.setEnabled(false);
@@ -207,6 +271,7 @@
@@ -207,6 +277,7 @@
stopButton.setVisible(false);
stopButton.setEnabled(false);
receiveButton.setEnabled(true);
......@@ -128,71 +241,84 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
remoteTopButton.setEnabled(true);
sendButton.setEnabled(true);
remoteFileTable.setEnabled(true);
@@ -253,6 +318,7 @@
@@ -221,10 +292,11 @@
/*
* Print Directory prints out all the contents of a directory
*/
- void printDirectory(ArrayList a) {
+ void printDirectory(ArrayList a, ArrayList b) {
for (int i = 0; i < a.size(); i++) {
remoteList.addElement(a.get(i));
+ remoteListInfo.addElement(b.get(i));
}
remoteFileTable.setListData(remoteList);
}
@@ -253,6 +325,7 @@
jContentPane.add(getRemotePanel(), java.awt.BorderLayout.EAST);
jContentPane.add(getLocalPanel(), java.awt.BorderLayout.WEST);
jContentPane.add(getButtonPanel(), java.awt.BorderLayout.CENTER);
+System.out.println("getJContentPane");
+//System.out.println("getJContentPane");
}
return jContentPane;
}
@@ -270,6 +336,7 @@
@@ -270,6 +343,7 @@
topPanelLocal.add(getLocalMachineLabel(), java.awt.BorderLayout.CENTER);
topPanelLocal.add(getLocalTopButton(), java.awt.BorderLayout.EAST);
topPanelLocal.setBackground(java.awt.Color.lightGray);
+System.out.println("getTopPanelLocal");
+//System.out.println("getTopPanelLocal");
}
return topPanelLocal;
}
@@ -288,6 +355,7 @@
@@ -288,6 +362,7 @@
topPanelRemote.add(getRemoteMachineLabel(), java.awt.BorderLayout.CENTER);
topPanelRemote.add(getRemoteTopButton(), java.awt.BorderLayout.EAST);
topPanelRemote.setBackground(java.awt.Color.lightGray);
+System.out.println("getTopPanelRemote");
+//System.out.println("getTopPanelRemote");
}
return topPanelRemote;
}
@@ -301,6 +369,7 @@
@@ -301,6 +376,7 @@
if (topPanelCenter == null) {
topPanelCenter = new javax.swing.JPanel();
topPanelCenter.add(getDummyButton(), null);
+System.out.println("getTopPanelCenter");
+//System.out.println("getTopPanelCenter");
}
return topPanelCenter;
}
@@ -328,6 +397,7 @@
@@ -328,6 +404,7 @@
topPanel.add(getRemoteTopButton(), null);
topPanel.setBackground(java.awt.Color.lightGray);
*/
+System.out.println("getTopPanel");
+//System.out.println("getTopPanel");
}
return topPanel;
}
@@ -348,6 +418,7 @@
@@ -348,6 +425,7 @@
statusPanel.add(getJProgressBar(), null);
statusPanel.add(getConnectionStatus(), null);
statusPanel.setBackground(java.awt.Color.lightGray);
+System.out.println("getStatusPanel");
+//System.out.println("getStatusPanel");
}
return statusPanel;
@@ -368,6 +439,7 @@
@@ -368,6 +446,7 @@
remotePanel.add(getRemoteScrollPane(), null);
remotePanel.add(getRemoteStatus(), null);
remotePanel.setBackground(java.awt.Color.lightGray);
+System.out.println("getRemotePanel");
+//System.out.println("getRemotePanel");
}
return remotePanel;
}
@@ -390,6 +462,7 @@
@@ -390,6 +469,7 @@
localPanel.setComponentOrientation(
java.awt.ComponentOrientation.UNKNOWN);
localPanel.setName("localPanel");
+System.out.println("getLocalPanel");
+//System.out.println("getLocalPanel");
}
return localPanel;
}
@@ -405,12 +478,14 @@
@@ -405,12 +485,14 @@
buttonPanel = new javax.swing.JPanel();
buttonPanel.setLayout(null);
buttonPanel.add(getReceiveButton(), null);
......@@ -203,11 +329,11 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
buttonPanel.add(getSendButton(), null);
buttonPanel.add(getStopButton(), null);
buttonPanel.setBackground(java.awt.Color.lightGray);
+System.out.println("getButtonPanel");
+//System.out.println("getButtonPanel");
}
return buttonPanel;
}
@@ -422,10 +497,11 @@
@@ -422,10 +504,11 @@
private javax.swing.JButton getSendButton() {
if (sendButton == null) {
sendButton = new javax.swing.JButton();
......@@ -216,11 +342,11 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
sendButton.setText("Send >>");
sendButton.setName("sendButton");
sendButton.addActionListener(this);
+System.out.println("getSendButton");
+//System.out.println("getSendButton");
}
return sendButton;
@@ -438,7 +514,7 @@
@@ -438,7 +521,7 @@
private javax.swing.JButton getReceiveButton() {
if (receiveButton == null) {
receiveButton = new javax.swing.JButton();
......@@ -229,7 +355,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
receiveButton.setText("<< Receive");
receiveButton.setName("receiveButton");
receiveButton.addActionListener(this);
@@ -453,7 +529,7 @@
@@ -453,7 +536,7 @@
private javax.swing.JButton getDeleteButton() {
if (deleteButton == null) {
deleteButton = new javax.swing.JButton();
......@@ -238,7 +364,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
deleteButton.setText("Delete File");
deleteButton.setName("deleteButton");
deleteButton.addActionListener(this);
@@ -468,7 +544,7 @@
@@ -468,7 +551,7 @@
private javax.swing.JButton getNewFolderButton() {
if (newFolderButton == null) {
newFolderButton = new javax.swing.JButton();
......@@ -247,7 +373,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
newFolderButton.setText("New Folder");
newFolderButton.setName("newFolderButton");
newFolderButton.addActionListener(this);
@@ -476,6 +552,24 @@
@@ -476,6 +559,24 @@
return newFolderButton;
}
......@@ -272,7 +398,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
/**
* This method initializes stopButton
*
@@ -486,7 +580,7 @@
@@ -486,7 +587,7 @@
if (stopButton == null)
{
stopButton = new javax.swing.JButton();
......@@ -281,144 +407,194 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
stopButton.setText("Stop");
stopButton.setName("stopButton");
stopButton.addActionListener(this);
@@ -503,7 +597,7 @@
@@ -503,8 +604,12 @@
private javax.swing.JButton getCloseButton() {
if (closeButton == null) {
closeButton = new javax.swing.JButton();
- closeButton.setBounds(20, 325, 97, 25);
- closeButton.setText("Close");
+ closeButton.setBounds(15, 325, 107, 25); // runge/x11vnc
closeButton.setText("Close");
+ if (viewer.ftpOnly) {
+ closeButton.setText("Quit");
+ } else {
+ closeButton.setText("Close");
+ }
closeButton.setName("closeButton");
closeButton.addActionListener(this);
@@ -551,6 +645,7 @@
}
@@ -551,6 +656,7 @@
//Select the second entry (e.g. C:\)
// localDrivesComboBox.setSelectedIndex(1);
localDrivesComboBox.addActionListener(this);
+System.out.println("getLocalDrivesComboBox");
+//System.out.println("getLocalDrivesComboBox");
}
updateDriveList = false;
return localDrivesComboBox;
@@ -567,6 +662,7 @@
@@ -567,6 +673,7 @@
remoteDrivesComboBox.setFont(
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
remoteDrivesComboBox.addActionListener(this);
+System.out.println("getRemoteDrivesComboBox");
+//System.out.println("getRemoteDrivesComboBox");
}
return remoteDrivesComboBox;
@@ -587,6 +683,7 @@
@@ -587,6 +694,7 @@
localMachineLabel.setFont(
new java.awt.Font("Dialog", java.awt.Font.BOLD, 11));
localMachineLabel.setEditable(false);
+System.out.println("getLocalMachineLabel");
+//System.out.println("getLocalMachineLabel");
}
return localMachineLabel;
}
@@ -622,6 +719,7 @@
@@ -622,6 +730,7 @@
localTopButton.setFont(
new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
localTopButton.addActionListener(this);
+System.out.println("getLocalTopButton");
+//System.out.println("getLocalTopButton");
}
return localTopButton;
}
@@ -638,6 +736,7 @@
@@ -638,6 +747,7 @@
remoteTopButton.setFont(
new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
remoteTopButton.addActionListener(this);
+System.out.println("getRemoteTopButton");
+//System.out.println("getRemoteTopButton");
}
return remoteTopButton;
}
@@ -653,6 +752,7 @@
@@ -650,9 +760,24 @@
private javax.swing.JList getLocalFileTable() {
if (localFileTable == null) {
localList = new Vector(0);
+ localListInfo = new Vector(0);
localFileTable = new JList(localList);
+ MouseMotionListener mlisten = new MouseMotionAdapter() {
+ public void mouseMoved(MouseEvent e) {
+ int index = localFileTable.locationToIndex(e.getPoint());
+ if (index == lastLocalIndex) {
+ return;
+ } else if (index < 0) {
+ return;
+ }
+ lastLocalIndex = index;
+ connectionStatus.setText((String) localListInfo.get(index));
+ }
+ };
localFileTable.addMouseListener(this);
+ localFileTable.addMouseMotionListener(mlisten);
localFileTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+System.out.println("getLocalFileTable");
+//System.out.println("getLocalFileTable");
}
return localFileTable;
}
@@ -669,6 +769,7 @@
@@ -669,6 +794,7 @@
localScrollPane.setFont(
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
localScrollPane.setName("localFileList");
+System.out.println("getLocalScrollPane");
+//System.out.println("getLocalScrollPane");
}
return localScrollPane;
}
@@ -684,6 +785,7 @@
@@ -680,10 +806,25 @@
private javax.swing.JList getRemoteFileTable() {
if (remoteFileTable == null) {
remoteList = new Vector(0);
+ remoteListInfo = new Vector(0);
remoteFileTable = new JList(remoteList);
+ MouseMotionListener mlisten = new MouseMotionAdapter() {
+ public void mouseMoved(MouseEvent e) {
+ int index = remoteFileTable.locationToIndex(e.getPoint());
+ if (index == lastRemoteIndex) {
+ return;
+ } else if (index < 0) {
+ return;
+ }
+ lastRemoteIndex = index;
+ connectionStatus.setText((String) remoteListInfo.get(index));
+ }
+ };
remoteFileTable.addMouseListener(this);
+ remoteFileTable.addMouseMotionListener(mlisten);
remoteFileTable.setSelectedValue("C:\\", false);
remoteFileTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+System.out.println("getRemoteFileTable");
+//System.out.println("getRemoteFileTable");
}
return remoteFileTable;
@@ -698,6 +800,7 @@
@@ -698,6 +839,7 @@
remoteScrollPane = new javax.swing.JScrollPane();
remoteScrollPane.setViewportView(getRemoteFileTable());
remoteScrollPane.setPreferredSize(new java.awt.Dimension(325, 418));
+System.out.println("getRemoteScrollPane");
+//System.out.println("getRemoteScrollPane");
}
return remoteScrollPane;
}
@@ -716,6 +819,7 @@
@@ -716,6 +858,7 @@
remoteLocation.setBackground(new Color(255,255,238));
remoteLocation.setFont(
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
+System.out.println("getRemoteLocation");
+//System.out.println("getRemoteLocation");
}
return remoteLocation;
}
@@ -732,6 +836,7 @@
@@ -732,6 +875,7 @@
localLocation.setBackground( new Color(255,255,238));
localLocation.setFont(
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
+System.out.println("getLocalLocation");
+//System.out.println("getLocalLocation");
}
return localLocation;
}
@@ -748,6 +853,7 @@
@@ -748,6 +892,7 @@
localStatus.setFont(
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
localStatus.setEditable(false);
+System.out.println("getLocalStatus");
+//System.out.println("getLocalStatus");
}
return localStatus;
}
@@ -764,6 +870,7 @@
@@ -764,6 +909,7 @@
remoteStatus.setFont(
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
remoteStatus.setEditable(false);
+System.out.println("getRemoteStatus");
+//System.out.println("getRemoteStatus");
}
return remoteStatus;
}
@@ -780,6 +887,7 @@
@@ -780,6 +926,7 @@
historyComboBox.insertItemAt(new String("Pulldown to view history ..."),0);
historyComboBox.setSelectedIndex(0);
historyComboBox.addActionListener(this);
+System.out.println("getHistoryComboBox");
+//System.out.println("getHistoryComboBox");
}
return historyComboBox;
}
@@ -791,6 +899,7 @@
@@ -791,6 +938,7 @@
private javax.swing.JProgressBar getJProgressBar() {
if (jProgressBar == null) {
jProgressBar = new javax.swing.JProgressBar();
+System.out.println("getJProgressBar");
+//System.out.println("getJProgressBar");
}
return jProgressBar;
}
@@ -806,6 +915,7 @@
@@ -806,6 +954,7 @@
connectionStatus.setBackground(java.awt.Color.lightGray);
connectionStatus.setFont(
new java.awt.Font("Dialog", java.awt.Font.PLAIN, 10));
+System.out.println("getConnectionStatus");
+//System.out.println("getConnectionStatus");
}
connectionStatus.setEditable(false);
return connectionStatus;
@@ -829,12 +939,19 @@
@@ -815,7 +964,7 @@
* Implements Action listener.
*/
public void actionPerformed(ActionEvent evt) {
- System.out.println(evt.getSource());
+// System.out.println(evt.getSource());
if (evt.getSource() == closeButton)
{ // Close Button
@@ -829,14 +978,22 @@
{
doReceive();
}
......@@ -437,8 +613,11 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
+System.out.println("remoteDrivesComboBox"); // runge/x11vnc
changeRemoteDrive();
remoteList.clear();
+ remoteListInfo.clear();
remoteFileTable.setListData(remoteList);
@@ -845,6 +962,7 @@
}
else if (evt.getSource() == localTopButton)
@@ -845,6 +1002,7 @@
}
else if (evt.getSource() == remoteTopButton)
{
......@@ -446,13 +625,17 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
changeRemoteDrive();
}
else if(evt.getSource() == deleteButton)
@@ -880,22 +998,35 @@
@@ -880,25 +1038,42 @@
historyComboBox.setSelectedIndex(0);
}
}
- private void doClose()
+ public void doClose()
{
+ if (viewer.ftpOnly) {
+ viewer.disconnect();
+ return;
+ }
try {
this.setVisible(false);
- viewer.rfb.writeFramebufferUpdateRequest(
......@@ -488,15 +671,28 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
+ }
private void doDelete()
{
System.out.println("Delete Button Pressed");
@@ -979,6 +1110,56 @@
- System.out.println("Delete Button Pressed");
+// System.out.println("Delete Button Pressed");
//Call this method to delete a file at server
if(selectedTable.equals("remote"))
{
@@ -952,7 +1127,7 @@
private void doReceive()
{
- System.out.println("Received Button Pressed");
+// System.out.println("Received Button Pressed");
String sFileName = ((String) this.remoteFileTable.getSelectedValue());
@@ -979,9 +1154,59 @@
viewer.rfb.requestRemoteFile(remoteFileName,localDestinationPath);
}
+// begin runge/x11vnc
+ private void doView()
+ {
+ System.out.println("View Button Pressed");
+// System.out.println("View Button Pressed");
+
+ if (selectedTable == null) {
+ return;
......@@ -545,20 +741,27 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
+
private void doSend()
{
System.out.println("Send Button Pressed");
@@ -1035,8 +1216,11 @@
- System.out.println("Send Button Pressed");
+// System.out.println("Send Button Pressed");
String sFileName = ((String) this.localFileTable.getSelectedValue());
@@ -1035,10 +1260,14 @@
if (!updateDriveList) {
String drive = remoteDrivesComboBox.getSelectedItem().toString().substring(0,1)+ ":\\";
+System.out.println("changeRemoteDrive-A " + drive); // runge/x11vnc
+//System.out.println("changeRemoteDrive-A " + drive); // runge/x11vnc
+ drive = saveRemoteHack(drive);
viewer.rfb.readServerDirectory(drive);
remoteLocation.setText(drive);
+System.out.println("changeRemoteDrive-B " + drive); // runge/x11vnc
+//System.out.println("changeRemoteDrive-B " + drive); // runge/x11vnc
}
remoteList.clear();
+ remoteListInfo.clear();
remoteFileTable.setListData(remoteList);
@@ -1048,6 +1232,7 @@
}
/**
@@ -1048,6 +1277,7 @@
private void changeLocalDrive()
{
File currentDrive = new File(localDrivesComboBox.getSelectedItem().toString());
......@@ -566,7 +769,11 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
if(currentDrive.canRead())
{
localSelection = null;
@@ -1060,6 +1245,7 @@
@@ -1057,9 +1287,11 @@
else
{
localList.clear();
+ localListInfo.clear();
localStatus.setText("WARNING: Drive " + localDrivesComboBox.getSelectedItem().toString());
connectionStatus.setText(" > WARNING - Local Drive unavailable (possibly restricted access or media not present)");
}
......@@ -574,7 +781,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
}
/**
* Determines which FileTable was double-clicked and updates the table
@@ -1101,7 +1287,7 @@
@@ -1101,7 +1333,7 @@
String name = (remoteFileTable.getSelectedValue().toString()).substring(1);
if( !name.substring(0, 2).equals(" ["))
remoteSelection = remoteLocation.getText() + name.substring(0, name.length());
......@@ -583,7 +790,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
}
/*
@@ -1115,10 +1301,38 @@
@@ -1115,10 +1347,38 @@
localFileTable.setBackground(new Color(255, 255, 255));
File currentSelection = new File(currentLocalDirectory, getTrimmedSelection());
......@@ -623,7 +830,15 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
/**
* Updates the Remote File Table based on selection. Called from mouseClicked handler
*/
@@ -1149,6 +1363,7 @@
@@ -1140,6 +1400,7 @@
remoteLocation.setText(drive);
viewer.rfb.readServerDirectory(drive);
remoteList.clear();
+ remoteListInfo.clear();
remoteFileTable.setListData(remoteList);
}
else if (!name.substring(0, 2).equals(" [") && !name.substring((name.length() - 1), name.length()).equals("]"))
@@ -1149,6 +1410,7 @@
remoteSelection = remoteLocation.getText() + name.substring(0, name.length());
drive = remoteLocation.getText();
// ??
......@@ -631,7 +846,12 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
}
else
{
@@ -1163,6 +1378,7 @@
@@ -1159,10 +1421,12 @@
remoteLocation.setText(drive);
viewer.rfb.readServerDirectory(drive);
remoteList.clear();
+ remoteListInfo.clear();
remoteFileTable.setListData(remoteList);
}
//remoteLocation.setText(drive);
}
......@@ -639,7 +859,7 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
/**
* Updates the Local File Table based on selection. Called from MouseClicked handler
*/
@@ -1188,6 +1404,7 @@
@@ -1188,6 +1452,7 @@
else if (currentSelection.isFile())
{
localSelection = currentSelection.getAbsoluteFile();
......@@ -647,7 +867,45 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
}
else if (currentSelection.isDirectory())
{
@@ -1247,10 +1464,34 @@
@@ -1241,36 +1506,113 @@
return null;
}
+ String timeStr(long t) {
+ Date date = new Date(t);
+ return date.toString();
+ }
+ String dotPast(double f, int n) {
+ String fs = "" + f;
+ int i = fs.lastIndexOf(".") + n;
+ if (i >= 0) {
+ int len = fs.length();
+ if (i >= len) {
+ i = len-1;
+ }
+ fs = fs.substring(0, i);
+ }
+ return fs;
+ }
+ String sizeStr(int s) {
+ if (s < 0) {
+ return s + "? B";
+ } else if (s < 1024) {
+ return s + " B";
+ } else if (s < 1024 * 1024) {
+ double k = s / 1024.0;
+ String ks = dotPast(k, 3);
+
+ return s + " (" + ks + " KB)";
+ } else {
+ double m = s / (1024.0*1024.0);
+ String ms = dotPast(m, 3);
+ return s + " (" + ms + " MB)";
+ }
+ }
/*
* Navigates the local file structure up or down one directory
*/
public void changeLocalDirectory(File dir)
{
......@@ -656,6 +914,8 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
+
+ if (dir == null) {
+ connectionStatus.setText("Error changing local directory.");
+ historyComboBox.insertItemAt(new String("> Error changing local directory."), 0);
+ historyComboBox.setSelectedIndex(0);
+ return;
+ }
+
......@@ -664,6 +924,8 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
+ if (contents == null || allFiles == null) {
+ connectionStatus.setText("Error changing local directory.");
+ historyComboBox.insertItemAt(new String("> Error changing local directory."), 0);
+ historyComboBox.setSelectedIndex(0);
+ return;
+ }
+
......@@ -681,9 +943,51 @@ diff -Naur JavaViewer.orig/FTPFrame.java JavaViewer/FTPFrame.java
+// end runge/x11vnc
+
localList.clear();
+ localListInfo.clear();
localList.addElement(" [..]");
+ localListInfo.addElement(" [..]");
+
+ ArrayList DirInfo = new ArrayList();
+ ArrayList FilInfo = new ArrayList();
@@ -1296,3 +1537,135 @@
// Populate the Lists
for (int i = 0; i < contents.length; i++)
{
- if (allFiles[i].isDirectory())
+ String f2 = contents[i];
+ if (f2.length() < 24) {
+ for (int ik = f2.length(); ik < 24; ik++) {
+ f2 = f2 + " ";
+ }
+ }
+ String s = f2 + " \tLastmod: " + timeStr(allFiles[i].lastModified()) + " \t\tSize: " + sizeStr((int) allFiles[i].length());
+ if (allFiles[i].isDirectory()) {
// localList.addElement("[" + contents[i] + "]");
DirsList.add(" [" + contents[i] + "]"); // sf@2004
- else
- {
+ DirInfo.add(s);
+ } else {
// localList.addElement(contents[i]);
FilesList.add(" " + contents[i]); // sf@2004
+ FilInfo.add(s);
}
}
// sf@2004
- for (int i = 0; i < DirsList.size(); i++)
+ for (int i = 0; i < DirsList.size(); i++) {
localList.addElement(DirsList.get(i));
- for (int i = 0; i < FilesList.size(); i++)
+ localListInfo.addElement(DirInfo.get(i));
+ }
+ for (int i = 0; i < FilesList.size(); i++) {
localList.addElement(FilesList.get(i));
+ localListInfo.addElement(FilInfo.get(i));
+ }
FilesList.clear();
DirsList.clear();
@@ -1296,3 +1638,135 @@
}
} // @jve:visual-info decl-index=0 visual-constraint="10,10"
......@@ -836,8 +1140,20 @@ diff -Naur JavaViewer.orig/OptionsFrame.java JavaViewer/OptionsFrame.java
choices[shareDesktopIndex].select("Yes");
diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
--- JavaViewer.orig/RfbProto.java 2006-05-24 15:14:40.000000000 -0400
+++ JavaViewer/RfbProto.java 2007-05-18 22:03:42.000000000 -0400
@@ -199,6 +199,10 @@
+++ JavaViewer/RfbProto.java 2007-06-02 23:46:21.000000000 -0400
@@ -86,8 +86,11 @@
// sf@2004 - FileTransfer part
ArrayList remoteDirsList;
+ ArrayList remoteDirsListInfo;
ArrayList remoteFilesList;
+ ArrayList remoteFilesListInfo;
ArrayList a;
+ ArrayList b;
boolean fFTInit = true; // sf@2004
boolean fFTAllowed = true;
boolean fAbort = false;
@@ -199,6 +202,10 @@
// playback.
int numUpdatesInSession;
......@@ -848,7 +1164,7 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
//
// Constructor. Make TCP connection to RFB server.
//
@@ -207,7 +211,27 @@
@@ -207,7 +214,27 @@
viewer = v;
host = h;
port = p;
......@@ -877,20 +1193,229 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
is =
new DataInputStream(
new BufferedInputStream(sock.getInputStream(), 16384));
@@ -831,6 +855,12 @@
@@ -215,9 +242,12 @@
osw = new OutputStreamWriter(sock.getOutputStream());
inDirectory2 = false;
a = new ArrayList();
+ b = new ArrayList();
// sf@2004
remoteDirsList = new ArrayList();
+ remoteDirsListInfo = new ArrayList();
remoteFilesList = new ArrayList();
+ remoteFilesListInfo = new ArrayList();
sendFileSource = "";
}
@@ -420,7 +450,13 @@
//
int readServerMessageType() throws IOException {
- int msgType = is.readUnsignedByte();
+ int msgType;
+ try {
+ msgType = is.readUnsignedByte();
+ } catch (Exception e) {
+ viewer.disconnect();
+ return -1;
+ }
// If the session is being recorded:
if (rec != null) {
@@ -600,6 +636,7 @@
contentParamT = is.readUnsignedByte();
contentParamT = contentParamT << 8;
contentParam = contentParam | contentParamT;
+//System.out.println("FTM: contentType " + contentType + " contentParam " + contentParam);
if (contentType == rfbRDrivesList || contentType == rfbDirPacket)
{
readDriveOrDirectory(contentParam);
@@ -610,7 +647,7 @@
}
else if (contentType == rfbFilePacket)
{
- receiveFileChunk();
+ receiveFileChunk();
}
else if (contentType == rfbEndOfFile)
{
@@ -645,6 +682,7 @@
{
System.out.println("ContentType: " + contentType);
}
+//System.out.println("FTM: done");
}
//Refactored from readRfbFileTransferMsg()
@@ -688,11 +726,11 @@
// Internally used. Write an Rfb message to the server
void writeRfbFileTransferMsg(
- int contentType,
- int contentParam,
- long size, // 0 : compression not supported - 1 : compression supported
- long length,
- String text) throws IOException
+ int contentType,
+ int contentParam,
+ long size, // 0 : compression not supported - 1 : compression supported
+ long length,
+ String text) throws IOException
{
byte b[] = new byte[12];
@@ -702,7 +740,10 @@
byte by = 0;
long c = 0;
- length++;
+
+ if (text != null) {
+ length++; // we send the null I guess???
+ }
c = size & 0xFF000000;
by = (byte) (c >>> 24);
b[4] = by;
@@ -729,6 +770,8 @@
by = (byte) c;
b[11] = by;
os.write(b);
+
+//System.out.println("size: " + size + " length: " + length + " text: " + text);
if (text != null)
@@ -746,12 +789,12 @@
//Internally used. Write an rfb message to the server for sending files ONLY
int writeRfbFileTransferMsgForSendFile(
- int contentType,
- int contentParam,
- long size,
- long length,
- String source
- ) throws IOException
+ int contentType,
+ int contentParam,
+ long size,
+ long length,
+ String source
+ ) throws IOException
{
File f = new File(source);
fis = new FileInputStream(f);
@@ -768,50 +811,51 @@
while (bytesRead!=-1)
{
- counter += bytesRead;
- myDeflater.setInput(byteBuffer, 0, bytesRead);
- myDeflater.finish();
- compressedSize = myDeflater.deflate(CompressionBuffer);
- myDeflater.reset();
- // If the compressed data is larger than the original one, we're dealing with
- // already compressed data
- if (compressedSize > bytesRead)
- fCompress = false;
- this.writeRfbFileTransferMsg(
- contentType,
- contentParam,
- (fCompress ? 1 : 0),
- (fCompress ? compressedSize-1 : bytesRead-1),
- null
- );
- // Todo: Test write error !
- os.write(
- fCompress ? CompressionBuffer : byteBuffer,
- 0,
- fCompress ? compressedSize : bytesRead
- );
-
- // Todo: test read error !
- bytesRead = fis.read(byteBuffer);
-
- // viewer.ftp.connectionStatus.setText("Sent: "+ counter + " bytes of "+ f.length() + " bytes");
- viewer.ftp.jProgressBar.setValue((int)((counter * 100) / f.length()));
- viewer.ftp.connectionStatus.setText(">>> Sending File: " + source + " - Size: " + f.length() + " bytes - Progress: " + ((counter * 100) / f.length()) + "%");
-
- if (fAbort == true)
- {
- fAbort = false;
- fError = true;
- break;
- }
- try
- {
- Thread.sleep(5);
- }
- catch(InterruptedException e)
- {
- System.err.println("Interrupted");
- }
+ counter += bytesRead;
+ myDeflater.setInput(byteBuffer, 0, bytesRead);
+ myDeflater.finish();
+ compressedSize = myDeflater.deflate(CompressionBuffer);
+ myDeflater.reset();
+ // If the compressed data is larger than the original one, we're dealing with
+ // already compressed data
+ if (compressedSize > bytesRead)
+ fCompress = false;
+ this.writeRfbFileTransferMsg(
+ contentType,
+ contentParam,
+ (fCompress ? 1 : 0),
+// RUNGE (fCompress ? compressedSize-1 : bytesRead-1),
+ (fCompress ? compressedSize : bytesRead),
+ null
+ );
+ // Todo: Test write error !
+ os.write(
+ fCompress ? CompressionBuffer : byteBuffer,
+ 0,
+ fCompress ? compressedSize : bytesRead
+ );
+
+ // Todo: test read error !
+ bytesRead = fis.read(byteBuffer);
+
+ // viewer.ftp.connectionStatus.setText("Sent: "+ counter + " bytes of "+ f.length() + " bytes");
+ viewer.ftp.jProgressBar.setValue((int)((counter * 100) / f.length()));
+ viewer.ftp.connectionStatus.setText(">>> Sending File: " + source + " - Size: " + f.length() + " bytes - Progress: " + ((counter * 100) / f.length()) + "%");
+
+ if (fAbort == true)
+ {
+ fAbort = false;
+ fError = true;
+ break;
+ }
+ try
+ {
+ Thread.sleep(5);
+ }
+ catch(InterruptedException e)
+ {
+ System.err.println("Interrupted");
+ }
}
writeRfbFileTransferMsg(fError ? rfbAbortFileTransfer : rfbEndOfFile, 0, 0, 0, null);
@@ -831,6 +875,15 @@
{
System.out.print((char) is.readUnsignedByte());
}
+ System.out.println("");
+
+ if (size == rfbRErrorCmd || size == -1) {
+ viewer.ftp.enableButtons();
+ viewer.ftp.connectionStatus.setText("Remote file not available for writing.");
+ viewer.ftp.historyComboBox.insertItemAt(new String(" > Error - Remote file not available for writing."), 0);
+ viewer.ftp.historyComboBox.setSelectedIndex(0);
+ return;
+ }
int ret = writeRfbFileTransferMsgForSendFile(
rfbFilePacket,
@@ -907,7 +937,7 @@
@@ -907,7 +960,7 @@
//Handles acknowledgement that the file has been deleted on the server
void deleteRemoteFileFeedback() throws IOException
{
......@@ -899,7 +1424,7 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
int length = is.readInt();
String f = "";
for (int i = 0; i < length; i++)
@@ -916,7 +946,11 @@
@@ -916,7 +969,11 @@
}
viewer.ftp.refreshRemoteLocation();
......@@ -912,7 +1437,24 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
viewer.ftp.historyComboBox.setSelectedIndex(0);
}
@@ -943,7 +977,7 @@
@@ -927,11 +984,11 @@
{
String temp = text;
writeRfbFileTransferMsg(
- rfbCommand,
- rfbCFileDelete,
- 0,
- temp.length(),
- temp);
+ rfbCommand,
+ rfbCFileDelete,
+ 0,
+ temp.length(),
+ temp);
}
catch (IOException e)
{
@@ -943,7 +1000,7 @@
// Handles acknowledgement that the directory has been created on the server
void createRemoteDirectoryFeedback() throws IOException
{
......@@ -921,7 +1463,7 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
int length = is.readInt();
String f="";
for (int i = 0; i < length; i++)
@@ -951,7 +985,11 @@
@@ -951,7 +1008,11 @@
f += (char)is.readUnsignedByte();
}
viewer.ftp.refreshRemoteLocation();
......@@ -934,15 +1476,40 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
viewer.ftp.historyComboBox.setSelectedIndex(0);
}
@@ -1004,6 +1042,7 @@
@@ -979,15 +1040,17 @@
{
try
{
+//System.out.println("requestRemoteFile text: " + text);
+//System.out.println("requestRemoteFile leng: " + text.length());
String temp = text;
receivePath = localPath;
writeRfbFileTransferMsg(
- rfbFileTransferRequest,
- 0,
- 1, // 0 : compression not supported - 1 : compression supported
- temp.length(),
- temp);
+ rfbFileTransferRequest,
+ 0,
+ 1, // 0 : compression not supported - 1 : compression supported
+ temp.length(),
+ temp);
}
catch (IOException e)
{
@@ -1004,6 +1067,9 @@
viewer.ftp.disableButtons();
int size = is.readInt();
int length = is.readInt();
+
+//System.out.println("receiveFileHeader size: " + size);
+//System.out.println("receiveFileHeader leng: " + length);
String tempName = "";
for (int i = 0; i < length; i++)
@@ -1011,6 +1050,13 @@
@@ -1011,6 +1077,15 @@
tempName += (char) is.readUnsignedByte();
}
......@@ -950,13 +1517,15 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
+ fFileReceptionRunning = false;
+ viewer.ftp.enableButtons();
+ viewer.ftp.connectionStatus.setText("Remote file not available for reading.");
+ viewer.ftp.historyComboBox.insertItemAt(new String(" > Error - Remote file not available for reading."), 0);
+ viewer.ftp.historyComboBox.setSelectedIndex(0);
+ return;
+ }
+
// sf@2004 - Read the high part of file size (not yet in rfbFileTransferMsg for
// backward compatibility reasons...)
int sizeH = is.readInt();
@@ -1021,7 +1067,15 @@
@@ -1021,7 +1096,16 @@
fileSize=0;
fileChunkCounter = 0;
String fileName = receivePath;
......@@ -967,13 +1536,113 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
+ fFileReceptionRunning = false;
+ writeRfbFileTransferMsg(rfbAbortFileTransfer, 0, 0, 0, null);
+ viewer.ftp.historyComboBox.insertItemAt(new String(" > ERROR opening Local File: <" + fileName ),0);
+ viewer.ftp.historyComboBox.setSelectedIndex(0);
+ viewer.ftp.enableButtons();
+ return;
+ }
writeRfbFileTransferMsg(rfbFileHeader, 0, 0, 0, null);
}
@@ -1263,11 +1317,47 @@
@@ -1133,11 +1217,11 @@
{
String temp = text;
writeRfbFileTransferMsg(
- rfbDirContentRequest,
- rfbRDirContent,
- 0,
- temp.length(),
- temp);
+ rfbDirContentRequest,
+ rfbRDirContent,
+ 0,
+ temp.length(),
+ temp);
}
catch (IOException e)
{
@@ -1202,6 +1286,52 @@
}
}
+ int zogswap(int n) {
+ long l = n;
+ if (l < 0) {
+ l += 0x100000000L;
+ }
+ l = l & 0xFFFFFFFF;
+ l = (l >> 24) | ((l & 0x00ff0000) >> 8) | ((l & 0x0000ff00) << 8) | (l << 24);
+ return (int) l;
+ }
+
+ String timeStr(int t) {
+ t = zogswap(t);
+ long tl = (long) t;
+ Date date = new Date(tl * 1000);
+ return date.toString();
+ }
+ String dotPast(double f, int n) {
+ String fs = "" + f;
+ int i = fs.lastIndexOf(".") + n;
+ if (i >= 0) {
+ int len = fs.length();
+ if (i >= len) {
+ i = len-1;
+ }
+ fs = fs.substring(0, i);
+ }
+ return fs;
+ }
+ String sizeStr(int s) {
+ s = zogswap(s);
+ if (s < 0) {
+ return s + "? B";
+ } else if (s < 1024) {
+ return s + " B";
+ } else if (s < 1024 * 1024) {
+ double k = s / 1024.0;
+ String ks = dotPast(k, 3);
+
+ return s + " (" + ks + " KB)";
+ } else {
+ double m = s / (1024.0*1024.0);
+ String ms = dotPast(m, 3);
+ return s + " (" + ms + " MB)";
+ }
+ }
+
//Internally used to receive directory content from server
//Here, the server sends one file/directory with it's attributes
void readFTPMsgDirectoryListContent() throws IOException
@@ -1217,17 +1347,25 @@
dwReserved0,
dwReserved1;
long ftCreationTime, ftLastAccessTime, ftLastWriteTime;
+ int ftCreationTimeL, ftLastAccessTimeL, ftLastWriteTimeL;
+ int ftCreationTimeH, ftLastAccessTimeH, ftLastWriteTimeH;
char cFileName, cAlternateFileName;
int length = 0;
is.readInt();
length = is.readInt();
dwFileAttributes = is.readInt();
length -= 4;
- ftCreationTime = is.readLong();
+ //ftCreationTime = is.readLong();
+ ftCreationTimeL = is.readInt();
+ ftCreationTimeH = is.readInt();
length -= 8;
- ftLastAccessTime = is.readLong();
+ //ftLastAccessTime = is.readLong();
+ ftLastAccessTimeL = is.readInt();
+ ftLastAccessTimeH = is.readInt();
length -= 8;
- ftLastWriteTime = is.readLong();
+ //ftLastWriteTime = is.readLong();
+ ftLastWriteTimeL = is.readInt();
+ ftLastWriteTimeH = is.readInt();
length -= 8;
nFileSizeHigh = is.readInt();
length -= 4;
@@ -1263,11 +1401,68 @@
|| dwFileAttributes == 369623040)
{
fileName = " [" + fileName + "]";
......@@ -990,10 +1659,21 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
+ break;
+ }
+ }
+ //String s = "Lastmod: " + timeStr(ftLastWriteTimeL) + " " + fileName;
+ String f2 = fileName;
+ if (f2.length() < 24) {
+ for (int ik = f2.length(); ik < 24; ik++) {
+ f2 = f2 + " ";
+ }
+ }
+ String s = f2 + " \tLastmod: " + timeStr(ftLastWriteTimeL) + " \t\tSize: " + sizeStr(nFileSizeLow);
+ //s = fileName + " Lastmod: " + zogswap(ftLastWriteTimeL);
+ if (i >= 0) {
+ remoteDirsList.add(i, fileName);
+ remoteDirsListInfo.add(i, s);
+ } else {
+ remoteDirsList.add(fileName);
+ remoteDirsListInfo.add(s);
+ }
+// end runge/x11vnc
}
......@@ -1014,36 +1694,83 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
+ break;
+ }
+ }
+ String f2 = fileName;
+ if (f2.length() < 24) {
+ for (int ik = f2.length(); ik < 24; ik++) {
+ f2 = f2 + " ";
+ }
+ }
+ String s = f2 + " \tLastmod: " + timeStr(ftLastWriteTimeL) + " \t\tSize: " + sizeStr(nFileSizeLow);
+ //s = fileName + " Lastmod: " + ftLastWriteTimeL + "/" + zogswap(ftLastWriteTimeL) + " Size: " + nFileSizeLow + "/" + zogswap(nFileSizeLow);
+ if (i >= 0) {
+ remoteFilesList.add(i, fileName);
+ remoteFilesListInfo.add(i, s);
+ } else {
+ remoteFilesList.add(fileName);
+ remoteFilesListInfo.add(s);
+ }
+// end runge/x11vnc
}
// a.add(fileName);
@@ -1289,6 +1379,16 @@
@@ -1282,14 +1477,31 @@
// sf@2004
a.clear();
- for (int i = 0; i < remoteDirsList.size(); i++)
+ b.clear();
+ for (int i = 0; i < remoteDirsList.size(); i++) {
a.add(remoteDirsList.get(i));
- for (int i = 0; i < remoteFilesList.size(); i++)
+ b.add(remoteDirsListInfo.get(i));
+ }
+ for (int i = 0; i < remoteFilesList.size(); i++) {
a.add(remoteFilesList.get(i));
+ b.add(remoteFilesListInfo.get(i));
+ }
remoteDirsList.clear();
+ remoteDirsListInfo.clear();
remoteFilesList.clear();
+ remoteFilesListInfo.clear();
- viewer.ftp.printDirectory(a);
+// begin runge/x11vnc
+ // Hack for double listing at startup... probably libvncserver bug..
+ readServerDriveListCnt++;
+ if (readServerDriveListCnt == 2) {
+ if (System.currentTimeMillis() - readServerDriveListTime < 1500) {
+System.out.println("readServerDriveListCnt skip " + readServerDriveListCnt);
+ if (System.currentTimeMillis() - readServerDriveListTime < 2000) {
+//System.out.println("readServerDriveListCnt skip " + readServerDriveListCnt);
+ return;
+ }
+ }
+// end runge/x11vnc
viewer.ftp.printDirectory(a);
+ viewer.ftp.printDirectory(a, b);
}
//Internally used to signify the drive requested is not ready
@@ -1299,6 +1511,8 @@
System.out.println("Remote Drive unavailable");
viewer.ftp.connectionStatus.setText(" > WARNING - Remote Drive unavailable (possibly restricted access or media not present)");
viewer.ftp.remoteStatus.setText("WARNING: Remote Drive unavailable");
+ viewer.ftp.historyComboBox.insertItemAt(new String(" > WARNING: Remote Drive unavailable."), 0);
+ viewer.ftp.historyComboBox.setSelectedIndex(0);
}
@@ -1312,6 +1412,10 @@
0,
0,
null);
//Call this method to request the list of drives on the server.
@@ -1307,11 +1521,15 @@
try
{
viewer.rfb.writeRfbFileTransferMsg(
- RfbProto.rfbDirContentRequest,
- RfbProto.rfbRDrivesList,
- 0,
- 0,
- null);
+ RfbProto.rfbDirContentRequest,
+ RfbProto.rfbRDrivesList,
+ 0,
+ 0,
+ null);
+// begin runge/x11vnc
+ readServerDriveListCnt = 0;
+ readServerDriveListTime = System.currentTimeMillis();
......@@ -1051,6 +1778,41 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
}
catch (IOException e)
{
@@ -1355,21 +1573,21 @@
int h,
boolean incremental)
throws IOException {
- if (!viewer.ftp.isVisible()) {
- byte[] b = new byte[10];
+ if (!viewer.ftp.isVisible()) {
+ byte[] b = new byte[10];
- b[0] = (byte) FramebufferUpdateRequest;
- b[1] = (byte) (incremental ? 1 : 0);
- b[2] = (byte) ((x >> 8) & 0xff);
- b[3] = (byte) (x & 0xff);
- b[4] = (byte) ((y >> 8) & 0xff);
- b[5] = (byte) (y & 0xff);
- b[6] = (byte) ((w >> 8) & 0xff);
- b[7] = (byte) (w & 0xff);
- b[8] = (byte) ((h >> 8) & 0xff);
- b[9] = (byte) (h & 0xff);
+ b[0] = (byte) FramebufferUpdateRequest;
+ b[1] = (byte) (incremental ? 1 : 0);
+ b[2] = (byte) ((x >> 8) & 0xff);
+ b[3] = (byte) (x & 0xff);
+ b[4] = (byte) ((y >> 8) & 0xff);
+ b[5] = (byte) (y & 0xff);
+ b[6] = (byte) ((w >> 8) & 0xff);
+ b[7] = (byte) (w & 0xff);
+ b[8] = (byte) ((h >> 8) & 0xff);
+ b[9] = (byte) (h & 0xff);
- os.write(b);
+ os.write(b);
}
}
diff -Naur JavaViewer.orig/SSLSocketToMe.java JavaViewer/SSLSocketToMe.java
--- JavaViewer.orig/SSLSocketToMe.java 1969-12-31 19:00:00.000000000 -0500
+++ JavaViewer/SSLSocketToMe.java 2007-04-29 20:40:35.000000000 -0400
......@@ -2478,7 +3240,7 @@ diff -Naur JavaViewer.orig/SSLSocketToMe.java JavaViewer/SSLSocketToMe.java
+}
diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
--- JavaViewer.orig/VncCanvas.java 2005-11-21 18:50:18.000000000 -0500
+++ JavaViewer/VncCanvas.java 2007-05-16 15:57:36.000000000 -0400
+++ JavaViewer/VncCanvas.java 2007-05-31 15:33:20.000000000 -0400
@@ -27,6 +27,9 @@
import java.lang.*;
import java.util.zip.*;
......@@ -2512,7 +3274,17 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
colors = new Color[256];
// sf@2005 - Now Default
for (int i = 0; i < 256; i++)
@@ -237,6 +256,9 @@
@@ -202,6 +221,9 @@
public void setPixelFormat() throws IOException {
// sf@2005 - Adding more color modes
+ if (viewer.graftFtp) {
+ return;
+ }
if (viewer.options.eightBitColors > 0)
{
viewer.options.oldEightBitColors = viewer.options.eightBitColors;
@@ -237,6 +259,9 @@
}
else
{
......@@ -2522,7 +3294,38 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
rfb.writeSetPixelFormat(
32,
24,
@@ -1532,9 +1554,14 @@
@@ -376,12 +401,14 @@
// Start/stop session recording if necessary.
viewer.checkRecordingStatus();
- rfb.writeFramebufferUpdateRequest(
- 0,
- 0,
- rfb.framebufferWidth,
- rfb.framebufferHeight,
- false);
+ if (!viewer.graftFtp) {
+ rfb.writeFramebufferUpdateRequest(
+ 0,
+ 0,
+ rfb.framebufferWidth,
+ rfb.framebufferHeight,
+ false);
+ }
//
// main dispatch loop
@@ -390,6 +417,9 @@
while (true) {
// Read message type from the server.
int msgType = rfb.readServerMessageType();
+ if (viewer.ftpOnly && msgType != RfbProto.rfbFileTransfer) {
+ System.out.println("msgType:" + msgType);
+ }
// Process the message depending on its type.
switch (msgType) {
@@ -1532,9 +1562,14 @@
else
{
result =
......@@ -2540,7 +3343,7 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
}
} else {
result = 0; // Transparent pixel
@@ -1565,9 +1592,14 @@
@@ -1565,9 +1600,14 @@
else
{
result =
......@@ -2560,8 +3363,17 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
result = 0; // Transparent pixel
diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
--- JavaViewer.orig/VncViewer.java 2006-05-24 15:14:40.000000000 -0400
+++ JavaViewer/VncViewer.java 2007-05-15 15:09:10.000000000 -0400
@@ -115,6 +115,22 @@
+++ JavaViewer/VncViewer.java 2007-05-31 16:13:10.000000000 -0400
@@ -80,7 +80,7 @@
GridBagLayout gridbag;
ButtonPanel buttonPanel;
AuthPanel authenticator;
- VncCanvas vc;
+ VncCanvas vc = null;
OptionsFrame options;
ClipboardFrame clipboard;
RecordingFrame rec;
@@ -115,6 +115,28 @@
int i;
// mslogon support 2 end
......@@ -2578,18 +3390,126 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
+boolean trustUrlVncCert;
+
+boolean ignoreMSLogonCheck;
+boolean delayAuthPanel;
+boolean ftpOnly;
+boolean graftFtp;
+
+boolean gotAuth;
+int authGot;
+// end runge/x11vnc
+
+
//
// init()
//
@@ -336,7 +352,12 @@
@@ -124,19 +146,20 @@
readParameters();
if (inSeparateFrame) {
- vncFrame = new Frame("Ultr@VNC");
- if (!inAnApplet) {
- vncFrame.add("Center", this);
- }
- vncContainer = vncFrame;
+ vncFrame = new Frame("Ultr@VNC");
+ if (!inAnApplet) {
+ vncFrame.add("Center", this);
+ }
+ vncContainer = vncFrame;
} else {
- vncContainer = this;
+ vncContainer = this;
}
recordingSync = new Object();
options = new OptionsFrame(this);
clipboard = new ClipboardFrame(this);
+
// authenticator = new AuthPanel(false); // mslogon support : go to connectAndAuthenticate()
if (RecordingFrame.checkSecurity())
rec = new RecordingFrame(this);
@@ -147,7 +170,7 @@
cursorUpdatesDef = null;
eightBitColorsDef = null;
- if (inSeparateFrame)
+ if (inSeparateFrame && vncFrame != null)
vncFrame.addWindowListener(this);
ftp = new FTPFrame(this); // KMC: FTPFrame creation
@@ -186,6 +209,30 @@
gbc.weightx = 1.0;
gbc.weighty = 1.0;
+ if (ftpOnly) {
+ if (showControls) {
+ buttonPanel.enableButtons();
+ }
+ ActionListener taskPerformer = new ActionListener() {
+ public void actionPerformed(ActionEvent evt) {
+ vncFrame.setVisible(false);
+ ftp.setSavedLocations();
+ if (ftp.isVisible()) {
+ ftp.doClose();
+ } else {
+ ftp.doOpen();
+ }
+ rfb.readServerDriveList();
+ }
+ };
+ Timer t = new Timer(300, taskPerformer);
+ t.setRepeats(false);
+ t.start();
+
+ vc.processNormalProtocol();
+ return;
+ }
+
// Add ScrollPanel to applet mode
// Create a panel which itself is resizeable and can hold
@@ -286,6 +333,24 @@
void connectAndAuthenticate() throws Exception {
+ if (graftFtp) {
+ rfb = new RfbProto(host, port, this);
+ rfb.desktopName = "ftponly";
+ rfb.framebufferWidth = 12;
+ rfb.framebufferHeight = 12;
+ rfb.bitsPerPixel = 32;
+ rfb.depth = 24;
+ rfb.trueColour = true;
+ rfb.redMax = 255;
+ rfb.greenMax = 255;
+ rfb.blueMax = 255;
+ rfb.redShift = 16;
+ rfb.greenShift = 8;
+ rfb.blueShift = 0;
+ rfb.inNormalProtocol = true;
+ return;
+ }
+
// If "ENCPASSWORD" parameter is set, decrypt the password into
// the passwordParam string.
@@ -336,7 +401,22 @@
//
- prologueDetectAuthProtocol() ;
+// begin runge/x11vnc
+ gotAuth = false;
+ if (delayAuthPanel) {
+ if (tryAuthenticate(null, null)) {
+ if (inSeparateFrame) {
+ vncFrame.pack();
+ vncFrame.show();
+ }
+ return;
+ }
+ }
+// prologueDetectAuthProtocol() ;
+ if (ignoreMSLogonCheck == false) {
+ prologueDetectAuthProtocol() ;
......@@ -2598,16 +3518,86 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
authenticator = new AuthPanel(mslogon);
@@ -435,7 +456,7 @@
@@ -390,6 +470,10 @@
break;
//mslogon support end
+// begin runge/x11vnc
+ gotAuth = false;
+// end runge/x11vnc
+
// Retry on authentication failure.
authenticator.retry();
}
@@ -405,9 +489,11 @@
rfb.readVersionMsg();
void prologueDetectAuthProtocol() throws Exception {
- System.out.println("RFB server supports protocol version " +
+ System.out.println("RFB server supports protocol version: " +
- rfb = new RfbProto(host, port, this);
+ if (!gotAuth) {
+ rfb = new RfbProto(host, port, this);
- rfb.readVersionMsg();
+ rfb.readVersionMsg();
+ }
System.out.println("RFB server supports protocol version " +
rfb.serverMajor + "." + rfb.serverMinor);
@@ -431,16 +517,36 @@
rfb.writeVersionMsg();
@@ -804,6 +825,75 @@
boolean tryAuthenticate(String us, String pw) throws Exception {
- rfb = new RfbProto(host, port, this);
+ int authScheme;
- rfb.readVersionMsg();
+ if (!gotAuth) {
+ rfb = new RfbProto(host, port, this);
- System.out.println("RFB server supports protocol version " +
- rfb.serverMajor + "." + rfb.serverMinor);
+ rfb.readVersionMsg();
- rfb.writeVersionMsg();
+ System.out.println("RFB server supports protocol version: " +
+ rfb.serverMajor + "." + rfb.serverMinor);
+
+ rfb.writeVersionMsg();
+
+ authScheme = rfb.readAuthScheme();
- int authScheme = rfb.readAuthScheme();
+ gotAuth = true;
+ authGot = authScheme;
+ } else {
+ authScheme = authGot;
+ }
+// begin runge/x11vnc
+ if (delayAuthPanel && pw == null) {
+ if (authScheme == RfbProto.NoAuth) {
+ System.out.println("No authentication needed");
+ return true;
+ } else {
+ return false;
+ }
+ }
+System.out.println("as: " + authScheme);
+// end runge/x11vnc
switch (authScheme) {
@@ -629,6 +735,10 @@
void doProtocolInitialisation() throws IOException {
+ if (graftFtp) {
+ return;
+ }
+
rfb.writeClientInit();
rfb.readServerInit();
@@ -804,6 +914,90 @@
deferScreenUpdates = readIntParameter("Defer screen updates", 20);
deferCursorUpdates = readIntParameter("Defer cursor updates", 10);
deferUpdateRequests = readIntParameter("Defer update requests", 50);
......@@ -2679,6 +3669,21 @@ diff -Naur JavaViewer.orig/VncViewer.java JavaViewer/VncViewer.java
+ if (str != null && str.equalsIgnoreCase("Yes")) {
+ ignoreMSLogonCheck = true;
+ }
+ ftpOnly = false;
+ str = readParameter("ftpOnly", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) {
+ ftpOnly = true;
+ }
+ graftFtp = false;
+ str = readParameter("graftFtp", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) {
+ graftFtp = true;
+ }
+ delayAuthPanel = false;
+ str = readParameter("delayAuthPanel", false);
+ if (str != null && str.equalsIgnoreCase("Yes")) {
+ delayAuthPanel = true;
+ }
+// end runge/x11vnc
}
......
......@@ -675,8 +675,20 @@ AC_CONFIG_FILES([Makefile
test/Makefile
libvncserver-config
LibVNCServer.spec])
#
# x11vnc only:
#
if test "$build_x11vnc" = "yes"; then
#
# NOTE: if you are using the LibVNCServer-X.Y.Z.tar.gz source
# tarball and nevertheless want to run autoconf (i.e. aclocal,
# autoheader, automake, autoconf) AGAIN (perhaps you have a
# special target system, e.g. embedded) then you will need to
# comment out the following 'AC_CONFIG_FILES' line to avoid
# automake error messages like:
#
# configure.ac:690: required file `x11vnc/Makefile.in' not found
#
AC_CONFIG_FILES([x11vnc/Makefile x11vnc/misc/Makefile])
fi
......
2007-06-14 Karl Runge <runge@karlrunge.com>
* x11vnc: add detectors if ultravnc chat or file xfer took place,
if so ping clients more frequently. Fix compile bug if libssl
not available.
* ssvnc: add ultravnc ftp jar feature. Add certificate management
"Verify All Certs".
2007-05-26 Karl Runge <runge@karlrunge.com>
* x11vnc: set to version 0.9.2, back to NCACHE -12 for testing.
in -unixpw, initial Escape means no echo username (see ssvnc).
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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.
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
#!/bin/sh
rm -rf ./src/tmp/* || exit 1
vers=1.0.17
vers=1.0.18
cd .. || exit 1
......
......@@ -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,39 +5090,11 @@ 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;
}
+
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;
- case rfbEncodingCopyRect:
- {
- rfbCopyRect cr;
......@@ -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)
+{
......@@ -7669,12 +7502,21 @@ diff -Naur -X ./exclude vnc_unixsrc.orig/vncviewer/vncviewer.c vnc_unixsrc/vncvi
+ if (appData.chatActive)
+ 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
......
......@@ -371,6 +371,8 @@ int force_dpms = 0;
int client_dpms = 0;
int no_ultra_dpms = 0;
int no_ultra_ext = 0;
int saw_ultra_chat = 0;
int saw_ultra_file = 0;
int watch_selection = 1; /* normal selection/cutbuffer maintenance */
int watch_primary = 1; /* more dicey, poll for changes in PRIMARY */
......
......@@ -270,6 +270,8 @@ extern int force_dpms;
extern int client_dpms;
extern int no_ultra_dpms;
extern int no_ultra_ext;
extern int saw_ultra_chat;
extern int saw_ultra_file;
extern int watch_selection;
extern int watch_primary;
......
......@@ -2704,8 +2704,13 @@ static void ping_clients(int tile_cnt) {
rfbLog("reset rfbMaxClientWait to %d msec.\n",
rfbMaxClientWait);
}
if (tile_cnt) {
if (tile_cnt > 0) {
last_send = now;
} else if (tile_cnt < 0) {
if (now >= last_send - tile_cnt) {
mark_rect_as_modified(0, 0, 1, 1, 1);
last_send = now;
}
} else if (now - last_send > 2) {
/* Send small heartbeat to client */
mark_rect_as_modified(0, 0, 1, 1, 1);
......@@ -3344,6 +3349,8 @@ if (tile_count) fprintf(stderr, "XX copytile: %.4f tile_count: %d\n", dnow() -
/* Work around threaded rfbProcessClientMessage() calls timeouts */
if (use_threads) {
ping_clients(tile_diffs);
} else if (saw_ultra_chat || saw_ultra_file) {
ping_clients(-1);
} else if (use_openssl && !tile_diffs) {
ping_clients(0);
}
......
......@@ -34,6 +34,11 @@ int https_sock = -1;
pid_t openssl_last_helper_pid = 0;
char *openssl_last_ip = NULL;
static char *certret = NULL;
static int certret_fd = -1;
static mode_t omode;
char *certret_str = NULL;
void raw_xfer(int csock, int s_in, int s_out);
#if !LIBVNCSERVER_HAVE_LIBSSL
......@@ -1315,11 +1320,6 @@ if (db) fprintf(stderr, "buf: '%s'\n", buf);
return 1;
}
static char *certret = NULL;
static int certret_fd = -1;
static mode_t omode;
char *certret_str = NULL;
void accept_openssl(int mode, int presock) {
int sock = -1, listen = -1, cport, csock, vsock;
int peerport = 0;
......
.\" This file was automatically generated from x11vnc -help output.
.TH X11VNC "1" "May 2007" "x11vnc " "User Commands"
.TH X11VNC "1" "June 2007" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.9.2, lastmod: 2007-05-26
version: 0.9.2, lastmod: 2007-06-14
.SH SYNOPSIS
.B x11vnc
[OPTION]...
......
......@@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.9.2 lastmod: 2007-05-26";
char lastmod[] = "0.9.2 lastmod: 2007-06-14";
/* X display info */
......
......@@ -1376,6 +1376,7 @@ void set_server_input(rfbClientPtr cl, int grab) {
}
#endif
}
void set_text_chat(rfbClientPtr cl, int len, char *txt) {
int dochat = 1;
rfbClientIteratorPtr iter;
......@@ -1384,6 +1385,7 @@ void set_text_chat(rfbClientPtr cl, int len, char *txt) {
if (no_ultra_ext || ! dochat) {
return;
}
#if 0
rfbLog("set_text_chat: len=%d\n", len);
rfbLog("set_text_chat: len=0x%x txt='", len);
......@@ -1395,6 +1397,9 @@ void set_text_chat(rfbClientPtr cl, int len, char *txt) {
rfbCloseClient(cl);
return;
}
saw_ultra_chat = 1;
iter = rfbGetClientIterator(screen);
while( (cl2 = rfbClientIteratorNext(iter)) ) {
unsigned int ulen = (unsigned int) len;
......@@ -1440,6 +1445,9 @@ if (0) fprintf(stderr, "get_file_transfer_permitted called\n");
if (!input.files) {
return FALSE;
}
if (screen->permitFileTransfer) {
saw_ultra_file = 1;
}
return screen->permitFileTransfer;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment