]> source.dussan.org Git - tigervnc.git/commitdiff
Merge branch 'congestion' of https://github.com/CendioOssman/tigervnc
authorPierre Ossman <ossman@cendio.se>
Mon, 26 Feb 2018 16:08:34 +0000 (17:08 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 26 Feb 2018 16:08:34 +0000 (17:08 +0100)
1  2 
common/rfb/Timer.cxx
common/rfb/VNCSConnectionST.cxx
common/rfb/VNCSConnectionST.h
common/rfb/VNCServerST.cxx
common/rfb/VNCServerST.h
common/rfb/util.cxx
common/rfb/util.h

Simple merge
index bd4bc366aff3377ab9a4046484f35e340f1d5a5b,5b9152c2183a8d44e5f86fbbf82d2056d05de4d9..e707e492863ac8cb2adfc063e07d484c2fe9b8e2
   * USA.
   */
  
- // Debug output on what the congestion control is up to
- #undef CONGESTION_DEBUG
- #include <sys/time.h>
- #ifdef CONGESTION_DEBUG
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <netinet/tcp.h>
- #endif
  #include <network/TcpSocket.h>
- #include <rfb/VNCSConnectionST.h>
+ #include <rfb/ComparingUpdateTracker.h>
+ #include <rfb/Encoder.h>
+ #include <rfb/KeyRemapper.h>
  #include <rfb/LogWriter.h>
  #include <rfb/Security.h>
+ #include <rfb/ServerCore.h>
+ #include <rfb/SMsgWriter.h>
+ #include <rfb/VNCServerST.h>
+ #include <rfb/VNCSConnectionST.h>
  #include <rfb/screenTypes.h>
  #include <rfb/fenceTypes.h>
- #include <rfb/ServerCore.h>
- #include <rfb/ComparingUpdateTracker.h>
- #include <rfb/KeyRemapper.h>
- #include <rfb/Encoder.h>
 +#include <rfb/ledStates.h>
 +#define XK_LATIN1
  #define XK_MISCELLANY
  #define XK_XKB_KEYS
  #include <rfb/keysymdef.h>
@@@ -48,35 -38,12 +40,14 @@@ using namespace rfb
  
  static LogWriter vlog("VNCSConnST");
  
- // This window should get us going fairly fast on a decent bandwidth network.
- // If it's too high, it will rapidly be reduced and stay low.
- static const unsigned INITIAL_WINDOW = 16384;
- // TCP's minimal window is 3*MSS. But since we don't know the MSS, we
- // make a guess at 4 KiB (it's probably a bit higher).
- static const unsigned MINIMUM_WINDOW = 4096;
- // The current default maximum window for Linux (4 MiB). Should be a good
- // limit for now...
- static const unsigned MAXIMUM_WINDOW = 4194304;
- struct RTTInfo {
-   struct timeval tv;
-   int offset;
-   unsigned inFlight;
- };
 +static Cursor emptyCursor(0, 0, Point(0, 0), NULL);
 +
  VNCSConnectionST::VNCSConnectionST(VNCServerST* server_, network::Socket *s,
                                     bool reverse)
    : sock(s), reverseConnection(reverse),
 -    queryConnectTimer(this), inProcessMessages(false),
 +    inProcessMessages(false),
      pendingSyncFence(false), syncFence(false), fenceFlags(0),
-     fenceDataLen(0), fenceData(NULL),
-     baseRTT(-1), congWindow(0), ackedOffset(0), sentOffset(0),
-     minRTT(-1), seenCongestion(false),
-     pingCounter(0), congestionTimer(this),
+     fenceDataLen(0), fenceData(NULL), congestionTimer(this),
      server(server_), updates(false),
      updateRenderedCursor(false), removeRenderedCursor(false),
      continuousUpdates(false), encodeManager(this), pointerEventTime(0),
@@@ -864,8 -723,12 +836,8 @@@ void VNCSConnectionST::supportsLEDState
  bool VNCSConnectionST::handleTimeout(Timer* t)
  {
    try {
 -    if (t == &queryConnectTimer) {
 -      if (state() == RFBSTATE_QUERYING)
 -        approveConnection(false, "The attempt to prompt the user to accept the connection failed");
 -    } else if (t == &congestionTimer) {
 +    if (t == &congestionTimer)
-       updateCongestion();
+       writeFramebufferUpdate();
 -    }
    } catch (rdr::Exception& e) {
      close(e.str());
    }
@@@ -1100,7 -822,9 +944,9 @@@ void VNCSConnectionST::writeFramebuffer
    // Then real data (if possible)
    writeDataUpdate();
  
 -  network::TcpSocket::cork(sock->getFd(), false);
 +  sock->cork(false);
+   congestion.updatePosition(sock->outStream().length());
  }
  
  void VNCSConnectionST::writeNoDataUpdate()
index 8d6a7bc6a1643cf53dc677a8a1acfac7969fc1b3,dde0b1ec5c8ca1d66f408613902814abe00bf701..2f075a649591733d666b8e1b750a92dd6e719908
  #ifndef __RFB_VNCSCONNECTIONST_H__
  #define __RFB_VNCSCONNECTIONST_H__
  
 -#include <set>
 +#include <map>
+ #include <rfb/Congestion.h>
+ #include <rfb/EncodeManager.h>
  #include <rfb/SConnection.h>
- #include <rfb/SMsgWriter.h>
- #include <rfb/VNCServerST.h>
  #include <rfb/Timer.h>
- #include <rfb/EncodeManager.h>
- struct RTTInfo;
  
  namespace rfb {
+   class VNCServerST;
  
    class VNCSConnectionST : public SConnection,
                             public Timer::Callback {
  
      // Internal methods
  
 +    bool isShiftPressed();
 +
      // Congestion control
      void writeRTTPing();
-     void handleRTTPong(const struct RTTInfo &rttInfo);
      bool isCongested();
-     void updateCongestion();
  
      // writeFramebufferUpdate() attempts to write a framebuffer update to the
      // client.
index f27099f0b9d1a62b05af2ce897721bec7e9c580f,654391928cb51d132b75bbaea42bc5486aa3a075..fc649fa133e71b80954d63b37ee139f2ef76c52a
  #include <rfb/ServerCore.h>
  #include <rfb/VNCServerST.h>
  #include <rfb/VNCSConnectionST.h>
- #include <rfb/ComparingUpdateTracker.h>
- #include <rfb/Security.h>
- #include <rfb/KeyRemapper.h>
  #include <rfb/util.h>
 +#include <rfb/ledStates.h>
  
  #include <rdr/types.h>
  
Simple merge
Simple merge
Simple merge