From b4a1100f4f81534e2aac0141afda750f318223d4 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 17 Mar 2003 01:54:37 +0000 Subject: 2003-03-16 Havoc Pennington * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc the watch * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new): add some missing dbus_set_result * bus/dispatch.c (bus_dispatch_add_connection): handle failure to alloc the DBusMessageHandler * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref the transport here, since we call this from the finalizer; it resulted in a double-finalize. * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug where we tried to use transport->connection that was NULL, happened when transport was disconnected early on due to OOM * bus/*.c: adapt to handle OOM for watches/timeouts * dbus/dbus-transport-unix.c: port to handle OOM during watch handling * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a reference to unused bytes instead of a copy * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for out of memory * dbus/dbus-connection.c (dbus_connection_handle_watch): return FALSE on OOM * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out of memory --- dbus/dbus-server-debug.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'dbus/dbus-server-debug.c') diff --git a/dbus/dbus-server-debug.c b/dbus/dbus-server-debug.c index b1318e32..3b7e78dd 100644 --- a/dbus/dbus-server-debug.c +++ b/dbus/dbus-server-debug.c @@ -71,11 +71,12 @@ debug_finalize (DBusServer *server) { } -static void +static dbus_bool_t debug_handle_watch (DBusServer *server, DBusWatch *watch, unsigned int flags) { + return TRUE; } static void @@ -184,7 +185,7 @@ typedef struct DBusTimeout *timeout; } ServerAndTransport; -static void +static dbus_bool_t handle_new_client (void *data) { ServerAndTransport *st = data; @@ -196,13 +197,13 @@ handle_new_client (void *data) transport = _dbus_transport_debug_server_new (st->transport); if (transport == NULL) - return; + return FALSE; connection = _dbus_connection_new_for_transport (transport); _dbus_transport_unref (transport); if (connection == NULL) - return; + return FALSE; /* See if someone wants to handle this new connection, * self-referencing for paranoia @@ -223,6 +224,8 @@ handle_new_client (void *data) /* killing timeout frees both "st" and "timeout" */ _dbus_timeout_unref (st->timeout); + + return TRUE; } /** -- cgit