Skip to content

Commit

Permalink
#1836: make it possible to completely disable functional modules
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@19284 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 11, 2018
1 parent 78cfbee commit ea5a9b4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
39 changes: 19 additions & 20 deletions src/xpra/scripts/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,26 +907,25 @@ def noerr(fn, *args):
if ssh_port:
add_mdns("ssh", "", ssh_port)

if False:
def b(v):
return v.lower() not in FALSE_OPTIONS
#turn off some server mixins:
from xpra.server import server_features
server_features.notifications = opts.notifications
server_features.webcam = b(opts.webcam)
server_features.clipboard = b(opts.clipboard)
server_features.audio = b(opts.speaker) or b(opts.microphone)
server_features.av_sync = server_features.audio and b(opts.av_sync)
server_features.fileprint = b(opts.printing) or b(opts.file_transfer)
server_features.mmap = b(opts.mmap)
server_features.input_devices = not opts.readonly
#server_features.commands = ??
server_features.dbus = opts.dbus_proxy
#server_features.encoding = ??
server_features.logging = b(opts.remote_logging)
#server_features.network_state = ??
server_features.display = opts.windows
server_features.windows = opts.windows
def b(v):
return v.lower() not in FALSE_OPTIONS
#turn off some server mixins:
from xpra.server import server_features
server_features.notifications = opts.notifications
server_features.webcam = b(opts.webcam)
server_features.clipboard = b(opts.clipboard)
server_features.audio = b(opts.speaker) or b(opts.microphone)
server_features.av_sync = server_features.audio and b(opts.av_sync)
server_features.fileprint = b(opts.printing) or b(opts.file_transfer)
server_features.mmap = b(opts.mmap)
server_features.input_devices = not opts.readonly
#server_features.commands = ??
server_features.dbus = opts.dbus_proxy
#server_features.encoding = ??
server_features.logging = b(opts.remote_logging)
#server_features.network_state = ??
server_features.display = opts.windows
server_features.windows = opts.windows

kill_dbus = None
if shadowing:
Expand Down
3 changes: 2 additions & 1 deletion src/xpra/server/source/client_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ def close(self):


def update_bandwidth_limits(self):
if self.mmap_size>0:
mmap_size = getattr(self, "mmap_size", 0)
if mmap_size>0:
return
#calculate soft bandwidth limit based on send congestion data:
bandwidth_limit = 0
Expand Down
10 changes: 7 additions & 3 deletions src/xpra/server/source/windows_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,11 @@ def make_window_source(self, wid, window):
batch_config = self.make_batch_config(wid, window)
ww, wh = window.get_dimensions()
bandwidth_limit = self.bandwidth_limit
if getattr(self, "mmap_size", 0)>0:
mmap = getattr(self, "mmap", None)
mmap_size = getattr(self, "mmap_size", 0)
av_sync = getattr(self, "av_sync", False)
av_sync_delay = getattr(self, "av_sync_delay", 0)
if mmap_size>0:
bandwidth_limit = 0
from xpra.server.window.window_video_source import WindowVideoSource
ws = WindowVideoSource(
Expand All @@ -508,13 +512,13 @@ def make_window_source(self, wid, window):
self.record_congestion_event, self.queue_size, self.call_in_encode_thread, self.queue_packet, self.compressed_wrapper,
self.statistics,
wid, window, batch_config, self.auto_refresh_delay,
self.av_sync, self.av_sync_delay,
av_sync, av_sync_delay,
self.video_helper,
self.server_core_encodings, self.server_encodings,
self.encoding, self.encodings, self.core_encodings, self.window_icon_encodings, self.encoding_options, self.icons_encoding_options,
self.rgb_formats,
self.default_encoding_options,
self.mmap, self.mmap_size, bandwidth_limit)
mmap, mmap_size, bandwidth_limit)
self.window_sources[wid] = ws
if len(self.window_sources)>1:
#re-distribute bandwidth:
Expand Down

0 comments on commit ea5a9b4

Please sign in to comment.