aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2017-11-16 16:43:13 +0100
committerPierre Ossman <ossman@cendio.se>2017-11-17 08:06:30 +0100
commitb218ecd50ea6c49a00a0c17ab348aca5d497b695 (patch)
treee2dac33ed63e02e8252ea823c6cb6ca50b07406e /common
parent25db44a164e9dfb76b65e8b5540abef4668596df (diff)
downloadtigervnc-b218ecd50ea6c49a00a0c17ab348aca5d497b695.tar.gz
tigervnc-b218ecd50ea6c49a00a0c17ab348aca5d497b695.zip
Avoid extra framebuffer update messages
In most cases we will send an update at the end of processing client messages so these extra calls only slow things down. Server initiated events still need an explicit call though.
Diffstat (limited to 'common')
-rw-r--r--common/rfb/VNCSConnectionST.cxx22
1 files changed, 5 insertions, 17 deletions
diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx
index 6a3e1c7d..619b0a24 100644
--- a/common/rfb/VNCSConnectionST.cxx
+++ b/common/rfb/VNCSConnectionST.cxx
@@ -276,6 +276,7 @@ void VNCSConnectionST::screenLayoutChangeOrClose(rdr::U16 reason)
{
try {
screenLayoutChange(reason);
+ writeFramebufferUpdate();
} catch(rdr::Exception &e) {
close(e.str());
}
@@ -307,6 +308,7 @@ void VNCSConnectionST::setDesktopNameOrClose(const char *name)
{
try {
setDesktopName(name);
+ writeFramebufferUpdate();
} catch(rdr::Exception& e) {
close(e.str());
}
@@ -317,6 +319,7 @@ void VNCSConnectionST::setCursorOrClose()
{
try {
setCursor();
+ writeFramebufferUpdate();
} catch(rdr::Exception& e) {
close(e.str());
}
@@ -327,6 +330,7 @@ void VNCSConnectionST::setLEDStateOrClose(unsigned int state)
{
try {
setLEDState(state);
+ writeFramebufferUpdate();
} catch(rdr::Exception& e) {
close(e.str());
}
@@ -744,7 +748,6 @@ void VNCSConnectionST::setDesktopSize(int fb_width, int fb_height,
if (!layout.validate(fb_width, fb_height)) {
writer()->writeExtendedDesktopSize(reasonClient, resultInvalid,
fb_width, fb_height, layout);
- writeFramebufferUpdate();
return;
}
@@ -762,10 +765,6 @@ void VNCSConnectionST::setDesktopSize(int fb_width, int fb_height,
throw Exception("Desktop configured a different screen layout than requested");
server->notifyScreenLayoutChange(this);
}
-
- // but always send back a reply to the requesting client
- // (do this last as it might throw an exception on socket errors)
- writeFramebufferUpdate();
}
void VNCSConnectionST::fence(rdr::U32 flags, unsigned len, const char data[])
@@ -823,7 +822,6 @@ void VNCSConnectionST::enableContinuousUpdates(bool enable,
if (enable) {
requested.clear();
- writeFramebufferUpdate();
} else {
writer()->writeEndOfContinuousUpdates();
}
@@ -1243,7 +1241,6 @@ void VNCSConnectionST::screenLayoutChange(rdr::U16 reason)
writer()->writeExtendedDesktopSize(reason, 0, cp.width, cp.height,
cp.screenLayout);
- writeFramebufferUpdate();
}
@@ -1273,8 +1270,6 @@ void VNCSConnectionST::setCursor()
}
}
}
-
- writeFramebufferUpdate();
}
void VNCSConnectionST::setDesktopName(const char *name)
@@ -1288,8 +1283,6 @@ void VNCSConnectionST::setDesktopName(const char *name)
fprintf(stderr, "Client does not support desktop rename\n");
return;
}
-
- writeFramebufferUpdate();
}
void VNCSConnectionST::setLEDState(unsigned int ledstate)
@@ -1299,12 +1292,7 @@ void VNCSConnectionST::setLEDState(unsigned int ledstate)
cp.setLEDState(ledstate);
- if (!writer()->writeLEDState()) {
- // No client support
- return;
- }
-
- writeFramebufferUpdate();
+ writer()->writeLEDState();
}
void VNCSConnectionST::setSocketTimeouts()