syncevolution/src/gdbusxx
Patrick Ohly 31e4df6760 GDBus GIO: fix returning of error exceptions from asynchronous method + Interface_t/Member_t
When an asynchronous method call failed with an exception, the code
DBusResult got destructed first before handling the exception and then
sent a generic, uninformative error back to the caller. A test
demonstrating that for the PIM Manager SetPeer() with an invalid UID
be committed separately.

To fix this, the DBusResult must know whether it is really responsible
for replying to the method message. The method call handlers
themselves do not know whether any of their parameters is a
DBusResult, so we have to activate the automatic reply indirectly, via
a guard instance with the same life time as the handler.

When the guard destructs, it can check whether the handler has
replied, because the handler then clears the message pointers. If it
hasn't, the DBusResult becomes the owner of the message. For this to
work, an extra try/catch block is necessary. Otherwise exception
handling would still occur too late, at a time when the guard is gone
and the DBusResult has sent the generic error.

Some other classes had to be adapted to allow for this extra level of
indirection. While doing so, another bug was found.

Retrieving the interface and member used when calling a method
returned the path instead, due to a cut-and-paste error. Fixed. Not
used in practice.
2013-05-29 09:13:31 +02:00
..
test GDBus GIO: mark class as noncopyable 2013-04-22 16:01:44 +02:00
.gitignore build: Enable configure switch to build with GIO GDBus 2011-11-29 16:38:38 +00:00
gdbus-cxx-bridge.cpp GDBus GIO: fix returning of error exceptions from asynchronous method + Interface_t/Member_t 2013-05-29 09:13:31 +02:00
gdbus-cxx-bridge.h GDBus GIO: fix returning of error exceptions from asynchronous method + Interface_t/Member_t 2013-05-29 09:13:31 +02:00
gdbus-cxx.h GDBus GIO: more flexible SignalWatch 2012-09-26 08:36:35 +02:00
gdbusxx.am autotools: Boost was not found in src/gdbus* 2012-11-25 18:02:06 -08:00
README build: Enable configure switch to build with GIO GDBus 2011-11-29 16:38:38 +00:00

This is a C++ wrapper for the GLib GDBus d-bus implementation.

SyncEvolution also includes a wrapper for another library named gdbus
which originated in the Bluez project. This implementation has been
included in-tree and getting and sending patches is a somewhat
automated process.

The plan is to drop the in-tree, Bluez gdbus as soon as Debian stable
and Ubuntu LTS both support a GLib >= 2.26 (the version first to
include GDBus). Until this happens we'll have to keep the in-tree one
around.

In order to make our lives easier, both implementation should have the
same interface.