mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-25 01:24:04 +01:00
Count data rects separately for UDP flip
This commit is contained in:
parent
29c48a8679
commit
5823b550a4
@ -39,7 +39,7 @@ static LogWriter vlog("SMsgWriter");
|
||||
|
||||
SMsgWriter::SMsgWriter(ConnParams* cp_, rdr::OutStream* os_, rdr::OutStream* udps_)
|
||||
: cp(cp_), os(os_), udps(udps_),
|
||||
nRectsInUpdate(0), nRectsInHeader(0),
|
||||
nRectsInUpdate(0), dataRectsInUpdate(0), nRectsInHeader(0),
|
||||
needSetDesktopSize(false), needExtendedDesktopSize(false),
|
||||
needSetDesktopName(false), needSetCursor(false),
|
||||
needSetXCursor(false), needSetCursorWithAlpha(false),
|
||||
@ -340,7 +340,7 @@ void SMsgWriter::writeFramebufferUpdateStart(int nRects)
|
||||
|
||||
os->writeU16(nRects);
|
||||
|
||||
nRectsInUpdate = 0;
|
||||
nRectsInUpdate = dataRectsInUpdate = 0;
|
||||
if (nRects == 0xFFFF)
|
||||
nRectsInHeader = 0;
|
||||
else
|
||||
@ -365,7 +365,7 @@ void SMsgWriter::writeFramebufferUpdateEnd()
|
||||
|
||||
// Send an UDP flip marker, if needed
|
||||
if (cp->supportsUdp) {
|
||||
udps->writeS16(nRectsInUpdate);
|
||||
udps->writeS16(dataRectsInUpdate);
|
||||
udps->writeS16(0);
|
||||
udps->writeU16(0);
|
||||
udps->writeU16(0);
|
||||
@ -394,6 +394,7 @@ void SMsgWriter::startRect(const Rect& r, int encoding)
|
||||
{
|
||||
if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader)
|
||||
throw Exception("SMsgWriter::startRect: nRects out of sync");
|
||||
++dataRectsInUpdate;
|
||||
|
||||
if (cp->supportsUdp) {
|
||||
udps->writeS16(r.tl.x);
|
||||
|
@ -165,6 +165,7 @@ namespace rfb {
|
||||
rdr::OutStream* udps;
|
||||
|
||||
int nRectsInUpdate;
|
||||
int dataRectsInUpdate;
|
||||
int nRectsInHeader;
|
||||
|
||||
bool needSetDesktopSize;
|
||||
|
Loading…
Reference in New Issue
Block a user