Merge branch 'configchecks' into 'master'

Fixes dynamic quality changes by client not applying

See merge request kasm-technologies/internal/KasmVNC!74
This commit is contained in:
Matthew McClaskey 2022-10-28 09:45:03 +00:00
commit 9622048753
2 changed files with 11 additions and 1 deletions

View File

@ -212,7 +212,7 @@ void ConnParams::setEncodings(int nEncodings, const rdr::S32* encodings)
break;
case pseudoEncodingPreferBandwidth:
if (!rfb::Server::ignoreClientSettingsKasm && canChangeSettings)
Server::preferBandwidth.setParam();
Server::preferBandwidth.setParam(true);
break;
case pseudoEncodingMaxVideoResolution:
if (!rfb::Server::ignoreClientSettingsKasm && canChangeSettings)

View File

@ -356,6 +356,16 @@ void EncodeManager::doUpdate(bool allowLossy, const Region& changed_,
if (conn->cp.kasmPassed[ConnParams::KASM_MAX_VIDEO_RESOLUTION])
updateMaxVideoRes(&maxVideoX, &maxVideoY);
// The dynamic quality params may have changed
if (Server::dynamicQualityMax && Server::dynamicQualityMax <= 9 &&
Server::dynamicQualityMax > Server::dynamicQualityMin) {
dynamicQualityMin = Server::dynamicQualityMin;
dynamicQualityOff = Server::dynamicQualityMax - Server::dynamicQualityMin;
} else if (dynamicQualityMin >= 0) {
dynamicQualityMin = Server::dynamicQualityMin;
dynamicQualityOff = 0;
}
prepareEncoders(allowLossy);
changed = changed_;