Make zlib encoding messages idempotent.
Otherwise duplicate messages can trigger a reinitialization of the compression stream while the update thread is running. Also ensure that the stream is initialized before the update thread may attempt to use it. PR: 238333 Reviewed by: cem, rgrimes MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20673
This commit is contained in:
parent
49ee0fcea5
commit
ab877e64d0
@ -273,8 +273,10 @@ rfb_recv_set_encodings_msg(struct rfb_softc *rc, int cfd)
|
||||
rc->enc_raw_ok = true;
|
||||
break;
|
||||
case RFB_ENCODING_ZLIB:
|
||||
rc->enc_zlib_ok = true;
|
||||
deflateInit(&rc->zstream, Z_BEST_SPEED);
|
||||
if (!rc->enc_zlib_ok) {
|
||||
deflateInit(&rc->zstream, Z_BEST_SPEED);
|
||||
rc->enc_zlib_ok = true;
|
||||
}
|
||||
break;
|
||||
case RFB_ENCODING_RESIZE:
|
||||
rc->enc_resize_ok = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user