]> source.dussan.org Git - tigervnc.git/commitdiff
Merge branch 'connparams' of https://github.com/CendioOssman/tigervnc
authorPierre Ossman <ossman@cendio.se>
Mon, 10 Dec 2018 20:16:07 +0000 (21:16 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 10 Dec 2018 20:16:07 +0000 (21:16 +0100)
1  2 
common/rfb/CMsgReader.cxx
common/rfb/CSecurityTLS.cxx
common/rfb/SConnection.cxx
common/rfb/TightDecoder.cxx
common/rfb/VNCSConnectionST.cxx
common/rfb/VNCServerST.cxx
tests/encperf.cxx
unix/x0vncserver/XDesktop.cxx
vncviewer/DesktopWindow.cxx
vncviewer/Viewport.cxx

Simple merge
Simple merge
Simple merge
Simple merge
index dbbf1d805fb2cf5737f134cd52650126153ec312,a58fd09f5bf49607efc14fe98b874672ef80c798..ea5c52aacaac503de41f1b5577bc6ddc41197173
@@@ -49,10 -49,11 +49,10 @@@ VNCSConnectionST::VNCSConnectionST(VNCS
      inProcessMessages(false),
      pendingSyncFence(false), syncFence(false), fenceFlags(0),
      fenceDataLen(0), fenceData(NULL), congestionTimer(this),
-     losslessTimer(this), server(server_), updates(false),
+     losslessTimer(this), server(server_),
      updateRenderedCursor(false), removeRenderedCursor(false),
 -    continuousUpdates(false), encodeManager(this), pointerEventTime(0),
 -    clientHasCursor(false),
 -    accessRights(AccessDefault), startTime(time(0))
 +    continuousUpdates(false), encodeManager(this), idleTimer(this),
 +    pointerEventTime(0), clientHasCursor(false)
  {
    setStreams(&sock->inStream(), &sock->outStream());
    peerEndpoint.buf = sock->getPeerEndpoint();
@@@ -199,9 -192,9 +199,9 @@@ void VNCSConnectionST::pixelBufferChang
  {
    try {
      if (!authenticated()) return;
-     if (cp.width && cp.height &&
-         (server->getPixelBuffer()->width() != cp.width ||
-          server->getPixelBuffer()->height() != cp.height))
+     if (client.width() && client.height() &&
 -        (server->pb->width() != client.width() ||
 -         server->pb->height() != client.height()))
++        (server->getPixelBuffer()->width() != client.width() ||
++         server->getPixelBuffer()->height() != client.height()))
      {
        // We need to clip the next update to the new size, but also add any
        // extra bits if it's bigger.  If we wanted to do this exactly, something
  
        //updates.intersect(server->pb->getRect());
        //
-       //if (server->pb->width() > cp.width)
-       //  updates.add_changed(Rect(cp.width, 0, server->pb->width(),
+       //if (server->pb->width() > client.width())
+       //  updates.add_changed(Rect(client.width(), 0, server->pb->width(),
        //                           server->pb->height()));
-       //if (server->pb->height() > cp.height)
-       //  updates.add_changed(Rect(0, cp.height, cp.width,
+       //if (server->pb->height() > client.height())
+       //  updates.add_changed(Rect(0, client.height(), client.width(),
        //                           server->pb->height()));
  
 -      damagedCursorRegion.assign_intersect(server->pb->getRect());
 +      damagedCursorRegion.assign_intersect(server->getPixelBuffer()->getRect());
  
-       cp.width = server->getPixelBuffer()->width();
-       cp.height = server->getPixelBuffer()->height();
-       cp.screenLayout = server->getScreenLayout();
 -      client.setDimensions(server->pb->width(), server->pb->height(),
 -                           server->screenLayout);
++      client.setDimensions(server->getPixelBuffer()->width(),
++                           server->getPixelBuffer()->height(),
++                           server->getScreenLayout());
        if (state() == RFBSTATE_NORMAL) {
-         // We should only send EDS to client asking for both
-         if (!writer()->writeExtendedDesktopSize()) {
-           if (!writer()->writeSetDesktopSize()) {
-             close("Client does not support desktop resize");
-             return;
-           }
+         if (!client.supportsDesktopSize()) {
+           close("Client does not support desktop resize");
+           return;
          }
+         writer()->writeDesktopSize(reasonServer);
        }
  
        // Drop any lossy tracking that is now outside the framebuffer
@@@ -363,10 -383,9 +361,9 @@@ bool VNCSConnectionST::needRenderedCurs
    if (state() != RFBSTATE_NORMAL)
      return false;
  
-   if (!cp.supportsLocalCursorWithAlpha &&
-       !cp.supportsLocalCursor && !cp.supportsLocalXCursor)
+   if (!client.supportsLocalCursor())
      return true;
 -  if (!server->cursorPos.equals(pointerEventPos) &&
 +  if (!server->getCursorPos().equals(pointerEventPos) &&
        (time(0) - pointerEventTime) > 0)
      return true;
  
@@@ -390,20 -409,20 +387,20 @@@ void VNCSConnectionST::approveConnectio
  
  void VNCSConnectionST::authSuccess()
  {
 -  lastEventTime = time(0);
 -
 -  server->startDesktop();
 +  if (rfb::Server::idleTimeout)
 +    idleTimer.start(secsToMillis(rfb::Server::idleTimeout));
  
    // - Set the connection parameters appropriately
-   cp.width = server->getPixelBuffer()->width();
-   cp.height = server->getPixelBuffer()->height();
-   cp.screenLayout = server->getScreenLayout();
-   cp.setName(server->getName());
-   cp.setLEDState(server->getLEDState());
 -  client.setDimensions(server->pb->width(), server->pb->height(),
 -                       server->screenLayout);
++  client.setDimensions(server->getPixelBuffer()->width(),
++                       server->getPixelBuffer()->height(),
++                       server->getScreenLayout());
+   client.setName(server->getName());
 -  client.setLEDState(server->ledState);
++  client.setLEDState(server->getLEDState());
    
    // - Set the default pixel format
-   cp.setPF(server->getPixelBuffer()->getPF());
 -  client.setPF(server->pb->getPF());
++  client.setPF(server->getPixelBuffer()->getPF());
    char buffer[256];
-   cp.pf().print(buffer, 256);
+   client.pf().print(buffer, 256);
    vlog.info("Server default pixel format %s", buffer);
  
    // - Mark the entire display as "dirty"
@@@ -631,12 -710,28 +630,11 @@@ void VNCSConnectionST::setDesktopSize(i
  {
    unsigned int result;
  
 -  if (!(accessRights & AccessSetDesktopSize)) return;
 +  if (!accessCheck(AccessSetDesktopSize)) return;
    if (!rfb::Server::acceptSetDesktopSize) return;
  
 -  // Don't bother the desktop with an invalid configuration
 -  if (!layout.validate(fb_width, fb_height)) {
 -    writer()->writeDesktopSize(reasonClient, resultInvalid);
 -    return;
 -  }
 -
 -  // FIXME: the desktop will call back to VNCServerST and an extra set
 -  // of ExtendedDesktopSize messages will be sent. This is okay
 -  // protocol-wise, but unnecessary.
 -  result = server->desktop->setScreenLayout(fb_width, fb_height, layout);
 -
 +  result = server->setDesktopSize(this, fb_width, fb_height, layout);
-   writer()->writeExtendedDesktopSize(reasonClient, result,
-                                      fb_width, fb_height, layout);
+   writer()->writeDesktopSize(reasonClient, result);
 -
 -  // Only notify other clients on success
 -  if (result == resultSuccess) {
 -    if (server->screenLayout != layout)
 -        throw Exception("Desktop configured a different screen layout than requested");
 -    server->notifyScreenLayoutChange(this);
 -  }
  }
  
  void VNCSConnectionST::fence(rdr::U32 flags, unsigned len, const char data[])
@@@ -1063,7 -1121,8 +1062,8 @@@ void VNCSConnectionST::screenLayoutChan
    if (!authenticated())
      return;
  
-   cp.screenLayout = server->getScreenLayout();
+   client.setDimensions(client.width(), client.height(),
 -                       server->screenLayout);
++                       server->getScreenLayout());
  
    if (state() != RFBSTATE_NORMAL)
      return;
@@@ -1084,10 -1142,10 +1083,10 @@@ void VNCSConnectionST::setCursor(
  
    // We need to blank out the client's cursor or there will be two
    if (needRenderedCursor()) {
-     cp.setCursor(emptyCursor);
+     client.setCursor(emptyCursor);
      clientHasCursor = false;
    } else {
-     cp.setCursor(*server->getCursor());
 -    client.setCursor(*server->cursor);
++    client.setCursor(*server->getCursor());
      clientHasCursor = true;
    }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge