diff options
author | dscho <dscho> | 2008-01-30 20:38:51 +0000 |
---|---|---|
committer | dscho <dscho> | 2008-01-30 20:38:51 +0000 |
commit | ce8d6c2409ca15f0fb5800b1c2c0a03e86683fc2 (patch) | |
tree | c3c6200b7442bab417b05ae90bdf08037c98dc83 /libvncserver/zrle.c | |
parent | 5b9b4543616db4cefc5eb052287a32f03fdd8e85 (diff) | |
download | libtdevnc-ce8d6c2409ca15f0fb5800b1c2c0a03e86683fc2.tar.gz libtdevnc-ce8d6c2409ca15f0fb5800b1c2c0a03e86683fc2.zip |
Make ZYWRLE thread-safe for multiple clients
ZYWRLE used a static buffer, which does not work too well if you have
more than one client in a threaded server. Instead, we have the data
in the client structure now.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'libvncserver/zrle.c')
-rw-r--r-- | libvncserver/zrle.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libvncserver/zrle.c b/libvncserver/zrle.c index ae65061..2475fc0 100644 --- a/libvncserver/zrle.c +++ b/libvncserver/zrle.c @@ -96,6 +96,7 @@ * data. */ +/* TODO: put into rfbClient struct */ static char zrleBeforeBuf[rfbZRLETileWidth * rfbZRLETileHeight * 4 + 4]; @@ -114,17 +115,16 @@ rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl, int x, int y, int w, int h) if (cl->preferredEncoding == rfbEncodingZYWRLE) { if (cl->tightQualityLevel < 0) { - zywrle_level = 1; + cl->zywrleLevel = 1; } else if (cl->tightQualityLevel < 3) { - zywrle_level = 3; + cl->zywrleLevel = 3; } else if (cl->tightQualityLevel < 6) { - zywrle_level = 2; + cl->zywrleLevel = 2; } else { - zywrle_level = 1; + cl->zywrleLevel = 1; } - } else { - zywrle_level = 0; - } + } else + cl->zywrleLevel = 0; if (!cl->zrleData) cl->zrleData = zrleOutStreamNew(); |