Skip to content

Commit

Permalink
forgot to remove 'zlib' here
Browse files Browse the repository at this point in the history
also handle invalid compressors more gracefully
  • Loading branch information
totaam committed Jul 26, 2023
1 parent cd0b5c7 commit 8c442a2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions xpra/net/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
# the compressors we may want to use, in the best compatibility order:
TRY_COMPRESSORS : Tuple[str, ...] = ("lz4", "brotli", "none")
# order for performance:
PERFORMANCE_ORDER : Tuple[str, ...] = ("none", "lz4", "zlib", "brotli")
PERFORMANCE_ORDER : Tuple[str, ...] = ("none", "lz4", "brotli")
# require compression (disallow 'none'):
PERFORMANCE_COMPRESSION : Tuple[str, ...] = ("lz4", "zlib", "brotli")
PERFORMANCE_COMPRESSION : Tuple[str, ...] = ("lz4", "brotli")

Compression = namedtuple("Compression", ["name", "version", "compress", "decompress"])

Expand Down Expand Up @@ -73,9 +73,12 @@ def init_compressors(*names) -> None:
if not envbool("XPRA_"+x.upper(), True):
continue
attr = globals().get(f"init_{x}", None)
if attr is None:
log.warn(f"Warning: invalid compressor {x} specified")
continue
try:
if not callable(attr):
raise ValueError(f"{attr!r} is not callable")
raise ValueError(f"{attr!r} for {x} is not callable")
fn : Callable = attr
c = fn()
assert c
Expand Down

0 comments on commit 8c442a2

Please sign in to comment.