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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349196
@ -273,8 +273,10 @@ rfb_recv_set_encodings_msg(struct rfb_softc *rc, int cfd)
|
|||||||
rc->enc_raw_ok = true;
|
rc->enc_raw_ok = true;
|
||||||
break;
|
break;
|
||||||
case RFB_ENCODING_ZLIB:
|
case RFB_ENCODING_ZLIB:
|
||||||
rc->enc_zlib_ok = true;
|
if (!rc->enc_zlib_ok) {
|
||||||
deflateInit(&rc->zstream, Z_BEST_SPEED);
|
deflateInit(&rc->zstream, Z_BEST_SPEED);
|
||||||
|
rc->enc_zlib_ok = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case RFB_ENCODING_RESIZE:
|
case RFB_ENCODING_RESIZE:
|
||||||
rc->enc_resize_ok = true;
|
rc->enc_resize_ok = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user