Bug 623143 – Never require non-closed connections
authorDavid Zeuthen <davidz@redhat.com>
Tue, 29 Jun 2010 19:19:56 +0000 (15:19 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Tue, 29 Jun 2010 19:21:11 +0000 (15:21 -0400)
commit6d4ade4cf0d6ed64ce59f3db4f270be08a4478fd
tree95e8c9d9b1afa8ea1d1ee25b98eb1abcc36b66ba
parentab6b6c68c5b060057fd2953435c090b4d53fe93c
Bug 623143 – Never require non-closed connections

There's a couple of places in GDBus where it's a programming error
(e.g. we'll assert or spew via e.g. g_warning()) to use the API on a
closed connection.  This approach can never work since a
GDBusConnection can be closed at any point in time outside of
programmer control.

Just change the code to return a run-time error (e.g. return
G_IO_ERROR_CLOSED when sending messages, invoking methods) or silently
accept the request (e.g.  exporting objects, registering for signals)
without doing anything.

Note that a GDBusConnection object is always useless after being
closed - e.g.  there's no way to "reopen" a connection - the user will
have to create a new object and use that instead.

https://bugzilla.gnome.org/show_bug.cgi?id=623143

Signed-off-by: David Zeuthen <davidz@redhat.com>
gio/gdbusconnection.c
gio/gdbusnameowning.c
gio/gdbusnamewatching.c