summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrunge <runge>2006-09-18 00:22:13 +0000
committerrunge <runge>2006-09-18 00:22:13 +0000
commit3d00472a9c2878c4526311e2e820583a04e85817 (patch)
tree937a1b818e6a7495741054eb698ba8c34bcb135e
parent462c30db7d8e78a7ca6541ee20bf9fa59aca2e87 (diff)
downloadlibtdevnc-3d00472a9c2878c4526311e2e820583a04e85817.tar.gz
libtdevnc-3d00472a9c2878c4526311e2e820583a04e85817.zip
x11vnc: improve ultravnc filexfer rate by calling rfbCheckFD more often
-rw-r--r--libvncserver/rfbserver.c3
-rw-r--r--x11vnc/README14
-rw-r--r--x11vnc/x11vnc.c42
3 files changed, 52 insertions, 7 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c
index eebbd47..7335ac0 100644
--- a/libvncserver/rfbserver.c
+++ b/libvncserver/rfbserver.c
@@ -1292,8 +1292,9 @@ rfbBool rfbSendFileTransferChunk(rfbClientPtr cl)
tv.tv_usec = 0;
n = select(cl->sock + 1, NULL, &wfds, NULL, &tv);
- if (n<1)
+ if (n<0) {
rfbLog("rfbSendFileTransferChunk() select failed: %s\n", strerror(errno));
+ }
/* We have space on the transmit queue */
if (n > 0)
{
diff --git a/x11vnc/README b/x11vnc/README
index 703ba63..9c66244 100644
--- a/x11vnc/README
+++ b/x11vnc/README
@@ -1,5 +1,5 @@
-x11vnc README file Date: Sun Sep 17 13:31:31 EDT 2006
+x11vnc README file Date: Sun Sep 17 19:51:07 EDT 2006
The following information is taken from these URLs:
@@ -44,11 +44,12 @@ x11vnc: a VNC server for real X displays
or questions.
An x11vnc side-project provides an [17]Enhanced TightVNC Viewer
- package with automatic SSL and/or SSH tunnelling support, NewFBSize
- support on Unix, and cursor alphablending. Please help test out some
- recently added features: automatic service tunnelling via SSH for CUPS
- and SMB Printing, ESD/ARTSD Audio, and SMB (Windows/Samba) filesystem
- mounting; and Port Knocking.
+ package with automatic SSL and/or SSH tunnelling support, SSL
+ Certificate creation, NewFBSize support on Unix, and cursor
+ alphablending. Please help test out some recently added features:
+ automatic service tunnelling via SSH for CUPS and SMB Printing,
+ ESD/ARTSD Audio, and SMB (Windows/Samba) filesystem mounting; and Port
+ Knocking.
Background:
@@ -7708,6 +7709,7 @@ Enhanced TightVNC Viewer
only)
* xgrabserver support for fullscreen mode, for old window managers
(-grab option, Unix only).
+ * Create or Import SSL Certificates and Private Keys.
* Automatic Service tunnelling via SSH for CUPS and SMB Printing,
ESD/ARTSD Audio, and SMB (Windows/Samba) filesystem mounting.
* Port Knocking for "closed port" SSH/SSL connections. In addition
diff --git a/x11vnc/x11vnc.c b/x11vnc/x11vnc.c
index 0ca354e..b5e8b98 100644
--- a/x11vnc/x11vnc.c
+++ b/x11vnc/x11vnc.c
@@ -394,6 +394,47 @@ if (0 && dt > 0.0) fprintf(stderr, "dt: %.5f %.4f\n", dt, dnow() - x11vnc_start)
return msec;
}
+void check_filexfer(void) {
+ static time_t last_check = 0;
+ rfbClientIteratorPtr iter;
+ rfbClientPtr cl;
+ int transferring = 0;
+
+ if (time(NULL) <= last_check) {
+ return;
+ }
+
+#if 0
+ if (getenv("NOFT")) {
+ return;
+ }
+#endif
+
+ iter = rfbGetClientIterator(screen);
+ while( (cl = rfbClientIteratorNext(iter)) ) {
+ if (cl->fileTransfer.receiving) {
+ transferring = 1;
+ break;
+ }
+ if (cl->fileTransfer.sending) {
+ transferring = 1;
+ break;
+ }
+ }
+ rfbReleaseClientIterator(iter);
+
+ if (transferring) {
+ double start = dnow();
+ while (dnow() < start + 0.5) {
+ rfbCFD(5000);
+ rfbCFD(1000);
+ rfbCFD(0);
+ }
+ } else {
+ last_check = time(NULL);
+ }
+}
+
/*
* main x11vnc loop: polls, checks for events, iterate libvncserver, etc.
*/
@@ -515,6 +556,7 @@ static void watch_loop(void) {
check_xevents(0);
check_autorepeat();
check_pm();
+ check_filexfer();
check_keycode_state();
check_connect_inputs();
check_gui_inputs();