Example #1
0
 def test_main(self):
     compression.init_all()
     assert compression.use("zlib")
     assert compression.get_compression_caps()
     assert compression.get_enabled_compressors()
     for x in compression.get_enabled_compressors():
         assert compression.get_compressor(x)
Example #2
0
def get_network_caps():
    try:
        from xpra.net.mmap_pipe import can_use_mmap
        mmap = can_use_mmap()
    except:
        mmap = False
    caps = {
        "digest": ("hmac", "xor"),
        "compressors": compression.get_enabled_compressors(),
        "encoders": packet_encoding.get_enabled_encoders(),
        "mmap": mmap,
    }
    caps.update(get_crypto_caps())
    caps.update(get_compression_caps())
    caps.update(get_packet_encoding_caps())
    return caps
Example #3
0
def get_network_caps():
    try:
        from xpra.net.mmap_pipe import can_use_mmap
        mmap = can_use_mmap()
    except:
        mmap = False
    caps = {
                "digest"                : ("hmac", "xor"),
                "compressors"           : compression.get_enabled_compressors(),
                "encoders"              : packet_encoding.get_enabled_encoders(),
                "mmap"                  : mmap,
               }
    caps.update(get_crypto_caps())
    caps.update(get_compression_caps())
    caps.update(get_packet_encoding_caps())
    return caps
Example #4
0
def get_network_caps() -> dict:
    from xpra.net.digest import get_digests
    from xpra.net.crypto import get_crypto_caps
    from xpra.net.compression import get_enabled_compressors, get_compression_caps
    from xpra.net.packet_encoding import get_enabled_encoders, get_packet_encoding_caps
    digests = get_digests()
    #"hmac" is the legacy name, "xor" and "des" should not be used for salt:
    salt_digests = tuple(x for x in digests if x not in ("hmac", "xor", "des"))
    caps = {
        "digest": digests,
        "salt-digest": salt_digests,
        "compressors": get_enabled_compressors(),
        "encoders": get_enabled_encoders(),
    }
    caps.update(get_crypto_caps())
    caps.update(get_compression_caps())
    caps.update(get_packet_encoding_caps())
    return caps
Example #5
0
def get_network_caps(legacy=True):
    try:
        from xpra.net.mmap_pipe import can_use_mmap
        mmap = can_use_mmap()
    except:
        mmap = False
    caps = {
        "digest": ("hmac", "xor"),
        "compressors": compression.get_enabled_compressors(),
        "encoders": packet_encoding.get_enabled_encoders(),
        "mmap": mmap,
    }
    if legacy:
        #for backwards compatibility only:
        caps.update({"raw_packets": True, "chunked_compression": True})
    caps.update(get_crypto_caps())
    caps.update(get_compression_caps())
    caps.update(get_packet_encoding_caps())
    return caps
Example #6
0
def get_network_caps():
    try:
        from xpra.net.mmap_pipe import can_use_mmap
        mmap = can_use_mmap()
    except:
        mmap = False
    digests = get_digests()
    #"hmac" is the legacy name, "xor" should not be used for salt:
    salt_digests = [x for x in digests if x not in ("hmac", "xor")]
    caps = {
        "digest": digests,
        "salt-digest": salt_digests,
        "compressors": compression.get_enabled_compressors(),
        "encoders": packet_encoding.get_enabled_encoders(),
        "mmap": mmap,
    }
    caps.update(get_crypto_caps())
    caps.update(get_compression_caps())
    caps.update(get_packet_encoding_caps())
    return caps
Example #7
0
def get_network_caps(legacy=True):
    try:
        from xpra.net.mmap_pipe import can_use_mmap

        mmap = can_use_mmap()
    except:
        mmap = False
    caps = {
        "digest": ("hmac", "xor"),
        "compressors": compression.get_enabled_compressors(),
        "encoders": packet_encoding.get_enabled_encoders(),
        "mmap": mmap,
    }
    if legacy:
        # for backwards compatibility only:
        caps.update({"raw_packets": True, "chunked_compression": True})
    caps.update(get_crypto_caps())
    caps.update(get_compression_caps())
    caps.update(get_packet_encoding_caps())
    return caps
Example #8
0
def get_network_caps():
    try:
        from xpra.platform.features import MMAP_SUPPORTED
    except:
        MMAP_SUPPORTED = False
    from xpra.net.crypto import get_digests, get_crypto_caps
    from xpra.net.compression import get_enabled_compressors, get_compression_caps
    from xpra.net.packet_encoding import get_enabled_encoders, get_packet_encoding_caps
    digests = get_digests()
    #"hmac" is the legacy name, "xor" and "des" should not be used for salt:
    salt_digests = [x for x in digests if x not in ("hmac", "xor", "des")]
    caps = {
        "digest": digests,
        "salt-digest": salt_digests,
        "compressors": get_enabled_compressors(),
        "encoders": get_enabled_encoders(),
        "mmap": MMAP_SUPPORTED,
    }
    caps.update(get_crypto_caps())
    caps.update(get_compression_caps())
    caps.update(get_packet_encoding_caps())
    return caps