summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2006-07-07 19:42:56 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2006-07-07 19:42:56 +0000
commit50f88a0322cee156a5d9737f0987e57b964606cc (patch)
tree6db31d41f4bbd27167e03654577db84cf36145ad
parent84e55065ea9bef999f068de65c3eed0c9cc42fac (diff)
* dbus/dbus-connection.c (dbus_connection_close): removed deprecated
function (dbus_connection_dispatch): On disconnect unref any shared connections * dbus/dbus-bus.c (_dbus_bus_check_connection_and_unref): new function for cleaning up shared connections on disconnect (internal_bus_get): get a hard refrence to shared connections when they are created * doc/TODO: Remove items which are no longer relevent or have been fixed Split 1.0 todo items with a 0.90 freeze todo list
-rw-r--r--ChangeLog14
-rw-r--r--dbus/dbus-bus.c23
-rw-r--r--dbus/dbus-bus.h2
-rw-r--r--dbus/dbus-connection.c30
-rw-r--r--dbus/dbus-connection.h1
-rw-r--r--doc/TODO36
6 files changed, 62 insertions, 44 deletions
diff --git a/ChangeLog b/ChangeLog
index e4773d5d..b8062ca3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-07-07 John (J5) Palmieri <johnp@redhat.com>
+
+ * dbus/dbus-connection.c (dbus_connection_close): removed deprecated
+ function
+ (dbus_connection_dispatch): On disconnect unref any shared connections
+
+ * dbus/dbus-bus.c (_dbus_bus_check_connection_and_unref): new function
+ for cleaning up shared connections on disconnect
+ (internal_bus_get): get a hard refrence to shared connections when
+ they are created
+
+ * doc/TODO: Remove items which are no longer relevent or have been fixed
+ Split 1.0 todo items with a 0.90 freeze todo list
+
2006-06-14 Ross Burton <ross@openedhand.com>
* glib/dbus-gobject.c:
diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c
index 0b8c9c4f..273fe5fe 100644
--- a/dbus/dbus-bus.c
+++ b/dbus/dbus-bus.c
@@ -302,6 +302,23 @@ ensure_bus_data (DBusConnection *connection)
return bd;
}
+/* internal function that checks to see if this
+ is a shared bus connection and if it is unref it */
+void
+_dbus_bus_check_connection_and_unref (DBusConnection *connection)
+{
+ if (bus_connections[DBUS_BUS_SYSTEM] == connection)
+ {
+ bus_connections[DBUS_BUS_SYSTEM] = NULL;
+ dbus_connection_unref (connection);
+ }
+ else if (bus_connections[DBUS_BUS_SESSION] == connection)
+ {
+ bus_connections[DBUS_BUS_SESSION] = NULL;
+ dbus_connection_unref (connection);
+ }
+}
+
static DBusConnection *
internal_bus_get (DBusBusType type,
DBusError *error, dbus_bool_t private)
@@ -385,7 +402,11 @@ internal_bus_get (DBusBusType type,
}
if (!private)
- bus_connections[type] = connection;
+ {
+ /* get a hard ref to the connection */
+ bus_connections[type] = connection;
+ dbus_connection_ref (bus_connections[type]);
+ }
bd = ensure_bus_data (connection);
_dbus_assert (bd != NULL);
diff --git a/dbus/dbus-bus.h b/dbus/dbus-bus.h
index 2329e138..c47af153 100644
--- a/dbus/dbus-bus.h
+++ b/dbus/dbus-bus.h
@@ -68,6 +68,8 @@ void dbus_bus_remove_match (DBusConnection *connection,
const char *rule,
DBusError *error);
+void _dbus_bus_check_connection_and_unref (DBusConnection *connection);
+
DBUS_END_DECLS
#endif /* DBUS_BUS_H */
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index 4a2d087b..9f6e6260 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -1947,18 +1947,6 @@ dbus_connection_close (DBusConnection *connection)
_dbus_connection_update_dispatch_status_and_unlock (connection, status);
}
-/** Alias for dbus_connection_close(). This method is DEPRECATED and will be
- * removed for 1.0. Change your code to use dbus_connection_close() instead.
- *
- * @param connection the connection.
- * @deprecated
- */
-void
-dbus_connection_disconnect (DBusConnection *connection)
-{
- dbus_connection_close (connection);
-}
-
static dbus_bool_t
_dbus_connection_get_is_connected_unlocked (DBusConnection *connection)
{
@@ -3780,15 +3768,21 @@ dbus_connection_dispatch (DBusConnection *connection)
{
_dbus_verbose (" ... done dispatching in %s\n", _DBUS_FUNCTION_NAME);
- if (connection->exit_on_disconnect &&
- dbus_message_is_signal (message,
+ if (dbus_message_is_signal (message,
DBUS_INTERFACE_LOCAL,
"Disconnected"))
{
- _dbus_verbose ("Exiting on Disconnected signal\n");
- CONNECTION_UNLOCK (connection);
- _dbus_exit (1);
- _dbus_assert_not_reached ("Call to exit() returned");
+ int i;
+
+
+ _dbus_bus_check_connection_and_unref (connection);
+ if (connection->exit_on_disconnect)
+ {
+ _dbus_verbose ("Exiting on Disconnected signal\n");
+ CONNECTION_UNLOCK (connection);
+ _dbus_exit (1);
+ _dbus_assert_not_reached ("Call to exit() returned");
+ }
}
_dbus_list_free_link (message_link);
diff --git a/dbus/dbus-connection.h b/dbus/dbus-connection.h
index 9784f260..983f327e 100644
--- a/dbus/dbus-connection.h
+++ b/dbus/dbus-connection.h
@@ -93,7 +93,6 @@ DBusConnection* dbus_connection_open_private (const char
DBusError *error);
DBusConnection* dbus_connection_ref (DBusConnection *connection);
void dbus_connection_unref (DBusConnection *connection);
-void dbus_connection_close (DBusConnection *connection);
void dbus_connection_disconnect (DBusConnection *connection);
dbus_bool_t dbus_connection_get_is_connected (DBusConnection *connection);
dbus_bool_t dbus_connection_get_is_authenticated (DBusConnection *connection);
diff --git a/doc/TODO b/doc/TODO
index 1b75985b..6ae67d1c 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,3 +1,15 @@
+Important for 0.90 freeze
+===
+
+- Audit @todo and FIXME for security issues that require API/ABI changes
+
+- dbus-pending-call.c has some API and thread safety issues to review.
+ DBusPendingCall is used from multiple threads with no locks.
+ Either DBusConnection's lock has to protect all associated pending
+ call (means pending->connection can't ever be set to null) or
+ or DBusPendingCall needs its own lock
+ http://lists.freedesktop.org/archives/dbus/2006-June/004945.html
+
Important for 1.0
===
@@ -8,8 +20,6 @@ Important for 1.0
locks. Fixes the recursive deadlock. See the @todo for more
and this thread: http://lists.freedesktop.org/archives/dbus/2006-February/004128.html
- - Remove all deprecated functions
-
- Audit @todo and FIXME for security issues
- the "break loader" and valid/invalid message tests are all disabled;
@@ -21,30 +31,8 @@ Important for 1.0
- just before 1.0, try a HAVE_INT64=0 build and be sure it runs
- - dbus-pending-call.c has some API and thread safety issues to review.
- DBusPendingCall is used from multiple threads with no locks.
- Either DBusConnection's lock has to protect all associated pending
- call (means pending->connection can't ever be set to null) or
- or DBusPendingCall needs its own lock
- http://lists.freedesktop.org/archives/dbus/2006-June/004945.html
-
- - Add test harness for selinux allow/deny cf. this message
- http://lists.freedesktop.org/archives/dbus/2005-April/002506.html
-
- publish the introspection dtd at its URL
- - RequestName flags seem a bit strange; see the docs for dbus_bus_request_name()
- and think about use cases in better detail.
- Proposal on list:
- http://lists.freedesktop.org/archives/dbus/2005-August/003207.html
-
- Kind of a major API change, but seems high-value.
-
- - dbus_bus_get() should hold a strong reference associated with the "connected"
- state (i.e. libdbus drops its reference when the connection disconnects,
- and sets its internal connection variable to null).
- See http://lists.freedesktop.org/archives/dbus/2006-May/004806.html
-
Important for 1.0 GLib Bindings
===