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, }