From 74fba2669d25914ba81866e525b563a1f6ae1035 Mon Sep 17 00:00:00 2001 From: Ron Waldon-Howe Date: Sat, 16 Nov 2024 10:31:50 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A1=20Remove=20confusing=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/dbus2/busd/pull/159#discussion_r1842106607 and https://github.com/dbus2/busd/pull/159#discussion_r1843718931 --- src/config.rs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/config.rs b/src/config.rs index 16dce24..449c905 100644 --- a/src/config.rs +++ b/src/config.rs @@ -156,14 +156,13 @@ impl TryFrom for BusConfig { impl BusConfig { pub fn limits(&self) -> Limits { match self.r#type { + // For the session bus, override the default relatively-low limits with essentially + // infinite limits, since the bus is just running as the user anyway, using up bus + // resources is not something we need to worry about. In some cases, we do set the + // limits lower than "all available memory" if exceeding the limit is almost certainly a + // bug, having the bus enforce a limit is nicer than a huge memory leak. But the intent + // is that these limits should never be hit. Some(BusType::Session) => Limits { - /* For the session bus, override the default relatively-low limits - with essentially infinite limits, since the bus is just running - as the user anyway, using up bus resources is not something we need - to worry about. In some cases, we do set the limits lower than - "all available memory" if exceeding the limit is almost certainly a bug, - having the bus enforce a limit is nicer than a huge memory leak. But the - intent is that these limits should never be hit. */ // dbus-daemon / dbus-broker is limited to the highest positive number in i32, // but we use u32 here, so we can pick the preferred 4GB memory limits max_incoming_bytes: 4000000000, @@ -256,13 +255,7 @@ impl BusConfig { #[derive(Clone, Debug, Deserialize, PartialEq)] #[serde(rename_all = "lowercase")] pub enum BusType { - /// The DBUS_STARTER_BUS_TYPE environment variable will be set to "session", - /// and the DBUS_SESSION_BUS_ADDRESS environment variable will be set to the address of the - /// session bus. Session, - /// The DBUS_STARTER_BUS_TYPE environment variable will be set to "system", - /// and the DBUS_SYSTEM_BUS_ADDRESS environment variable will be set to the address of the - /// system bus. System, }