xpra icon
Bug tracker and wiki

Opened 2 months ago

Closed 10 days ago

#1838 closed enhancement (fixed)

completely skip server base classes

Reported by: Antoine Martin Owned by: J. Max Mena
Priority: major Milestone: 2.4
Component: server Version: 2.3.x
Keywords: Cc:

Description (last modified by Antoine Martin)

Similar to #1836 but for mixins (#1778 / #1761), we should be able to completely skip some of the server base classes.

  • if remote-logging is disabled, don't inherit from LoggingServer
  • if mmap is disabled, don't inherit from MMAP_Server


This would reduce the memory footprint, and increase the security (decreasing the attack surface): it is impossible to attack code which isn't there.

Could be done for the server by using a dynamic type for "server base" (see example patch).
The client is not modular enough to support this sort of refactoring. (see #1796 for authentication handlers)

Attachments (1)

bases.patch (4.1 KB) - added by Antoine Martin 2 months ago.
dynamic list of base classes

Download all attachments as: .zip

Change History (11)

Changed 2 months ago by Antoine Martin

Attachment: bases.patch added

dynamic list of base classes

comment:1 Changed 2 months ago by Antoine Martin

Description: modified (diff)
Status: newassigned

Huge commits making things modular in r19283 + r19282.

This may help with #1123, we just need a new "upgrade" argument for the cleanup method.

comment:2 Changed 2 months ago by Antoine Martin

As of r19284, the server can completely skip a number of modules:

xpra start --notifications=no --webcam=no --speaker=no --microphone=no \
    --file-transfer=no --printing=no --dbus-proxy=no \
    --remote-logging=no --mmap=no --clipboard=no --av-sync=no

(this will disable most of the optional mixins, both in the server base class and in the "client connection" instance)

Still TODO:

  • add test script running every combination possible (there are 2**10=1024!) to check for invalid attribute dependencies
  • ideally, deal with the "mmap_size" check more cleanly - meh
  • add switch for "idle", "client info" mixins
  • make control commands mixin optional (some subclasses assume this is always defined)
  • make it possible to disable the "commands", "encoding" and "network state" switches? (hard, especially for "encoding")
  • this probably caused #1841
Last edited 2 months ago by Antoine Martin (previous) (diff)

comment:3 Changed 2 months ago by Antoine Martin

Regression: #1841, fixup: r19363

Last edited 2 months ago by Antoine Martin (previous) (diff)

comment:4 Changed 2 months ago by Antoine Martin

Automated test script added in r19371, with some bug fixes included.

This script exposes lots of ugly dependency issues. (in particular with read-only mode, keyboard, etc)
So many more bugs are left to fix..

comment:5 Changed 2 months ago by Antoine Martin


Still TODO:

  • send_cursor might belong in the display rather than windows mixin?
  • the "desktop_size_unscaled" / "desktop_size" code in x11 server base is a bit ugly
  • same for "suspended" attribute used in source mixins: r19409
  • keys_pressed should be moved to the keyboard config: r19466
  • maybe verify that the window we forward is on the client's vfb screen (checking pixel colour at window location)
  • use super() more
  • add new build options to exclude some subsystems completely and avoid failures when they cannot be imported
  • batch delay and other data is missing from session info
Last edited 5 weeks ago by Antoine Martin (previous) (diff)

comment:6 Changed 7 weeks ago by Antoine Martin

Summary: completely skip base classescompletely skip server base classes

For the client, see #1861

comment:7 Changed 5 weeks ago by Antoine Martin

Ugly dependency utility cursor functions added: ticket:1658#comment:8.

comment:8 Changed 3 weeks ago by Antoine Martin

  • as of r19723 + r19724, we can run the server with some modules completely missing. Either not installing them (ie: build with --without-dbus - new switches added in r19725) or by nuking them afterwards (ie: rm -fr /usr/lib64/python2.7/site-packages/xpra/keyboard/).

This is true for the following xpra submodules: notifications, keyboard, clipboard, sound and dbus.
The server runs but prints a warning if the settings or command line try to enable functionality that is not available, ie:

Warning: missing notifications module
  • r19726: the server can run without any codecs at all, this also means without any webcam or window forwarding
  • r19727: the client avoids sending keyboard and pointer events if the server doesn't know how to handle them
  • r19728: the client still runs without any of the optional modules (but those are still loaded - not the same as #1861)
Last edited 3 weeks ago by Antoine Martin (previous) (diff)

comment:9 Changed 10 days ago by Antoine Martin

Owner: changed from Antoine Martin to J. Max Mena
Status: assignednew

@maxmylyn: FYI, feel free to close. (see comment:8)

Will follow up in #1913 (high memory usage).

comment:10 Changed 10 days ago by J. Max Mena

Resolution: fixed
Status: newclosed

Noted and closed.

Note: See TracTickets for help on using tickets.