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>
accept more than one callback.
g_bus_own_name_with_closures
g_bus_own_name_on_connection_with_closures
g_bus_watch_name_with_closures
g_bus_watch_name_on_connection_with_closures
g_bus_watch_proxy_with_closures
g_bus_watch_proxy_on_connection_with_closures
https://bugzilla.gnome.org/show_bug.cgi?id=621092
This allows the caller to specify the reply type that they are expecting
for this call. If the reply comes back with the wrong type, GDBus will
generate an appropriate error internally.
- add a GVariantType * argument to g_dbus_connection_call() and
_call_sync().
- move the internal API for computing message types from introspection
data to be based on GVariantType instead of strings. Update users
of this code.
- have GDBusProxy pass this calculated GVariantType into
g_dbus_connection_call(). Remove the checks done in GDBusProxy.
- Update other users of the code (test cases, gdbus-tool, GSettings
tool, etc). In some cases, remove redundant checks; in some other
cases, we are fixing bugs because no checking was done where it
should have been.
Closes bug #619391.
Lots of people been suggesting this. We still use MethodInvocation /
method_invocation for handling incoming method calls so use call()
instead of invoke_method() helps to separate the client and server
facilities. Which is a good thing(tm).
Things compile and the test-suite passes. Still need to hook up
gio.symbols and docs. There are still a bunch of TODOs left in the
sources that needs to be addressed.
Signed-off-by: David Zeuthen <davidz@redhat.com>