From 983200f912f41ba75a873c011bfbcd3b0285bf4c Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 19 Apr 2003 16:16:24 +0000 Subject: 2003-04-19 Havoc Pennington * bus/driver.c (bus_driver_handle_hello): check limits and return an error if they are exceeded. * bus/connection.c: maintain separate lists of active and inactive connections, and a count of each. Maintain count of completed connections per user. Implement code to check connection limits. * dbus/dbus-list.c (_dbus_list_unlink): export * bus/bus.c (bus_context_check_security_policy): enforce a maximum number of bytes in the message queue for a connection --- bus/driver.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'bus/driver.c') diff --git a/bus/driver.c b/bus/driver.c index c52020b5..bc58f556 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -262,8 +262,23 @@ bus_driver_handle_hello (DBusConnection *connection, BusService *service; dbus_bool_t retval; BusRegistry *registry; + BusConnections *connections; _DBUS_ASSERT_ERROR_IS_CLEAR (error); + + /* Note that when these limits are exceeded we don't disconnect the + * connection; we just sort of leave it hanging there until it times + * out or disconnects itself or is dropped due to the max number of + * incomplete connections. It's even OK if the connection wants to + * retry the hello message, we support that. + */ + connections = bus_connection_get_connections (connection); + if (!bus_connections_check_limits (connections, connection, + error)) + { + _DBUS_ASSERT_ERROR_IS_SET (error); + return FALSE; + } if (!_dbus_string_init (&unique_name)) { -- cgit