summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authordscho <dscho>2001-10-16 20:57:26 +0000
committerdscho <dscho>2001-10-16 20:57:26 +0000
commit2c4869fc9a8f2c72e6f8631b25894246a0a90701 (patch)
treee7396ef0a8a40c102bde4b490897204e368f233a /main.c
parent47f18e575da762733c19e9f499472ba42f478df8 (diff)
downloadlibtdevnc-2c4869fc9a8f2c72e6f8631b25894246a0a90701.tar.gz
libtdevnc-2c4869fc9a8f2c72e6f8631b25894246a0a90701.zip
deferUpdate
Diffstat (limited to 'main.c')
-rw-r--r--main.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/main.c b/main.c
index 96f335e..7be9191 100644
--- a/main.c
+++ b/main.c
@@ -471,6 +471,7 @@ rfbScreenInfoPtr rfbGetScreen(int argc,char** argv,
rfbScreen->rfbAlwaysShared = FALSE;
rfbScreen->rfbNeverShared = FALSE;
rfbScreen->rfbDontDisconnect = FALSE;
+ rfbScreen->rfbAuthPasswdData = 0;
processArguments(rfbScreen,argc,argv);
@@ -580,6 +581,7 @@ rfbProcessEvents(rfbScreenInfoPtr rfbScreen,long usec)
{
rfbClientIteratorPtr i;
rfbClientPtr cl,clPrev;
+ struct timeval tv;
rfbCheckFds(rfbScreen,usec);
httpCheckFds(rfbScreen);
@@ -590,10 +592,24 @@ rfbProcessEvents(rfbScreenInfoPtr rfbScreen,long usec)
i = rfbGetClientIterator(rfbScreen);
cl=rfbClientIteratorNext(i);
while(cl) {
- if(cl->sock>=0 && FB_UPDATE_PENDING(cl))
- rfbSendFramebufferUpdate(cl,cl->modifiedRegion);
- clPrev=cl;
- cl=rfbClientIteratorNext(i);
+ if(cl->sock>=0 && FB_UPDATE_PENDING(cl)) {
+ if(cl->startDeferring.tv_usec == 0) {
+ gettimeofday(&cl->startDeferring,NULL);
+ if(cl->startDeferring.tv_usec == 0)
+ cl->startDeferring.tv_usec++;
+ } else {
+ gettimeofday(&tv,NULL);
+ if(tv.tv_sec < cl->startDeferring.tv_sec /* at midnight */
+ || ((tv.tv_sec-cl->startDeferring.tv_sec)*1000
+ +(tv.tv_usec-cl->startDeferring.tv_usec)/1000)
+ > cl->screen->rfbDeferUpdateTime) {
+ cl->startDeferring.tv_usec = 0;
+ rfbSendFramebufferUpdate(cl,cl->modifiedRegion);
+ }
+ }
+ }
+ clPrev=cl;
+ cl=rfbClientIteratorNext(i);
if(clPrev->sock==-1)
rfbClientConnectionGone(clPrev);
}