summaryrefslogtreecommitdiffstats
path: root/libvncserver/sockets.c
diff options
context:
space:
mode:
authorsteven_carr <steven_carr>2006-05-15 05:37:39 +0000
committersteven_carr <steven_carr>2006-05-15 05:37:39 +0000
commitccdbe8f3256c3c776a1cc1a0517a38437b9e2c65 (patch)
tree9853559d1c965946b196cccd03ce0f466d524950 /libvncserver/sockets.c
parent347c4a98475d1dba8030efe33aa0b35856c4d17f (diff)
downloadlibtdevnc-ccdbe8f3256c3c776a1cc1a0517a38437b9e2c65.tar.gz
libtdevnc-ccdbe8f3256c3c776a1cc1a0517a38437b9e2c65.zip
The great UltraVNC Compatibility Commit
Diffstat (limited to 'libvncserver/sockets.c')
-rwxr-xr-xlibvncserver/sockets.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/libvncserver/sockets.c b/libvncserver/sockets.c
index 181862d..0d04f0a 100755
--- a/libvncserver/sockets.c
+++ b/libvncserver/sockets.c
@@ -239,8 +239,18 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
tv.tv_usec = usec;
nfds = select(rfbScreen->maxFd + 1, &fds, NULL, NULL /* &fds */, &tv);
if (nfds == 0) {
+ /* timed out, check for async events */
+ i = rfbGetClientIterator(rfbScreen);
+ while((cl = rfbClientIteratorNext(i))) {
+ if (cl->onHold)
+ continue;
+ if (FD_ISSET(cl->sock, &(rfbScreen->allFds)))
+ rfbSendFileTransferChunk(cl);
+ }
+ rfbReleaseClientIterator(i);
return result;
}
+
if (nfds < 0) {
#ifdef WIN32
errno = WSAGetLastError();
@@ -332,11 +342,17 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
i = rfbGetClientIterator(rfbScreen);
while((cl = rfbClientIteratorNext(i))) {
+
if (cl->onHold)
continue;
- if (FD_ISSET(cl->sock, &fds) &&
- FD_ISSET(cl->sock, &(rfbScreen->allFds)))
- rfbProcessClientMessage(cl);
+
+ if (FD_ISSET(cl->sock, &(rfbScreen->allFds)))
+ {
+ if (FD_ISSET(cl->sock, &fds))
+ rfbProcessClientMessage(cl);
+ else
+ rfbSendFileTransferChunk(cl);
+ }
}
rfbReleaseClientIterator(i);
} while(rfbScreen->handleEventsEagerly);