Skip to content

2017 03 08 Overview libdbus Patches

Juergen Gehring edited this page Mar 8, 2017 · 1 revision

2017-03-08 Overview libdbus Patches

The CommonAPI C++ D-Bus runtime source code is delivered together with a couple fo D-Bus patches which are mandatory or optional for compiling and installing the CommonAPI C++ D-Bus runtime library.

capi-dbus-1-pc.patch

Adds the line Ldflags: -L${libdir} to dbus-1.pc.in in order to get the usual linker flags in CMake with pkg-config. This simplifies the standard CommonAPI C++ D-Bus CMake file when finding the patched libdbus library which is installed to a user defined directory.

✅ Is needed only if the patched libdbus is installed to a user defined directory and the standard CommonAPI C++ D-Bus CMake file shal be used.

capi-dbus-add-send-with-reply-set-notify.patch

Add dbus_connection_send_with_reply_set_notify function for proper thread handling in dbus-connection.c. This function merges the functionality of dbus_connection_send_with_reply and dbus_pending_call_set_notiy. This is needed because the successive call of these functions is not thread-safe.

✅ This patch is mandatory because it adds an additional function to libdbus which is used in the CommonAPI C++ D-Bus binding. The patch is completely compatible to the standard libdbus library because it add only an additional function.

capi-dbus-add-support-for-custom-marshalling.patch

Add functions to support querying and manipulating the message body and signature. This is useful for code generators, which can generate custom marshaling functions based on a given IDL. Those functions tend to be optimized and faster than the generic iterator based marshalling.

Added functions:

  • dbus_message_set_signature
  • dbus_message_get_body
  • dbus_message_set_body_length
  • dbus_message_get_body_length
  • dbus_message_get_body_allocated

✅ This patch is mandatory because it adds additional functions to libdbus which are used in the CommonAPI C++ D-Bus binding. The patch is completely compatible to the standard libdbus library because it adds only additional functions.

capi-dbus-block-acquire-io-path-on-send.patch

Patch for fixing hang ups (rarely appeared) e.g. in StabilitySP CommonAPI verification tests. Internal libdbus function _dbus_connection_acquire_io_path gets finite timeout parameter instead of infinite -1.

✅ Generally CommonAPI C++ D-Bus will also work without this patch. But in some sophisticated multi-threaded use-cases libdbus might get stuck in this function and hang forever.

capi-dbus-correct-dbus-connection-block-pending-call.patch

In method _dbus_connection_block_pending_call the call of method _dbus_connection_do_iteration_unlocked has been adapted. Instead of passing NULL for the DBusPendingCall pointer the current pending call pointer must be passed.

✅ Generally CommonAPI C++ D-Bus will also work without this patch. The patch was needed in order to fix problems with synchronous function calls and big payloads.

capi-dbus-send-with-reply-and-block-delete-reply-on-error.patch

This patch is needed in order to add support for the D-Bus message type Error on CommonAPI C++ level. It avoids the deletion of a message reply when an error occured and the error reply was sent. This is necessary to deserialize the arguments of the error reply.

✅ CommonAPI C++ D-Bus will also work without this patch. The patch is needed if the evaluation of D-Bus error messages on CommonAPI level is necessary.