Skip to content

Commit

Permalink
#3592 remove legacy workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jul 26, 2023
1 parent 9783ef5 commit b988313
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 57 deletions.
5 changes: 0 additions & 5 deletions xpra/client/gtk3/session_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,11 +983,6 @@ def all_values_from_info(self, *window_props):
iget = v.intget
return iget("cur"), iget("min"), iget("avg"), iget("90p"), iget("max")

#legacy servers: sum up the values for all the windows found
def avg(values):
if not values:
return ""
return sum(values) // len(values)
def getv(suffix, op):
if self.client.server_last_info is None:
return ""
Expand Down
14 changes: 1 addition & 13 deletions xpra/client/gui/keyboard_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
LAYOUT_GROUPS = envbool("XPRA_LAYOUT_GROUPS", True)
DEBUG_KEY_EVENTS = tuple(x.lower() for x in os.environ.get("XPRA_DEBUG_KEY_EVENTS", "").split(","))

def add_xkbmap_legacy_prefix(props):
#legacy format: flat with 'xkbmap_' prefix:
return dict((f"xkbmap_{k}", v) for k, v in props.items())


class KeyboardHelper:

Expand Down Expand Up @@ -310,10 +306,7 @@ def send_layout(self):

def send_keymap(self):
log("send_keymap()")
keymap = self.get_keymap_properties()
#legacy format: flat with 'xkbmap_' prefix:
props = add_xkbmap_legacy_prefix(keymap)
props["keymap"] = keymap
props = {"keymap" : self.get_keymap_properties()}
self.send("keymap-changed", props)


Expand All @@ -334,11 +327,6 @@ def get_full_keymap(self) -> Tuple[Tuple[int,str,int,int,int],...]:
return ()


def get_prefixed_keymap_properties(self, skip=()):
key_props = self.get_keymap_properties(skip)
#legacy format: flat with 'xkbmap_' prefix:
return dict((f"xkbmap_{k}", v) for k, v in key_props.items())

def get_keymap_properties(self, skip=()):
props = {}
for x in (
Expand Down
10 changes: 2 additions & 8 deletions xpra/client/gui/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import Type, Dict, List, Any, Callable, Tuple

from xpra.client.base.client_base import XpraClientBase
from xpra.client.gui.keyboard_helper import KeyboardHelper, add_xkbmap_legacy_prefix
from xpra.client.gui.keyboard_helper import KeyboardHelper
from xpra.platform import set_name
from xpra.platform.gui import ready as gui_ready, get_wm_name, get_session_type, ClientExtras
from xpra.common import FULL_INFO, noop
Expand Down Expand Up @@ -428,8 +428,6 @@ def skipkeys(d, *keys):
if FULL_INFO==1:
op = skipkeys(op, "extensions", "GLU.extensions")
pi = skipkeys(pi, "release", "sysrelease", "platform", "processor", "architecture")
#legacy mode:
u("platform", pi)
caps["platform"] = pi
caps["opengl"] = op
caps["session-type"] = get_session_type()
Expand Down Expand Up @@ -765,11 +763,7 @@ def get_keyboard_caps(self):
caps["keyboard"] = True
caps["modifiers"] = self.get_current_modifiers()
skip = ("keycodes", "x11_keycodes") if DELAY_KEYBOARD_DATA else ()
keymap = kh.get_keymap_properties(skip)
#legacy, prefixed with underscore:
caps.update(add_xkbmap_legacy_prefix(keymap))
#newer versions understand this:
caps["keymap"] = keymap
caps["keymap"] = kh.get_keymap_properties(skip)
#show the user a summary of what we have detected:
self.keyboard_helper.log_keyboard_info()
delay_ms, interval_ms = kh.key_repeat_delay, kh.key_repeat_interval
Expand Down
7 changes: 0 additions & 7 deletions xpra/client/mixins/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,14 @@ def get_caps(self) -> Dict[str,Any]:
d : Dict[str,Any] = {}
avcaps = self.get_avsync_capabilities()
acaps = self.get_audio_capabilities()
#legacy flat format:
updict(d, "av-sync", avcaps)
updict(d, "audio", acaps)
#v4.4 namespace:
d["av-sync"] = avcaps
d["audio"] = acaps
return d

def get_audio_capabilities(self) -> Dict[str,Any]:
if not self.audio_properties:
return {}
#we don't know if the server supports new codec names,
#so always add legacy names in hello:
caps : Dict[str,Any] = {
"codec-full-names" : True,
"decoders" : self.speaker_codecs,
"encoders" : self.microphone_codecs,
"send" : self.microphone_allowed,
Expand Down
2 changes: 1 addition & 1 deletion xpra/net/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class ConnectionClosedException(Exception):
#audio:
"sound-data", "new-stream", "state-changed", "new-buffer", "cleanup", "add_data", "stop",
#display:
"show-desktop", "desktop_size",
"show-desktop",
#windows and trays:
"new-window", "new-override-redirect", "new-tray",
"raise-window", "initiate-moveresize", "window-move-resize", "window-resized", "window-metadata",
Expand Down
7 changes: 2 additions & 5 deletions xpra/server/proxy/proxy_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#for testing only: passthrough as RGB:
PASSTHROUGH_RGB = envbool("XPRA_PROXY_PASSTHROUGH_RGB", False)
VIDEO_TIMEOUT = 5 #destroy video encoder after N seconds of idle state
LEGACY_SALT_DIGEST = envbool("XPRA_LEGACY_SALT_DIGEST", False)
PASSTHROUGH_AUTH = envbool("XPRA_PASSTHROUGH_AUTH", True)

PING_INTERVAL = max(1, envint("XPRA_PROXY_PING_INTERVAL", 5))*1000
Expand Down Expand Up @@ -553,10 +552,8 @@ def process_server_packet(self, proto, packet : PacketType) -> None:
if len(packet)>=5:
salt_digest = bytestostr(packet[4])
if salt_digest in ("xor", "des"):
if not LEGACY_SALT_DIGEST:
self.stop(None, f"server uses legacy salt digest {salt_digest!r}")
return
log.warn("Warning: server using legacy support for '%s' salt digest", salt_digest)
self.stop(None, f"server uses legacy salt digest {salt_digest!r}")
return
if salt_digest=="xor":
#with xor, we have to match the size
if l<16:
Expand Down
7 changes: 2 additions & 5 deletions xpra/server/server_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
MAX_CONCURRENT_CONNECTIONS = envint("XPRA_MAX_CONCURRENT_CONNECTIONS", 100)
SIMULATE_SERVER_HELLO_ERROR = envbool("XPRA_SIMULATE_SERVER_HELLO_ERROR", False)
SERVER_SOCKET_TIMEOUT = envfloat("XPRA_SERVER_SOCKET_TIMEOUT", 0.1)
LEGACY_SALT_DIGEST = envbool("XPRA_LEGACY_SALT_DIGEST", False)
CHALLENGE_TIMEOUT = envint("XPRA_CHALLENGE_TIMEOUT", 120)

SYSCONFIG = envbool("XPRA_SYSCONFIG", FULL_INFO>0)
Expand Down Expand Up @@ -2107,10 +2106,8 @@ def send_fake_challenge() -> None:
return
salt_digest = authenticator.choose_salt_digest(salt_digest_modes)
if salt_digest in ("xor", "des"):
if not LEGACY_SALT_DIGEST:
auth_failed(f"insecure salt digest {salt_digest!r} rejected")
return
authlog.warn(f"Warning: using legacy support for {salt_digest!r} salt digest")
auth_failed(f"insecure salt digest {salt_digest!r} rejected")
return
authlog(f"sending challenge {authenticator.prompt!r}")
self.send_challenge(proto, salt, auth_caps, digest, salt_digest, authenticator.prompt)
return
Expand Down
3 changes: 1 addition & 2 deletions xpra/server/source/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def is_needed(cls, caps : typedict) -> bool:
if isinstance(audio, dict):
audio = typedict(audio)
return audio.boolget("send") or audio.boolget("receive")
#legacy:
return caps.boolget("sound.send") or caps.boolget("sound.receive")
return False


def __init__(self):
Expand Down
14 changes: 5 additions & 9 deletions xpra/server/source/avsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ class AVSyncMixin(StubSourceMixin):
@classmethod
def is_needed(cls, caps : typedict) -> bool:
audio = caps.get("audio")
if isinstance(audio, dict):
audio = typedict(audio)
if not (audio.boolget("send") or audio.boolget("receive")):
return False
else:
#legacy:
if not (caps.boolget("sound.send") or caps.boolget("sound.receive")):
#no audio!
return False
if not isinstance(audio, dict):
return False
audio = typedict(audio)
if not (audio.boolget("send") or audio.boolget("receive")):
return False
return caps.boolget("av-sync") and caps.boolget("windows")

def __init__(self):
Expand Down
2 changes: 0 additions & 2 deletions xpra/server/window/window_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,6 @@ def set_client_properties(self, properties : typedict) -> None:
#and if not, don't bother doing the potentially expensive update_encoding_selection()
for k in ("workspace", "screen"):
properties.pop(k, None)
#for legacy packet encoders:
properties.pop(k.encode("latin1"), None)
if properties:
self.do_set_client_properties(properties)

Expand Down

0 comments on commit b988313

Please sign in to comment.