Skip to content

Commit

Permalink
#3930 remove yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Sep 1, 2023
1 parent 9559d78 commit 1ca5eab
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
3 changes: 1 addition & 2 deletions docs/Network/Protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ is made of 8 bytes:
### Protocol Flags

The _protocol flags_ is an 8-bit bitmask value.
It must contain the value `16` for `rencodeplus` packet data
or `4` for `yaml` data (unsupported).
It must contain the value `16` for `rencodeplus` packet data. Other values are no longer supported.
This value can then be ORed with:
* `8` to set the `flush` flag which notifies the packet layer that there aren't any other packets immediately following this one
* `2` to set the `cipher` flag for [AES encrypted packets](./AES.md)
Expand Down
12 changes: 3 additions & 9 deletions xpra/net/packet_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
from xpra.util import envbool

#all the encoders we know about:
ALL_ENCODERS : tuple[str, ...] = ("rencodeplus", "yaml", "none")
ALL_ENCODERS : tuple[str, ...] = ("rencodeplus", "none")
#the encoders we may have, in the best compatibility order
TRY_ENCODERS : tuple[str, ...] = ("rencodeplus", "yaml", "none")
TRY_ENCODERS : tuple[str, ...] = ("rencodeplus", "none")
#order for performance:
PERFORMANCE_ORDER : tuple[str, ...] = ("rencodeplus", "yaml")
PERFORMANCE_ORDER : tuple[str, ...] = ("rencodeplus", )

Encoding = namedtuple("Encoding", ["name", "flag", "version", "encode", "decode"])

Expand All @@ -38,12 +38,6 @@ def do_rencodeplus(v):
return rencodeplus_dumps(v), FLAGS_RENCODEPLUS
return Encoding("rencodeplus", FLAGS_RENCODEPLUS, rencodeplus.__version__, do_rencodeplus, rencodeplus.loads) # @UndefinedVariable

def init_yaml() -> Encoding:
#json messes with strings and unicode (makes it unusable for us)
from yaml import dump, safe_load, __version__
def yaml_dump(v):
return dump(v).encode("latin1"), FLAGS_YAML
return Encoding("yaml", FLAGS_YAML, __version__, yaml_dump, safe_load)

def init_none() -> Encoding:
def encode(data):
Expand Down
2 changes: 1 addition & 1 deletion xpra/server/mixins/controlcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def control_command_compression(self, compress:str) -> str:
def control_command_encoder(self, encoder:str) -> str:
e = encoder.lower()
from xpra.net import packet_encoding #pylint: disable=import-outside-toplevel
opts = packet_encoding.get_enabled_encoders() #ie: [rencodeplus, yaml]
opts = packet_encoding.get_enabled_encoders() #ie: [rencodeplus, ]
if e not in opts:
raise ControlError("encoder argument must be one of: " + csv(opts))
for cproto in tuple(self._server_sources.keys()):
Expand Down
1 change: 0 additions & 1 deletion xpra/server/proxy/proxy_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ def number(k, v):
"compression_level" : number,
"lz4" : parse_bool,
"rencodeplus" : parse_bool,
"yaml" : parse_bool,
}
for k,v in options.items():
parser = OPTION_WHITELIST.get(k)
Expand Down
1 change: 0 additions & 1 deletion xpra/server/source/encodings.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ def parse_encoding_caps(self, c:typedict) -> None:
self.encoding_options[ek] = c.boolget(k)
#2: standardized encoding options:
for k in c.keys():
#yaml gives us str..
k = bytestostr(k)
if k.startswith("theme.") or k.startswith("encoding.icons."):
self.icons_encoding_options[k.replace("encoding.icons.", "").replace("theme.", "")] = c.get(k)
Expand Down

0 comments on commit 1ca5eab

Please sign in to comment.