From 8c9dd963b9c79a892dc9577fe8227ce5eb700c67 Mon Sep 17 00:00:00 2001 From: Adam Halim Date: Thu, 20 Jul 2023 10:02:34 +0200 Subject: [PATCH] ZlibLevel parameter marked deprecated Trying to set the ZlibLevel will set off a warning to users. --- common/rfb/ZRLEEncoder.cxx | 2 +- unix/x0vncserver/x0vncserver.cxx | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/common/rfb/ZRLEEncoder.cxx b/common/rfb/ZRLEEncoder.cxx index c35fff9ebc..3bf0781e26 100644 --- a/common/rfb/ZRLEEncoder.cxx +++ b/common/rfb/ZRLEEncoder.cxx @@ -31,7 +31,7 @@ using namespace rfb; -IntParameter zlibLevel("ZlibLevel","Zlib compression level",-1); +IntParameter zlibLevel("ZlibLevel","[DEPRECATED] Zlib compression level",-1); ZRLEEncoder::ZRLEEncoder(SConnection* conn) : Encoder(conn, encodingZRLE, EncoderPlain, 127), diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index 9d74f91574..5ab56e6e9f 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -113,6 +113,18 @@ static void CleanupSignalHandler(int /*sig*/) caughtSignal = true; } +static void migrateDeprecatedOptions() +{ + rfb::VoidParameter* param = Configuration::getParam("ZlibLevel"); + if (param == NULL) + return; + + int compressLevel = *((rfb::IntParameter*) param); + if (compressLevel != -1) { + vlog.info("ZlibLevel is deprecated, let clients set the compression level instead."); + } +} + class FileTcpFilter : public TcpFilter { @@ -275,6 +287,8 @@ int main(int argc, char** argv) usage(); } + migrateDeprecatedOptions(); + if (!(dpy = XOpenDisplay(displayname))) { // FIXME: Why not vlog.error(...)? fprintf(stderr,"%s: unable to open display \"%s\"\r\n",