x11vnc: improve ultravnc filexfer rate by calling rfbCheckFD more often

pull/1/head
runge 18 years ago
parent 462c30db7d
commit 3d00472a9c

@ -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)
{

@ -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

@ -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();

Loading…
Cancel
Save