#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: | norman@… |
Description (last modified by )
Similar to #1836 but for mixins (#1778 / #1761), we should be able to completely skip some of the server base classes.
ie:
- if remote-logging is disabled, don't inherit from
LoggingServer
- if mmap is disabled, don't inherit from
MMAP_Server
etc
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)
Change History (16)
Changed 3 years ago by
Attachment: | bases.patch added |
---|
comment:1 Changed 3 years ago by
Description: | modified (diff) |
---|---|
Status: | new → assigned |
comment:2 Changed 3 years ago by
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
comment:3 Changed 3 years ago by
comment:4 Changed 3 years ago by
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 3 years ago by
Updates:
- r19373 + r19381 + r19388 + r19389 + r19467: fix readonly mode
- r19400 skip shadow pointer polling when input devices are disabled
- r19374 client bug when the desktop-size is not provided
- r19375 fix wrong location for packet-queue
- r19401 window model management refactoring
- r19376 improve client warning message when the server does not forward any windows (
--windows=no
) - r19440 move encode work queue and thread to superclass (used by both clipboard and picture encoding)
- r19379 + r19395 + r19406 major unit tests improvements
- minor fixes: r19380, r19407, r19413, r19439, r19443, r19446 + r19447 + r19450, r19462, r19476, r19484
- r19410 + r19452: audio vs av-sync fix
- r19414 + r19415 + r19416 + r19417 + r19441 + r19442 + r19451 + r19482 + r19483 + r19485: run shadow unit tests on win32 and macos
- r19475: test desktop and shadow servers with vnc client
- r19448 + r19454: make it easier to run without first compiling with cython + installing
- r19460 + r19461 + r19463 + r19469 + r19471 + r19473: rfb fixes
- r19486: run fewer tests by default (slows down the build too much)
- r19599 actually add test for "start-desktop"
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
comment:6 Changed 3 years ago by
Summary: | completely skip base classes → completely skip server base classes |
---|
For the client, see #1861
comment:7 Changed 3 years ago by
Ugly dependency utility cursor functions added: ticket:1658#comment:8.
comment:8 Changed 3 years ago by
- 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)
comment:9 Changed 3 years ago by
Owner: | changed from Antoine Martin to J. Max Mena |
---|---|
Status: | assigned → new |
comment:12 Changed 2 years ago by
Would you backport a fix to the v2.3.x branch (and maybe others?) to include calls to IdleMixin
and ClipboardConnection
in ClientConnection.get_info
? I noticed that the data is missing :-(
comment:13 Changed 2 years ago by
Cc: | norman@… added |
---|
comment:14 Changed 2 years ago by
Would you backport a fix to the v2.3.x branch (and maybe others?) to include calls to
IdleMixin
andClipboardConnection
inClientConnection.get_info
? I noticed that the data is missing :-(
Done in r20284.
@norman: does that work for you?
dynamic list of base classes